:root {
  --ink: #102b4e; --ink-strong: #08264b; --muted: #68778c; --soft-muted: #8a97a8;
  --paper: #fff; --soft-paper: #f7f9fb; --line: #dce3ea; --line-strong: #cbd5df;
  --tiffany: #81d8d0; --tiffany-hover: #6bcac1; --tiffany-soft: #e7f8f6;
  --success: #237e61; --success-bg: #e9f6f1; --warning: #976207; --warning-bg: #fff4dc;
  --danger: #a53b46; --danger-bg: #fcecef; --history-width: 356px; --header-height: 84px;
  --app-safe-top: env(safe-area-inset-top,0px);
  color-scheme: light;
}
* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; overscroll-behavior-y: none; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: "Microsoft YaHei UI", "PingFang SC", "Noto Sans CJK SC", Arial, sans-serif; -webkit-font-smoothing: antialiased; overscroll-behavior-y: none; }
button, textarea { font: inherit; }
button { color: inherit; }

.site-header { position: sticky; top: 0; z-index: 30; min-height: var(--header-height); padding: 13px 36px; display: grid; grid-template-columns: minmax(0,1fr) minmax(320px,520px) auto; align-items: center; gap: 28px; background: rgba(255,255,255,.98); border-bottom: 1px solid var(--line); }
.brand-lockup { min-width: 0; display: grid; grid-template-columns: auto 1px minmax(0,1fr); align-items: center; gap: 20px; }
.brand-logo { display: block; width: 273px; height: 40px; flex: 0 0 auto; }
.header-divider { width: 1px; height: 28px; flex: 0 0 auto; background: #aab5c1; }
.brand-copy { min-width: 0; display: grid; gap: 3px; }
.company-name, .project-name { display: block; min-width: 0; overflow: hidden; color: var(--ink-strong); font-size: 16px; font-weight: 600; letter-spacing: .01em; text-overflow: ellipsis; white-space: nowrap; }
.project-name { color: #425a73; font-size: 14px; font-weight: 500; }
.header-greeting { min-width: 0; height: 46px; padding: 7px 18px 7px 10px; display: flex; align-items: center; justify-content: center; gap: 13px; color: #31536d; background: linear-gradient(90deg,#f2fbfa 0%,#fff 78%); border: 1px solid #c5e8e4; border-radius: 23px; box-shadow: 0 4px 14px rgba(44,137,130,.07); white-space: nowrap; }
.pony-lane { --pony-distance: 52px; position: relative; width: 86px; height: 28px; flex: 0 0 86px; overflow: hidden; border-bottom: 1px dashed #8bcfc8; }
.running-pony { position: absolute; left: 0; bottom: 1px; width: 31px; height: 27px; display: block; object-fit: contain; filter: drop-shadow(0 2px 2px rgba(20,66,81,.12)); animation: pony-run 3.2s linear infinite; will-change: transform; }
.greeting-divider { width: 1px; height: 20px; background: #c4ddd9; }
#greeting-date {
  color: #7b3f98;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .025em;
  background: linear-gradient(90deg,#d83f68 0%,#d06b00 18%,#8a8200 36%,#0d806e 54%,#2568af 72%,#7441a5 88%,#c23b8b 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
#greeting-message { color: #087c73; font-size: 14px; letter-spacing: .08em; }
@keyframes pony-run {
  0% { transform: translateX(0) translateY(0); }
  24% { transform: translateX(calc(var(--pony-distance) * .48)) translateY(-2px); }
  50% { transform: translateX(var(--pony-distance)) translateY(0); }
  74% { transform: translateX(calc(var(--pony-distance) * .48)) translateY(-2px); }
  100% { transform: translateX(0) translateY(0); }
}
.header-meta { flex: 0 0 auto; display: flex; align-items: center; gap: 20px; color: #40526b; font-size: 12px; }
#today, #market-date { display: none; }
.current-user { max-width: 110px; overflow: hidden; color: var(--ink-strong); font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.header-action { padding: 6px 10px; color: #355a76; background: #fff; border: 1px solid var(--line-strong); border-radius: 4px; text-decoration: none; cursor: pointer; font-size: 12px; }
.header-action:hover { color: #174e70; border-color: #87cec8; background: var(--tiffany-soft); }
.mobile-history-button { display: none; }

.workspace { min-height: calc(100vh - var(--header-height)); display: grid; grid-template-columns: minmax(0,1fr) var(--history-width); transition: grid-template-columns 180ms ease; }
.workspace.history-collapsed { grid-template-columns: minmax(0,1fr) 52px; }
.main-content { width: min(100% - 72px, 940px); margin: 0 auto; padding: 36px 0 42px; }
.hero { margin-bottom: 20px; }
.intro { max-width: 760px; margin: 0; color: var(--muted); font-size: 14px; line-height: 1.8; }

.question-card { padding: 24px; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 12px 34px rgba(23,51,79,.05); }
.question-card > label { display: block; margin-bottom: 13px; color: var(--ink-strong); font-size: 15px; font-weight: 700; }
.input-row { display: grid; grid-template-columns: minmax(0,1fr) 136px; gap: 16px; align-items: end; }
.textarea-wrap { position: relative; }
.textarea-wrap textarea { width: 100%; height: 82px; min-height: 82px; max-height: 180px; padding: 15px 16px 31px; display: block; resize: vertical; color: var(--ink-strong); background: #fff; border: 1px solid var(--line-strong); border-radius: 5px; line-height: 1.55; transition: border-color 140ms ease, box-shadow 140ms ease; }
.textarea-wrap textarea::placeholder { color: #919cac; }
.textarea-wrap textarea:focus { outline: none; border-color: #4ebeb4; box-shadow: 0 0 0 3px rgba(129,216,208,.3); }
.character-count { position: absolute; right: 68px; bottom: 9px; color: var(--soft-muted); font-size: 11px; pointer-events: none; }
.question-clear { position: absolute; right: 12px; bottom: 7px; min-width: 46px; height: 24px; padding: 0 8px; color: #426077; background: #f7fafb; border: 1px solid var(--line-strong); border-radius: 4px; cursor: pointer; font-size: 11px; line-height: 22px; transition: color 140ms ease, border-color 140ms ease, background 140ms ease; }
.question-clear:hover { color: #0b5d66; background: var(--tiffany-soft); border-color: #83d3cc; }
.question-clear[hidden] { display: none; }
.voice-input-button { position: absolute; left: 12px; bottom: 7px; min-width: 64px; height: 28px; padding: 0 9px 0 7px; display: inline-flex; align-items: center; justify-content: center; gap: 5px; color: #245a73; background: #f2fbfa; border: 1px solid #9adbd5; border-radius: 14px; cursor: pointer; font-size: 11px; font-weight: 750; line-height: 26px; transition: color 140ms ease, border-color 140ms ease, background 140ms ease, transform 140ms ease, box-shadow 140ms ease; }
.voice-input-button[hidden] { display: none; }
.voice-input-button svg { width: 16px; height: 16px; overflow: visible; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.voice-input-button:hover { color: #0b5d66; background: var(--tiffany-soft); border-color: #62c8bf; }
.voice-input-button.is-listening { color: #8c2836; background: #fff0f2; border-color: #eea9b2; box-shadow: 0 0 0 4px rgba(224,92,109,.10); animation: voice-listening-pulse 1.4s ease-in-out infinite; }
.voice-input-button.is-starting { color: #0b5d66; background: var(--tiffany-soft); }
.voice-input-button.is-unsupported { color: #536c7a; background: #f7fafb; border-color: #c5d2d8; }
.voice-input-button.is-keyboard-fallback { color: #0b5d66; background: #eefbf9; border-color: #87d4cd; }
.voice-input-status { margin: 8px 0 0; color: #26776f; font-size: 11px; line-height: 1.5; }
.voice-input-status.is-error { color: var(--danger); }
.mobile-standalone-voice-enabled .textarea-wrap textarea { padding-bottom: 39px; }
@keyframes voice-listening-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 3px rgba(224,92,109,.08); }
  50% { transform: scale(1.025); box-shadow: 0 0 0 6px rgba(224,92,109,.13); }
}
#submit-button { min-height: 54px; padding: 0 22px; border: 1px solid #62c8bf; border-radius: 5px; color: #082f3c; background: var(--tiffany); font-weight: 800; cursor: pointer; box-shadow: 0 7px 16px rgba(70,177,167,.16); transition: background 140ms ease, transform 140ms ease, box-shadow 140ms ease; }
#submit-button:hover { background: var(--tiffany-hover); transform: translateY(-1px); box-shadow: 0 9px 20px rgba(70,177,167,.22); }
#submit-button:focus-visible, button:focus-visible { outline: 3px solid rgba(0,103,165,.2); outline-offset: 2px; }
#submit-button:disabled { opacity: .65; cursor: wait; transform: none; }
.form-helper-row { margin-top: 12px; display: flex; justify-content: space-between; gap: 20px; color: var(--muted); font-size: 11px; }
.form-helper-row p { margin: 0; }
kbd { padding: 1px 4px; color: #526378; background: var(--soft-paper); border: 1px solid var(--line); border-radius: 3px; font-family: inherit; font-size: 10px; }

.data-status { margin-top: 16px; padding: 12px 15px; display: flex; align-items: center; justify-content: space-between; gap: 20px; color: #53647a; background: #fbfcfd; border: 1px solid var(--line); border-radius: 6px; font-size: 12px; }
.data-status strong { color: var(--ink); }
.data-status-date { color: var(--success); white-space: nowrap; }
.suggestions { padding: 20px 0 28px; }
.suggestions h2 { margin: 0 0 12px; color: var(--ink-strong); font-size: 14px; }
.suggestion-list { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 10px; }
.suggestion-list button { min-height: 42px; padding: 9px 12px; overflow: hidden; color: #425a73; background: #fff; border: 1px solid var(--line-strong); border-radius: 22px; cursor: pointer; font-size: 12px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; transition: border-color 140ms ease, background 140ms ease; }
.suggestion-list button:hover { color: var(--ink-strong); background: var(--tiffany-soft); border-color: #9edfd9; }

.answer-panel { padding: 22px 20px 18px; scroll-margin-top: calc(var(--header-height) + var(--app-safe-top) + 16px); background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 10px 28px rgba(23,51,79,.045); }
.answer-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.section-label { margin: 0 0 7px; padding-left: 10px; color: var(--ink-strong); border-left: 4px solid var(--tiffany); font-size: 14px; font-weight: 800; }
.answer-heading h2 { margin: 0; color: var(--ink-strong); font-size: 18px; line-height: 1.45; font-weight: 600; }
.answer-tools { display: flex; align-items: center; gap: 10px; }
.answer-tools button, .answer-tools .export-full-link, .text-button { padding: 6px 8px; color: #607087; background: transparent; border: 0; border-radius: 4px; cursor: pointer; font-size: 12px; text-decoration: none; }
.answer-tools button:hover, .answer-tools .export-full-link:hover, .text-button:hover { color: var(--ink-strong); background: var(--soft-paper); }
.status { padding: 6px 9px; border-radius: 4px; white-space: nowrap; font-size: 11px; font-weight: 700; }
.approved_source { color: var(--success); background: var(--success-bg); }
.needs_review { color: var(--warning); background: var(--warning-bg); }
.error { color: var(--danger); background: var(--danger-bg); }
.answer-text { margin: 18px 0 14px; color: #344a64; font-size: 14px; line-height: 1.9; overflow-wrap: anywhere; }
.answer-text h3 { margin: 20px 0 8px; padding-left: 10px; color: var(--ink-strong); border-left: 3px solid var(--tiffany); font-size: 14px; line-height: 1.6; font-weight: 750; }
.answer-text h3:first-child { margin-top: 0; }
.answer-text p { margin: 0 0 14px; }
.answer-text p:last-child { margin-bottom: 0; }
.answer-text ul, .answer-text ol { display: grid; gap: 9px; margin: 0 0 16px; padding-left: 24px; }
.answer-text li { padding-left: 3px; color: #344a64; line-height: 1.75; }
.answer-text strong { color: var(--ink-strong); font-weight: 850; }
.answer-text li::marker { color: var(--tiffany-dark); font-weight: 750; }
.answer-text h3 + ul, .answer-text h3 + ol { margin-top: 2px; }
.answer-analysis { margin-top: 16px; padding-top: 2px; }
.answer-tables { margin: 18px 0 16px; }
.answer-table-section { width: fit-content; max-width: 100%; }
.answer-table-section + .answer-table-section { margin-top: 18px; }
.answer-table-heading { min-height: 32px; margin: 0 0 8px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.answer-table-heading h3 { min-width: 0; margin: 0; color: var(--ink-strong); font-size: 13px; line-height: 1.55; }
.answer-table-note { margin: -2px 2px 8px; color: #7a6751; font-size: 12px; line-height: 1.55; }
.table-export-actions { display: flex; align-items: center; gap: 5px; flex: 0 0 auto; }
.table-export-actions button { min-height: 28px; padding: 4px 9px; color: #315978; background: #fff; border: 1px solid var(--line-strong); border-radius: 5px; cursor: pointer; font-size: 10px; font-weight: 700; white-space: nowrap; }
.table-export-actions button:hover { color: var(--ink-strong); background: var(--tiffany-soft); border-color: #9edfd9; }
.table-export-actions button:disabled, .answer-tools button:disabled { cursor: wait; opacity: .62; }
.answer-table-scroll { width: fit-content; max-width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: 6px; cursor: zoom-in; touch-action: pan-x pan-y pinch-zoom; overscroll-behavior-x: contain; scrollbar-width: thin; scrollbar-color: #bfcbd6 transparent; -webkit-overflow-scrolling: touch; }
.answer-data-table { width: max-content; border-collapse: collapse; color: #344a64; background: #fff; font-size: 12px; font-variant-numeric: tabular-nums; }
.answer-data-table th, .answer-data-table td { padding: 11px 12px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; line-height: 1.45; overflow-wrap: normal; white-space: nowrap; word-break: keep-all; }
.answer-data-table th:last-child, .answer-data-table td:last-child { border-right: 0; }
.answer-data-table tbody tr:last-child > * { border-bottom: 0; }
.answer-data-table thead th { color: #294b6d; background: #f2f9f8; font-weight: 700; white-space: nowrap; }
.answer-data-table tbody th { min-width: 128px; color: #244866; background: #fafcfd; font-weight: 700; white-space: nowrap; }
.answer-data-table th.serial-column, .answer-data-table td.serial-column { width: 1%; min-width: 44px; max-width: 54px; padding-right: 7px; padding-left: 7px; text-align: center; }
.answer-data-table tbody tr:nth-child(even) td { background: #fcfefe; }
.answer-data-table tbody tr.market-row-sse > * { background: #f8fcff !important; }
.answer-data-table tbody tr.market-row-interbank > * { background: #eee4ff !important; }
.answer-data-table tbody tr.table-total-row > * { color: #123f63; background: #eef9f8 !important; border-top: 2px solid #8bdad4; font-weight: 900 !important; }
.answer-data-table tbody tr.table-total-row > .table-total-label { font-weight: 950 !important; }
.answer-table-zoom-hint { margin: 6px 2px 16px; color: #8a98a8; text-align: right; font-size: 10px; }
.answer-table-section:last-child .answer-table-zoom-hint { margin-bottom: 0; }
.answer-charts { margin: 18px 0 16px; }
.answer-chart-section { max-width: 100%; padding: 16px 16px 10px; overflow: hidden; background: linear-gradient(180deg,#fbfefe 0%,#fff 100%); border: 1px solid var(--line); border-radius: 7px; }
.answer-chart-section + .answer-chart-section { margin-top: 18px; }
.answer-chart-section h3 { margin: 0 0 10px; color: var(--ink-strong); font-size: 13px; line-height: 1.55; }
.answer-chart-scroll { max-width: 100%; overflow-x: auto; scrollbar-width: thin; scrollbar-color: #bfcbd6 transparent; -webkit-overflow-scrolling: touch; }
.answer-line-chart { display: block; width: max(100%,720px); height: auto; min-height: 270px; }
.chart-grid-line { stroke: #dfe8ed; stroke-width: 1; }
.chart-line { fill: none; stroke: #438ccf; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.chart-point { fill: #438ccf; stroke: #fff; stroke-width: 2; }
.chart-point-latest { fill: #087c73; }
.chart-latest-ring { fill: rgba(129,216,208,.28); stroke: none; }
.chart-y-label, .chart-x-label, .chart-value { fill: #6d7f91; font-family: inherit; font-size: 10px; font-variant-numeric: tabular-nums; }
.chart-value { fill: #2f5574; font-size: 10.5px; font-weight: 700; }
.chart-value-latest { fill: #087c73; font-weight: 900; }
.answer-chart-legend { margin: 6px 0 0; color: var(--muted); text-align: right; font-size: 10px; }
.table-zoom-open { overflow: hidden; }
.table-zoom-modal[hidden] { display: none; }
.table-zoom-modal { position: fixed; inset: 0; z-index: 1000; padding: 22px; display: grid; place-items: center; background: rgba(11,31,51,.72); backdrop-filter: blur(3px); }
.table-zoom-dialog { width: min(96vw,1680px); height: min(94vh,980px); display: grid; grid-template-rows: auto minmax(0,1fr) auto; overflow: hidden; background: #fff; border: 1px solid rgba(255,255,255,.8); border-radius: 10px; box-shadow: 0 28px 80px rgba(0,0,0,.28); }
.table-zoom-header { min-height: 60px; padding: 10px 14px 10px 18px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--line); }
.table-zoom-header > div:first-child { min-width: 0; }
.table-zoom-header strong, .table-zoom-header span { display: block; }
.table-zoom-header strong { overflow: hidden; color: var(--ink-strong); font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.table-zoom-header > div:first-child span { margin-top: 3px; color: var(--muted); font-size: 10px; }
.table-zoom-controls { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.table-zoom-controls button { min-width: 36px; height: 36px; padding: 0 10px; color: #315978; background: #fff; border: 1px solid var(--line-strong); border-radius: 5px; cursor: pointer; font-size: 15px; font-weight: 700; }
.table-zoom-controls button:hover { background: var(--tiffany-soft); border-color: #9edfd9; }
.table-zoom-controls #table-zoom-reset { min-width: 62px; font-size: 11px; }
.table-zoom-controls .table-zoom-close { min-width: 54px; margin-left: 5px; font-size: 11px; }
.table-zoom-viewport { min-width: 0; min-height: 0; overflow: auto; touch-action: pan-x pan-y pinch-zoom; background-color: #f7fafc; background-image: linear-gradient(#eaf0f4 1px,transparent 1px),linear-gradient(90deg,#eaf0f4 1px,transparent 1px); background-size: 20px 20px; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.table-zoom-canvas { position: relative; min-width: 100%; min-height: 100%; }
.table-zoom-stage { position: absolute; top: 0; left: 0; width: max-content; transform-origin: top left; }
.table-zoom-stage .answer-data-table { min-width: max-content; font-size: 13px; box-shadow: 0 8px 30px rgba(25,54,80,.1); }
.table-zoom-stage .answer-data-table th, .table-zoom-stage .answer-data-table td { padding: 12px 14px; }
.table-zoom-help { margin: 0; padding: 8px 16px; color: #7c8998; background: #fff; border-top: 1px solid var(--line); font-size: 10px; }
.trend-cell-content { display: inline-flex; align-items: center; gap: 6px; }
.trend-arrow { width: 18px; height: 18px; flex: 0 0 18px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; font-size: 14px; font-weight: 900; line-height: 1; }
.trend-arrow.trend-up { color: #087f5b; background: #e6f7f0; }
.trend-arrow.trend-down { color: #d92d20; background: #fff0ee; }
.answer-meta { color: var(--muted); font-size: 11px; }
.sources-wrap { margin-top: 20px; }
.sources-wrap h3 { margin: 0 0 9px; color: var(--ink-strong); font-size: 12px; }
.sources-wrap ul { margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); list-style: none; border: 1px solid var(--line); border-radius: 5px; }
.sources-wrap li { min-width: 0; padding: 13px 14px; border-left: 1px solid var(--line); }
.sources-wrap li:first-child { border-left: 0; }
.sources-wrap strong, .sources-wrap span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sources-wrap strong { color: #334c67; font-size: 12px; }
.sources-wrap span { margin-top: 5px; color: var(--soft-muted); font-size: 10px; }
.disclaimer { margin: 16px 0 0; color: var(--soft-muted); font-size: 10px; line-height: 1.6; }
.hidden { display: none !important; }

.history-panel { position: sticky; top: var(--header-height); height: calc(100vh - var(--header-height)); min-width: 0; background: #fbfcfd; border-left: 1px solid var(--line); overflow: visible; }
.history-backdrop { display: none; }
.resize-handle { position: absolute; top: 0; bottom: 0; left: -5px; z-index: 4; width: 10px; cursor: col-resize; touch-action: none; }
.resize-handle::after { content: ""; position: absolute; top: 42%; bottom: 42%; left: 4px; width: 2px; border-radius: 2px; background: #b9c5d0; opacity: 0; transition: opacity 140ms ease, background 140ms ease; }
.resize-handle:hover::after, .resize-handle:focus-visible::after { opacity: 1; background: #56bfb6; }
.history-content { height: 100%; display: grid; grid-template-rows: auto minmax(0,1fr) auto; }
.history-header { padding: 28px 22px 16px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.history-header h2 { margin: 0; color: var(--ink-strong); font-size: 15px; }
.history-header h2 span { display: inline-grid; min-width: 20px; height: 20px; margin-left: 4px; padding: 0 5px; place-items: center; color: #50647b; background: #eef2f5; border-radius: 10px; font-size: 10px; font-weight: 700; }
.history-list { padding: 0 12px 16px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #cbd5df transparent; }
.history-item { width: 100%; padding: 16px 15px; display: block; text-align: left; background: #fff; border: 1px solid var(--line); border-bottom: 0; cursor: pointer; }
.history-item:first-child { border-radius: 7px 7px 0 0; }
.history-item:last-child { border-bottom: 1px solid var(--line); border-radius: 0 0 7px 7px; }
.history-item:only-child { border-radius: 7px; }
.history-item:hover { position: relative; z-index: 1; background: #f4fbfa; border-color: #a8ded9; }
.history-question { display: block; overflow: hidden; color: #25466b; font-size: 13px; font-weight: 700; line-height: 1.45; text-overflow: ellipsis; white-space: nowrap; }
.history-preview { margin-top: 8px; display: -webkit-box; overflow: hidden; color: #6b798b; font-size: 11px; line-height: 1.55; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.history-time { margin-top: 10px; display: block; color: #9aa4b2; font-size: 10px; }
.history-empty { margin: 36px 16px; color: var(--muted); text-align: center; font-size: 12px; line-height: 1.7; }
.history-footer { padding: 12px; border-top: 1px solid var(--line); }
.history-footer button { width: 100%; min-height: 38px; color: #657589; background: #fff; border: 1px solid var(--line-strong); border-radius: 5px; cursor: pointer; font-size: 12px; }
.history-footer button:hover { color: var(--danger); border-color: #e4b7bd; }
.history-footer button:disabled { opacity: .5; cursor: default; }
.history-collapsed-tab { position: absolute; inset: 0; width: 52px; padding: 20px 0; display: none; align-items: center; justify-content: flex-start; gap: 8px; color: #42617f; background: #f7fafb; border: 0; cursor: pointer; font-size: 12px; writing-mode: vertical-rl; }
.workspace.history-collapsed .history-content, .workspace.history-collapsed .resize-handle { display: none; }
.workspace.history-collapsed .history-collapsed-tab { display: flex; }

.site-footer { padding: 20px; color: var(--soft-muted); background: #fff; border-top: 1px solid var(--line); text-align: center; font-size: 11px; }
.auth-page { min-height: 100vh; background: linear-gradient(145deg,#f4fbfa 0,#fff 48%,#f5f8fb 100%); }
.auth-shell { width: min(100% - 32px,460px); margin: 0 auto; padding: 9vh 0 48px; }
.auth-brand { display: flex; flex-direction: column; align-items: center; gap: 18px; text-align: center; }
.auth-brand .brand-logo { width: min(273px,75vw); height: auto; }
.auth-brand h1 { margin: 0; color: var(--ink-strong); font-family: Georgia,"Songti SC","SimSun",serif; font-size: 27px; font-weight: 500; }
.auth-brand p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
.auth-card { margin-top: 28px; padding: 28px; background: #fff; border: 1px solid var(--line); border-radius: 9px; box-shadow: 0 18px 50px rgba(19,55,82,.09); }
.auth-card h2 { margin: 0 0 20px; color: var(--ink-strong); font-size: 18px; }
.field { margin-bottom: 16px; }
.field label { display: block; margin-bottom: 7px; color: #334b64; font-size: 13px; font-weight: 700; }
.field input { width: 100%; min-height: 44px; padding: 10px 12px; color: var(--ink-strong); background: #fff; border: 1px solid var(--line-strong); border-radius: 5px; font: inherit; }
.field input:focus { outline: 0; border-color: #62c5bc; box-shadow: 0 0 0 3px rgba(129,216,208,.25); }
.input-control { position: relative; }
.username-control input { padding-left: 43px; }
.username-fish { position: absolute; top: 50%; left: 13px; z-index: 1; width: 21px; height: 21px; transform: translateY(-50%); fill: #f3a6bd; stroke: #c65e82; stroke-width: 1.1; pointer-events: none; }
.username-fish circle { fill: var(--ink-strong); stroke: none; }
.password-control input { padding-right: 60px; padding-left: 43px; }
.password-cat { position: absolute; top: 50%; left: 13px; z-index: 1; width: 21px; height: 21px; transform: translateY(-50%); fill: #f7cf55; stroke: #b77908; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.2; pointer-events: none; }
.password-cat .cat-detail { fill: none; stroke: #6e4b00; stroke-width: 1.5; }
.password-toggle { position: absolute; top: 50%; right: 7px; min-width: 46px; min-height: 32px; padding: 4px 7px; transform: translateY(-50%); color: #376078; background: transparent; border: 0; border-radius: 4px; cursor: pointer; font-size: 12px; font-weight: 700; }
.password-toggle:hover { background: var(--tiffany-soft); }
.password-toggle:focus-visible { outline: 2px solid rgba(0,103,165,.24); outline-offset: 1px; }
.primary-button { width: 100%; min-height: 44px; padding: 10px 16px; color: #092f4f; background: var(--tiffany); border: 0; border-radius: 5px; cursor: pointer; font-weight: 800; }
.primary-button:hover { background: var(--tiffany-hover); }
.primary-button:disabled { opacity: .6; cursor: wait; }
.form-message { min-height: 20px; margin: 14px 0 0; color: var(--danger); font-size: 12px; line-height: 1.6; }
.auth-note { margin-top: 18px; color: var(--soft-muted); text-align: center; font-size: 11px; line-height: 1.7; }
.admin-page { min-height: 100vh; background: var(--soft-paper); }
.admin-container { width: min(100% - 36px,960px); margin: 0 auto; padding: 38px 0 60px; }
.admin-topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.admin-topbar h1 { margin: 0; color: var(--ink-strong); font-size: 26px; }
.admin-topbar p { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.secondary-link { padding: 9px 13px; color: #315978; background: #fff; border: 1px solid var(--line-strong); border-radius: 5px; text-decoration: none; font-size: 12px; }
.admin-grid { margin-top: 28px; display: grid; grid-template-columns: minmax(260px,340px) minmax(0,1fr); gap: 24px; align-items: start; }
.admin-card { padding: 22px; background: #fff; border: 1px solid var(--line); border-radius: 8px; }
.admin-card h2 { margin: 0 0 18px; color: var(--ink-strong); font-size: 16px; }
.authorized-users-panel { padding: 0; overflow: hidden; }
.authorized-users-summary { min-height: 64px; padding: 0 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; color: var(--ink-strong); cursor: pointer; list-style: none; font-size: 16px; font-weight: 700; }
.authorized-users-summary::-webkit-details-marker { display: none; }
.authorized-users-summary:focus-visible { outline: 3px solid rgba(128,214,209,.36); outline-offset: -3px; }
.authorized-users-meta { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 11px; font-weight: 500; white-space: nowrap; }
.authorized-users-meta b { color: var(--ink-strong); font-size: 12px; }
.authorized-users-meta i { width: 8px; height: 8px; margin-left: 5px; display: inline-block; border-right: 2px solid #71849a; border-bottom: 2px solid #71849a; transform: rotate(45deg) translateY(-2px); transition: transform .18s ease; }
.authorized-users-panel[open] .authorized-users-meta i { transform: rotate(225deg) translate(-1px,-1px); }
.authorized-users-list { max-height: min(52vh,520px); padding: 0 20px 20px; overflow: auto; border-top: 1px solid var(--line); }
.authorized-users-list .user-row:first-child { margin-top: 16px; }
.credential-box { margin-top: 16px; padding: 14px; background: var(--warning-bg); border: 1px solid #efd69a; border-radius: 6px; }
.credential-box strong,.credential-box code { display: block; }
.credential-box code { margin: 9px 0; padding: 10px; overflow-wrap: anywhere; color: #563b00; background: #fff; border-radius: 4px; font-size: 14px; }
.small-button { min-height: 34px; padding: 6px 10px; color: #355a76; background: #fff; border: 1px solid var(--line-strong); border-radius: 4px; cursor: pointer; font-size: 11px; }
.small-button.danger { color: var(--danger); }
.user-list { display: grid; gap: 10px; }
.user-row { padding: 14px; display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 14px; align-items: center; border: 1px solid var(--line); border-radius: 6px; }
.user-name { color: var(--ink-strong); font-weight: 800; }
.user-meta { margin-top: 5px; color: var(--muted); font-size: 11px; }
.user-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.status-pill { margin-left: 7px; padding: 2px 6px; border-radius: 10px; color: var(--success); background: var(--success-bg); font-size: 10px; }
.status-pill.off { color: var(--danger); background: var(--danger-bg); }
.activity-card { margin-top: 24px; }
.activity-toolbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.activity-toolbar h2 { margin-bottom: 6px; }
.activity-toolbar p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.activity-controls { display: flex; align-items: center; gap: 8px; }
.activity-controls label { color: #465d75; font-size: 12px; font-weight: 700; white-space: nowrap; }
.activity-controls select { min-height: 34px; max-width: 220px; padding: 5px 30px 5px 9px; color: var(--ink); background: #fff; border: 1px solid var(--line-strong); border-radius: 4px; }
.activity-summary { margin: 18px 0 10px; color: #607087; font-size: 11px; }
.activity-list { display: grid; gap: 9px; }
.activity-item { padding: 13px 15px; background: #fbfcfd; border: 1px solid var(--line); border-radius: 6px; }
.activity-item.qa-event { background: #fff; }
.activity-item-heading { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 10px; }
summary.activity-item-heading { cursor: pointer; }
.activity-item-heading strong { overflow: hidden; color: #294967; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.activity-item-heading time { color: var(--soft-muted); font-size: 10px; white-space: nowrap; }
.activity-tag { padding: 3px 7px; color: #246159; background: var(--tiffany-soft); border-radius: 10px; font-size: 10px; font-weight: 800; }
.login-event .activity-tag { color: #50647b; background: #edf1f5; }
.activity-question, .activity-answer { margin: 12px 0 0; padding-top: 12px; border-top: 1px solid var(--line); }
.activity-question b, .activity-answer b { color: var(--ink-strong); font-size: 11px; }
.activity-question p, .activity-answer p { margin: 5px 0 0; color: #465c74; font-size: 12px; line-height: 1.75; white-space: pre-wrap; }
.activity-answer p { max-height: 360px; overflow: auto; }
.activity-empty { margin: 24px 0; color: var(--muted); text-align: center; font-size: 12px; }
body.is-resizing { cursor: col-resize; user-select: none; }

@media (max-width: 1500px) {
  .site-header { grid-template-columns: minmax(0,1fr) minmax(280px,380px) auto; gap: 18px; }
  .header-greeting { padding-inline: 8px 14px; gap: 9px; }
  .pony-lane { --pony-distance: 37px; width: 70px; flex-basis: 70px; }
  .header-meta { gap: 16px; }
}
@media (max-width: 1320px) {
  .site-header { grid-template-columns: minmax(0,1fr) minmax(220px,300px) auto; gap: 12px; }
  .header-greeting { height: 40px; padding-inline: 7px 11px; gap: 7px; }
  .pony-lane { --pony-distance: 17px; width: 50px; flex-basis: 50px; }
  #greeting-date { font-size: 10px; }
  #greeting-message { font-size: 12px; }
}
@media (max-width: 1240px) {
  .site-header { padding-inline: 24px; }
  .brand-lockup { gap: 14px; }
  .brand-logo { width: 225px; height: auto; }
  .company-name, .project-name { font-size: 14px; }
  .project-name { font-size: 12px; }
  .header-meta { gap: 16px; }
  .main-content { width: min(100% - 48px,900px); }
  .suggestion-list { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 980px) {
  :root { --header-height: 72px; }
  .site-header { position: fixed; top: var(--app-safe-top); right: 0; left: 0; width: 100%; min-height: var(--header-height); padding: 10px 12px; grid-template-columns: minmax(0,1fr) minmax(180px,220px) auto; gap: 8px; }
  .workspace, .workspace.history-collapsed { margin-top: calc(var(--header-height) + var(--app-safe-top)); }
  .brand-logo { width: 180px; }
  .project-name { display: none; }
  .header-meta > span { display: none; }
  .header-greeting { min-width: 0; padding-inline: 6px 9px; gap: 6px; }
  .pony-lane { --pony-distance: 10px; width: 38px; flex-basis: 38px; }
  .running-pony { width: 26px; height: 23px; }
  #greeting-date { overflow: hidden; text-overflow: ellipsis; }
  .mobile-history-button { min-height: 36px; padding: 0 12px; display: inline-flex; align-items: center; color: #244968; background: var(--tiffany-soft); border: 1px solid #a2ddd8; border-radius: 4px; cursor: pointer; font-size: 12px; }
  .workspace, .workspace.history-collapsed { display: block; }
  .main-content { width: min(100% - 36px,780px); padding-top: 28px; }
  .history-panel { position: fixed; top: calc(var(--header-height) + var(--app-safe-top)); right: 0; bottom: 0; z-index: 25; width: min(88vw,380px); height: auto; box-shadow: -16px 0 36px rgba(21,46,70,.14); transform: translateX(105%); transition: transform 180ms ease; }
  .history-backdrop { position: fixed; inset: calc(var(--header-height) + var(--app-safe-top)) 0 0; z-index: 24; display: block; background: rgba(16,39,61,.16); opacity: 0; pointer-events: none; transition: opacity 180ms ease; }
  .workspace.mobile-history-open .history-backdrop { opacity: 1; pointer-events: auto; }
  .workspace.mobile-history-open .history-panel { transform: translateX(0); }
  .workspace.history-collapsed .history-content { display: grid; }
  .workspace.history-collapsed .history-collapsed-tab, .resize-handle { display: none; }
  .sources-wrap ul { grid-template-columns: 1fr; }
  .sources-wrap li { border-left: 0; border-top: 1px solid var(--line); }
  .sources-wrap li:first-child { border-top: 0; }
}
@media (max-width: 680px) {
  :root { --header-height: 148px; }
  .site-header { padding: 9px 14px; display: grid; grid-template-columns: minmax(0,1fr) auto; grid-template-rows: auto 34px; gap: 7px 12px; }
  .brand-lockup { grid-template-columns: minmax(0,1fr); align-content: center; gap: 5px; }
  .brand-logo { width: 164px; }
  .company-name { display: block; overflow-wrap: anywhere; white-space: normal; font-size: 12px; line-height: 1.35; letter-spacing: 0; }
  .header-divider, .project-name { display: none; }
  .header-meta { justify-self: end; gap: 0; }
  .header-greeting { grid-column: 1 / -1; width: 100%; height: 34px; padding: 3px 12px 3px 7px; display: flex; justify-content: flex-start; gap: 8px; border-radius: 17px; }
  .pony-lane { --pony-distance: 28px; width: 58px; height: 24px; flex-basis: 58px; }
  .running-pony { width: 27px; height: 24px; }
  #greeting-date { font-size: 10px; }
  #greeting-message { font-size: 12px; }
  .greeting-divider { height: 16px; }
  .main-content { width: min(100% - 28px,620px); padding-top: 22px; }
  .question-card { padding: 18px; }
  .input-row { grid-template-columns: 1fr; }
  #submit-button { width: 100%; }
  .form-helper-row { display: block; }
  .form-helper-row p + p { margin-top: 7px; }
  .data-status { align-items: flex-start; flex-direction: column; gap: 7px; }
  .suggestion-list { grid-template-columns: 1fr; }
  .answer-heading { display: block; }
  .answer-tools { margin-top: 12px; flex-wrap: wrap; }
  .answer-table-heading { align-items: flex-start; flex-direction: column; gap: 7px; }
  .table-export-actions { width: 100%; }
  .table-export-actions button { flex: 1 1 0; min-height: 34px; }
  .admin-grid { grid-template-columns: 1fr; }
  .admin-topbar { display: block; }
  .admin-topbar .secondary-link { display: inline-block; margin-top: 16px; }
  .activity-toolbar, .activity-controls { align-items: stretch; flex-direction: column; }
  .activity-controls { gap: 7px; }
  .activity-controls select { max-width: none; }
  .activity-item-heading { grid-template-columns: auto minmax(0,1fr); }
  .activity-item-heading time { grid-column: 2; }
  .user-row { grid-template-columns: 1fr; }
  .user-actions { justify-content: flex-start; }
  .header-action { padding: 5px 7px; font-size: 10px; }
  .table-zoom-modal { padding: 0; }
  .table-zoom-dialog { width: 100%; height: 100dvh; max-height: 100dvh; border: 0; border-radius: 0; }
  .table-zoom-header { min-height: 56px; padding: 8px 9px 8px 12px; gap: 8px; }
  .table-zoom-header > div:first-child span { display: none; }
  .table-zoom-controls { gap: 4px; }
  .table-zoom-controls button { min-width: 34px; height: 34px; padding: 0 7px; }
  .table-zoom-controls #table-zoom-reset { min-width: 52px; }
  .table-zoom-controls .table-zoom-close { min-width: 46px; margin-left: 1px; }
  .table-zoom-help { padding: 7px 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
  .running-pony { animation: none; transform: translateX(28px); }
  .voice-input-button.is-listening { animation: none; }
}

.trusted-device-note {
  margin: 2px 0 0;
  color: #58758c;
  font-size: 12px;
  line-height: 1.6;
  text-align: center;
}

.pwa-install-button {
  min-height: 36px;
  padding: 7px 13px;
  border: 1px solid #8fd7d1;
  border-radius: 8px;
  color: #0a4667;
  background: #eefaf9;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.auth-card > .pwa-install-button {
  width: 100%;
  margin-top: 12px;
}

.pwa-update-notice {
  position: fixed;
  left: 50%;
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 120;
  width: min(420px, calc(100vw - 28px));
  max-width: calc(100vw - 28px);
  min-width: 0;
  padding: 10px 12px 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid #a5ddd8;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 14px 36px rgba(13, 54, 83, .18);
  color: #123f61;
  transform: translateX(-50%);
}

.pwa-update-notice > span { min-width: 0; overflow-wrap: anywhere; }

.pwa-update-button {
  flex: 0 0 auto;
  padding: 7px 12px;
  border: 0;
  border-radius: 8px;
  background: #81d8d0;
  color: #073c58;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.pwa-update-button:disabled { opacity: .65; cursor: wait; }
.image-export-notice { position: fixed; left: 50%; bottom: max(18px,env(safe-area-inset-bottom)); z-index: 1002; width: min(520px,calc(100vw - 28px)); transform: translateX(-50%); display: grid; gap: 4px; padding: 13px 16px; color: #163d58; background: rgba(246,255,253,.98); border: 1px solid #8bd7cf; border-radius: 14px; box-shadow: 0 12px 34px rgba(15,53,75,.20); font-size: 13px; line-height: 1.5; }
.image-export-notice strong { color: #075f59; font-size: 14px; }
.image-export-notice span { overflow-wrap: anywhere; }

@media (display-mode: standalone) and (max-width: 980px) {
  :root { --app-safe-top: max(env(safe-area-inset-top,0px),24px); }
}

@media (max-width: 680px) {
  .pwa-update-notice { bottom: max(12px,env(safe-area-inset-bottom)); padding: 9px 9px 9px 12px; gap: 9px; border-radius: 12px; font-size: 13px; }
  .pwa-update-button { min-height: 38px; padding: 7px 11px; font-size: 13px; }
  .header-meta > .pwa-install-button {
    position: fixed;
    right: 14px;
    bottom: max(14px, env(safe-area-inset-bottom));
    z-index: 22;
    box-shadow: 0 8px 24px rgba(13, 54, 83, .16);
  }
}
