﻿:root {
  color-scheme: light;
  --ink: #182026;
  --muted: #5c6975;
  --line: #d7dde2;
  --surface: #ffffff;
  --soft: #f3f6f7;
  --accent: #0f766e;
  --accent-strong: #0b5f59;
  --warn: #b45309;
  --blue: #2563eb;
  --shadow: 0 16px 40px rgba(24, 32, 38, 0.08);
  font-family: "Yu Gothic", "Hiragino Kaku Gothic ProN", Meiryo, system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--soft);
  color: var(--ink);
}

.page,
.admin-shell {
  width: min(100%, 1080px);
  margin: 0 auto;
  padding: 24px 16px 56px;
}

.survey-page {
  max-width: 760px;
}

.survey-hero,
.auth-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 28px;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-weight: 700;
  font-size: 0.9rem;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  line-height: 1.2;
  margin-bottom: 14px;
}

h2 {
  font-size: 1.1rem;
  line-height: 1.4;
}

.note,
.helper,
.message {
  color: var(--muted);
  line-height: 1.7;
}

.form-stack {
  display: grid;
  gap: 16px;
}

#questions {
  display: grid;
  gap: 16px;
}

.question-card,
.thanks,
.chart-card,
.table-section,
.settings-section,
.metric {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.question-card {
  margin: 0;
  padding: 20px;
}

legend,
.question-title {
  display: block;
  width: 100%;
  font-weight: 700;
  line-height: 1.6;
  margin-bottom: 14px;
}

legend span:first-child,
.question-title span:first-child {
  color: var(--accent);
  margin-right: 8px;
}

.required,
.optional {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.78rem;
  margin-left: 6px;
}

.required {
  color: #ffffff;
  background: var(--warn);
}

.optional {
  color: var(--muted);
  background: var(--soft);
}

.choice-list {
  display: grid;
  gap: 10px;
}

.choice {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 10px;
  align-items: start;
  min-height: 48px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  font: inherit;
  color: var(--ink);
  background: #ffffff;
}

textarea {
  resize: vertical;
}

.primary-button,
.secondary-button {
  appearance: none;
  border: 0;
  border-radius: 8px;
  min-height: 44px;
  padding: 0 16px;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.primary-button {
  background: var(--accent);
  color: #ffffff;
}

.primary-button:hover {
  background: var(--accent-strong);
}

.secondary-button {
  background: #e8eef1;
  color: var(--ink);
}

.form-actions {
  display: grid;
  gap: 10px;
}

.thanks {
  padding: 28px;
  line-height: 1.8;
}

.hidden {
  display: none !important;
}

.auth-panel {
  max-width: 460px;
  margin: 48px auto;
}

.login-form,
.settings-form {
  display: grid;
  gap: 12px;
}

.login-form label span {
  display: block;
  margin-bottom: 6px;
  font-weight: 700;
}

.dashboard {
  display: grid;
  gap: 18px;
}

.dashboard-header {
  display: flex;
  gap: 16px;
  justify-content: space-between;
  align-items: center;
}

.header-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.metric {
  padding: 18px;
}

.metric span {
  display: block;
  color: var(--muted);
  margin-bottom: 8px;
}

.metric strong {
  font-size: 2rem;
}

.chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.chart-card,
.table-section,
.settings-section {
  padding: 18px;
}

.bar-list {
  display: grid;
  gap: 12px;
}

.bar-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.92rem;
}

.bar-track {
  height: 10px;
  background: #e6ecef;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 5px;
}

.bar-track span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--blue));
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.section-heading h2 {
  margin: 0;
}

.section-heading input {
  max-width: 280px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  padding: 10px;
  font-size: 0.88rem;
}

th {
  background: #f7f9fa;
  position: sticky;
  top: 0;
}

@media (max-width: 760px) {
  .page,
  .admin-shell {
    padding: 14px 10px 40px;
  }

  .survey-hero,
  .auth-panel,
  .question-card,
  .thanks,
  .chart-card,
  .table-section,
  .settings-section {
    padding: 16px;
  }

  .dashboard-header,
  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .metric-grid,
  .chart-grid {
    grid-template-columns: 1fr;
  }

  .header-actions,
  .header-actions > * {
    width: 100%;
  }
}

/* Cyber admin test theme */
.admin-body {
  background:
    radial-gradient(circle at 15% 8%, rgba(33, 212, 253, 0.16), transparent 30%),
    radial-gradient(circle at 82% 18%, rgba(124, 58, 237, 0.18), transparent 28%),
    linear-gradient(180deg, #030712 0%, #050816 46%, #020617 100%);
  color: #9db7ff;
  min-height: 100vh;
}

.admin-body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(33, 212, 253, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(33, 212, 253, 0.05) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,0.85), transparent 86%);
}

.cyber-shell {
  width: min(100%, 1240px);
  position: relative;
}

.admin-body .cyber-panel,
.admin-body .metric,
.admin-body .chart-card,
.admin-body .table-section,
.admin-body .settings-section,
.admin-body .auth-panel {
  background: rgba(3, 12, 32, 0.86);
  border: 1px solid rgba(33, 212, 253, 0.26);
  box-shadow: 0 0 0 1px rgba(124, 58, 237, 0.13), 0 24px 80px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255,255,255,0.06);
  color: #9db7ff;
}

.admin-body .cyber-hero {
  padding: 22px;
  border-radius: 8px;
  border: 1px solid rgba(33, 212, 253, 0.34);
  background: linear-gradient(135deg, rgba(2, 6, 23, 0.96), rgba(15, 23, 42, 0.72));
  box-shadow: 0 0 34px rgba(33, 212, 253, 0.12);
}

.admin-body h1,
.admin-body h2,
.admin-body h3 {
  color: #dbeafe;
  letter-spacing: 0;
}

.admin-body .eyebrow {
  color: #21d4fd;
  text-shadow: 0 0 16px rgba(33, 212, 253, 0.55);
}

.admin-body .hero-copy,
.admin-body .message,
.admin-body .metric span,
.admin-body .bar-label,
.admin-body .note,
.admin-body .helper {
  color: #7892d6;
}

.admin-body input,
.admin-body select,
.admin-body textarea {
  color: #dbeafe;
  background: rgba(2, 6, 23, 0.78);
  border-color: rgba(33, 212, 253, 0.28);
  outline-color: #21d4fd;
}

.admin-body .primary-button {
  background: linear-gradient(135deg, #0e7490, #1d4ed8);
  color: #eef6ff;
  box-shadow: 0 0 18px rgba(33, 212, 253, 0.26);
}

.admin-body .secondary-button {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(33, 212, 253, 0.28);
  color: #bcd2ff;
}

.admin-body .metric strong {
  color: #21d4fd;
  text-shadow: 0 0 20px rgba(33, 212, 253, 0.48);
}

.analysis-lab {
  padding: 18px;
  border-radius: 8px;
}

.analysis-heading {
  align-items: flex-start;
}

.analysis-count {
  min-height: 40px;
  padding: 8px 12px;
  border-radius: 8px;
  color: #dbeafe;
  border: 1px solid rgba(33, 212, 253, 0.28);
  background: rgba(15, 23, 42, 0.8);
}

.analysis-count span {
  color: #21d4fd;
  font-weight: 800;
  font-size: 1.25rem;
}

.analysis-controls {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 16px 18px;
  align-items: stretch;
}

.control-block {
  display: grid;
  gap: 8px;
  align-content: start;
  min-width: 0;
}

.answer-block {
  grid-column: 1 / 2;
}

.analysis-controls .control-block:nth-child(3) {
  grid-column: 2 / 3;
  grid-row: 1 / 2;
}

.analysis-controls .control-block:nth-child(4) {
  grid-column: 2 / 3;
  grid-row: 2 / 3;
}

.control-block select {
  width: 100%;
  min-width: 0;
}

.control-block > span,
.login-form label span {
  color: #8fb8ff;
  font-weight: 700;
  font-size: 0.88rem;
}

.chip-grid {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-content: flex-start;
  max-width: 100%;
}

.filter-chip,
.chart-type-group label {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  border-radius: 8px;
  border: 1px solid rgba(33, 212, 253, 0.25);
  background: rgba(2, 6, 23, 0.72);
  color: #bcd2ff;
  overflow: hidden;
  cursor: pointer;
}

.filter-chip input,
.chart-type-group input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.filter-chip span,
.chart-type-group span {
  padding: 9px 11px;
}

.filter-chip:has(input:checked),
.chart-type-group label:has(input:checked) {
  color: #03111f;
  background: #21d4fd;
  border-color: #21d4fd;
  box-shadow: 0 0 20px rgba(33, 212, 253, 0.38);
}

.chart-type-group {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.chart-type-group label {
  justify-content: center;
}

.analysis-output {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(260px, 0.75fr);
  gap: 14px;
  margin-top: 16px;
}

.chart-stage,
.insight-panel {
  min-height: 330px;
  border-radius: 8px;
  border: 1px solid rgba(33, 212, 253, 0.22);
  background: rgba(2, 6, 23, 0.58);
  padding: 16px;
}

.chart-stage {
  display: grid;
  place-items: center;
  overflow: hidden;
}

.pie-chart {
  width: min(68vw, 310px);
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  box-shadow: 0 0 44px rgba(33, 212, 253, 0.24);
  position: relative;
}

.pie-chart::after {
  content: "";
  position: absolute;
  inset: 24%;
  border-radius: 50%;
  background: #020617;
  border: 1px solid rgba(33, 212, 253, 0.25);
}

.pie-chart span {
  position: relative;
  z-index: 1;
  display: grid;
  text-align: center;
  color: #dbeafe;
  font-size: 2.6rem;
  font-weight: 800;
}

.pie-chart small {
  font-size: 0.85rem;
  color: #8fb8ff;
}

.custom-bars {
  width: 100%;
  min-height: 280px;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(54px, 1fr);
  align-items: end;
  gap: 10px;
}

.custom-bar {
  display: grid;
  grid-template-rows: auto 220px auto;
  gap: 8px;
  justify-items: center;
  min-width: 0;
}

.custom-bar strong {
  color: #dbeafe;
}

.custom-bar span {
  width: 72%;
  align-self: end;
  border-radius: 6px 6px 0 0;
  min-height: 6px;
  box-shadow: 0 0 18px currentColor;
}

.custom-bar small {
  color: #8fb8ff;
  font-size: 0.72rem;
  text-align: center;
  overflow-wrap: anywhere;
}

.line-chart {
  width: 100%;
  max-height: 300px;
  filter: drop-shadow(0 0 12px rgba(33, 212, 253, 0.32));
}

.line-chart text {
  fill: #dbeafe;
  font-size: 14px;
  font-weight: 700;
}

.insight-panel h3 {
  margin-top: 0;
}

.breakdown-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.breakdown-item {
  display: grid;
  grid-template-columns: 12px 1fr auto;
  gap: 8px;
  align-items: center;
  color: #bcd2ff;
}

.breakdown-item i {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

.breakdown-item strong {
  color: #dbeafe;
}

.admin-body .bar-track {
  background: rgba(148, 163, 184, 0.16);
}

.admin-body table {
  color: #bcd2ff;
}

.admin-body th {
  background: rgba(15, 23, 42, 0.96);
  color: #dbeafe;
}

.admin-body td,
.admin-body th {
  border-bottom-color: rgba(33, 212, 253, 0.16);
}

@media (max-width: 980px) {
  .analysis-controls,
  .analysis-output {
    grid-template-columns: 1fr;
  }

  .answer-block,
  .analysis-controls .control-block:nth-child(3),
  .analysis-controls .control-block:nth-child(4) {
    grid-column: auto;
    grid-row: auto;
  }
}

@media (max-width: 760px) {
  .admin-body .cyber-hero {
    padding: 16px;
  }

  .chart-type-group {
    grid-template-columns: 1fr 1fr 1fr;
  }

  .custom-bars {
    grid-auto-columns: minmax(44px, 1fr);
    overflow-x: auto;
  }
}


/* Chinese-inspired paged survey theme */
.chinese-theme {
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 12%, rgba(255, 214, 102, 0.18), transparent 26%),
    radial-gradient(circle at 86% 8%, rgba(176, 32, 32, 0.26), transparent 30%),
    linear-gradient(135deg, #210607 0%, #4b0f12 46%, #120708 100%);
  color: #f8e8c8;
}

.chinese-theme::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(45deg, rgba(255, 214, 102, 0.08) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255, 214, 102, 0.08) 25%, transparent 25%);
  background-size: 34px 34px;
  opacity: 0.28;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,0.85), transparent 88%);
}

.paged-survey {
  max-width: 820px;
  position: relative;
}

.china-hero,
.china-question,
.progress-panel,
.china-thanks {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(75, 15, 18, 0.96), rgba(36, 8, 10, 0.96));
  border: 1px solid rgba(255, 214, 102, 0.46);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.34), inset 0 0 0 1px rgba(255, 246, 214, 0.08);
  color: #f8e8c8;
}

.china-hero::after,
.china-question::after,
.china-thanks::after {
  content: "福";
  position: absolute;
  right: -10px;
  bottom: -36px;
  color: rgba(255, 214, 102, 0.08);
  font-family: serif;
  font-size: 10rem;
  line-height: 1;
  transform: rotate(-12deg);
  pointer-events: none;
}

.chinese-theme .eyebrow {
  color: #ffd666;
  text-shadow: 0 0 18px rgba(255, 214, 102, 0.38);
}

.chinese-theme h1,
.chinese-theme h2,
.chinese-theme legend,
.chinese-theme .question-title {
  color: #fff2cf;
}

.chinese-theme .note,
.chinese-theme .helper,
.chinese-theme .message {
  color: #e9c98a;
}

.china-hero {
  padding: 30px;
}

.china-hero h1 {
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
}

.lantern-button {
  background: linear-gradient(135deg, #b91c1c, #ef4444 55%, #f59e0b);
  color: #fff7dc;
  border: 1px solid rgba(255, 214, 102, 0.42);
  box-shadow: 0 0 22px rgba(239, 68, 68, 0.28), inset 0 1px 0 rgba(255,255,255,0.22);
}

.chinese-theme .secondary-button {
  background: rgba(42, 12, 12, 0.88);
  color: #f8e8c8;
  border: 1px solid rgba(255, 214, 102, 0.36);
}

.progress-panel {
  border-radius: 8px;
  padding: 14px 16px;
}

.progress-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  color: #ffd666;
  font-weight: 800;
}

.progress-track {
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 246, 214, 0.14);
  overflow: hidden;
}

.progress-track span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #ffd666, #ef4444);
  transition: width 0.22s ease;
}

.question-stage {
  min-height: 430px;
}

.china-question {
  padding: 24px;
  animation: paperIn 0.18s ease-out;
}

@keyframes paperIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.chinese-theme .required {
  background: #b91c1c;
  color: #fff7dc;
}

.chinese-theme .optional {
  background: rgba(255, 214, 102, 0.16);
  color: #ffd666;
}

.china-choice {
  background: rgba(255, 246, 214, 0.06);
  border-color: rgba(255, 214, 102, 0.28);
  color: #f8e8c8;
}

.china-choice:has(input:checked) {
  background: rgba(185, 28, 28, 0.54);
  border-color: #ffd666;
  box-shadow: 0 0 22px rgba(255, 214, 102, 0.14);
}

.chinese-theme input,
.chinese-theme textarea {
  color: #fff7dc;
  background: rgba(18, 7, 8, 0.76);
  border-color: rgba(255, 214, 102, 0.36);
  outline-color: #ffd666;
}

.step-actions {
  grid-template-columns: 1fr 1fr;
}

.step-actions .primary-button:last-child {
  grid-column: 2 / 3;
}

.china-thanks {
  padding: 28px;
}

@media (max-width: 760px) {
  .china-hero,
  .china-question,
  .china-thanks {
    padding: 18px;
  }

  .question-stage {
    min-height: 480px;
  }

  .step-actions {
    grid-template-columns: 1fr;
  }

  .step-actions .primary-button:last-child {
    grid-column: auto;
  }
}

/* Shumai watermark generated for the survey background */
.china-hero::after,
.china-question::after,
.china-thanks::after {
  content: "";
  right: -18px;
  bottom: -24px;
  width: min(42vw, 220px);
  height: min(42vw, 220px);
  background-image: url("/assets/shumai-watermark.png?v=2");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  opacity: 0.15;
  transform: rotate(-8deg);
  filter: saturate(0.9) sepia(0.12);
}

.china-question::after {
  opacity: 0.1125;
}

.china-thanks::after {
  opacity: 0.125;
}



/* Final shumai placement: intro screen only */
.china-hero::after {
  opacity: 0.75;
}

.china-question::after,
.china-thanks::after {
  content: none;
  background-image: none;
}
