:root {
  --green: #1e9e41;
  --green-deep: #15943b;
  --green-soft: #f5fbf7;
  --green-border: #b8e2c5;
  --ink: #111827;
  --text: #374151;
  --muted: #6b7280;
  --light: #9ca3af;
  --line: #f3f4f6;
  --page: #fafafa;
  --white: #ffffff;
  --blue: #2f80ed;
  --radius-lg: 16px;
  --shadow-soft: 0 1px 1px rgba(0, 0, 0, 0.05);
  --font:
    Inter, "Noto Sans SC", "Microsoft YaHei", "PingFang SC", "Helvetica Neue",
    Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--page);
}

body {
  margin: 0;
  min-width: 1180px;
  background: var(--page);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  letter-spacing: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

svg {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.site-header {
  height: 88px;
  background: var(--white);
  border-bottom: 1px solid #e5e7eb;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1440px;
  height: 100%;
  margin: 0 auto;
  padding: 0 32px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
}

.brand-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 78px;
  height: 66px;
  overflow: hidden;
}

.brand-logo img {
  width: 66px;
  height: 66px;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.brand-copy strong {
  color: var(--green);
  font-size: 28px;
  font-weight: 800;
  line-height: 28px;
  margin-bottom: 8px;
}

.brand-copy span {
  color: var(--muted);
  font-size: 14px;
  line-height: 14px;
  white-space: nowrap;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 60px;
  height: 27px;
  margin-left: 24px;
}

.main-nav a {
  position: relative;
  color: var(--text);
  font-size: 16px;
  font-weight: 500;
  line-height: 24px;
  white-space: nowrap;
}

.main-nav a.active {
  color: var(--green);
  font-size: 18px;
  line-height: 27px;
}

.main-nav a.active::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -32px;
  left: 0;
  height: 3px;
  border-radius: 2px 2px 0 0;
  background: var(--green);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 24px;
  flex: 0 0 auto;
}

.phone-link {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--green);
  font-size: 16px;
  font-weight: 600;
  line-height: 24px;
  white-space: nowrap;
}

.phone-link svg {
  width: 16px;
  height: 16px;
  stroke-width: 2.5;
}

.login-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 124px;
  height: 41px;
  padding: 0 25px;
  border: 1px solid var(--green);
  border-radius: 9999px;
  background: var(--white);
  color: var(--green);
  font-size: 14px;
  line-height: 21px;
  white-space: nowrap;
}

.user-menu {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 41px;
  padding: 5px 6px 5px 14px;
  border: 1px solid #d8eadf;
  border-radius: 999px;
  background: #f8fffb;
}

.user-menu[hidden] {
  display: none;
}

.user-menu span {
  max-width: 150px;
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  line-height: 20px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-menu a,
.user-menu button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--green);
  font-size: 13px;
  font-weight: 700;
  line-height: 18px;
  white-space: nowrap;
}

.user-menu a {
  padding: 5px 8px;
}

.user-menu button {
  padding: 5px 11px;
  background: var(--green);
  color: #fff;
}

.page-shell {
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px 32px;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  color: var(--muted);
  font-size: 14px;
  line-height: 21px;
}

.breadcrumbs svg {
  width: 10px;
  height: 10px;
}

.breadcrumbs span {
  color: #1f2937;
}

.title-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 8px;
}

.title-kicker {
  width: fit-content;
  padding: 5px 10px;
  border: 1px solid #d8eadf;
  border-radius: 999px;
  background: #f2fbf6;
  color: var(--green);
  font-size: 13px;
  font-weight: 700;
  line-height: 20px;
}

.title-section h1 {
  margin: 0;
  color: var(--ink);
  font-size: 38px;
  font-weight: 800;
  line-height: 50px;
}

.title-section p {
  margin: 0;
  color: var(--muted);
  max-width: 760px;
  font-size: 15px;
  line-height: 24px;
}

.report-preview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  max-width: 920px;
  padding-top: 10px;
}

.report-preview-grid article {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-height: 74px;
  padding: 14px 16px;
  border: 1px solid #e7eee9;
  border-radius: 12px;
  background: #fff;
}

.report-preview-grid strong {
  color: var(--ink);
  font-size: 15px;
  line-height: 22px;
}

.report-preview-grid span {
  color: var(--muted);
  font-size: 13px;
  line-height: 20px;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 30px;
  align-items: start;
  padding-top: 8px;
}

.left-column {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
}

.upload-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 360px;
  padding: 49px;
  border: 1px dashed var(--green-border);
  border-radius: 24px;
  background: var(--green-soft);
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
  cursor: pointer;
}

.upload-box.is-dragging {
  border-color: var(--green);
  box-shadow: 0 18px 48px rgba(30, 158, 65, 0.14);
  transform: translateY(-1px);
}

.upload-illustration {
  width: 348px;
  height: 205px;
  object-fit: contain;
  margin-bottom: 24px;
}

.upload-title {
  color: #1f2937;
  font-size: 24px;
  font-weight: 600;
  line-height: 36px;
  white-space: nowrap;
  margin-bottom: 12px;
}

.upload-title b {
  color: var(--green);
  font-weight: 600;
}

.upload-type {
  color: var(--muted);
  font-size: 16px;
  line-height: 24px;
  margin-bottom: 12px;
}

.upload-limit {
  color: var(--light);
  font-size: 14px;
  line-height: 21px;
}

.file-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  padding: 25px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--white);
}

.file-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.file-card-head h2 {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
  font-weight: 600;
  line-height: 27px;
}

.text-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  line-height: 21px;
  padding: 0;
}

.text-button svg {
  width: 14px;
  height: 14px;
}

.file-list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--line);
}

.empty-files {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 150px;
  gap: 6px;
  color: var(--muted);
  text-align: center;
}

.empty-files strong {
  color: var(--ink);
  font-size: 16px;
  line-height: 24px;
}

.empty-files span {
  font-size: 13px;
  line-height: 19.5px;
}

.file-row {
  display: grid;
  grid-template-columns: 320px 183px 183px 150px 32px;
  align-items: center;
  justify-content: space-between;
  column-gap: 16px;
  min-height: 75px;
  padding: 16px 0 17px;
  border-bottom: 1px solid var(--line);
}

.file-row:last-child {
  border-bottom: 0;
}

.file-name-group {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.file-name-group > span:last-child,
.file-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
}

.file-name-group strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  line-height: 21px;
  margin-bottom: 4px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-name-group em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 18px;
}

.file-icon {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  padding-bottom: 4px;
  font-size: 10px;
  font-weight: 700;
  line-height: 15px;
  flex: 0 0 auto;
}

.file-icon.pdf {
  background: #ffecec;
  color: #ef4444;
}

.file-icon.image {
  align-items: center;
  padding: 0;
  background: #eff6ff;
  color: #2f80ed;
}

.file-icon.image svg {
  width: 24px;
  height: 24px;
  stroke-width: 1.8;
}

.file-icon.excel {
  align-items: center;
  padding: 0;
  background: #e8f7ed;
  color: var(--green);
  font-size: 18px;
  line-height: 18px;
}

.file-meta small,
.progress-block small {
  color: var(--light);
  font-size: 12px;
  font-weight: 400;
  line-height: 18px;
  margin-bottom: 4px;
}

.file-meta > span {
  color: var(--text);
  font-size: 13px;
  line-height: 19.5px;
  white-space: nowrap;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}

.status svg {
  width: 13px;
  height: 13px;
  stroke-width: 2.4;
}

.status.complete {
  color: var(--green);
}

.status.processing {
  color: var(--blue);
}

.status.waiting {
  color: var(--muted);
  font-weight: 400;
}

.status.failed {
  color: #ef4444;
}

.progress-block {
  display: grid;
  grid-template-columns: 1fr 36px;
  grid-template-areas:
    "label label"
    "bar pct";
  align-items: center;
  column-gap: 8px;
}

.progress-block small {
  grid-area: label;
}

.progress-line {
  grid-area: bar;
  display: block;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
}

.progress-line i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
  transition: width 0.18s linear;
}

.progress-block.blue .progress-line i {
  background: linear-gradient(90deg, var(--blue), #58a9ff, var(--blue));
  background-size: 160% 100%;
  animation: progressFlow 1.1s linear infinite;
}

.progress-block.gray .progress-line i {
  background: var(--light);
}

.progress-block.failed .progress-line i {
  background: #ef4444;
}

.progress-block b {
  grid-area: pct;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  line-height: 18px;
}

@keyframes progressFlow {
  from {
    background-position: 0 0;
  }

  to {
    background-position: 160% 0;
  }
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  color: var(--light);
  padding: 0;
}

.icon-button svg {
  width: 18px;
  height: 18px;
}

.right-column {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.analysis-card {
  display: flex;
  flex-direction: column;
  gap: 32px;
  min-height: 354px;
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--white);
}

.analysis-card h2 {
  margin: 0;
  color: var(--ink);
  font-size: 20px;
  font-weight: 700;
  line-height: 30px;
}

.feature-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.feature-item img {
  width: 70px;
  height: 70px;
  object-fit: contain;
  flex: 0 0 auto;
}

.feature-item span {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 70px;
}

.feature-item strong {
  color: var(--green);
  font-size: 16px;
  font-weight: 600;
  line-height: 24px;
  margin-bottom: 4px;
}

.feature-item em {
  width: 202px;
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
  line-height: 20.8px;
}

.action-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

#openQuestionnaireButton {
  order: 1;
}

#resetUploadButton {
  order: 2;
}

#startAiButton {
  order: 3;
}

.primary-action,
.secondary-action,
.next-action {
  width: 100%;
  border-radius: var(--radius-lg);
}

.primary-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 76px;
  border: 0;
  background: var(--green);
  color: var(--white);
  box-shadow: var(--shadow-soft);
}

.primary-action strong {
  font-size: 20px;
  font-weight: 600;
  line-height: 30px;
}

.primary-action span {
  color: rgba(255, 255, 255, 0.8);
  font-size: 13px;
  line-height: 19.5px;
}

.secondary-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 80px;
  border: 1px solid var(--green);
  background: var(--white);
}

.secondary-action strong {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--green);
  font-size: 18px;
  font-weight: 600;
  line-height: 27px;
}

.secondary-action strong svg {
  width: 18px;
  height: 18px;
  stroke-width: 2.5;
}

.secondary-action span {
  color: var(--muted);
  font-size: 13px;
  line-height: 19.5px;
}

.primary-action:disabled,
.secondary-action:disabled,
.next-action:disabled {
  cursor: wait;
  opacity: 0.72;
}

.primary-action.compact,
.secondary-action.compact {
  min-height: 58px;
  width: auto;
  padding: 10px 28px;
}

.primary-action.compact strong,
.secondary-action.compact strong {
  font-size: 16px;
  line-height: 24px;
}

.next-action {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 84px;
  border: 1px solid var(--green);
  background: var(--white);
  padding: 19px 33px;
}

.next-action span {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.next-action strong {
  color: var(--green);
  font-size: 18px;
  font-weight: 600;
  line-height: 27px;
}

.next-action em {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
  line-height: 19.5px;
}

.next-action > svg {
  position: absolute;
  right: 23px;
  width: 20px;
  height: 20px;
  color: var(--green);
  stroke-width: 3;
}

.privacy-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0 4px;
}

.privacy-row p {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 19.5px;
}

.privacy-row svg {
  width: 13px;
  height: 13px;
}

.privacy-row p:first-child svg {
  color: var(--green);
}

.privacy-row p:last-child svg {
  color: var(--light);
}

.result-card {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 25px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--white);
  box-shadow: var(--shadow-soft);
}

.result-card[hidden] {
  display: none;
}

.result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
}

.result-head small,
.questionnaire-head small {
  color: var(--green);
  font-size: 13px;
  line-height: 19.5px;
}

.result-head h2,
.questionnaire-head h2 {
  margin: 0;
  color: var(--ink);
  font-size: 22px;
  font-weight: 700;
  line-height: 33px;
}

.result-body {
  color: var(--text);
  font-size: 14px;
  line-height: 1.8;
}

.result-body h1,
.result-body h2,
.result-body h3 {
  color: var(--ink);
  font-size: 18px;
  line-height: 1.6;
  margin: 16px 0 8px;
}

.result-body p {
  margin: 8px 0;
}

.result-body ul,
.result-body ol {
  margin: 8px 0 8px 22px;
  padding: 0;
}

.report-loading {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px;
  border: 1px solid #dbeafe;
  border-radius: 12px;
  background: #eff6ff;
}

.report-loading strong {
  color: #1d4ed8;
  font-size: 16px;
  line-height: 24px;
}

.report-loading span {
  color: #31537a;
  line-height: 22px;
}

.loading-dot {
  width: 34px;
  height: 34px;
  border: 4px solid #bfdbfe;
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

.report-shell {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.report-shell.markdown-only {
  padding: 6px 0 0;
}

.report-overview {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 16px;
}

.score-card,
.summary-card,
.report-section {
  border: 1px solid #e8edf0;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.score-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 220px;
  padding: 20px;
}

.score-card small,
.section-title small {
  color: var(--green);
  font-size: 13px;
  font-weight: 700;
  line-height: 20px;
}

.score-ring {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  width: 132px;
  height: 132px;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #fff 0 58%, transparent 59%),
    conic-gradient(var(--green) calc(var(--score) * 1%), #e5edf0 0);
}

.score-ring strong {
  color: var(--ink);
  font-size: 36px;
  font-weight: 800;
  line-height: 36px;
}

.score-ring span,
.score-card em {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
  line-height: 18px;
}

.score-card em {
  padding: 5px 10px;
  border-radius: 999px;
  background: #f8fafc;
  color: var(--ink);
  font-weight: 700;
}

.summary-card {
  padding: 22px;
}

.summary-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.summary-card h3,
.section-title h3 {
  margin: 0;
  color: var(--ink);
  font-size: 20px;
  font-weight: 800;
  line-height: 30px;
}

.summary-card p,
.advice-card p,
.food-card p,
.indicator-detail p,
.risk-card em,
.timeline-list em,
.plan-step-grid p,
.report-disclaimer {
  margin: 8px 0 0;
  color: var(--text);
  font-size: 14px;
  line-height: 24px;
}

.report-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #f3f4f6;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 18px;
  white-space: nowrap;
}

.report-pill.high {
  background: #fff1f2;
  color: #dc2626;
}

.report-pill.low {
  background: #eff6ff;
  color: #2563eb;
}

.report-pill.watch,
.report-pill.warn {
  background: #fff7ed;
  color: #c2410c;
}

.report-pill.normal {
  background: #ecfdf5;
  color: var(--green);
}

.report-grid-two {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(0, 1.2fr);
  gap: 16px;
}

.report-section {
  padding: 20px;
}

.section-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 16px;
}

.risk-bars {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.risk-bar-row {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr) 28px;
  align-items: center;
  gap: 10px;
}

.risk-bar-row span,
.risk-bar-row em {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
  line-height: 20px;
}

.risk-bar-row b {
  display: block;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #eef2f7;
}

.risk-bar-row i {
  display: block;
  height: 100%;
  min-width: 8px;
  border-radius: inherit;
  background: var(--green);
}

.risk-bar-row.high i {
  background: #ef4444;
}

.risk-bar-row.medium i {
  background: #f59e0b;
}

.risk-bar-row.low i {
  background: #22c55e;
}

.risk-bar-row.watch i {
  background: #60a5fa;
}

.indicator-chart {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.indicator-bar-card {
  display: grid;
  grid-template-columns: minmax(150px, 0.8fr) minmax(120px, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid #edf1f4;
  border-radius: 12px;
  background: #fbfcfd;
}

.indicator-bar-card strong {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  line-height: 22px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.indicator-bar-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 18px;
}

.indicator-bar {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf2f7;
}

.indicator-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.indicator-bar-card.high .indicator-bar i {
  background: #ef4444;
}

.indicator-bar-card.low .indicator-bar i {
  background: #3b82f6;
}

.indicator-bar-card.warn .indicator-bar i {
  background: #f59e0b;
}

.risk-card-grid,
.advice-grid,
.food-card-grid,
.plan-step-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.risk-card,
.advice-card,
.food-card,
.plan-step-grid article,
.timeline-list article,
.indicator-detail {
  border: 1px solid #e8edf0;
  border-radius: 12px;
  background: #fbfcfd;
}

.risk-card,
.advice-card,
.food-card,
.plan-step-grid article {
  padding: 16px;
}

.risk-card {
  border-left: 4px solid #94a3b8;
}

.risk-card.high {
  border-left-color: #ef4444;
}

.risk-card.medium {
  border-left-color: #f59e0b;
}

.risk-card.low {
  border-left-color: #22c55e;
}

.risk-card strong,
.advice-card strong,
.food-card strong,
.plan-step-grid strong,
.indicator-detail strong,
.timeline-list strong {
  color: var(--ink);
  font-size: 15px;
  font-weight: 800;
  line-height: 22px;
}

.risk-card p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 20px;
}

.risk-card em,
.food-card em,
.timeline-list em {
  display: block;
  font-style: normal;
}

.indicator-detail-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.indicator-detail {
  padding: 16px;
}

.indicator-detail header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.indicator-detail dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.indicator-detail dt {
  color: var(--muted);
  font-size: 12px;
  line-height: 18px;
}

.indicator-detail dd {
  margin: 2px 0 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
  line-height: 22px;
}

.advice-card.green {
  background: #f3fbf6;
}

.advice-card.blue {
  background: #f5f9ff;
}

.food-group {
  margin-top: 16px;
}

.food-group h4 {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 16px;
  line-height: 24px;
}

.food-card span {
  display: block;
  margin-top: 8px;
  padding: 9px 10px;
  border-radius: 10px;
  background: #fff;
  color: var(--green);
  font-size: 13px;
  font-weight: 700;
  line-height: 20px;
}

.food-group.restricted .food-card span {
  color: #dc2626;
}

.timeline-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.timeline-list article {
  padding: 14px 16px;
}

.timeline-list span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 20px;
}

.plan-step-grid article {
  position: relative;
  padding-top: 48px;
}

.plan-step-grid b {
  position: absolute;
  top: 16px;
  left: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  font-size: 13px;
  line-height: 24px;
}

.markdown-appendix {
  border: 1px solid #e8edf0;
  border-radius: 12px;
  background: #fbfcfd;
}

.markdown-appendix summary {
  padding: 14px 16px;
  color: var(--ink);
  font-weight: 800;
  cursor: pointer;
}

.markdown-body {
  padding: 0 16px 16px;
}

.report-shell.markdown-only .markdown-body {
  padding: 0;
}

.empty-report-block {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  border: 1px dashed #dbe5de;
  border-radius: 12px;
  color: var(--muted);
}

.report-disclaimer {
  padding: 12px 14px;
  border-radius: 12px;
  background: #f8fafc;
  color: var(--muted);
}

.records-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 25px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--white);
  box-shadow: var(--shadow-soft);
}

.records-card[hidden] {
  display: none;
}

.records-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
}

.records-head small {
  color: var(--green);
  font-size: 13px;
  line-height: 19.5px;
}

.records-head h2 {
  margin: 0;
  color: var(--ink);
  font-size: 22px;
  font-weight: 700;
  line-height: 33px;
}

.records-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.record-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px 180px;
  align-items: center;
  gap: 16px;
  min-height: 72px;
  padding: 14px 16px;
  border: 1px solid #eef2f7;
  border-radius: 12px;
  background: #fff;
}

.record-item.is-clickable {
  cursor: pointer;
}

.record-item.is-clickable:hover {
  border-color: #c7e5d1;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.record-item > div:first-child {
  min-width: 0;
}

.record-item strong {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
  line-height: 22px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-item span,
.record-item em {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 18px;
}

.record-item em {
  color: #dc2626;
}

.record-hint {
  display: block;
  margin-top: 4px;
  color: #2563eb;
  font-size: 12px;
  line-height: 18px;
}

.record-status {
  justify-self: start;
  min-width: 86px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #f3f4f6;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}

.record-status.uploaded,
.record-status.completed {
  background: #eaf8ef;
  color: var(--green);
}

.record-status.generating,
.record-status.uploading {
  background: #eaf3ff;
  color: var(--blue);
}

.record-status.upload_failed,
.record-status.parse_failed,
.record-status.generate_failed {
  background: #fff1f2;
  color: #dc2626;
}

.record-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.record-actions a,
.record-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 5px 10px;
  border: 1px solid #d9eadf;
  border-radius: 999px;
  background: #fff;
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
  line-height: 18px;
}

.empty-records {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 126px;
  border: 1px dashed #dce7df;
  border-radius: 12px;
  background: #fbfefc;
  color: var(--muted);
}

.empty-records strong {
  color: var(--ink);
  font-size: 16px;
  line-height: 24px;
}

.trust-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  padding-top: 8px;
}

.trust-card {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  height: 100px;
  padding: 24px;
  border-radius: var(--radius-lg);
  background: var(--white);
  box-shadow: var(--shadow-soft);
}

.trust-card img {
  width: 54px;
  height: 61px;
  object-fit: contain;
  flex: 0 0 auto;
}

.trust-card:first-child img,
.trust-card:nth-child(3) img {
  width: 49px;
}

.trust-card:nth-child(2) img {
  width: 51px;
}

.trust-card span {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.trust-card strong {
  color: var(--ink);
  font-size: 16px;
  font-weight: 600;
  line-height: 24px;
  margin-bottom: 4px;
  white-space: nowrap;
}

.trust-card em {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
  line-height: 19.5px;
  white-space: nowrap;
}

.auth-dialog {
  width: min(460px, calc(100vw - 32px));
  border: 0;
  border-radius: 18px;
  padding: 0;
  background: transparent;
}

.auth-dialog::backdrop {
  background: rgba(15, 23, 42, 0.46);
  backdrop-filter: blur(4px);
}

.auth-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  background: var(--white);
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.2);
}

.auth-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.auth-head small {
  color: var(--green);
  font-size: 13px;
  line-height: 19.5px;
}

.auth-head h2 {
  margin: 0;
  color: var(--ink);
  font-size: 24px;
  font-weight: 800;
  line-height: 34px;
}

.auth-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 20px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 4px;
  border-radius: 12px;
  background: #f3f4f6;
}

.auth-tabs button {
  min-height: 38px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.auth-tabs button.active {
  background: #fff;
  color: var(--green);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.auth-field[hidden] {
  display: none;
}

.auth-field span {
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  line-height: 21px;
}

.auth-field input {
  width: 100%;
  min-height: 46px;
  border: 1px solid #dfe5ec;
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-size: 14px;
  line-height: 22px;
  outline: none;
  padding: 11px 12px;
  transition:
    border-color 0.16s ease,
    box-shadow 0.16s ease;
}

.auth-field input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(30, 158, 65, 0.12);
}

.questionnaire-dialog {
  width: min(920px, calc(100vw - 32px));
  border: 0;
  border-radius: 20px;
  padding: 0;
  background: transparent;
}

.questionnaire-dialog::backdrop {
  background: rgba(15, 23, 42, 0.46);
  backdrop-filter: blur(4px);
}

.questionnaire-card {
  display: flex;
  flex-direction: column;
  max-height: min(820px, calc(100dvh - 40px));
  padding: 0;
  border: 1px solid #e5e7eb;
  border-radius: 20px;
  background: var(--white);
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.2);
  overflow: hidden;
}

.questionnaire-head {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 26px 30px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--white);
}

.questionnaire-head p {
  max-width: 560px;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 22px;
}

.questionnaire-body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 18px;
  min-height: 0;
  overflow-y: auto;
  padding: 22px 30px 24px;
  background: #f8fafc;
  scrollbar-gutter: stable;
}

.questionnaire-section {
  padding: 18px;
  border: 1px solid #e8eef4;
  border-radius: 14px;
  background: var(--white);
}

.questionnaire-section-head {
  margin-bottom: 14px;
}

.questionnaire-section-head h3 {
  margin: 0;
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
  line-height: 24px;
}

.questionnaire-section-head p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 20px;
}

.section-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.section-grid.basic-grid {
  grid-template-columns: minmax(0, 1fr) minmax(270px, 1.16fr) minmax(0, 1fr);
}

.section-grid.basic-grid .option-group {
  grid-column: auto;
}

.question-field {
  min-width: 0;
}

label.question-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.question-field.wide {
  grid-column: 1 / -1;
}

.form-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 160px;
  color: var(--muted);
}

.form-loading span {
  width: 18px;
  height: 18px;
  border: 2px solid #dcefe4;
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.form-loading strong {
  color: var(--text);
  font-size: 14px;
  line-height: 22px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.question-field > span,
.option-group legend span {
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  line-height: 21px;
}

.required-mark {
  color: #dc2626;
  font-style: normal;
  font-weight: 700;
}

.optional-tag {
  margin-left: 6px;
  color: var(--light);
  font-size: 12px;
  font-style: normal;
  font-weight: 500;
}

.option-group {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.option-group legend {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  line-height: 21px;
  padding: 0;
  margin-bottom: 10px;
}

.option-group legend em {
  color: var(--light);
  font-size: 12px;
  font-style: normal;
  font-weight: 500;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 10px;
  clear: both;
}

.choice-grid-radio {
  display: flex;
  flex-wrap: wrap;
}

.choice-chip {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 18px;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
  transition:
    border-color 0.16s ease,
    background 0.16s ease,
    box-shadow 0.16s ease,
    color 0.16s ease;
}

.choice-chip:hover {
  border-color: rgba(21, 167, 79, 0.38);
  background: #fbfffd;
}

.choice-chip:has(input:checked) {
  border-color: rgba(21, 167, 79, 0.72);
  background: #effbf4;
  box-shadow: 0 0 0 2px rgba(21, 167, 79, 0.08);
}

.choice-chip:has(input:focus-visible) {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(30, 158, 65, 0.14);
}

.choice-chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.choice-label {
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  line-height: 20px;
  overflow-wrap: anywhere;
}

.choice-chip:has(input:checked) .choice-label {
  color: var(--green-deep);
}

.choice-check {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--green);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  line-height: 18px;
  opacity: 0;
  transform: scale(0.72);
  transition:
    opacity 0.16s ease,
    transform 0.16s ease;
}

.choice-chip:has(input:checked) .choice-check {
  opacity: 1;
  transform: scale(1);
}

.choice-grid-radio .choice-chip {
  display: flex;
  justify-content: center;
  min-width: 72px;
  min-height: 42px;
  border-radius: 10px;
}

.choice-grid-radio .choice-label {
  white-space: nowrap;
}

.questionnaire-body input:not([type="checkbox"]):not([type="radio"]),
.questionnaire-body select,
.questionnaire-body textarea {
  width: 100%;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-size: 14px;
  line-height: 22px;
  outline: none;
  padding: 11px 12px;
  transition:
    border-color 0.16s ease,
    box-shadow 0.16s ease;
}

.questionnaire-body textarea {
  resize: vertical;
}

.questionnaire-body input:not([type="checkbox"]):not([type="radio"]):focus,
.questionnaire-body select:focus,
.questionnaire-body textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(30, 158, 65, 0.12);
}

.download-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  padding: 12px;
  border: 1px solid rgba(21, 167, 79, 0.18);
  border-radius: 10px;
  background: #f0fbf5;
}

.download-row strong {
  color: var(--ink);
  font-size: 14px;
  line-height: 22px;
}

.download-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--green);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  line-height: 18px;
  text-decoration: none;
}

.download-pill.is-disabled {
  border: 1px solid #d7e3dd;
  background: #fff;
  color: var(--muted);
}

.ai-progress-dialog {
  width: min(560px, calc(100vw - 32px));
  border: 0;
  padding: 0;
  background: transparent;
}

.ai-progress-dialog::backdrop {
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(5px);
}

.ai-progress-card {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 24px;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.22);
}

.ai-progress-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.ai-progress-head small {
  color: var(--green);
  font-size: 13px;
  font-weight: 700;
  line-height: 20px;
}

.ai-progress-head h2 {
  margin: 0;
  color: var(--ink);
  font-size: 24px;
  font-weight: 800;
  line-height: 34px;
}

.ai-progress-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 22px;
}

.ai-progress-meter {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #eef2f7;
}

.ai-progress-meter i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), #2f80ed);
  transition: width 0.3s ease;
}

.ai-step-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ai-step-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid #edf1f4;
  border-radius: 12px;
  background: #fbfcfd;
}

.ai-step-list li b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #e5e7eb;
  color: var(--muted);
  font-size: 13px;
}

.ai-step-list li span {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ai-step-list strong {
  color: var(--ink);
  font-size: 14px;
  line-height: 21px;
}

.ai-step-list em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 18px;
}

.ai-step-list li.active {
  border-color: #b8e2c5;
  background: #f2fbf6;
}

.ai-step-list li.active b,
.ai-step-list li.complete b {
  background: var(--green);
  color: #fff;
}

.ai-step-list li.failed {
  border-color: #fecdd3;
  background: #fff1f2;
}

.ai-step-list li.failed b {
  background: #dc2626;
  color: #fff;
}

.questionnaire-actions {
  flex: 0 0 auto;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 30px 20px;
  border-top: 1px solid var(--line);
  background: var(--white);
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 100;
  max-width: 360px;
  padding: 12px 16px;
  border-radius: 12px;
  background: #111827;
  color: #fff;
  box-shadow: 0 18px 60px rgba(15, 23, 42, 0.24);
  font-size: 14px;
  line-height: 22px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1180px) {
  body {
    min-width: 0;
  }

  .header-inner,
  .page-shell {
    padding-right: 22px;
    padding-left: 22px;
  }

  .main-nav {
    gap: 28px;
  }

  .content-grid {
    grid-template-columns: 1fr;
  }

  .right-column {
    display: grid;
    grid-template-columns: 1fr 390px;
    align-items: start;
  }

  .report-grid-two,
  .report-overview {
    grid-template-columns: 1fr;
  }

  .risk-card-grid,
  .advice-grid,
  .food-card-grid,
  .plan-step-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .site-header {
    height: auto;
  }

  .header-inner {
    flex-wrap: wrap;
    gap: 18px;
    padding-top: 16px;
    padding-bottom: 16px;
  }

  .main-nav {
    order: 3;
    width: 100%;
    overflow-x: auto;
    padding-bottom: 6px;
  }

  .main-nav a.active::after {
    bottom: -8px;
  }

  .header-actions {
    margin-left: auto;
  }

  .user-menu {
    max-width: 100%;
    flex-wrap: wrap;
    border-radius: 14px;
  }

  .user-menu span {
    max-width: 110px;
  }

  .right-column,
  .trust-grid,
  .report-preview-grid,
  .risk-card-grid,
  .advice-grid,
  .food-card-grid,
  .plan-step-grid,
  .indicator-detail-list,
  .timeline-list {
    grid-template-columns: 1fr;
  }

  .title-section h1 {
    font-size: 30px;
    line-height: 40px;
  }

  .report-card,
  .result-card {
    padding: 18px;
  }

  .result-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .indicator-bar-card {
    grid-template-columns: 1fr;
  }

  .indicator-detail header {
    align-items: flex-start;
    flex-direction: column;
  }

  .score-card {
    min-height: 190px;
  }

  .ai-progress-dialog {
    width: calc(100vw - 16px);
  }

  .ai-progress-card {
    padding: 20px;
    border-radius: 16px;
  }

  .file-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .progress-block {
    max-width: 260px;
  }

  .privacy-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .records-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .record-item {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .record-actions {
    justify-content: flex-start;
  }

  .auth-dialog {
    width: calc(100vw - 16px);
  }

  .auth-card {
    padding: 20px;
    border-radius: 16px;
  }

  .questionnaire-dialog {
    width: calc(100vw - 16px);
    margin: 8px auto;
  }

  .questionnaire-card {
    max-height: calc(100dvh - 16px);
    border-radius: 16px;
  }

  .questionnaire-body {
    padding: 16px;
    gap: 14px;
  }

  .questionnaire-head {
    padding: 22px 18px 16px;
  }

  .questionnaire-section {
    padding: 16px;
  }

  .section-grid.basic-grid,
  .choice-grid,
  .choice-grid-radio {
    grid-template-columns: 1fr;
  }

  .choice-grid-radio {
    display: grid;
  }

  .questionnaire-actions {
    flex-direction: column-reverse;
    padding: 14px 18px 18px;
  }

  .primary-action.compact,
  .secondary-action.compact {
    width: 100%;
  }
}
