:root {
  --canvas: #f3f5f8;
  --surface: #ffffff;
  --surface-soft: #f8fafb;
  --ink: #18212b;
  --ink-soft: #3e4a58;
  --muted: #778290;
  --line: #e4e8ed;
  --line-strong: #d5dbe2;
  --brand: #e5b51b;
  --brand-strong: #9b7400;
  --brand-soft: #fff7d6;
  --blue: #3478c8;
  --blue-soft: #eaf2fc;
  --amber: #a66908;
  --amber-soft: #fff4dc;
  --red: #b72c39;
  --red-soft: #fdecef;
  --nav: #1f2933;
  --nav-soft: #2a3642;
  --shadow-sm: 0 1px 2px rgba(28, 38, 49, .04), 0 4px 14px rgba(28, 38, 49, .05);
  --shadow-lg: 0 24px 70px rgba(22, 30, 39, .2);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--canvas); }
body { margin: 0; min-width: 320px; min-height: 100vh; background: var(--canvas); color: var(--ink); font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; letter-spacing: 0; }
button, input, select, textarea { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }
.hidden { display: none !important; }

.brand-mark { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 8px; background: var(--brand); color: #fff; font-size: 20px; font-weight: 800; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12); }
.brand-mark.small { width: 36px; height: 36px; border-radius: 7px; font-size: 15px; box-shadow: none; }
.login-logo { display: block; width: min(220px, 60%); height: auto; object-fit: contain; }
.login-kicker, .section-kicker, .workspace-kicker { color: var(--brand); font-size: 10px; font-weight: 800; line-height: 1.4; text-transform: uppercase; }

.login-view { min-height: 100vh; display: grid; grid-template-columns: minmax(380px, .92fr) minmax(440px, 1.08fr); background: #fff; }
.login-brand-panel { min-height: 100vh; display: flex; flex-direction: column; justify-content: space-between; padding: clamp(50px, 7vw, 96px); background: var(--nav); color: #fff; }
.login-brand-content { max-width: 560px; }
.login-brand-content .login-kicker { margin: 34px 0 14px; color: #f2d269; }
.login-brand-content h1 { margin: 46px 0 0; font-size: clamp(38px, 4.4vw, 64px); line-height: 1.14; font-weight: 760; }
.login-brand-content > p:last-child { max-width: 500px; margin: 26px 0 0; color: #b8c2cc; font-size: 15px; line-height: 1.9; }
.login-flow-preview { display: flex; align-items: center; width: min(540px, 100%); margin-top: 48px; }
.flow-node { flex: none; min-width: 62px; padding: 8px 10px; border: 1px solid #53606c; border-radius: 5px; color: #aeb8c2; font-size: 12px; text-align: center; }
.flow-node.done { border-color: #8b7834; color: #f0d16d; background: rgba(229, 181, 27, .12); }
.flow-node.active { border-color: #eed05d; color: #27210c; background: var(--brand); }
.login-flow-preview i { flex: 1; height: 1px; min-width: 15px; background: #53606c; }
.login-form-wrap { min-height: 100vh; display: grid; place-items: center; padding: 36px; background: #fff; }
.login-panel { width: min(400px, 100%); }
.mobile-brand { display: none; align-items: center; justify-content: center; margin-bottom: 42px; padding: 14px 18px; border-radius: 7px; background: var(--nav); }
.mobile-brand img { display: block; width: 156px; height: auto; object-fit: contain; }
.login-panel .login-kicker { margin: 0 0 9px; }
.login-panel h2 { margin: 0 0 8px; font-size: 30px; line-height: 1.2; }
.login-panel > p { margin: 0 0 34px; color: var(--muted); font-size: 14px; }

label { display: grid; gap: 7px; margin-bottom: 16px; color: var(--ink-soft); font-size: 12px; font-weight: 680; }
input, select, textarea { width: 100%; min-height: 42px; padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: 6px; outline: none; background: #fff; color: var(--ink); transition: border-color .18s, box-shadow .18s; }
textarea { min-height: 86px; resize: vertical; line-height: 1.6; }
input:hover, select:hover, textarea:hover { border-color: #b9c1ca; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(229, 173, 22, .16); }

.primary, .secondary, .danger, .ghost, .success, .warning { min-height: 38px; padding: 8px 14px; border: 1px solid transparent; border-radius: 6px; font-weight: 700; transition: background .18s, border-color .18s, box-shadow .18s, transform .18s; }
.primary:active, .secondary:active, .danger:active, .ghost:active, .success:active, .warning:active { transform: translateY(1px); }
.primary { background: var(--brand); color: #2b240f; box-shadow: 0 3px 10px rgba(174, 133, 0, .18); }
.primary:hover { background: #d5a409; }
.secondary { border-color: #e4cf79; background: var(--brand-soft); color: var(--brand-strong); }
.secondary:hover { border-color: #d3b84d; background: #fff1b5; }
.success { border-color: #9fd2b7; background: #e9f7ef; color: #24754d; }
.success:hover { border-color: #6fba91; background: #ddf2e6; box-shadow: 0 3px 10px rgba(47, 157, 103, .12); }
.warning { border-color: #e8c47d; background: #fff6df; color: #8c5c08; }
.warning:hover { border-color: #d5a94f; background: #ffedc1; }
.danger { border-color: #edbcc2; background: var(--red-soft); color: var(--red); }
.danger:hover { border-color: #df979f; }
.ghost { border-color: var(--line-strong); background: #fff; color: var(--ink-soft); }
.ghost:hover { border-color: #aeb8c2; background: var(--surface-soft); }
.wide { width: 100%; min-height: 46px; }
.text-button { padding: 7px; border: 0; background: transparent; color: var(--muted); font-size: 12px; }
.text-button:hover { color: var(--ink); }
.form-error { min-height: 20px; margin-top: 10px; color: var(--red); font-size: 12px; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 224px minmax(0, 1fr); }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 30; width: 224px; display: flex; flex-direction: column; padding: 20px 14px; background: var(--nav); color: #fff; }
.brand { display: flex; align-items: center; justify-content: center; min-height: 92px; padding: 0 8px 20px; border-bottom: 1px solid rgba(255, 255, 255, .09); }
.app-logo { display: block; width: 154px; height: 64px; object-fit: contain; }
.brand div { display: grid; gap: 2px; }
.brand strong { font-size: 14px; }
.brand div span { color: #8795a2; font-size: 9px; font-weight: 760; }
.tabs { display: grid; gap: 5px; margin-top: 20px; }
.tab { position: relative; width: 100%; min-height: 44px; display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 8px; padding: 8px 11px; border: 0; border-radius: 6px; background: transparent; color: #aeb8c2; text-align: left; font-size: 13px; font-weight: 650; }
.tab:hover { background: rgba(255, 255, 255, .05); color: #fff; }
.tab.active { background: var(--nav-soft); color: #fff; box-shadow: inset 3px 0 0 var(--brand); }
.nav-symbol { width: 26px; height: 26px; display: grid; place-items: center; border: 1px solid #475563; border-radius: 5px; color: #aeb8c2; font-size: 10px; }
.tab.active .nav-symbol { border-color: #8a7438; background: rgba(229, 181, 27, .16); color: #f2d269; }
.nav-badge { min-width: 20px; height: 20px; display: grid; place-items: center; padding: 0 5px; border-radius: 10px; background: var(--red); color: #fff; font-size: 10px; }
.sidebar-note { margin-top: auto; display: grid; grid-template-columns: 9px 1fr; gap: 10px; align-items: start; padding: 13px 10px; border: 1px solid rgba(255, 255, 255, .08); border-radius: 6px; background: rgba(255, 255, 255, .025); }
.status-light { width: 8px; height: 8px; margin-top: 4px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 4px rgba(229, 173, 22, .13); }
.sidebar-note div { display: grid; gap: 3px; }
.sidebar-note strong { color: #dce2e8; font-size: 11px; }
.sidebar-note small { color: #83909d; font-size: 9px; }

.workspace { grid-column: 2; min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 25; height: 66px; display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 0 30px; border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, .96); }
.topbar > div:first-child { display: grid; gap: 2px; }
.topbar > div:first-child strong { font-size: 14px; }
.workspace-kicker { color: #9aa4ae; font-size: 8px; }
.user-area { display: flex; justify-content: flex-end; align-items: center; gap: 10px; color: var(--ink-soft); font-size: 12px; }
.avatar { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--brand-soft); color: var(--brand-strong); font-size: 11px; font-weight: 800; }
.topbar-button, .binding-status { min-height: 32px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 6px 10px; border: 1px solid var(--line-strong); border-radius: 6px; background: #fff; color: var(--ink-soft); font-size: 11px; font-weight: 700; white-space: nowrap; }
.topbar-button:hover, .binding-status:hover { border-color: #b7c0c9; background: var(--surface-soft); }
.topbar-button { border-color: #e4cf79; background: var(--brand-soft); color: var(--brand-strong); }
.binding-dot { width: 7px; height: 7px; flex: none; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 3px var(--amber-soft); }
.binding-status.bound { border-color: #b7ddc8; background: #eef8f2; color: #24754d; }
.binding-status.bound .binding-dot { background: #2f9d67; box-shadow: 0 0 0 3px #dff2e7; }

main { width: min(1480px, 100%); margin: 0 auto; padding: 30px 34px 70px; }
.page-head { min-height: 70px; display: flex; justify-content: space-between; align-items: flex-start; gap: 22px; margin-bottom: 20px; }
.page-head h2 { margin: 5px 0 5px; font-size: 24px; line-height: 1.2; }
.page-head p, .reminder-run p { margin: 0; color: var(--muted); font-size: 12px; }
.section-kicker { color: #8a95a1; font-size: 9px; }
.page-head .primary { min-height: 42px; padding-inline: 17px; }
.page-head .primary span { font-size: 16px; }
.page-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.page-actions button { min-height: 42px; padding-inline: 17px; }

.urgent-panel { margin-bottom: 18px; padding: 15px 17px; border: 1px solid #f0c8cd; border-left: 4px solid var(--red); border-radius: 6px; background: var(--red-soft); }
.urgent-panel strong { display: block; margin-bottom: 8px; color: var(--red); font-size: 13px; }
.urgent-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 6px 0; color: #68212a; font-size: 12px; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { position: relative; min-height: 112px; display: grid; grid-template-columns: 38px 1fr auto; grid-template-rows: auto 1fr auto; align-items: center; gap: 4px 10px; padding: 16px; overflow: hidden; border: 1px solid var(--line); border-top: 3px solid var(--line-strong); border-radius: 7px; background: var(--surface); color: var(--ink); text-align: left; box-shadow: var(--shadow-sm); transition: border-color .18s, box-shadow .18s, transform .18s; }
.stat:hover { border-color: #d4dbe2; box-shadow: 0 9px 24px rgba(28, 38, 49, .09); transform: translateY(-1px); }
.stat-icon { width: 36px; height: 36px; grid-row: 1 / 3; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-soft); color: var(--ink-soft); font-size: 12px; font-weight: 800; }
.stat[data-tone="green"] { border-top-color: #2f9d67; }
.stat[data-tone="amber"] { border-top-color: #d69a2d; }
.stat[data-tone="red"] { border-top-color: var(--red); }
.stat[data-tone="blue"] { border-top-color: var(--blue); }
.stat[data-tone="green"] .stat-icon { border-color: #b7ddc8; background: #eef8f2; color: #24754d; }
.stat[data-tone="amber"] .stat-icon { border-color: #ead39e; background: #fff8e7; color: #98650b; }
.stat[data-tone="red"] .stat-icon { border-color: #efc0c5; background: var(--red-soft); color: var(--red); }
.stat[data-tone="blue"] .stat-icon { border-color: #bfd3ed; background: var(--blue-soft); color: var(--blue); }
.stat-label { align-self: end; color: var(--muted); font-size: 11px; font-weight: 700; }
.stat strong { align-self: start; font-size: 28px; line-height: 1; }
.stat small { grid-column: 1 / 4; color: var(--muted); font-size: 10px; }
.stat small b { color: var(--brand); font-size: 12px; }

.toolbar { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); }
.toolbar-filters { width: 100%; min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 9px; }
.person-filter { min-width: 210px; display: grid; grid-template-columns: auto minmax(120px, 1fr); align-items: center; gap: 8px; margin: 0; color: var(--muted); font-size: 11px; font-weight: 650; }
.person-filter select { min-height: 36px; padding-block: 6px; }
.search-wrap { width: min(330px, 45vw); display: grid; grid-template-columns: 28px 1fr; align-items: center; border: 1px solid var(--line-strong); border-radius: 6px; background: #fff; color: #9ba5af; }
.search-wrap span { text-align: center; font-size: 18px; }
.search-wrap input { min-height: 36px; padding-left: 0; border: 0; box-shadow: none; background: transparent; }
.search-wrap input:focus { box-shadow: none; }

.project-list { display: grid; gap: 13px; }
.focus-strip { min-height: 46px; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 12px; border: 1px solid #ecc68f; border-left: 4px solid var(--brand); border-radius: 6px; background: var(--brand-soft); color: var(--brand-strong); font-size: 12px; font-weight: 700; }
.project { overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: #fff; box-shadow: var(--shadow-sm); transition: border-color .18s, box-shadow .18s; }
.project:hover { border-color: #d4dbe2; box-shadow: 0 8px 24px rgba(28, 38, 49, .07); }
.project-highlight { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft), var(--shadow-sm); }
.project.archived { opacity: .76; }
.site-detail-strip { width: 100%; min-height: 42px; display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 9px 18px; border: 0; border-bottom: 1px solid #e9c86d; background: #fff8df; color: #70550b; text-align: left; }
.site-detail-strip span { font-size: 11px; }
.site-detail-strip b { display: inline-flex; margin-right: 7px; padding: 3px 7px; border-radius: 4px; background: var(--brand); color: #fff; font-size: 9px; }
.site-detail-strip strong { flex: none; font-size: 10px; }
.site-detail-strip:hover { background: #fff2c1; }
.project-head { display: grid; grid-template-columns: minmax(240px, 1.3fr) minmax(210px, .8fr) minmax(150px, .8fr) auto; gap: 20px; align-items: center; min-height: 86px; padding: 15px 18px; border-bottom: 1px solid var(--line); }
.project-title { min-width: 0; }
.project-title strong { display: block; margin-bottom: 6px; overflow-wrap: anywhere; font-size: 15px; }
.project-title span, .project-meta { color: var(--muted); font-size: 11px; }
.project-meta { display: grid; gap: 5px; }
.project-summary { display: grid; gap: 8px; }
.project-summary-row { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 10px; }
.progress-track { width: 100%; height: 6px; overflow: hidden; border-radius: 3px; background: #edf0f3; }
.progress-value { height: 100%; border-radius: 3px; background: #2f9d67; transition: width .25s ease, background-color .2s ease; }
.project-summary[data-progress-tone="due-soon"] .progress-value { background: var(--brand); }
.project-summary[data-progress-tone="due-soon"] .project-summary-row span:last-child { color: var(--brand-strong); }
.project-summary[data-progress-tone="overdue"] .progress-value { background: var(--red); }
.project-summary[data-progress-tone="overdue"] .project-summary-row span:last-child { color: var(--red); }
.project-actions { display: flex; justify-content: flex-end; gap: 7px; }
.project-actions button { min-height: 32px; padding: 5px 10px; font-size: 11px; }

.tasks { width: 100%; border-collapse: collapse; table-layout: fixed; }
.tasks th { padding: 10px 13px; border-bottom: 1px solid var(--line); background: #fafbfc; color: #8b96a1; text-align: left; font-size: 10px; font-weight: 760; }
.tasks td { padding: 13px; border-bottom: 1px solid #edf0f3; color: var(--ink-soft); vertical-align: top; overflow-wrap: anywhere; font-size: 12px; }
.tasks tr:last-child td { border-bottom: 0; }
.tasks tbody tr { transition: background .15s; }
.tasks tbody tr:hover { background: #fbfcfd; }
.tasks tbody tr.task-highlight { background: var(--brand-soft); }
.task-role { color: var(--ink); font-weight: 720; }
.task-note { margin-top: 5px; color: var(--muted); font-size: 11px; line-height: 1.55; white-space: pre-line; }
.unassigned-note { color: #8c5c08; }
.assignee-cell { display: flex; align-items: center; gap: 7px; }
.mini-avatar { width: 24px; height: 24px; flex: none; display: grid; place-items: center; border-radius: 50%; background: #edf2f5; color: #526170; font-size: 9px; font-weight: 800; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }
.chip { min-height: 23px; display: inline-flex; align-items: center; padding: 3px 8px; border-radius: 4px; background: #eef1f4; color: #52606d; font-size: 10px; font-weight: 720; }
.chip.awaiting { background: var(--amber-soft); color: var(--amber); }
.chip.progress { background: var(--blue-soft); color: var(--blue); }
.chip.done { background: var(--brand-soft); color: var(--brand-strong); }
.chip.overdue { background: var(--red-soft); color: var(--red); }
.status-accept { min-height: 34px; display: grid; gap: 1px; padding: 5px 9px; border: 1px solid #e1b65e; border-radius: 5px; background: var(--amber-soft); color: var(--amber); text-align: left; }
.status-accept span { font-size: 9px; font-weight: 650; }
.status-accept strong { font-size: 11px; }
.status-accept:hover { border-color: var(--brand); background: #ffefc8; }
.task-actions { display: flex; flex-wrap: wrap; gap: 5px; }
.task-actions button { min-height: 29px; padding: 4px 8px; font-size: 10px; }
.compact { min-height: 30px; padding: 4px 9px; font-size: 10px; }

.notification-list { display: grid; gap: 10px; }
.notification { display: grid; grid-template-columns: 9px minmax(0, 1fr) auto; gap: 14px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 7px; background: #fff; box-shadow: var(--shadow-sm); cursor: pointer; }
.notification:hover { border-color: #cfd7df; }
.notification-dot { width: 8px; height: 8px; margin-top: 5px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.notification.read { box-shadow: none; }
.notification.read .notification-dot { background: #c8cdd3; box-shadow: none; }
.notification h3 { margin: 0 0 6px; font-size: 13px; }
.notification pre { margin: 0; color: var(--ink-soft); font: inherit; font-size: 12px; line-height: 1.7; white-space: pre-wrap; }
.notification time { color: var(--muted); font-size: 10px; white-space: nowrap; }

.admin-layout { display: grid; grid-template-columns: 1.25fr 1fr; gap: 15px; }
.panel { padding: 18px; border: 1px solid var(--line); border-radius: 7px; background: #fff; box-shadow: var(--shadow-sm); }
.panel:first-child { grid-row: span 2; }
.panel-head { min-height: 36px; display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.panel h3 { margin: 0; font-size: 14px; }
.user-row { display: grid; grid-template-columns: 1fr 1fr auto; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); font-size: 12px; }
.user-row small { color: var(--muted); }
.view-scope { display: block; margin-top: 5px; }
.user-row-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 3px; }
.danger-text { color: var(--red); }
.danger-text:hover { color: #8f1723; }
.binding-admin-note { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 15px; padding: 11px 13px; border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: 6px; background: var(--surface-soft); }
.binding-admin-note strong { flex: none; color: var(--ink); font-size: 11px; }
.binding-admin-note span { color: var(--muted); font-size: 11px; line-height: 1.55; text-align: right; }
.binding-success { display: grid; justify-items: center; padding: 10px 6px 20px; text-align: center; }
.binding-check { width: 48px; height: 48px; display: grid; place-items: center; margin-bottom: 13px; border-radius: 50%; background: #e9f7ef; color: #24754d; font-size: 24px; font-weight: 800; }
.binding-success strong { font-size: 15px; }
.binding-success p, .install-help p { margin: 8px 0 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.install-help { display: grid; gap: 5px; margin-bottom: 18px; }
.install-help strong { margin-top: 8px; color: var(--ink); font-size: 12px; }
.install-help strong:first-child { margin-top: 0; }
.toggle-row { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 13px 0; border-top: 1px solid var(--line); }
.toggle-row input { width: 18px; min-height: 18px; }
.manager-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 9px; }
.manager-list label { display: flex; align-items: center; gap: 8px; margin: 0; font-weight: 520; }
.manager-list input { width: 16px; min-height: 16px; }
.reminder-run { display: grid; gap: 10px; }
.reminder-run label { margin: 0; }

dialog { width: min(1060px, calc(100% - 28px)); max-height: calc(100vh - 40px); padding: 0; border: 0; border-radius: 8px; background: #fff; box-shadow: var(--shadow-lg); }
dialog.compact-modal { width: min(520px, calc(100% - 28px)); }
dialog::backdrop { background: rgba(19, 27, 35, .5); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 17px 20px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; font-size: 16px; }
.icon-button { width: 34px; height: 34px; border: 0; background: transparent; color: var(--muted); font-size: 22px; }
.modal-body { max-height: calc(100vh - 120px); padding: 20px; overflow-y: auto; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; padding-top: 17px; border-top: 1px solid var(--line); }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 14px; }
.form-grid .full { grid-column: 1 / -1; }
.site-form-intro { min-height: 58px; display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 15px; padding: 12px 14px; border-left: 4px solid var(--brand); border-radius: 6px; background: var(--brand-soft); }
.site-form-intro div { display: grid; gap: 4px; }
.site-form-intro strong { color: var(--brand-strong); font-size: 12px; }
.site-form-intro span { color: var(--muted); font-size: 10px; }
.site-form-section { margin-bottom: 14px; padding: 15px; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.site-section-head { min-height: 30px; display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.site-section-head h4 { margin: 0; font-size: 13px; }
.site-section-head > span, .site-config-panel .panel-head small { color: var(--muted); font-size: 9px; }
.site-field-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 12px; }
.site-field { min-width: 0; }
.site-field.textarea { grid-column: span 2; }
.site-field em, .site-edit-reason em { margin-left: 3px; color: var(--red); font-style: normal; }
.site-choices { min-width: 0; grid-column: 1 / -1; margin: 0 0 16px; padding: 0; border: 0; }
.site-choices legend { margin-bottom: 8px; color: var(--ink-soft); font-size: 12px; font-weight: 680; }
.site-choices > div { display: flex; flex-wrap: wrap; gap: 7px; }
.site-choices label { position: relative; display: block; margin: 0; }
.site-choices input { position: absolute; opacity: 0; pointer-events: none; }
.site-choices span { min-height: 32px; display: flex; align-items: center; padding: 5px 10px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface-soft); color: var(--ink-soft); font-size: 10px; cursor: pointer; }
.site-choices input:checked + span { border-color: #dba54d; background: var(--brand-soft); color: var(--brand-strong); }
.power-warning { margin-top: 2px; padding: 10px 12px; border-left: 3px solid var(--brand); border-radius: 5px; background: #fff5d5; color: #755a12; font-size: 11px; }
.site-measure-section { border-color: #e2bd62; background: #fffdf5; }
.site-measure-section > p { margin: -4px 0 11px; color: var(--muted); font-size: 10px; }
.site-measure-row { display: grid; grid-template-columns: 1.2fr .65fr .65fr .5fr 1.2fr auto; gap: 8px; align-items: end; padding: 10px; border: 1px solid #ede0b2; border-radius: 6px; background: #fff; }
.site-measure-row + .site-measure-row { margin-top: 8px; }
.site-measure-row label { margin: 0; font-size: 9px; }
.site-measure-row input { min-height: 35px; padding: 7px 8px; }
.site-upload { min-height: 108px; place-items: center; align-content: center; padding: 15px; border: 1px dashed #d8ae45; border-radius: 6px; background: #fffaf0; text-align: center; }
.site-upload strong, .site-upload span { display: block; }
.site-upload span { color: var(--muted); font-size: 10px; font-weight: 500; }
.site-upload input { max-width: 310px; min-height: 35px; margin-top: 8px; font-size: 10px; }
.site-edit-reason { padding: 14px; border: 1px solid #edbdc3; border-radius: 6px; background: var(--red-soft); }
.site-detail-banner { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; padding: 14px 16px; border-left: 5px solid var(--brand); border-radius: 6px; background: var(--brand-soft); }
.site-detail-banner > div:first-child { display: grid; gap: 4px; }
.site-detail-banner strong { color: var(--brand-strong); font-size: 15px; }
.site-detail-banner span { color: var(--muted); font-size: 10px; }
.site-detail-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.site-detail-section { margin-bottom: 14px; padding: 15px; border: 1px solid var(--line); border-radius: 7px; }
.site-detail-section h4 { margin: 0 0 11px; font-size: 13px; }
.site-detail-section dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin: 0; }
.site-detail-section dl div { min-width: 0; padding: 9px 10px; border-radius: 5px; background: var(--surface-soft); }
.site-detail-section dt { margin-bottom: 5px; color: var(--muted); font-size: 9px; }
.site-detail-section dd { margin: 0; color: var(--ink-soft); overflow-wrap: anywhere; white-space: pre-line; font-size: 11px; line-height: 1.55; }
.site-photo-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.site-photo { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--ink-soft); text-decoration: none; }
.site-photo img { width: 100%; aspect-ratio: 4 / 3; display: block; object-fit: cover; background: var(--surface-soft); }
.site-photo span { display: block; padding: 7px 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 9px; }
.site-config-panel { grid-column: 1 / -1; }
.site-config-panel .panel-head > div { display: grid; gap: 4px; }
.site-config-switches { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.site-config-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 6px; }
.site-config-table { width: 100%; min-width: 980px; border-collapse: collapse; table-layout: fixed; }
.site-config-table th { padding: 8px; border-bottom: 1px solid var(--line); background: var(--surface-soft); color: var(--muted); text-align: left; font-size: 9px; }
.site-config-table td { padding: 7px; border-bottom: 1px solid var(--line); vertical-align: top; }
.site-config-table tr:last-child td { border-bottom: 0; }
.site-config-table th:nth-child(1) { width: 60px; }
.site-config-table th:nth-child(2) { width: 170px; }
.site-config-table th:nth-child(3), .site-config-table th:nth-child(4) { width: 115px; }
.site-config-table th:nth-child(5) { width: 190px; }
.site-config-table th:nth-child(6) { width: 135px; }
.site-config-table th:nth-child(7) { width: 100px; }
.site-config-table input, .site-config-table select, .site-config-table textarea { min-height: 34px; padding: 6px 7px; font-size: 10px; }
.site-config-table textarea { height: 58px; min-height: 58px; resize: vertical; }
.site-config-table .config-order { text-align: center; }
.config-check { display: flex; grid-template-columns: auto 1fr; align-items: center; gap: 5px; margin: 0 0 5px; white-space: nowrap; font-size: 9px; }
.config-check input { width: 15px; min-height: 15px; }
.permission-picker { margin-bottom: 16px; }
.permission-picker > strong { font-size: 12px; }
.permission-picker > p { margin: 5px 0 9px; color: var(--muted); font-size: 11px; }
.context-box { margin-bottom: 15px; padding: 12px 14px; border-left: 4px solid var(--brand); border-radius: 5px; background: var(--brand-soft); }
.context-box strong { font-size: 11px; color: var(--brand-strong); }
.context-box p { margin: 5px 0 0; color: var(--ink-soft); font-size: 12px; }
.task-builder { margin: 5px 0 16px; overflow: hidden; border: 1px solid var(--line); border-radius: 7px; }
.task-builder-head { display: flex; justify-content: space-between; align-items: center; padding: 11px 13px; border-bottom: 1px solid var(--line); background: var(--surface-soft); }
.task-builder-head strong { font-size: 12px; }
.task-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px 12px; padding: 13px; border-bottom: 1px solid var(--line); }
.task-row:last-child { border-bottom: 0; }
.task-row label { margin: 0; font-size: 10px; }
.task-row select, .task-row input { min-height: 36px; }
.task-row select[multiple] { height: 64px; }
.coordinator-field { min-width: 0; grid-column: span 2; }
.remove-task { align-self: end; justify-self: end; }
.coordinator-field > span { display: block; margin-bottom: 6px; font-size: 10px; font-weight: 700; }
.coordinator-dropdown { position: relative; }
.coordinator-dropdown summary { min-height: 36px; display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid var(--line-strong); border-radius: 6px; background: #fff; color: var(--ink-soft); cursor: pointer; list-style: none; }
.coordinator-dropdown summary::-webkit-details-marker { display: none; }
.coordinator-dropdown[open] summary { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(229, 173, 22, .16); }
.dropdown-arrow { color: var(--muted); font-size: 15px; transition: transform .18s; }
.coordinator-dropdown[open] .dropdown-arrow { transform: rotate(180deg); }
.coordinator-menu { margin-top: 5px; padding: 8px; border: 1px solid var(--line-strong); border-radius: 6px; background: #fff; box-shadow: var(--shadow-sm); }
.coordinator-menu > input { min-height: 34px; margin-bottom: 7px; }
.coordinator-options { max-height: 150px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; overflow-y: auto; }
.coordinator-options label { position: relative; margin: 0; }
.coordinator-options input { position: absolute; opacity: 0; pointer-events: none; }
.coordinator-options span { min-height: 30px; display: flex; align-items: center; padding: 5px 8px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface-soft); color: var(--ink-soft); font-size: 10px; cursor: pointer; }
.coordinator-options input:checked + span { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-strong); }
.coordinator-picker { max-height: 92px; display: flex; flex-wrap: wrap; align-content: flex-start; gap: 6px; padding: 7px; overflow-y: auto; border: 1px solid var(--line-strong); border-radius: 6px; background: #fff; }
.coordinator-picker label { position: relative; margin: 0; }
.coordinator-picker input { position: absolute; opacity: 0; pointer-events: none; }
.coordinator-picker span { min-height: 28px; display: inline-flex; align-items: center; padding: 4px 9px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface-soft); color: var(--ink-soft); font-size: 10px; cursor: pointer; }
.coordinator-picker input:checked + span { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-strong); }
.summary-meta { margin-bottom: 12px; color: var(--muted); font-size: 11px; }
.summary-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 7px; }
.summary-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.summary-table th { padding: 11px 12px; border-bottom: 1px solid var(--line); background: #fafbfc; color: var(--muted); text-align: left; font-size: 10px; }
.summary-table td { padding: 12px; border-bottom: 1px solid var(--line); color: var(--ink-soft); vertical-align: top; overflow-wrap: anywhere; font-size: 11px; }
.summary-table tr:last-child td { border-bottom: 0; }
.summary-table tbody tr:hover { background: #fffaf2; }
.summary-table td strong { display: block; margin-bottom: 3px; color: var(--ink); }
.summary-reason { margin-top: 5px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.summary-progress { color: #24754d; font-weight: 800; }
.archive-search { margin-left: auto; }
.archive-detail-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-bottom: 14px; color: var(--muted); font-size: 11px; }
.empty { padding: 42px; border: 1px dashed var(--line-strong); border-radius: 7px; background: #fff; color: var(--muted); text-align: center; font-size: 12px; }
.toast { position: fixed; left: calc(50% + 112px); bottom: 24px; z-index: 100; transform: translateX(-50%); padding: 11px 16px; border-radius: 6px; background: #222c35; color: #fff; box-shadow: var(--shadow-lg); font-size: 12px; }

@media (max-width: 1080px) {
  .project-head { grid-template-columns: minmax(220px, 1fr) minmax(160px, .7fr) auto; }
  .project-summary { grid-column: 1 / 3; grid-row: 2; }
  .project-actions { grid-column: 3; grid-row: 1 / 3; }
}

@media (max-width: 860px) {
  .login-view { grid-template-columns: 1fr; }
  .login-brand-panel { display: none; }
  .login-form-wrap { min-height: 100vh; padding: 28px; background: var(--canvas); }
  .login-panel { padding: 28px; border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: var(--shadow-sm); }
  .mobile-brand { display: flex; }
  .app-shell { grid-template-columns: 72px minmax(0, 1fr); }
  .sidebar { width: 72px; padding: 16px 9px; }
  .brand { justify-content: center; padding-inline: 0; }
  .app-logo { width: 42px; height: 42px; object-position: left center; }
  .brand div, .tab > span:not(.nav-symbol), .sidebar-note { display: none; }
  .tab { grid-template-columns: 1fr; justify-items: center; padding: 8px; }
  .tab.active { box-shadow: inset 0 -3px 0 var(--brand); }
  .nav-badge { position: absolute; top: 5px; right: 5px; }
  .workspace { grid-column: 2; }
  .toast { left: calc(50% + 36px); }
  main { padding: 24px 20px 60px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .toolbar { align-items: stretch; flex-direction: column; }
  .toolbar-filters { justify-content: stretch; }
  .person-filter, .search-wrap { flex: 1; width: auto; }
  .admin-layout { grid-template-columns: 1fr; }
  .panel:first-child { grid-row: auto; }
  .project-head { grid-template-columns: 1fr auto; }
  .project-meta { grid-column: 1; }
  .project-summary { grid-column: 1 / -1; grid-row: auto; }
  .project-actions { grid-column: 2; grid-row: 1 / 3; align-self: start; }
  .site-field-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .site-detail-section dl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .site-photo-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .site-measure-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .site-measure-row .measure-note { grid-column: span 2; }
  .tasks { display: block; }
  .tasks thead { display: none; }
  .tasks tbody, .tasks tr, .tasks td { display: block; width: 100%; }
  .tasks tr { padding: 13px 15px; border-bottom: 1px solid var(--line); }
  .tasks td { display: grid; grid-template-columns: 82px 1fr; padding: 5px 0; border: 0; }
  .tasks td::before { content: attr(data-label); color: var(--muted); font-size: 10px; }
  .task-note, .chips { grid-column: 2; }
  .task-actions { grid-column: 2; }
  .task-row { grid-template-columns: 1fr 1fr; }
  .coordinator-field { grid-column: 1 / -1; }
  .task-row > :last-child { grid-column: 1 / -1; }
}

@media (max-width: 580px) {
  .app-shell { display: block; padding-bottom: 66px; }
  .sidebar { position: fixed; inset: auto 0 0; width: auto; height: 64px; display: block; padding: 7px 10px; border-top: 1px solid #3a4652; }
  .sidebar .brand, .sidebar-note { display: none; }
  .tabs { grid-template-columns: repeat(auto-fit, minmax(68px, 1fr)); gap: 7px; margin: 0; }
  .tab { min-height: 50px; grid-template-columns: 24px 1fr; justify-items: start; padding: 6px 10px; }
  .tab > span:not(.nav-symbol) { display: inline; }
  .nav-symbol { width: 23px; height: 23px; }
  .workspace { display: block; }
  .topbar { height: 58px; padding: 0 14px; }
  .topbar > div:first-child { display: none; }
  .user-area { width: 100%; justify-content: flex-end; gap: 7px; }
  .user-area #currentUser { max-width: 82px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar-button, .binding-status { min-width: 32px; padding-inline: 8px; }
  .topbar-button { font-size: 0; }
  .topbar-button::before { content: '安装'; font-size: 10px; }
  .binding-status span:last-child { display: none; }
  .binding-status .binding-dot { width: 8px; height: 8px; }
  .toast { left: 50%; bottom: 78px; width: calc(100% - 28px); text-align: center; }
  main { padding: 18px 13px 42px; }
  .page-head { min-height: 0; flex-direction: column; align-items: stretch; margin-bottom: 16px; }
  .page-head .primary { width: 100%; }
  .page-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .page-actions button { width: 100%; padding-inline: 10px; }
  .stats { gap: 8px; }
  .stat { min-height: 84px; padding: 14px; }
  .stat strong { font-size: 23px; }
  .toolbar { align-items: stretch; flex-direction: column; padding: 8px; }
  .toolbar-filters { display: grid; grid-template-columns: 1fr; }
  .person-filter { width: 100%; grid-template-columns: 64px 1fr; }
  .search-wrap { width: 100%; }
  .project-head { grid-template-columns: 1fr; gap: 10px; }
  .project-meta, .project-summary, .project-actions { grid-column: 1; grid-row: auto; }
  .project-actions { justify-content: flex-start; }
  .tasks td { grid-template-columns: 72px 1fr; }
  .notification { grid-template-columns: 9px 1fr; }
  .notification time { grid-column: 2; }
  .form-grid, .task-row { grid-template-columns: 1fr; }
  .site-form-intro, .site-section-head, .site-detail-banner { align-items: flex-start; flex-direction: column; }
  .site-field-grid, .site-detail-section dl, .site-config-switches { grid-template-columns: 1fr; }
  .site-field.textarea { grid-column: auto; }
  .site-measure-row { grid-template-columns: 1fr 1fr; }
  .site-measure-row label:first-child, .site-measure-row .measure-note { grid-column: 1 / -1; }
  .site-measure-row button { grid-column: 2; width: 100%; }
  .site-photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .site-detail-strip { align-items: flex-start; flex-direction: column; padding: 10px 13px; }
  .form-grid .full, .task-row > :last-child, .coordinator-field { grid-column: auto; }
  .remove-task { width: 100%; justify-self: stretch; }
  .summary-scroll { border: 0; overflow: visible; }
  .summary-table, .summary-table thead, .summary-table tbody, .summary-table tr, .summary-table td { display: block; width: 100%; }
  .summary-table thead { display: none; }
  .summary-table tr { margin-bottom: 10px; padding: 10px 12px; border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: 6px; background: #fff; }
  .summary-table td { display: grid; grid-template-columns: 86px 1fr; gap: 8px; padding: 5px 0; border: 0; }
  .summary-table td::before { content: attr(data-label); color: var(--muted); font-size: 10px; }
  .manager-list { grid-template-columns: 1fr; }
  .coordinator-options { grid-template-columns: 1fr; }
  .binding-admin-note { align-items: flex-start; flex-direction: column; gap: 5px; }
  .binding-admin-note span { text-align: left; }
}

@media print {
  body { background: #fff; }
  body > :not(dialog), dialog::backdrop, .modal-head, .modal-actions, .site-detail-actions, .site-photo-grid, .site-detail-section:last-child { display: none !important; }
  dialog[open] { position: static; width: 100%; max-height: none; display: block; padding: 0; box-shadow: none; }
  .modal-body { max-height: none; padding: 0; overflow: visible; }
  .site-detail-section { break-inside: avoid; }
}
