:root {
  --ink: #12292f;
  --ink-2: #28434a;
  --muted: #708187;
  --line: #dde4e2;
  --line-soft: #e9eeec;
  --paper: #fbfcfa;
  --canvas: #f1f4f1;
  --cream: #f6f1e8;
  --brand: #ed6946;
  --brand-dark: #d85332;
  --teal: #1d6f70;
  --green: #28a56c;
  --sidebar: #102e36;
  --sidebar-soft: #173b43;
  --white: #fff;
  --shadow: 0 18px 48px rgba(24, 52, 56, .08);
  --radius-lg: 22px;
  --radius-md: 15px;
  --radius-sm: 10px;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; }
html { height: 100%; }
body { min-width: 320px; background: var(--canvas); }
button, input, textarea { font: inherit; }
button { color: inherit; }
button, [tabindex] { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(460px, 1.08fr) minmax(440px, .92fr); background: var(--paper); }
.login-brand { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; padding: 54px clamp(44px, 6vw, 104px) 42px; color: var(--white); background: var(--sidebar); isolation: isolate; }
.login-brand::before { content: ""; position: absolute; width: 540px; height: 540px; right: -170px; top: -150px; border: 1px solid rgba(255,255,255,.09); border-radius: 50%; box-shadow: 0 0 0 80px rgba(255,255,255,.025), 0 0 0 160px rgba(255,255,255,.018); z-index: -1; }
.login-brand::after { content: ""; position: absolute; width: 370px; height: 460px; right: -120px; bottom: -170px; background: var(--brand); transform: rotate(24deg); opacity: .92; z-index: -1; }
.brand-mark { width: 44px; height: 44px; border-radius: 12px 12px 12px 4px; display: grid; place-items: center; color: var(--white); background: var(--brand); box-shadow: 0 8px 24px rgba(237,105,70,.22); flex: 0 0 auto; }
.brand-mark span { font-weight: 800; font-size: 22px; letter-spacing: -.1em; transform: translateX(-1px); }
.brand-mark--large { width: 54px; height: 54px; border-radius: 16px 16px 16px 5px; }
.brand-mark--large span { font-size: 28px; }
.brand-logo { display: block; max-width: 100%; object-fit: contain; object-position: left center; }
.brand-logo--hero { width: 236px !important; height: auto !important; }
.brand-logo--sidebar { width: 104px !important; height: auto !important; max-height: 38px; flex: 0 0 auto; }
.brand-logo-box { display: inline-flex; align-items: center; justify-content: center; padding: 7px 9px; border-radius: 10px; background: var(--sidebar); }
.brand-logo--mobile { width: 104px !important; height: auto !important; }
.eyebrow, .kicker { margin: 0; color: var(--brand); font-size: 11px; font-weight: 800; letter-spacing: .17em; }
.login-brand h1 { margin: 18px 0 22px; max-width: 620px; font-size: clamp(42px, 5vw, 72px); line-height: 1.12; letter-spacing: -.055em; font-weight: 650; }
.login-brand__copy { max-width: 580px; margin: 0; color: rgba(255,255,255,.68); font-size: 16px; line-height: 1.85; }
.login-brand__footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; color: rgba(255,255,255,.55); font-size: 12px; letter-spacing: .04em; }
.signal { display: inline-flex; align-items: center; gap: 8px; }
.signal i, .system-status i, .module-state i { width: 7px; height: 7px; border-radius: 50%; background: #4bd091; box-shadow: 0 0 0 4px rgba(75,208,145,.12); }
.login-panel { display: grid; place-items: center; padding: 48px; background: var(--paper); }
.login-card { width: min(390px, 100%); }
.login-card__mobile-brand { display: none; align-items: center; gap: 12px; margin-bottom: 54px; }
.login-card h2 { margin: 11px 0 8px; font-size: 32px; letter-spacing: -.035em; }
.muted { margin: 0 0 35px; color: var(--muted); font-size: 14px; }
.field { display: block; margin: 0 0 20px; }
.field > span { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.field em { color: #9aa7aa; font-size: 11px; font-style: normal; font-weight: 500; }
.input-wrap { display: flex; align-items: center; height: 52px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--white); transition: .2s ease; }
.input-wrap:focus-within { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(29,111,112,.09); }
.input-wrap > svg { width: 18px; margin-left: 15px; color: #8b999c; }
.input-wrap input { width: 100%; height: 100%; padding: 0 12px; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 14px; }
.input-wrap input::placeholder, textarea::placeholder { color: #a5afb1; }
.icon-button { width: 38px; height: 38px; border: 0; border-radius: 9px; display: grid; place-items: center; color: #718287; background: transparent; cursor: pointer; transition: .18s ease; }
.icon-button:hover { color: var(--ink); background: rgba(20,52,58,.06); }
.icon-button svg { width: 18px; height: 18px; }
.input-wrap .icon-button { margin-right: 6px; }
.form-error { min-height: 20px; margin: -6px 0 9px; color: #c7472c; font-size: 12px; }
.primary-button { min-height: 48px; border: 0; border-radius: var(--radius-sm); display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 0 22px; color: var(--white); background: var(--brand); font-weight: 750; cursor: pointer; box-shadow: 0 10px 22px rgba(237,105,70,.2); transition: transform .18s ease, background .18s ease, opacity .18s ease; }
.primary-button:hover:not(:disabled) { background: var(--brand-dark); transform: translateY(-1px); }
.primary-button:disabled { opacity: .48; cursor: not-allowed; box-shadow: none; }
.primary-button svg { width: 18px; }
.primary-button--wide { width: 100%; }
.login-card .primary-button { height: 54px; margin-top: 2px; justify-content: space-between; padding: 0 20px 0 22px; }
.login-help { margin: 22px 0 0; text-align: center; color: #9ba6a8; font-size: 12px; }

.app-shell { height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; display: grid; grid-template-columns: 252px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; z-index: 20; height: 100vh; padding: 27px 18px 20px; display: flex; flex-direction: column; color: var(--white); background: var(--sidebar); }
.sidebar__brand { display: flex; align-items: center; gap: 9px; min-height: 62px; padding: 0 3px 25px; border-bottom: 1px solid rgba(255,255,255,.08); overflow: hidden; }
.sidebar__brand-copy { min-width: 0; flex: 1 1 auto; padding-left: 10px; border-left: 1px solid rgba(255,255,255,.12); white-space: nowrap; }
.sidebar__brand strong { display: block; white-space: nowrap; font-size: 15px; line-height: 1.15; letter-spacing: .01em; }
.sidebar__brand small { display: block; margin-top: 4px; white-space: nowrap; color: rgba(255,255,255,.45); font-size: 9px; letter-spacing: .08em; }
.navigation { display: flex; flex-direction: column; gap: 5px; padding: 27px 0 10px; }
.navigation__label { margin: 0 13px 10px; color: rgba(255,255,255,.28); font-size: 9px; font-weight: 800; letter-spacing: .17em; }
.nav-item { position: relative; width: 100%; height: 48px; border: 0; border-radius: 10px; display: flex; align-items: center; gap: 12px; padding: 0 13px; color: rgba(255,255,255,.61); background: transparent; font-size: 13px; cursor: pointer; text-align: left; transition: .18s ease; }
.nav-item svg { width: 19px; }
.nav-item:hover { color: var(--white); background: rgba(255,255,255,.05); }
.nav-item.is-active { color: var(--white); background: var(--sidebar-soft); }
.nav-item.is-active::before { content: ""; position: absolute; left: 0; width: 3px; height: 22px; border-radius: 0 4px 4px 0; background: var(--brand); }
.sidebar__future { display: flex; gap: 10px; align-items: center; margin: auto 5px 18px; padding: 14px 12px; border: 1px dashed rgba(255,255,255,.12); border-radius: 12px; color: rgba(255,255,255,.45); }
.future-icon { width: 27px; height: 27px; border-radius: 8px; display: grid; place-items: center; background: rgba(255,255,255,.06); font-size: 18px; }
.sidebar__future strong, .sidebar__future small { display: block; }
.sidebar__future strong { color: rgba(255,255,255,.67); font-size: 11px; }
.sidebar__future small { margin-top: 3px; font-size: 9px; }
.user-menu { min-height: 63px; padding: 13px 8px 0; border-top: 1px solid rgba(255,255,255,.08); display: flex; align-items: center; gap: 10px; }
.avatar { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--brand); font-size: 11px; font-weight: 800; }
.user-menu__text { min-width: 0; flex: 1; }
.user-menu__text strong, .user-menu__text small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-menu__text strong { font-size: 11px; }
.user-menu__text small { margin-top: 3px; color: rgba(255,255,255,.38); font-size: 9px; }
.user-menu .icon-button { color: rgba(255,255,255,.43); }
.user-menu .icon-button:hover { color: var(--white); background: rgba(255,255,255,.07); }

.workspace { min-width: 0; height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
.topbar { height: 88px; flex: 0 0 88px; padding: 0 clamp(24px, 3.5vw, 55px); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 16px; justify-content: space-between; background: rgba(251,252,250,.9); backdrop-filter: blur(14px); }
.topbar h2 { margin: 4px 0 0; font-size: 18px; letter-spacing: -.015em; }
.topbar__kicker { margin: 0; color: #91a0a3; font-size: 9px; font-weight: 800; letter-spacing: .16em; }
.topbar__right { display: flex; align-items: center; gap: 24px; color: var(--muted); font-size: 11px; }
.system-status { display: flex; align-items: center; gap: 9px; }
.today-label { padding-left: 24px; border-left: 1px solid var(--line); }
.mobile-menu { display: none; }
.route { width: 100%; min-height: 0; flex: 1 1 auto; overflow-y: auto; }
.route--home { padding: clamp(32px, 5vh, 62px) clamp(24px, 4.6vw, 72px) 38px; }
.home-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; margin-bottom: 37px; }
.home-intro h1 { margin: 8px 0 10px; font-size: clamp(34px, 3.5vw, 51px); line-height: 1.12; letter-spacing: -.055em; font-weight: 650; }
.home-intro h1 span { color: var(--brand); }
.home-intro p:last-child { margin: 0; color: var(--muted); font-size: 14px; }
.home-intro__date { display: flex; align-items: center; gap: 12px; padding: 0 0 5px; color: var(--muted); }
.home-intro__date span { color: var(--ink); font-size: 34px; line-height: 1; font-weight: 650; letter-spacing: -.05em; }
.home-intro__date small { max-width: 90px; padding-left: 12px; border-left: 1px solid var(--line); font-size: 10px; line-height: 1.5; }
.module-grid { display: grid; grid-template-columns: repeat(2, minmax(260px, 1fr)) minmax(210px, .68fr); gap: 18px; }
.module-card { position: relative; min-height: 380px; overflow: hidden; padding: 27px 28px 24px; border: 1px solid var(--line); border-radius: var(--radius-lg); display: flex; flex-direction: column; justify-content: space-between; background: var(--white); box-shadow: 0 8px 26px rgba(26,55,58,.035); cursor: pointer; transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease; }
.module-card:hover, .module-card:focus-visible { transform: translateY(-4px); border-color: #cbd6d3; box-shadow: var(--shadow); outline: 0; }
.module-card__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.module-icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; color: var(--brand); background: #fdf0ec; }
.module-icon svg { width: 23px; }
.module-state { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 10px; }
.module-state i { width: 6px; height: 6px; box-shadow: none; }
.module-state.is-offline i { background: #b4bdbe; }
.module-card__number { margin: 0 0 10px; color: #a2adaf; font-size: 10px; font-weight: 800; letter-spacing: .14em; }
.module-card h3 { margin: 0 0 12px; font-size: 24px; letter-spacing: -.035em; }
.module-card p:not(.module-card__number) { max-width: 430px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.8; }
.module-card__action { width: max-content; padding: 0 0 6px; border: 0; border-bottom: 1px solid var(--ink); display: flex; align-items: center; gap: 17px; background: transparent; font-size: 12px; font-weight: 750; cursor: pointer; }
.module-card__action span { color: var(--brand); }
.module-card__accent { position: absolute; right: -42px; top: 118px; width: 140px; height: 140px; border: 1px solid rgba(237,105,70,.12); border-radius: 50%; box-shadow: 0 0 0 34px rgba(237,105,70,.025), 0 0 0 68px rgba(237,105,70,.018); pointer-events: none; }
.module-card--summary .module-icon { color: var(--teal); background: #e9f4f2; }
.module-card--summary .module-card__accent { border-color: rgba(29,111,112,.12); box-shadow: 0 0 0 34px rgba(29,111,112,.025), 0 0 0 68px rgba(29,111,112,.018); }
.module-card--future { border-style: dashed; align-items: flex-start; justify-content: center; gap: 30px; color: #879597; background: rgba(255,255,255,.35); cursor: default; box-shadow: none; }
.module-card--future:hover { transform: none; box-shadow: none; }
.module-card--future h3 { font-size: 20px; }
.future-plus { width: 45px; height: 45px; border: 1px dashed #b5c0c0; border-radius: 50%; display: grid; place-items: center; font-size: 23px; font-weight: 300; }
.home-note { margin-top: 26px; display: flex; align-items: center; gap: 13px; color: #8b999b; font-size: 10px; }
.home-note__line { width: 22px; height: 1px; background: var(--brand); }

.route--tool { padding: 25px clamp(22px, 3.2vw, 48px) 35px; }
#route-orders { height: calc(100vh - 88px); height: calc(100dvh - 88px); overflow: hidden; }
.tool-layout, .summary-layout { min-height: calc(100vh - 148px); display: grid; gap: 18px; }
.tool-layout--orders {
  grid-template-columns: minmax(0, 1fr) 274px;
  height: 100%;
  min-height: 0;
  align-items: stretch;
}
.tool-panel { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--white); box-shadow: 0 8px 30px rgba(26,55,58,.035); }
.tool-panel__header { min-height: 82px; padding: 18px 22px; border-bottom: 1px solid var(--line-soft); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.tool-panel__header > div:first-child { display: flex; align-items: center; gap: 14px; }
.tool-panel__header h3 { margin: 0 0 5px; font-size: 16px; }
.tool-panel__header p { margin: 0; color: var(--muted); font-size: 10px; }
.section-index { height: 34px; min-width: 34px; padding: 0 8px; border-radius: 9px; display: grid; place-items: center; color: var(--white); background: var(--brand); font-size: 9px; font-weight: 800; letter-spacing: .08em; }
.section-index--muted { color: var(--teal); background: #e8f2ef; }
.secondary-button { min-height: 36px; padding: 0 13px; border: 1px solid var(--line); border-radius: 9px; display: inline-flex; align-items: center; gap: 7px; color: var(--ink-2); background: var(--paper); font-size: 10px; font-weight: 700; cursor: pointer; }
.secondary-button:hover { border-color: #bdc9c6; background: var(--white); }
.secondary-button svg { width: 15px; }
.order-panel { min-height: 0; height: 100%; display: flex; flex-direction: column; overflow: hidden; }
.messages { min-height: 0; flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; padding: 24px 28px; scroll-behavior: auto; }
.empty-chat { min-height: 390px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.empty-chat__visual { position: relative; width: 70px; height: 70px; margin-bottom: 19px; border-radius: 22px; display: grid; place-items: center; color: var(--teal); background: #eef6f4; }
.empty-chat__visual span { position: absolute; inset: -8px; border: 1px solid #e7efed; border-radius: 27px; transform: rotate(8deg); }
.empty-chat__visual svg { width: 28px; }
.empty-chat h4, .summary-empty h4, .summary-progress h4 { margin: 0 0 8px; font-size: 15px; }
.empty-chat > p, .summary-empty > p, .summary-progress > p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.65; }
.suggestion-list { width: min(600px, 100%); margin-top: 24px; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.suggestion-list button { min-height: 35px; padding: 0 13px; border: 1px solid var(--line-soft); border-radius: 18px; color: #597076; background: var(--paper); font-size: 10px; cursor: pointer; }
.suggestion-list button:hover { color: var(--teal); border-color: #bdd6d1; background: #f3f9f7; }
.message { max-width: 84%; margin-bottom: 20px; display: flex; align-items: flex-start; gap: 10px; animation: message-in .24s ease; }
.message--user { margin-left: auto; flex-direction: row-reverse; }
.message__avatar { width: 28px; height: 28px; flex: 0 0 28px; border-radius: 9px; display: grid; place-items: center; color: var(--white); background: var(--teal); font-size: 8px; font-weight: 800; }
.message--user .message__avatar { background: var(--brand); }
.message__content { min-width: 0; padding: 13px 15px; border-radius: 5px 14px 14px 14px; background: #f5f9f7; color: var(--ink-2); font-size: 12px; line-height: 1.78; }
.message--assistant { max-width: 88%; }
.message--assistant .message__content { border: 1px solid #e3ece9; background: #f8fbfa; box-shadow: 0 6px 18px rgba(19,57,60,.035); }
.message--assistant .markdown-body p { margin: 0 0 10px; }
.message--assistant .markdown-body strong { color: #18373d; }
.message--streaming .message__content { position: relative; white-space: pre-wrap; word-break: break-word; }
.streaming-text { white-space: pre-wrap; }
.streaming-caret { display: inline-block; width: 2px; height: 1.05em; margin-left: 3px; vertical-align: -.16em; border-radius: 2px; background: var(--teal); animation: stream-caret .8s steps(1) infinite; }
.message--user .message__content { border-radius: 14px 5px 14px 14px; color: var(--white); background: var(--sidebar-soft); }
.message__content > :first-child { margin-top: 0; }
.message__content > :last-child { margin-bottom: 0; }
.message--loading .message__content { display: flex; align-items: center; gap: 5px; height: 42px; }
.typing-dot { width: 5px; height: 5px; border-radius: 50%; background: #7b9693; animation: typing 1.2s infinite ease-in-out; }
.typing-dot:nth-child(2) { animation-delay: .15s; }
.typing-dot:nth-child(3) { animation-delay: .3s; }
.composer { position: relative; margin: 0 22px 20px; min-height: 88px; padding: 14px 56px 24px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); }
.composer:focus-within { border-color: #b8ccc8; box-shadow: 0 0 0 3px rgba(29,111,112,.06); }
.composer textarea { width: 100%; max-height: 120px; resize: none; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 12px; line-height: 1.6; }
.composer > button { position: absolute; right: 12px; top: 13px; width: 38px; height: 38px; border: 0; border-radius: 10px; display: grid; place-items: center; color: var(--white); background: var(--brand); cursor: pointer; }
.composer > button:disabled { opacity: .5; cursor: wait; }
.composer > button svg { width: 17px; }
.composer__meta { position: absolute; left: 16px; right: 16px; bottom: 7px; display: flex; justify-content: space-between; color: #a1acad; font-size: 8px; }
.tool-aside { position: relative; height: 100%; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; padding: 29px 24px; border-radius: var(--radius-lg); color: var(--white); background: var(--sidebar); }
.tool-aside .kicker { color: var(--brand); }
.tool-aside h3 { margin: 8px 0 28px; font-size: 19px; }
.guide-list { margin: 0; padding: 0; list-style: none; }
.guide-list li { display: grid; grid-template-columns: 26px 1fr; gap: 10px; padding: 18px 0; border-top: 1px solid rgba(255,255,255,.08); }
.guide-list li > span { color: var(--brand); font-size: 9px; font-weight: 800; }
.guide-list p { margin: 0; color: rgba(255,255,255,.46); font-size: 10px; line-height: 1.7; }
.guide-list strong { display: block; margin-bottom: 4px; color: rgba(255,255,255,.85); font-size: 11px; }
.privacy-note { margin-top: 27px; padding: 15px; border-radius: 12px; display: flex; align-items: flex-start; gap: 10px; background: rgba(255,255,255,.055); }
.privacy-note svg { width: 18px; flex: 0 0 18px; color: #68baa5; }
.privacy-note p { margin: 0; color: rgba(255,255,255,.43); font-size: 9px; line-height: 1.6; }
.privacy-note strong { display: block; color: rgba(255,255,255,.75); font-size: 10px; }

.summary-layout { grid-template-columns: minmax(330px, .72fr) minmax(420px, 1.28fr); }
.summary-input-panel, .summary-result-panel { min-height: 650px; }
.summary-form-body { padding: 22px; }
.drop-zone { min-height: 240px; border: 1.5px dashed #c7d3d0; border-radius: 15px; display: flex; flex-direction: column; align-items: center; justify-content: center; background: #f8faf8; cursor: pointer; transition: .2s ease; }
.drop-zone:hover, .drop-zone.is-dragging { border-color: var(--teal); background: #f1f7f5; }
.drop-zone__icon { width: 51px; height: 51px; margin-bottom: 15px; border-radius: 15px; display: grid; place-items: center; color: var(--teal); background: #e7f2ef; }
.drop-zone__icon svg { width: 23px; }
.drop-zone h4 { margin: 0 0 5px; font-size: 13px; }
.drop-zone p { margin: 0 0 16px; color: var(--brand); font-size: 10px; font-weight: 700; }
.drop-zone__types { color: #98a4a6; font-size: 8px; letter-spacing: .04em; }
.selected-file { min-height: 78px; margin-bottom: 18px; padding: 12px 12px; border: 1px solid var(--line); border-radius: 13px; display: flex; align-items: center; gap: 12px; background: var(--paper); }
.file-icon { width: 44px; height: 50px; flex: 0 0 44px; border-radius: 7px 7px 11px 7px; display: grid; place-items: center; color: var(--white); background: var(--teal); }
.file-icon span { font-size: 8px; font-weight: 800; letter-spacing: .06em; }
.selected-file > div:nth-child(2) { min-width: 0; flex: 1; }
.selected-file strong, .selected-file small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.selected-file strong { margin-bottom: 5px; font-size: 11px; }
.selected-file small { color: var(--muted); font-size: 9px; }
.summary-note-field { margin: 19px 0; }
.summary-note-field textarea { width: 100%; resize: vertical; min-height: 98px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 11px; outline: 0; color: var(--ink); background: var(--white); font-size: 11px; line-height: 1.65; }
.summary-note-field textarea:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(29,111,112,.07); }
.summary-result-panel { display: flex; flex-direction: column; }
.result-actions { display: flex; gap: 4px; }
.summary-empty, .summary-progress { min-height: 480px; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 35px; }
.summary-empty__paper { position: relative; width: 76px; height: 92px; margin-bottom: 24px; padding: 30px 18px; border: 1px solid #d8e2df; border-radius: 8px 8px 16px 8px; background: #f7faf8; transform: rotate(-2deg); }
.summary-empty__paper::before { content: ""; position: absolute; inset: 7px -7px -7px 7px; border: 1px solid #e4eae8; border-radius: inherit; z-index: -1; background: var(--white); }
.summary-empty__paper span { display: block; height: 2px; margin-bottom: 8px; border-radius: 2px; background: #cbd9d5; }
.summary-empty__paper span:nth-child(2) { width: 72%; }
.summary-empty__paper i { position: absolute; right: -10px; bottom: 13px; width: 25px; height: 25px; border-radius: 50%; background: var(--brand); box-shadow: 0 6px 15px rgba(237,105,70,.18); }
.summary-progress { background: linear-gradient(180deg, transparent, rgba(241,247,245,.55)); }
.progress-orbit { position: relative; width: 68px; height: 68px; margin-bottom: 24px; border: 2px solid #e3eeeb; border-radius: 50%; }
.progress-orbit span { position: absolute; inset: -2px; border: 2px solid transparent; border-top-color: var(--brand); border-radius: 50%; animation: spin 1s linear infinite; }
.progress-orbit i { position: absolute; inset: 23px; border-radius: 50%; background: var(--teal); }
.progress-track { width: min(260px, 75%); height: 4px; margin-top: 22px; overflow: hidden; border-radius: 4px; background: #e7eeec; }
.progress-track i { display: block; width: 35%; height: 100%; border-radius: 4px; background: var(--brand); transition: width .5s ease; }
.summary-result { flex: 1; overflow-y: auto; padding: 28px clamp(22px, 3.2vw, 42px) 42px; background: linear-gradient(180deg, #fbfcfb 0%, #f7faf8 100%); }
.result-document { width: min(900px, 100%); margin: 0 auto; padding: 26px 30px 38px; border: 1px solid #e5ece9; border-radius: 16px; background: var(--white); box-shadow: 0 10px 28px rgba(21,55,58,.045); }
.result-document__meta { display: flex; align-items: center; gap: 10px; min-width: 0; margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--line-soft); }
.result-document__badge { flex: 0 0 auto; padding: 5px 8px; border-radius: 7px; color: var(--teal); background: #eaf4f1; font-size: 9px; font-weight: 800; letter-spacing: .08em; }
.result-document__name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #7a898b; font-size: 10px; }
.result-document__body { color: #334b51; font-size: 13px; line-height: 1.92; }
.result-document__body > p:first-child { margin: 0 0 20px; padding: 14px 16px; border-left: 3px solid var(--teal); border-radius: 0 10px 10px 0; color: #29464c; background: #f3f8f6; }
.result-document__body ul, .result-document__body ol { margin: 16px 0 20px; padding: 14px 18px 14px 38px; border: 1px solid #edf2f0; border-radius: 12px; background: #fbfcfb; }
.result-document__body li { padding-left: 2px; }
.result-document__body li::marker { color: var(--teal); }
.markdown-body { color: #334b51; font-size: 12px; line-height: 1.85; }
.markdown-body h1, .markdown-body h2, .markdown-body h3 { color: var(--ink); letter-spacing: -.02em; }
.markdown-body h1 { font-size: 22px; }
.markdown-body h2 { margin-top: 26px; padding-bottom: 8px; border-bottom: 1px solid var(--line-soft); font-size: 17px; }
.markdown-body h3 { margin-top: 22px; font-size: 14px; }
.markdown-body ul, .markdown-body ol { padding-left: 20px; }
.markdown-body li { margin: 6px 0; }
.markdown-body blockquote { margin: 18px 0; padding: 10px 14px; border-left: 3px solid var(--brand); color: #526a70; background: #faf7f2; }
.markdown-body code { padding: 2px 5px; border-radius: 4px; background: #edf2f0; font-family: Consolas, monospace; font-size: .92em; }
.markdown-body pre { overflow-x: auto; padding: 15px; border-radius: 10px; color: #e8f0ee; background: var(--sidebar); }
.markdown-body pre code { padding: 0; color: inherit; background: transparent; }
.markdown-table-wrap { margin: 14px 0; overflow-x: auto; }
.markdown-body table { width: 100%; border-collapse: collapse; font-size: 10px; }
.markdown-body th, .markdown-body td { padding: 9px 10px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.markdown-body th { color: var(--ink); background: #f2f6f4; }

.toast-region { position: fixed; z-index: 100; right: 20px; top: 20px; display: grid; gap: 9px; }
.toast { min-width: 260px; max-width: 360px; padding: 13px 16px; border-radius: 11px; color: var(--white); background: var(--sidebar); box-shadow: 0 14px 35px rgba(12,35,40,.2); font-size: 11px; animation: toast-in .25s ease; }
.toast--error { background: #a9422d; }
.mobile-backdrop { position: fixed; inset: 0; z-index: 15; background: rgba(7,24,28,.42); backdrop-filter: blur(2px); }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes typing { 0%, 60%, 100% { transform: translateY(0); opacity: .45; } 30% { transform: translateY(-3px); opacity: 1; } }
@keyframes stream-caret { 0%, 48% { opacity: 1; } 49%, 100% { opacity: .15; } }
@keyframes message-in { from { opacity: 0; transform: translateY(5px); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(-5px); } }

@media (max-width: 1120px) {
  .module-grid { grid-template-columns: repeat(2, minmax(260px, 1fr)); }
  .module-card--future { min-height: 190px; grid-column: 1 / -1; flex-direction: row; align-items: center; }
  .tool-layout--orders { grid-template-columns: minmax(0, 1fr) 235px; }
  .summary-layout { grid-template-columns: minmax(320px, .85fr) minmax(380px, 1.15fr); }
}

@media (max-width: 860px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-brand { display: none; }
  .login-panel { min-height: 100vh; padding: 32px 24px; }
  .login-card__mobile-brand { display: flex; }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; transform: translateX(-105%); width: 252px; box-shadow: 20px 0 50px rgba(10,31,35,.18); transition: transform .22s ease; }
  .sidebar.is-open { transform: translateX(0); }
  .mobile-menu { display: grid; }
  .topbar { justify-content: flex-start; padding-inline: 18px; }
  .topbar__right { margin-left: auto; }
  .today-label { display: none; }
  .tool-layout--orders, .summary-layout { grid-template-columns: 1fr; }
  #route-orders { height: auto; overflow-y: auto; }
  .tool-layout--orders { height: auto; min-height: auto; }
  .order-panel { height: auto; min-height: 650px; overflow: visible; }
  .messages { min-height: 420px; }
  .tool-aside { display: none; }
  .summary-input-panel, .summary-result-panel { min-height: auto; }
  .summary-empty, .summary-progress { min-height: 360px; }
}

@media (max-width: 640px) {
  .topbar { height: 76px; flex-basis: 76px; }
  .system-status { font-size: 0; }
  .route--home, .route--tool { padding: 24px 14px; }
  .home-intro { align-items: flex-start; margin-bottom: 24px; }
  .home-intro__date { display: none; }
  .home-intro h1 { font-size: 34px; }
  .module-grid { grid-template-columns: 1fr; }
  .module-card { min-height: 315px; }
  .module-card--future { grid-column: auto; min-height: 180px; }
  .tool-layout, .summary-layout { min-height: auto; }
  .tool-panel { border-radius: 16px; }
  .tool-panel__header { padding: 15px; }
  .messages { padding: 20px 15px; }
  .result-document { padding: 22px 20px 30px; border-radius: 13px; }
  .summary-result { padding: 18px 14px 28px; }
  .message { max-width: 94%; }
  .composer { margin: 0 12px 12px; }
  .composer__meta span:first-child { display: none; }
  .composer__meta { justify-content: flex-end; }
  .summary-form-body { padding: 15px; }
  .drop-zone { min-height: 210px; }
  .summary-result { padding: 24px 20px 36px; }
  .toast-region { left: 14px; right: 14px; }
  .toast { min-width: 0; max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* v1.4 · MySQL-backed system management */
.route--admin { overflow: auto; }
.admin-shell { display: flex; flex-direction: column; gap: 20px; }
.admin-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.admin-stats article { min-height: 118px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 18px; background: var(--white); box-shadow: 0 8px 28px rgba(26,55,58,.035); }
.admin-stats span, .admin-stats small { display: block; color: var(--muted); font-size: 10px; }
.admin-stats strong { display: block; margin: 8px 0 5px; color: var(--ink); font-size: 28px; line-height: 1; }
.admin-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(360px, .8fr); gap: 18px; align-items: start; }
.admin-users-panel, .admin-log-panel { overflow: hidden; }
.admin-user-form { display: grid; grid-template-columns: 1fr 1.1fr 1fr .75fr auto; gap: 10px; align-items: end; padding: 16px 18px; border-bottom: 1px solid var(--line-soft); background: #fbfcfb; }
.admin-user-form label { display: grid; gap: 7px; min-width: 0; }
.admin-user-form label > span { color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .04em; }
.admin-user-form input, .admin-user-form select { min-width: 0; height: 40px; padding: 0 11px; border: 1px solid var(--line); border-radius: 10px; outline: none; background: #fff; color: var(--ink); font: inherit; font-size: 11px; }
.admin-user-form input:focus, .admin-user-form select:focus { border-color: rgba(23,126,125,.55); box-shadow: 0 0 0 3px rgba(23,126,125,.08); }
.admin-user-form .primary-button { height: 40px; padding: 0 16px; white-space: nowrap; }
.admin-table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 10px; }
.admin-table th { padding: 12px 14px; color: var(--muted); text-align: left; font-size: 9px; letter-spacing: .04em; background: #fbfcfb; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
.admin-table td { padding: 13px 14px; border-bottom: 1px solid var(--line-soft); color: #405257; vertical-align: middle; white-space: nowrap; }
.admin-table tbody tr:last-child td { border-bottom: 0; }
.admin-user-cell { display: flex; align-items: center; gap: 9px; min-width: 150px; }
.admin-user-cell > span { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 9px; background: #eaf4f2; color: var(--teal); font-size: 9px; font-weight: 800; }
.admin-user-cell strong, .admin-user-cell small { display: block; }
.admin-user-cell strong { color: var(--ink); font-size: 10px; }
.admin-user-cell small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.role-pill { display: inline-flex; align-items: center; min-height: 23px; padding: 0 8px; border-radius: 999px; background: #eef3f3; color: #607175; font-size: 9px; font-weight: 700; }
.role-pill--admin { background: #fff0e9; color: #c55a38; }
.admin-status { display: inline-flex; align-items: center; gap: 5px; color: #8a979a; font-size: 9px; }
.admin-status i { width: 6px; height: 6px; border-radius: 50%; background: #b9c1c3; }
.admin-status.is-active { color: #238765; }
.admin-status.is-active i { background: #48c99a; box-shadow: 0 0 0 3px rgba(72,201,154,.12); }
.admin-actions { display: flex; gap: 6px; }
.admin-actions button { padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: #52676b; font: inherit; font-size: 9px; cursor: pointer; }
.admin-actions button:hover:not(:disabled) { border-color: #9fb9b9; color: var(--teal); }
.admin-actions button:disabled { opacity: .4; cursor: not-allowed; }
.admin-loading { padding: 24px !important; color: var(--muted) !important; text-align: center !important; }
.admin-log-list { max-height: 580px; overflow-y: auto; padding: 6px 18px 14px; }
.admin-log-item { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 13px 0; border-bottom: 1px solid var(--line-soft); }
.admin-log-item:last-child { border-bottom: 0; }
.admin-log-icon { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: #eef2f2; color: #718184; font-size: 9px; font-weight: 800; }
.admin-log-icon.is-success { background: #e9f6f0; color: #258463; }
.admin-log-icon.is-error { background: #fff0ec; color: #c45c41; }
.admin-log-item strong { display: block; color: var(--ink); font-size: 10px; }
.admin-log-item p { margin: 4px 0 0; color: #637579; font-size: 9px; line-height: 1.55; overflow-wrap: anywhere; }
.admin-log-meta { display: grid; gap: 4px; min-width: 82px; color: var(--muted); font-size: 8px; text-align: right; }

@media (max-width: 1180px) {
  .admin-grid { grid-template-columns: 1fr; }
  .admin-user-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-user-form .primary-button { grid-column: span 2; }
}
@media (max-width: 760px) {
  .admin-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-user-form { grid-template-columns: 1fr; }
  .admin-user-form .primary-button { grid-column: auto; }
  .admin-log-item { grid-template-columns: 30px minmax(0, 1fr); }
  .admin-log-meta { grid-column: 2; grid-template-columns: 1fr 1fr; text-align: left; }
}

/* v1.9 · refined AI reading experience */
.order-panel { position: relative; }
.messages {
  scroll-padding-bottom: 118px;
  scrollbar-width: thin;
  scrollbar-color: #c8d2d0 transparent;
}
.messages::-webkit-scrollbar { width: 7px; }
.messages::-webkit-scrollbar-track { background: transparent; }
.messages::-webkit-scrollbar-thumb { border-radius: 10px; background: #cad4d2; }
.messages::-webkit-scrollbar-thumb:hover { background: #aebcba; }

.message--assistant { width: min(88%, 980px); max-width: 980px; }
.message--assistant .message__content {
  width: 100%;
  padding: 16px 18px 15px;
  border-color: #e1e9e7;
  background: linear-gradient(180deg, #fbfdfc 0%, #f7faf9 100%);
  box-shadow: 0 8px 24px rgba(19,57,60,.035);
}
.message--assistant.message--complete .message__content { padding-bottom: 10px; }
.message--assistant .markdown-body { font-size: 12px; line-height: 1.86; }
.message--assistant .markdown-body p { color: #435b61; }
.message--assistant .markdown-body ul,
.message--assistant .markdown-body ol {
  margin: 10px 0 18px;
  padding-left: 22px;
}
.message--assistant .markdown-body li {
  margin: 7px 0;
  padding-left: 3px;
  color: #40575d;
}
.message--assistant .markdown-body li::marker { color: #8da6a3; }
.message--assistant .markdown-body .order-field-label {
  color: #18373d;
  font-weight: 760;
}
.message--assistant .markdown-body .order-result-heading {
  position: relative;
  margin: 24px 0 12px;
  padding: 11px 13px 11px 17px;
  border: 1px solid #e4ece9;
  border-radius: 11px;
  color: #17363c;
  background: rgba(255,255,255,.72);
  font-size: 14px;
  line-height: 1.45;
  letter-spacing: -.01em;
}
.message--assistant .markdown-body .order-result-heading:first-child { margin-top: 0; }
.message--assistant .markdown-body .order-result-heading::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  bottom: 9px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--brand);
}
.match-score {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  margin-left: 4px;
  padding: 0 7px;
  border-radius: 999px;
  color: #19705b;
  background: #e7f5ef;
  font-size: .88em;
  font-weight: 800;
  vertical-align: 1px;
}
.order-result-note {
  margin: 12px 0 !important;
  padding: 9px 11px;
  border-left: 2px solid #9bbab5;
  border-radius: 0 8px 8px 0;
  color: #526a70 !important;
  background: #f1f6f4;
}

.message--loading .message__content {
  height: auto;
  min-height: 54px;
  padding-block: 10px;
}
.thinking-status {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-height: 32px;
}
.thinking-status > span:last-child { display: grid; gap: 2px; }
.thinking-status strong { color: #29464c; font-size: 10px; font-weight: 720; }
.thinking-status small { color: #8a999c; font-size: 8.5px; }
.thinking-status__mark {
  width: 31px;
  height: 31px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2.5px;
  border-radius: 9px;
  background: #eaf4f1;
}
.thinking-status__mark i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--teal);
  animation: thinking-pulse 1.1s ease-in-out infinite;
}
.thinking-status__mark i:nth-child(2) { animation-delay: .12s; }
.thinking-status__mark i:nth-child(3) { animation-delay: .24s; }

.message--streaming .message__content {
  white-space: normal;
  word-break: break-word;
}
.streaming-markdown { min-height: 24px; }
.streaming-stable { display: contents; }
.streaming-live-line {
  min-height: 1.8em;
  color: #40575d;
  line-height: 1.86;
}
.streaming-tail { white-space: pre-wrap; }
.streaming-tail.is-heading {
  color: #17363c;
  font-weight: 780;
  letter-spacing: -.01em;
}
.streaming-tail.is-heading-1 { font-size: 17px; }
.streaming-tail.is-heading-2 { font-size: 15px; }
.streaming-tail.is-heading-3 { font-size: 14px; }
.streaming-tail.is-list::before {
  content: "•";
  display: inline-block;
  width: 18px;
  color: #8da6a3;
  text-align: center;
}
.streaming-tail.is-ordered::before {
  content: attr(data-prefix);
  width: auto;
  min-width: 24px;
  margin-right: 4px;
  color: #587176;
  font-weight: 730;
  text-align: left;
}
.streaming-caret {
  width: 1.5px;
  height: 1.08em;
  margin-left: 2px;
  vertical-align: -.17em;
  background: #2d8582;
  box-shadow: 0 0 0 1px rgba(45,133,130,.03);
  animation: stream-caret .92s steps(1) infinite;
}

.message-result-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 16px -4px 0;
  padding: 10px 4px 0;
  border-top: 1px solid #e8efed;
}
.message-result-actions__status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #8b999b;
  font-size: 8.5px;
}
.message-result-actions__status i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4fc89d;
  box-shadow: 0 0 0 3px rgba(79,200,157,.1);
}
.message-result-actions > div { display: flex; gap: 5px; }
.message-result-actions button {
  min-height: 28px;
  padding: 0 8px;
  border: 0;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #6c7f83;
  background: transparent;
  font: inherit;
  font-size: 8.5px;
  cursor: pointer;
  transition: .16s ease;
}
.message-result-actions button:hover { color: var(--teal); background: #edf5f2; }
.message-result-actions button svg { width: 13px; height: 13px; }

.jump-latest {
  position: absolute;
  z-index: 8;
  right: 34px;
  bottom: 120px;
  min-height: 34px;
  padding: 0 11px 0 9px;
  border: 1px solid #dbe5e2;
  border-radius: 18px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #526a70;
  background: rgba(255,255,255,.94);
  box-shadow: 0 7px 24px rgba(20,55,59,.11);
  backdrop-filter: blur(8px);
  font-size: 9px;
  font-weight: 700;
  cursor: pointer;
  animation: jump-in .18s ease;
}
.jump-latest svg { width: 14px; height: 14px; }
.jump-latest i {
  display: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 3px rgba(237,105,70,.1);
}
.jump-latest.has-new i { display: block; }
.jump-latest:hover { color: var(--teal); border-color: #bfd1cd; }

.result-document__stat {
  flex: 0 0 auto;
  margin-left: auto;
  color: #a0abad;
  font-size: 8.5px;
  white-space: nowrap;
}

@keyframes thinking-pulse {
  0%, 70%, 100% { transform: translateY(0); opacity: .34; }
  35% { transform: translateY(-2px); opacity: 1; }
}
@keyframes jump-in { from { opacity: 0; transform: translateY(4px); } }

@media (max-width: 640px) {
  .message--assistant { width: 94%; max-width: 94%; }
  .message--assistant .message__content { padding: 14px 14px 10px; }
  .message-result-actions { align-items: flex-start; }
  .message-result-actions__status { display: none; }
  .message-result-actions > div { margin-left: auto; }
  .jump-latest { right: 22px; bottom: 108px; }
}
.message--streaming .streaming-stable > ul:last-child,
.message--streaming .streaming-stable > ol:last-child { margin-bottom: 4px; }
.message--streaming .streaming-stable > h3:last-child { margin-bottom: 8px; }
