/* 2026 interface refresh: a single, reversible visual layer for the existing app. */
:root {
  --ink: #18221d;
  --ink-soft: #34423a;
  --muted: #69756e;
  --line: #d9ded6;
  --line-strong: #c7cec4;
  --paper: #f2f4ee;
  --paper-deep: #e9ede5;
  --white: #fcfdf9;
  --green: #214b3b;
  --green-dark: #16392c;
  --green-mid: #356a55;
  --green-soft: #dfeae2;
  --green-wash: #edf3ed;
  --amber: #a9672a;
  --amber-soft: #f5e8d4;
  --danger: #a8473f;
  --danger-soft: #f8e9e6;
  --shadow: 0 18px 55px rgba(37, 61, 49, .09);
  --shadow-soft: 0 8px 28px rgba(37, 61, 49, .07);
  --focus: 0 0 0 3px rgba(45, 105, 82, .2);
  --radius-shell: 1.5rem;
  --radius-card: 1.05rem;
  --radius-control: .7rem;
  --z-header: 20;
  --z-toast: 60;
}

html { background: var(--paper); }
body {
  background:
    radial-gradient(circle at 8% -8%, rgba(169, 103, 42, .08), transparent 24rem),
    radial-gradient(circle at 92% 2%, rgba(33, 75, 59, .08), transparent 28rem),
    var(--paper);
  font-family: "HarmonyOS Sans SC", "MiSans", "Source Han Sans SC", "Microsoft YaHei UI", system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
  text-rendering: optimizeLegibility;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .18;
  background-image: repeating-linear-gradient(115deg, transparent 0 8px, rgba(28, 52, 40, .018) 8px 9px);
}

::selection { background: #c8ddcf; color: var(--ink); }
a, button, input, select, textarea, summary { transition: color .2s ease, background-color .2s ease, border-color .2s ease, box-shadow .2s ease, transform .2s ease, opacity .2s ease; }
button:active, [role="button"]:active { transform: translateY(1px) scale(.99); }
:where(a, button, input, select, textarea, summary):focus-visible { outline: none; box-shadow: var(--focus); }
.skip-link { position: fixed; left: 1rem; top: -4rem; z-index: 100; padding: .75rem 1rem; border-radius: .6rem; background: var(--green-dark); color: #fff; text-decoration: none; }
.skip-link:focus { top: 1rem; }

.topbar {
  height: 4.75rem;
  padding-inline: max(1.5rem, calc((100% - 90rem) / 2));
  z-index: var(--z-header);
  background: rgba(242, 244, 238, .88);
  border-bottom-color: rgba(33, 75, 59, .12);
  box-shadow: 0 1px 0 rgba(255,255,255,.7);
}
.brand { gap: .75rem; font-size: 1.05rem; font-weight: 760; }
.brand-mark { width: 2.45rem; height: 2.45rem; border-radius: .78rem .78rem .78rem .32rem; box-shadow: 0 .45rem 1.2rem rgba(33,75,59,.16); }
.top-actions { gap: 1.15rem; }
.status-dot { padding-right: 1rem; border-right: 1px solid var(--line); font-size: .75rem; }
.status-dot::before { content: ""; width: .42rem; height: .42rem; border-radius: 50%; background: #4d9069; box-shadow: 0 0 0 .25rem rgba(77,144,105,.12); }
.status-dot i { display: none; }
.header-action, .logout-button { min-height: 2.5rem; padding: 0 .45rem; border-radius: .55rem; }
.header-action:hover, .logout-button:hover { background: rgba(33,75,59,.07); color: var(--green-dark); }
.avatar { width: 2.55rem; height: 2.55rem; border-radius: .82rem; border: 1px solid rgba(33,75,59,.08); box-shadow: inset 0 1px 0 rgba(255,255,255,.75); }

main, .crumb { width: min(90rem, calc(100% - 3rem)); }
main:focus { outline: none; }
.crumb { margin-top: 1.45rem; }
.crumb a { padding: .4rem .6rem .4rem 0; border-radius: .5rem; }
.crumb a:hover { color: var(--green); }
footer { padding-block: 2.75rem 2.25rem; }

.eyebrow {
  margin-bottom: .8rem;
  color: var(--green-mid);
  font-size: .72rem;
  font-weight: 720;
  letter-spacing: .06em;
}
.hero {
  min-height: 31rem;
  padding: 6.2rem 0 5.5rem;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(18rem, .65fr);
  align-items: end;
  gap: clamp(3rem, 8vw, 9rem);
  overflow: visible;
}
.hero::after { display: none; }
.hero-copy { max-width: 49rem; }
.hero h1 {
  max-width: 9.5em;
  font-size: clamp(3.2rem, 6.8vw, 6.6rem);
  line-height: .98;
  letter-spacing: -.065em;
  text-wrap: balance;
}
.hero-copy > p:last-child { max-width: 34rem; margin-top: 1.6rem; color: var(--muted); font-size: 1.02rem; line-height: 1.8; text-wrap: pretty; }
.hero-principles {
  padding: 1rem 0 0;
  border-top: 2px solid var(--green);
  display: grid;
  gap: .1rem;
}
.hero-principles > span { margin-bottom: .65rem; color: var(--green-mid); font-size: .7rem; font-weight: 700; letter-spacing: .08em; }
.hero-principles > div { padding: .85rem 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 6.5rem 1fr; gap: 1rem; align-items: baseline; }
.hero-principles strong { font-size: .9rem; }
.hero-principles small { color: var(--muted); line-height: 1.55; }

.tool-section { padding-block: 4.4rem 7.5rem; }
.section-heading { margin-bottom: 2.2rem; }
.section-heading h2 { font-size: clamp(1.8rem, 3vw, 2.65rem); letter-spacing: -.045em; }
.section-kicker { color: var(--green-mid); font-weight: 650; }
.tool-grid { grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 1.1rem; }
.tool-card {
  min-height: 17rem;
  padding: clamp(1.45rem, 3vw, 2.35rem);
  border: 0;
  border-radius: 1.4rem 1.4rem 1.4rem .55rem;
  background: #e7eee7;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.75);
  grid-template-columns: auto 1fr;
  grid-template-rows: 1fr auto;
  gap: 1.4rem;
}
.tool-card:nth-child(1) { grid-column: span 5; }
.tool-card:nth-child(2) { grid-column: span 7; background: #dce7df; }
.tool-card:hover { transform: translateY(-.35rem); border-color: transparent; box-shadow: var(--shadow); }
.tool-icon, .tool-title-icon { width: 3.25rem; height: 3.25rem; border-radius: .95rem .95rem .95rem .38rem; }
.tool-icon.violet { background: var(--green); color: #fff; }
.tag { margin-bottom: .85rem; padding: .28rem 0; border-radius: 0; background: transparent; color: var(--green-mid); font-size: .68rem; letter-spacing: .06em; }
.tool-copy h3 { margin-bottom: .75rem; font-size: clamp(1.35rem, 2.2vw, 1.9rem); letter-spacing: -.035em; }
.tool-copy p { max-width: 35rem; line-height: 1.75; text-wrap: pretty; }
.card-arrow { grid-column: 1 / -1; justify-self: end; align-self: end; width: 2.75rem; height: 2.75rem; border-radius: 50%; background: rgba(255,255,255,.58); display: grid; place-items: center; }
.tool-card:hover .card-arrow { background: var(--green); color: #fff; transform: translateX(.2rem); }
.coming-card { min-height: 5.5rem; padding: 0 1.4rem; border-radius: .9rem; grid-column: 1 / -1; display: flex; align-items: center; justify-content: center; gap: .8rem; }
.coming-card span { font-size: 1.25rem; }
.coming-card p { margin: 0; }

.tool-header, .ai-tool-head { padding-block: 3.6rem 2.4rem; }
.tool-header h1, .ai-tool-head h1, .account-heading h1 { text-wrap: balance; }
.calculator-panel, .access-panel, .account-card {
  border-color: rgba(33,75,59,.1);
  border-radius: var(--radius-shell) var(--radius-shell) var(--radius-shell) .65rem;
  box-shadow: var(--shadow);
}
.panel-actions, .tabs { background: rgba(252,253,249,.76); }
.primary-button, .ai-primary { border-radius: var(--radius-control); box-shadow: 0 .55rem 1.4rem rgba(33,75,59,.14); }
.secondary-button, .ai-secondary { border-color: var(--line-strong); }
.primary-button:hover, .ai-primary:hover { background: var(--green-dark); transform: translateY(-1px); }
.field input, .field select, .field textarea, .setting-field input, .setting-field select,
.superadmin-login-form input, .inline-password-form input {
  border-color: var(--line-strong);
  border-radius: var(--radius-control);
  background: rgba(255,255,255,.8);
}
.field input:focus, .field select:focus, .field textarea:focus,
.setting-field input:focus, .setting-field select:focus,
.superadmin-login-form input:focus, .inline-password-form input:focus { border-color: var(--green-mid); box-shadow: var(--focus); outline: none; }

.login-shell { min-height: 100dvh; background: radial-gradient(circle at 18% 12%, rgba(169,103,42,.14), transparent 28rem), radial-gradient(circle at 88% 82%, rgba(33,75,59,.15), transparent 30rem), var(--paper); }
.login-card { width: min(100%, 32rem); padding: clamp(1.5rem, 5vw, 3rem); border-color: rgba(33,75,59,.1); border-radius: 2rem 2rem 2rem .8rem; box-shadow: 0 2.5rem 7rem rgba(30,58,44,.15); }
.login-brand { justify-content: flex-start; }
.login-tabs { margin-top: 2.4rem; border-radius: .8rem; }
.login-tabs button { min-height: 2.75rem; border-radius: .58rem; }
.login-tabs button.active { color: var(--green); box-shadow: var(--shadow-soft); }
.login-copy { margin-block: 2.6rem 1.5rem; text-align: left; }
.login-copy h1 { font-size: clamp(2rem, 7vw, 2.8rem); line-height: 1.08; }
.login-copy > p:last-child { margin-left: 0; }
.feishu-qr { border: 0; border-radius: 1.1rem; box-shadow: inset 0 0 0 1px var(--line), var(--shadow-soft); }

.account-page { max-width: 64rem; }
.account-card { padding: clamp(1.4rem, 4vw, 2.2rem); }
.account-avatar { border-radius: 1.35rem; }
.access-summary { background: var(--green-wash); }
.access-summary strong { color: var(--green-dark); font-size: 1.8rem; }
.access-form { background: rgba(237,243,237,.58); }
.grant-item { border-color: transparent; background: var(--green-wash); }
.grant-item:hover { background: #e4eee7; }
.access-empty { background: rgba(255,255,255,.45); }

/* AI workspace: use the same brand language as the portal. */
.ai-title-mark { border-radius: 1.05rem 1.05rem 1.05rem .38rem; background: var(--green); box-shadow: 0 1rem 2.2rem rgba(33,75,59,.2); }
.ai-tool-head { grid-template-columns: auto minmax(0, 1fr) auto; }
.ai-head-copy > p:last-child { max-width: 46rem; line-height: 1.7; text-wrap: pretty; }
.ai-guide-button { min-height: 2.75rem; border-color: var(--line-strong); border-radius: .65rem; background: rgba(255,255,255,.62); color: var(--green); }
.ai-guide-button:hover { border-color: var(--green-mid); background: var(--green-wash); }
.ai-provider-badge { border: 1px solid #c9dfcf; border-radius: .65rem; background: #e8f2ea; color: #2f6543; }
.ai-shell { border-color: rgba(33,75,59,.1); border-radius: 1.7rem 1.7rem 1.7rem .65rem; background: rgba(252,253,249,.92); box-shadow: var(--shadow); }
.ai-nav { min-height: 4.4rem; padding-inline: 1.75rem; gap: 2.3rem; }
.ai-nav button { position: relative; border-bottom: 0; font-weight: 680; }
.ai-nav button::after { content: ""; height: .18rem; position: absolute; left: 0; right: 100%; bottom: -.05rem; background: var(--green); border-radius: .2rem; transition: right .2s ease; }
.ai-nav button.active { color: var(--green-dark); border-bottom-color: transparent; }
.ai-nav button.active::after { right: 0; }
.ai-notice { border-color: #ead8b9; background: #fbf3e5; color: #74552f; }
.ai-mode-bar { padding: 1.5rem 1.7rem 1.25rem; }
.ai-segmented { padding: .3rem; border: 1px solid var(--line); border-radius: .85rem; background: var(--paper-deep); }
.ai-segmented button { border-radius: .58rem; }
.ai-segmented button.active { color: var(--green-dark); box-shadow: var(--shadow-soft); }
.ai-workspace-grid { padding: 0 1.7rem 2rem; grid-template-columns: minmax(25rem, .92fr) minmax(26rem, 1.08fr); gap: 1.25rem; }
.ai-compose-card, .ai-task-column { border-color: rgba(33,75,59,.1); border-radius: 1.15rem 1.15rem 1.15rem .45rem; background: #f7f9f4; }
.ai-compose-card { box-shadow: inset 0 1px 0 rgba(255,255,255,.8); }
.ai-task-column { background: #edf1eb; }
.ai-card-heading, .ai-task-heading { min-height: 4.9rem; padding: 1rem 1.25rem; }
.ai-card-heading span, .ai-task-heading span, .ai-history-head span, .ai-settings-head span { color: var(--green-mid); letter-spacing: .06em; }
.ai-card-heading code, .ai-job-reference code, .ai-feedback-list code { background: var(--green-soft); color: var(--green-dark); }
.ai-compose-form { padding: 1.25rem; }
.ai-field > span { font-size: .75rem; }
.ai-field input, .ai-field select, .ai-field textarea { min-height: 3rem; border-color: var(--line-strong); border-radius: .68rem; background: rgba(255,255,255,.88); }
.ai-field input:focus, .ai-field select:focus, .ai-field textarea:focus { border-color: var(--green-mid); box-shadow: var(--focus); }
.ai-choice, .ai-upload-section, .ai-structure-panel { border-color: var(--line); background: rgba(255,255,255,.62); }
.ai-preset-summary { background: var(--green-soft); }
.ai-preset-summary span { color: var(--green-dark); }
.ai-preset-summary strong { color: var(--green-dark); }
.ai-preset-summary small { color: var(--green-mid); }
.ai-upload-button { border-color: #bfd3c6; background: var(--green-wash); color: var(--green-dark); }
.ai-structure-panel.active { border-color: #b9cfc0; background: var(--green-wash); }
.ai-primary { background: var(--green); }
.ai-primary:hover { background: var(--green-dark); }
.ai-task-grid { max-height: 68rem; padding: .85rem; gap: .75rem; scrollbar-color: #b9c5bd transparent; }
.ai-job-card { padding: 1rem; border-color: transparent; border-radius: .9rem .9rem .9rem .35rem; box-shadow: 0 .25rem 1rem rgba(35,54,44,.045); }
.ai-job-card:hover { box-shadow: var(--shadow-soft); }
.ai-job-card.running { border-color: #a9c5b3; box-shadow: 0 .35rem 1.4rem rgba(33,75,59,.08); }
.ai-job-summary > header span { color: var(--green-mid); letter-spacing: .05em; }
.ai-job-summary > header h3 { margin-top: .25rem; font-size: .95rem; }
.ai-job-reference code { font-size: .67rem; }
.ai-job-card.running .ai-job-summary > header b { background: var(--green-soft); color: var(--green-dark); }
.ai-job-open-hint { color: var(--green-mid); }
.ai-job-error { max-height: 7.2rem; padding: .6rem .7rem; border-left: .2rem solid #c36358; border-radius: 0 .45rem .45rem 0; background: var(--danger-soft); overflow-y: auto; color: #8e4039; }
.ai-job-prompts { border-color: #cad8ce; background: #f5f8f4; }
.ai-job-prompts > summary { color: var(--green-dark); }
.ai-job-prompts article { box-shadow: inset 0 0 0 1px #dfe7e1; }
.ai-job-prompts article strong, .ai-job-input section strong { color: var(--green-dark); }
.ai-job-input section { border-color: #cad8ce; background: var(--green-wash); }
.ai-job-meta span { background: #edf1eb; }
.ai-task-scope { border-color: #ccd8cf; background: #f5f8f5; }
.ai-task-scope button.active { background: var(--green); box-shadow: 0 .3rem .8rem rgba(33,75,59,.16); }
.ai-task-pagination button:hover:not(:disabled) { border-color: var(--green-mid); color: var(--green); }
.ai-asset-card.selected, .ai-asset-card.batch-selected { border-color: var(--green-mid); box-shadow: 0 0 0 2px rgba(53,106,85,.13); }
.ai-asset-card.selectable:focus-visible { outline-color: rgba(53,106,85,.3); }
.ai-asset-checkbox input:checked + span { border-color: var(--green); background: var(--green); }
.ai-asset-actions button:hover { border-color: #b9cfc0; background: var(--green-wash); color: var(--green-dark); }

.ai-dialog-kicker, .ai-session-head span { color: var(--green-mid); }
.ai-dialog-loading > span, .ai-session-empty > span, .ai-session-loading > span { background: var(--green-soft); color: var(--green); }
.ai-session-dialog { background: var(--paper); }
.ai-session-head h2 small, .ai-session-head-actions b { background: var(--green-soft); color: var(--green-dark); }
.ai-session-message { border-color: #c8d8cd; background: var(--green-wash); }
.ai-session-message.user { border-color: var(--green); background: var(--green); }
.ai-session-job-marker i { background: var(--green); box-shadow: 0 0 0 2px #b8cfc0; }
.ai-session-gate.enabled { background: var(--green-soft); color: var(--green-dark); }
.ai-session-scope label:has(input:checked) { color: var(--green-dark); }
.ai-session-scope input { accent-color: var(--green); }
.ai-session-input-row textarea:focus { border-color: var(--green-mid); outline-color: rgba(53,106,85,.12); }
.ai-settings-tabs button.active { color: var(--green-dark); }
.ai-settings-panel > section { background: #f7f9f5; }
.ai-provider-table th { background: #edf1eb; color: #647168; }
.ai-provider-table tbody tr:hover { background: #f5f8f4; }
.ai-provider-table input:focus, .ai-provider-table select:focus { border-color: var(--green-mid); outline-color: rgba(53,106,85,.12); }
.ai-feedback-head > b, .ai-feedback-list code { background: var(--green-soft); color: var(--green-dark); }
.ai-feedback-form { border-color: #cbd9cf; background: var(--green-wash); }
.ai-settings-actions { border-color: rgba(33,75,59,.14); box-shadow: 0 .8rem 2.5rem rgba(33,75,59,.1); }
.toast { z-index: var(--z-toast); border-radius: .7rem; box-shadow: 0 1rem 3rem rgba(24,34,29,.2); }

@media (max-width: 72rem) {
  .hero { grid-template-columns: minmax(0, 1.15fr) minmax(17rem, .85fr); gap: 3.5rem; }
  .ai-workspace-grid { grid-template-columns: minmax(22rem, .9fr) minmax(24rem, 1.1fr); }
}

@media (max-width: 58rem) {
  main, .crumb { width: min(100% - 2rem, 48rem); }
  .hero { min-height: auto; padding-block: 4.5rem; grid-template-columns: 1fr; gap: 3rem; }
  .hero h1 { max-width: 10em; }
  .hero-principles { max-width: 36rem; }
  .tool-card:nth-child(1), .tool-card:nth-child(2) { grid-column: 1 / -1; }
  .tool-card { min-height: 14rem; }
  .ai-workspace-grid { grid-template-columns: 1fr; }
  .ai-task-grid { max-height: none; }
  .access-columns, .ai-access-grid { grid-template-columns: 1fr; }
  .access-form { border-right: 0; border-bottom: 1px solid var(--line); }
  .access-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .access-summary > button { grid-column: 1 / -1; }
}

@media (max-width: 47.5rem) {
  .topbar { height: 4rem; padding-inline: 1rem; }
  .brand span:last-child { font-size: .95rem; }
  .top-actions { gap: .35rem; }
  .status-dot, .header-action span { display: none; }
  .header-action { width: 2.75rem; min-height: 2.75rem; justify-content: center; padding: 0; }
  .logout-button { min-width: 2.75rem; min-height: 2.75rem; padding: 0 .35rem; }
  .avatar { width: 2.75rem; height: 2.75rem; }
  .ai-task-scope button { min-height: 2.75rem; }
  main, .crumb { width: calc(100% - 1.5rem); }
  .crumb { margin-top: 1rem; }
  .hero { padding-block: 3.5rem 3.8rem; }
  .hero h1 { font-size: clamp(2.8rem, 13vw, 4.2rem); }
  .hero-copy > p:last-child { font-size: .95rem; }
  .hero-principles > div { grid-template-columns: 5.6rem 1fr; }
  .tool-section { padding-block: 3rem 5rem; }
  .tool-grid { display: grid; grid-template-columns: 1fr; }
  .tool-card:nth-child(n), .coming-card { grid-column: 1; }
  .tool-card { min-height: 13rem; padding: 1.3rem; }
  .tool-card:hover { transform: none; }
  .tool-header, .ai-tool-head { padding-block: 2.25rem 1.65rem; }
  .login-shell { padding: 1rem; }
  .login-card { border-radius: 1.35rem 1.35rem 1.35rem .55rem; }
  .login-copy { margin-top: 2rem; }
  .access-summary { padding: 1.1rem; gap: .9rem; }
  .ai-tool-head { grid-template-columns: 1fr; gap: 1rem; }
  .ai-title-mark { display: none; }
  .ai-head-actions { justify-content: stretch; }
  .ai-head-actions > * { flex: 1; justify-content: center; }
  .ai-shell { border-radius: 1.2rem 1.2rem 1.2rem .45rem; }
  .ai-nav { min-height: 3.7rem; padding-inline: 1rem; gap: 1.4rem; overflow-x: auto; }
  .ai-nav button { min-width: max-content; }
  .ai-mode-bar { padding: 1rem; }
  .ai-segmented { width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ai-segmented button { padding-inline: .6rem; }
  .ai-workspace-grid { padding: 0 .75rem 1rem; gap: .85rem; }
  .ai-compose-card, .ai-task-column { border-radius: .9rem .9rem .9rem .35rem; }
  .ai-job-card { padding: .85rem; }
  .ai-job-error { max-height: 6rem; }
}

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