:root {
  color-scheme: light;
  font-family: system-ui, "Noto Sans CJK TC", "Microsoft JhengHei", sans-serif;
  color: #182a28;
  background: #f3f6f4;
  --forest: #163b34;
  --green: #235b49;
  --soft: #e6f0e9;
  --muted: #536760;
  --line: #dbe5df;
  --white: #fff;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid #a35c26; outline-offset: 4px; }
h1, h2, p, ul, ol { margin: 0; }
h2 { font-size: 1.15rem; }
small, .muted { color: var(--muted); }
a { color: inherit; }

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 750;
  letter-spacing: .03em;
}
.brand small { display: block; color: #bdcfc5; margin-top: 3px; font-size: .72rem; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 13px;
  background: #e4c49a;
  color: #243a32;
}
.mode, .tag, .count {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  white-space: nowrap;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: .77rem;
  font-weight: 700;
}
.mode { background: #f8ead7; color: #714716; }
.tag, .count { background: var(--soft); color: var(--green); }

.login {
  display: grid;
  grid-template-columns: 1fr 1.12fr;
  max-width: 930px;
  min-height: 520px;
  margin: max(40px, 10vh) auto 32px;
  width: calc(100% - 40px);
  overflow: hidden;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 22px 65px #17372a12;
}
.login-brand {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  gap: 88px;
  padding: clamp(28px, 5vw, 62px);
  color: #f5f9f3;
  background: linear-gradient(145deg, #142e28, #245746);
}
.login-brand p { font-size: clamp(2rem, 4vw, 3.1rem); font-weight: 800; line-height: 1.22; }
.brand-rings {
  z-index: -1;
  position: absolute;
  right: -120px;
  bottom: -140px;
  width: 330px;
  height: 330px;
  border: 1px solid #cdded34a;
  border-radius: 50%;
  box-shadow: 0 0 0 28px #cdded314, 0 0 0 57px #cdded314, 0 0 0 88px #cdded314;
}
.login-body { padding: clamp(24px, 5vw, 60px); align-self: center; }
.login h1 { margin: 12px 0 8px; font-size: 2rem; }
.login .muted { line-height: 1.65; }
fieldset { display: grid; gap: 10px; padding: 0; border: 0; margin: 24px 0 18px; }
legend { margin-bottom: 8px; font-weight: 750; }
.account-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
}
.account-option:has(input:checked) { border-color: #52816c; background: #f4f9f5; }
.account-option input { accent-color: var(--green); }
.account-option small, .profile small, .tasks small, .module-grid small { display: block; margin-top: 3px; }
.primary {
  width: 100%;
  display: flex;
  justify-content: space-between;
  padding: 13px 16px;
  color: white;
  background: var(--green);
  border: 0;
  border-radius: 10px;
  font-weight: 700;
}
.primary:hover { background: var(--forest); }

.workspace { display: grid; grid-template-columns: 226px minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: #152f29; color: #fff; padding: 25px 18px; }
.sidebar .brand { padding: 0 7px; }
.sidebar nav { display: grid; gap: 6px; margin-top: 36px; }
.sidebar a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  color: #d8e6df;
  border-radius: 9px;
  text-decoration: none;
  white-space: nowrap;
}
.sidebar a:first-child, .sidebar a:hover { background: #285145; color: #fff; }
.sidebar a span { min-width: 18px; text-align: center; }
.topbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-height: 74px;
  padding: 12px clamp(15px, 3vw, 38px);
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.top-controls, .profile { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.profile small { font-size: .72rem; }
.avatar {
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  border-radius: 50%;
  font-weight: 700;
  color: var(--green);
  background: var(--soft);
}
.logout, .switcher button { border: 0; border-radius: 8px; padding: 9px 11px; color: var(--forest); background: transparent; }
.logout { border: 1px solid var(--line); }
.logout:hover { background: var(--soft); }
.switcher { display: flex; padding: 3px; background: #edf2ef; border-radius: 10px; }
.switcher button { font-size: .84rem; white-space: nowrap; }
.switcher button[aria-pressed="true"] { background: #fff; color: var(--forest); font-weight: 750; box-shadow: 0 1px 4px #182a2822; }

#overview { max-width: 1320px; margin: 0 auto; padding: clamp(18px, 4vw, 46px); }
.page-heading, .section-heading { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 8px 16px; }
.page-heading { margin-bottom: 25px; }
.eyebrow, .date { color: var(--muted); font-size: .82rem; font-weight: 650; }
.page-heading h1 { margin: 5px 0; font-size: clamp(1.8rem, 3vw, 2.45rem); }
.panel, .module-grid li { background: #fff; border: 1px solid var(--line); border-radius: 16px; }
.panel { padding: clamp(15px, 2.5vw, 24px); }
.tasks, .module-grid, .bars { list-style: none; padding: 0; }
.tasks { margin-top: 9px; }
.tasks li { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.tasks li:last-child { border-bottom: 0; padding-bottom: 2px; }
.tasks .count { margin-left: auto; }
.task-icon, .module-grid li > span {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border-radius: 10px;
  background: var(--soft);
  color: var(--green);
  font-size: 1.15rem;
}
.module-section { margin-top: 24px; }
.module-section p { margin-top: 4px; font-size: .89rem; }
.module-grid, .metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.module-grid { margin-top: 12px; }
.module-grid li { padding: 16px; }
.module-grid strong { display: block; margin-top: 9px; }
.manager-heading { margin-bottom: 11px; }
.manager-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi-action {
  text-align: left;
  display: grid;
  gap: 5px;
  color: var(--forest);
}
.kpi-action:hover { background: #f5faf6; border-color: #85ac9a; }
.kpi-action > span { font-size: .91rem; color: var(--muted); font-weight: 700; }
.kpi-action strong { font-size: clamp(1.27rem, 2.7vw, 2rem); line-height: 1.3; }
.kpi-action small { font-size: .8rem; }
.manager-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 14px; margin-top: 14px; }
.chart-switcher { width: fit-content; max-width: 100%; margin-top: 12px; }
.bars { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin-top: 8px; }
.bars button {
  display: grid;
  gap: 6px;
  align-content: end;
  justify-items: center;
  width: 100%;
  min-height: 146px;
  padding: 6px 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: clamp(.67rem, 1vw, .8rem);
}
.bars button:hover, .bars button[aria-pressed="true"] { background: #edf5ef; }
.bars i { width: min(70%, 36px); height: var(--bar-size); background: #a4c5b6; border-radius: 5px 5px 0 0; }
.bars button[aria-pressed="true"] i { background: var(--green); }
.chart-readout {
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--soft);
  color: var(--forest);
  font-size: .88rem;
  font-weight: 700;
}
.brief-list { margin: 8px 0 0; }
.brief-list > div { padding: 9px 0; border-bottom: 1px solid var(--line); }
.brief-list > div:last-child { border-bottom: 0; padding-bottom: 0; }
.brief-list dt { font-size: .9rem; font-weight: 750; }
.brief-list dd { margin: 3px 0 0; color: var(--muted); font-size: .86rem; line-height: 1.5; }

@media (max-width: 860px) {
  .workspace { grid-template-columns: 177px minmax(0, 1fr); }
  .manager-grid { grid-template-columns: 1fr; }
  .manager-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .login { grid-template-columns: 1fr; margin-top: 18px; width: calc(100% - 24px); }
  .login-brand { padding: 18px 24px; }
  .login-brand p { display: none; }
  .workspace { grid-template-columns: 1fr; }
  .sidebar { padding: 13px 15px; }
  .sidebar .brand { padding: 0; }
  .sidebar nav { display: flex; gap: 5px; margin-top: 10px; }
  .sidebar a { padding: 8px 7px; font-size: .8rem; gap: 4px; }
  .topbar { align-items: flex-start; }
  .top-controls { gap: 6px; }
  .module-grid, .metrics, .manager-grid { gap: 8px; }
  .module-grid li, .metrics .panel { padding: 10px; }
  .module-grid strong, .kpi-action > span { font-size: .82rem; }
  .module-grid small { font-size: .7rem; }
}

.mobile-nav-toggle { display: none; }
.task-actions li { padding: 0; }
.task-actions li:last-child { padding-bottom: 0; }
.task-action, .module-action {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 12px;
  text-align: left;
  color: inherit;
  background: transparent;
  border: 0;
  border-radius: 10px;
}
.task-action { padding: 13px 4px; }
.task-action:hover, .module-action:hover { background: #f3f8f4; }
.action-arrow { color: var(--green); font-size: 1.4rem; }
.action-copy small { line-height: 1.45; }
.module-grid li { padding: 0; }
.module-action { display: block; padding: 15px; height: 100%; }
.module-header { display: flex; align-items: center; justify-content: space-between; gap: 5px; }
.module-open { display: block; margin-top: 10px; color: var(--green); font-size: .82rem; font-weight: 700; }
.module-dialog {
  width: min(470px, calc(100% - 32px));
  max-height: calc(100dvh - 36px);
  padding: clamp(16px, 4vw, 25px);
  color: inherit;
  border: 1px solid var(--line);
  border-radius: 16px;
}
.module-dialog::backdrop { background: #152f2977; }
.module-dialog h2 { margin-top: 14px; font-size: 1.42rem; }
.module-sample {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 9px 14px;
  padding: 13px;
  border-radius: 10px;
  background: #f3f6f4;
}
.module-sample dt { font-weight: 750; }
.module-sample dd { margin: 0; }
.integration-note { color: var(--muted); line-height: 1.5; }
.integration-note strong { display: block; color: #714716; margin-bottom: 3px; }

@media (max-width: 640px) {
  .sidebar { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
  .mobile-nav-toggle {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 42px;
    padding: 6px 10px;
    color: #fff;
    background: #285145;
    border: 1px solid #567c6e;
    border-radius: 9px;
  }
  .sidebar nav { grid-column: 1 / -1; flex-wrap: wrap; }
  .mobile-nav-toggle[aria-expanded="false"] + nav { display: none; }
  .module-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .module-action { padding: 10px; }
  .task-action { gap: 8px; }
}

.service-dialog {
  width: min(920px, calc(100% - 24px));
  height: min(760px, calc(100dvh - 24px));
  max-height: calc(100dvh - 24px);
  padding: clamp(12px, 3vw, 20px);
  overflow: hidden;
}
.service-dialog > .module-layout {
  height: 100%;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 8px;
  min-height: 0;
}
.service-dialog .section-heading { align-items: center; }
.service-dialog h2 { margin: 0; }
.service-preview {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f3f6f4;
}
.service-dialog .integration-note {
  padding-top: 8px;
  border-top: 1px solid var(--line);
  font-size: .83rem;
}
.legacy-brief { margin-top: 12px; }
.legacy-brief summary { color: var(--green); cursor: pointer; font-size: .86rem; font-weight: 700; }
.legacy-brief-copy { margin: 8px 0 0; color: var(--muted); font-size: .84rem; white-space: pre-line; }

.exhibition-return { text-decoration: none; font-size: .86rem; }

.local-data-note { margin: -12px 0 18px; font-size: .83rem; }
.data-status { margin: 8px 0; color: var(--green); font-size: .87rem; font-weight: 700; }
.data-status[data-error="true"] { color: #9c3224; }
.operation-dialog { width: min(780px, calc(100% - 24px)); }
.operation-dialog > .module-layout { display: flex; flex-direction: column; max-height: calc(100dvh - 86px); gap: 8px; }
.module-operations { min-height: 0; overflow: auto; padding: 2px 5px 2px 2px; }
.operation-filters, .operation-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; }
.operation-filters { margin-bottom: 12px; }
.operation-list { display: grid; gap: 8px; }
.operation-row { border: 1px solid var(--line); border-radius: 10px; padding: 10px; overflow-wrap: anywhere; }
.operation-row summary { cursor: pointer; }
.operation-row summary strong { margin-inline: 4px 8px; }
.operation-row p { margin-top: 6px; }
.operation-form { margin-top: 9px; }
.operation-filters input, .operation-filters select, .operation-form input, .operation-form textarea {
  font: inherit;
  color: inherit;
  border: 1px solid #aebfb5;
  border-radius: 8px;
  padding: 7px;
  min-width: 0;
  max-width: 100%;
}
.operation-form label { display: grid; gap: 3px; max-width: 100%; font-size: .88rem; }
.operation-button { padding: 8px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--soft); color: var(--forest); }
.operation-button:disabled { opacity: .55; }

.partner-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
  padding: 0;
  list-style: none;
}
.partner-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-content: start;
  align-items: start;
  gap: 8px;
}
.partner-card h3 { margin: 0; font-size: 1rem; }
.partner-card p, .partner-capabilities, .partner-launch { grid-column: 1 / -1; }
.partner-launch { justify-self: start; text-decoration: none; }
.partner-capabilities { padding-left: 1.25em; line-height: 1.6; font-size: .9rem; }

@media (max-width: 640px) {
  .partner-grid { grid-template-columns: minmax(0, 1fr); }
}

.ai-workspace { scroll-margin-top: 14px; }
.ai-brief-link { display: inline-block; margin-top: 10px; color: var(--green); font-size: .89rem; font-weight: 750; }
.ai-panel { margin-top: 12px; }
.ai-panel h3, .ai-result-card h4 { margin: 0; font-size: 1rem; }
.ai-metadata, .ai-results { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.ai-metadata { margin: 14px 0; }
.ai-metadata > div, .ai-result-card, .ai-answer { padding: 10px 12px; border-radius: 10px; background: #f3f6f4; }
.ai-metadata dt { color: var(--muted); font-size: .8rem; }
.ai-metadata dd { margin: 4px 0 0; font-weight: 700; overflow-wrap: anywhere; }
.ai-sources { margin-bottom: 12px; }
.ai-sources summary { color: var(--green); cursor: pointer; font-weight: 700; }
.ai-sources ul, .ai-result-card ul { padding-left: 1.25em; margin-top: 6px; }
.ai-actions, .ai-prompts { display: flex; flex-wrap: wrap; gap: 8px; }
.ai-run { width: fit-content; }
.ai-run:disabled, .ai-prompts button:disabled { opacity: .6; cursor: wait; }
#ai-history { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 12px; }
#ai-history-time { margin-top: 4px; font-size: .84rem; }
.ai-results { margin-top: 10px; }
.ai-result-card { min-width: 0; overflow-wrap: anywhere; line-height: 1.5; }
.ai-result-card li { margin-top: 4px; }
.ai-prompts { margin: 12px 0; }
#ai-question-form { display: grid; gap: 8px; }
#ai-question { font: inherit; resize: vertical; border: 1px solid #aebfb5; border-radius: 8px; padding: 8px; width: 100%; }
.ai-answer { margin-top: 10px; overflow-wrap: anywhere; }
@media (max-width: 900px) {
  .ai-results { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .ai-metadata, .ai-results { grid-template-columns: 1fr; }
  .ai-prompts button { text-align: left; max-width: 100%; }
}

.scenario-panel { margin-bottom: 18px; }
.scenario-panel p { margin: 8px 0; line-height: 1.55; }
.scenario-guide { color: var(--muted); }
.scenario-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.scenario-panel h3 { margin: 0 0 8px; font-size: 1rem; }
.scenario-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.scenario-metric { border-radius: 10px; background: #f3f6f4; padding: 9px; overflow-wrap: anywhere; }
.scenario-metric strong { display: block; font-size: .9rem; }
.scenario-metric small { display: block; margin-top: 4px; }
@media (max-width: 760px) {
  .scenario-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}


.exhibition-role-picker { position: relative; }
.exhibition-role-picker summary { cursor: pointer; }
.exhibition-role-picker[open] { z-index: 4; }
.exhibition-role-picker > div {
  position: absolute; inset: calc(100% + 5px) auto auto 0;
  min-width: max-content; display: grid; gap: 5px;
  background: var(--white); border: 1px solid var(--line); padding: 6px; border-radius: 10px;
  box-shadow: 0 8px 20px #163b3420;
}
.exhibition-role-picker button:disabled { cursor: default; opacity: .55; }
