/* 慧算账 · restrained product UI. Behaviour and financial logic stay in V1.1. */
:root {
  --ink: #183040;
  --deep: #183a4e;
  --blue: #24556f;
  --teal: #188b7c;
  --muted: #647887;
  --line: #e4e9ee;
  --paper: #f5f7f9;
  --radius: 16px;
}
body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
button, input, select { -webkit-tap-highlight-color: transparent; }
.site-header { background: #fff; }
.header-inner, .workspace { width: calc(100% - 128px); max-width: 1280px; margin-inline: auto; padding-left: 0; padding-right: 0; }
.header-inner { min-height: 82px; padding-top: 16px; padding-bottom: 16px; }
.brand { gap: 12px; font-size: 17px; letter-spacing: .5px; }
.brand img { width: 38px; height: 38px; }
.brand small { font-size: 10px; letter-spacing: .4px; margin-top: 1px; }
.header-right { font-size: 11px; }
.workspace { padding-top: 32px; padding-bottom: 32px; }
.workspace-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 27px; }
.intro { margin: 0; }
h1 { font-size: 38px; font-weight: 650; letter-spacing: 2px; line-height: 1.25; }
.intro .product-subtitle { font-size: 13px; margin-top: 8px; letter-spacing: .5px; color: #5f7382; }
.mode-tabs { width: 350px; max-width: none; flex-shrink: 0; padding: 5px; margin: 0; border-radius: 12px; background: #eaf0f4; border: 1px solid #e1e7ed; gap: 4px; }
.mode-tabs button { border: 0; padding: 11px 14px; border-radius: 8px; color: #526a7b; }
.mode-tabs button div { font-size: 13px; font-weight: 600; }
.mode-tabs button[aria-selected=true] { background: #fff; color: var(--deep); box-shadow: 0 2px 5px #19394e0c; }
.mode-tabs button:hover { color: var(--deep); background: #f7fafb; }
.mode-tabs button[aria-selected=true]:hover { background: #fff; }
.project-toolbar { padding: 18px 22px; margin-bottom: 12px; border-radius: 14px; box-shadow: 0 2px 8px #17334803; }
.working-project strong { font-size: 14px; font-weight: 600; }
.working-project>span { font-size: 11px; margin-top: 3px; color: #447264; }
.project-toolbar-actions { gap: 9px; }
.project-toolbar button, .project-dialog button, .backup-import-label { min-height: 38px; border-radius: 8px; padding: 8px 14px; font-size: 12px; }
.project-toolbar button:hover, .project-dialog button:hover, .backup-import-label:hover { background: #f5f8fa; border-color: #c9d6df; }
.project-toolbar .save-project-button, .project-dialog .save-project-button { background: var(--deep); border-color: var(--deep); }
.project-toolbar .save-project-button:hover, .project-dialog .save-project-button:hover { background: #244c62; border-color: #244c62; }
#project-count { background: #edf2f5; font-size: 10px; padding: 1px 5px; }
.sample-notice { padding: 8px 12px; margin-bottom: 24px; border-radius: 8px; border-color: #e9e3d6; background: #faf8f3; color: #796742; font-size: 11px; line-height: 1.7; }
.sample-notice b { font-weight: 500; }
.sample-notice.real-project { background: #f0f6f4; border-color: #dfeae5; }
.app-layout { grid-template-columns: 344px minmax(0, 1fr); gap: 24px; }
.parameter-panel { top: 24px; border-radius: 14px; box-shadow: 0 4px 16px #17334803; }
.panel-title { padding: 13px 17px; background: #fff; }
.panel-title .text-button { font-size: 11px; padding: 3px 0; }
.panel-title .text-button:last-child { color: #657786; }
.parameter-panel form { max-height: calc(100dvh - 160px); scrollbar-color: #cfd9df transparent; }
.input-section summary { padding: 18px 20px; font-size: 13px; font-weight: 600; color: #324e60; }
.input-section summary:hover { background: #f8fafb; }
.input-section summary:after { font-size: 18px; color: #92a2ae; }
.section-body { padding: 0 20px 22px; }
.fields { gap: 18px 12px; }
.field-label, .field-label-row>.field-label { font-size: 11px; color: #596f7f; }
.field-label-row { align-items: center; gap: 5px; }
.field-label small { font-size: 9px; color: #9aa7b1; }
.field input, .field select { height: 42px; font-size: 13px; padding: 9px 11px; border-radius: 8px; border-color: #dce4ea; }
.field select { font-size: 11px; padding-right: 5px; }
.field input:hover, .field select:hover { border-color: #bdcdd7; }
.field input:focus, .field select:focus { border-color: #4f969f; box-shadow: 0 0 0 3px #168c7c0c; }
.field input::placeholder { font-size: 11px; color: #acb8c1; }
.input-wrap>span { top: 13px; right: 10px; color: #657786; }
.field-hint, .group-note, .input-note, .storage-help-note { font-size: 10px; line-height: 1.85; color: #657786; }
.field-hint { margin-top: 7px; }
.subsidy-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 18px; align-items: start; }
.subsidy-row .field-label-row { min-height: 25px; align-items: center; }
.subsidy-row .field-label { margin-bottom: 0; }
.subsidy-row button { height: 42px; margin-top: 25px; padding: 0; }
.input-note>summary { padding: 0; font-size: 10px; font-weight: 400; color: #657786; }
.input-note>summary:hover { background: none; color: var(--blue); }
.total-line { margin-top: 18px; padding-top: 14px; font-size: 11px; align-items: center; }
.total-line b { font-size: 16px; font-weight: 600; }
.target-section { background: #f2f8f6; }
.target-section>summary { color: var(--teal); }
.energy-section>summary { color: #3e8379; }
.energy-section .checkbox-line { font-size: 12px; margin-bottom: 16px; }
.energy-assumption { color: #866233; line-height: 1.85; }
.field-help-button { width: 18px; height: 18px; flex-basis: 18px; border-color: #d5e1e5; background: #f6f9fa; color: #596f7f; font-size: 10px; }
.parameter-help-tooltip { border-radius: 12px; border-color: #d9e3e7; box-shadow: 0 8px 30px #18304016; }
.input-footer { padding: 16px 20px 20px; background: #fff; }
.primary-button { min-height: 43px; padding: 11px 15px; border-radius: 8px; background: var(--deep); justify-content: center; text-align: center; font-size: 13px; font-weight: 600; }
.primary-button:hover { background: #244c62; }
.results-heading { min-height: 40px; margin-bottom: 16px; }
.results-heading h2 { font-size: 18px; font-weight: 600; letter-spacing: .3px; }
.result-actions { gap: 10px; }
.view-switch { border-radius: 8px; padding: 3px; background: #edf2f5; border-color: #e3e9ee; gap: 2px; }
.view-switch button { border-radius: 5px; padding: 7px 11px; font-size: 11px; }
.view-switch button.active { background: #fff; color: var(--deep); box-shadow: 0 1px 3px #19394e09; }
.export-button { min-height: 38px; padding: 9px 14px; border-radius: 8px; font-size: 12px; }
.export-button:hover { background: #244c62; }
.metrics-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.metrics-grid.reverse { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.metric { border-radius: 12px; padding: 23px 20px 20px; box-shadow: 0 2px 6px #17334803; }
.metric:first-child { border-top: 1px solid var(--line); padding-top: 23px; }
.metric:first-child:before { content: ''; position: absolute; height: 3px; width: 30px; background: var(--teal); border-radius: 2px; top: 0; left: 20px; }
.metric-label { font-size: 11px; color: #657786; }
.metric-value { font-size: clamp(24px, 2.15vw, 34px); font-weight: 600; letter-spacing: -1px; margin: 14px 0 12px; line-height: 1.18; }
.metric-value.text { font-size: clamp(18px, 1.7vw, 24px); font-weight: 600; line-height: 1.55; letter-spacing: 0; }
.metric-unit { font-size: 10px; color: #657786; line-height: 1.7; }
.status-banner { padding: 15px 18px; margin-bottom: 18px; border-radius: 10px; font-size: 12px; }
.status-banner strong { font-weight: 600; }
.status-banner p { font-size: 11px; line-height: 1.9; }
.status-banner.warning { border-color: #eee4cf; background: #fbf8f1; color: #866233; }
.card { border-radius: 14px; padding: 24px; margin-bottom: 18px; box-shadow: 0 2px 8px #17334802; }
.card-header { margin-bottom: 22px; }
.card-header h3 { font-size: 14px; font-weight: 600; }
.card-header .caption { font-size: 10px; color: #657786; }
.chart-legend { font-size: 10px; gap: 18px; margin-bottom: 14px; }
.chart .annual { fill: #b1c9d6; }
.chart .initial { fill: #658ca2; }
.chart .cumulative { stroke-width: 2.8; }
.chart text { fill: #657786; }
.chart-footer { padding-top: 12px; font-size: 10px; color: #657786; }
.chart-footer strong { font-weight: 500; color: #648577; }
.data-table { font-size: 11px; }
.data-table th { background: #f6f8fa; font-size: 10px; padding: 12px; }
.data-table td { padding: 12px; }
.data-table small { font-size: 9px; }
.two-columns { gap: 18px; }
.cost-bar { margin: 16px 0; }
.cost-bar-head { font-size: 11px; }
.cost-bar-head b { font-weight: 500; }
.bar-track { height: 4px; margin-top: 9px; }
.bar-fill { background: #87a9bd; }
.bar-fill.negative { background: #c9a99a; }
.finance-summary { align-items: center; margin-top: 20px; padding-top: 16px; font-size: 12px; }
.mini-label { font-size: 11px; line-height: 1.7; }
.mini-value { font-size: 23px; font-weight: 600; margin-top: 10px; }
.mini-unit, .comparison-values small { font-size: 10px; line-height: 1.7; }
.comparison-values { gap: 18px; }
.comparison-values .mini-value { font-size: 23px; }
.comparison-note { font-size: 11px; line-height: 1.9; border-radius: 8px; padding: 14px 16px; }
.sales-summary { padding: 24px; }
.sales-summary .comparison-values { gap: 24px; margin-top: 12px; }
.sales-summary .comparison-values .mini-value { font-size: 24px; }
.risk-list li { font-size: 11px; line-height: 1.9; padding: 9px 0; }
.result-detail { border-radius: 14px; padding: 19px 23px; margin-bottom: 18px; }
.result-detail>summary { font-size: 12px; color: #57788c; }
.result-detail[open]>summary { margin-bottom: 22px; }
.formula-content { font-size: 11px; line-height: 2; }
.empty-results { padding: 48px 30px; border-radius: 14px; min-height: 320px; }
.empty-results h3 { font-size: 18px; }
.scenario-assumptions { font-size: 11px; gap: 12px; }
.scenario-assumptions label { font-size: 10px; }
.scenario-assumptions input { border-radius: 5px; padding: 5px 6px; width: 52px; font-size: 11px; }
.pdf-ready { border-radius: 10px; padding: 16px 18px; font-size: 12px; }
.snapshot-meta { font-size: 10px; line-height: 1.9; color: #5f7382; }
.page-footer { padding-top: 24px; margin-top: 34px; gap: 5px 24px; font-size: 10px; line-height: 1.9; color: #5f7382; }
.page-footer strong { color: #5f7382; }
.page-footer small { font-size: 9px; }
.project-dialog { border-radius: 18px; border-color: #e4e9ee; padding: 28px; box-shadow: 0 24px 90px #132e452b; }
.project-dialog::backdrop { background: #18304059; backdrop-filter: blur(3px); }
.project-dialog h2 { font-size: 20px; font-weight: 600; }
.project-dialog-header { margin-bottom: 24px; }
.project-dialog-header button { min-height: 32px; border: 0; background: #f4f6f8; color: #8c9ba5; font-size: 20px; }
.project-dialog input[type=text], .project-dialog input[type=search] { border-radius: 8px; padding: 12px; }
.saved-project-row { padding: 20px 0; }
.saved-project-row strong { font-weight: 600; }
.project-storage-note { line-height: 1.9; color: #657786; }
#toast { border-radius: 10px; padding: 12px 20px; box-shadow: 0 8px 30px #18304026; }
@media (min-width: 1500px) {
  .app-layout { grid-template-columns: 360px minmax(0, 1fr); gap: 28px; }
  .metric-value { font-size: 34px; }
}
@media (max-width: 1220px) {
  .header-inner, .workspace { width: calc(100% - 64px); }
  .app-layout { grid-template-columns: 320px minmax(0, 1fr); gap: 20px; }
  .metrics-grid, .metrics-grid.reverse { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .two-columns { grid-template-columns: 1fr; }
  .metric-value { font-size: 30px; }
  .metric-value.text { font-size: 19px; }
  .card { padding: 22px; }
  .sales-summary .comparison-values { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .header-inner, .workspace { width: 100%; }
  .header-inner { min-height: 73px; padding: 15px 20px; }
  .brand { font-size: 16px; gap: 10px; }
  .brand img { width: 34px; height: 34px; }
  .brand small { font-size: 9px; }
  .header-right { display: none; }
  .workspace { padding: 25px 18px 82px; }
  .workspace-heading { display: contents; }
  .intro { margin-bottom: 22px; }
  h1 { font-size: 33px; }
  .intro .product-subtitle { font-size: 12px; margin-top: 7px; }
  .mode-tabs { width: 100%; position: sticky; top: 0; z-index: 10; margin-bottom: 20px; padding: 5px; border-radius: 10px; box-shadow: 0 3px 10px #18304006; }
  .mode-tabs button { padding: 11px 8px; }
  .mode-tabs button div { font-size: 13px; }
  .project-toolbar { padding: 16px; gap: 14px; }
  .project-toolbar-actions { gap: 7px; }
  .project-toolbar button { padding: 8px 4px; font-size: 11px; }
  .working-project strong { font-size: 14px; }
  .working-project>span { font-size: 10px; }
  .sample-notice { padding: 10px 12px; font-size: 10px; margin-bottom: 20px; }
  .sample-notice b { display: inline; padding-right: 8px; }
  .app-layout { grid-template-columns: 1fr; gap: 28px; }
  .parameter-panel { position: static; }
  .parameter-panel form { max-height: none; overflow: visible; }
  .input-section summary { padding: 18px 20px; font-size: 14px; }
  .field input, .field select { height: 46px; font-size: 16px; }
  .field select { font-size: 12px; }
  .field-label, .field-label-row>.field-label { font-size: 12px; }
  .field-help-button { width: 24px; height: 24px; flex-basis: 24px; font-size: 12px; }
  .input-wrap>span { top: 16px; }
  .field-hint, .group-note, .storage-help-note, .input-note>summary { font-size: 11px; }
  .primary-button { min-height: 46px; font-size: 13px; }
  .results-heading { gap: 14px; }
  .results-heading h2 { font-size: 20px; }
  .result-actions { width: auto; }
  .view-switch button { font-size: 10px; padding: 7px 9px; }
  .export-button { font-size: 11px; padding: 9px 12px; }
  .metrics-grid, .metrics-grid.reverse { gap: 10px; }
  .metric { padding: 20px 15px 17px; border-radius: 11px; }
  .metric:first-child { padding-top: 20px; }
  .metric:first-child:before { left: 15px; }
  .metric-label { font-size: 10px; }
  .metric-value { font-size: 27px; margin: 13px 0 10px; }
  .metric-value.text { font-size: 18px; }
  .metric-unit { font-size: 9px; }
  .card { padding: 20px 16px; }
  .card-header h3 { font-size: 14px; }
  .card-header .caption { font-size: 9px; max-width: 44%; }
  .chart-legend { font-size: 9px; gap: 12px; }
  .chart text { font-size: 21px; }
  .chart-footer { font-size: 9px; }
  .status-banner { padding: 13px 15px; font-size: 11px; }
  .status-banner p { font-size: 10px; }
  .comparison-values .mini-value, .sales-summary .comparison-values .mini-value { font-size: 21px; }
  .sales-summary .comparison-values { gap: 16px; }
  .mini-label { font-size: 10px; }
  .snapshot-meta { font-size: 9px; }
  .project-dialog { padding: 22px; border-radius: 16px; }
  .project-dialog h2 { font-size: 18px; }
  .project-library-tools { gap: 10px; }
  .project-library-tools .checkbox-line { font-size: 11px; }
  .project-storage-note { font-size: 11px; }
  .mobile-dock { padding: 10px 18px max(10px, env(safe-area-inset-bottom)); }
  .mobile-dock button { padding: 12px; border-radius: 8px; font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *:before, *:after { transition: none !important; scroll-behavior: auto !important; }
}
