:root { --paper:#e5eaf2; --text:#20313d; --muted:#607084; --line:#dce2eb; --blue:#276bdd; --shadow:0 3px 12px #5267880a; }
body { background:linear-gradient(160deg,#e0e6f0,#edf0f5); font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif; }
.sidebar { background:#edf1f6; color:var(--text); border-right:1px solid #d7dfea; }
.sidebar::after { display:none; }
.brand { color:var(--text); }
.brand small,.sidebar-foot { color:var(--muted); }
.brand-mark,.modal-mark { background:#3477e5; box-shadow:none; }
.nav-item { color:var(--muted); border-radius:13px; text-decoration:none; }
.nav-item.active { background:white; color:var(--blue); box-shadow:0 2px 6px #52678808; }
.nav-item:hover { background:#f7f9fc; color:var(--blue); }
.records-panel,.stat-card { border-radius:24px; border:0; background:white; box-shadow:var(--shadow); }
.button { border-radius:12px; min-height:44px; box-shadow:none; }
.button.primary { background:linear-gradient(110deg,#448cf0,#316be9); }
.topbar h1 { font-weight:600; letter-spacing:0; }
.subtitle { color:var(--muted); }
.record-card { border-radius:24px; box-shadow:var(--shadow); }
.mobile-home { margin-left:auto; color:var(--blue); text-decoration:none; font-size:14px; font-weight:500; }
.drawer { background:#f5f7fa; }
input,select,textarea { border-radius:11px!important; }
@media (max-width:700px) { .stats { gap:10px; } .stat-card { padding:18px 16px; } }
.stat-card > span,.subtitle { font-size:14px; }
.button { font-size:14px; }
.header-actions { flex-wrap:wrap; justify-content:flex-end; }
.header-actions [data-site-language] { width:auto; min-height:44px; max-width:100%; padding:0 10px; color:var(--text); background:white; border:1px solid var(--line); font:inherit; font-size:14px; }
html:lang(en) :is(#statTotal,#statInvestigating,#statTemporary) small { display:none; }
html:lang(zh-TW) .preview-new::after { content:"待上傳"; }
html:lang(en) .preview-new::after { content:"Pending"; }
@media (max-width:660px) {
  .topbar { align-items:flex-start; flex-direction:column; gap:12px; }
  .header-actions { justify-content:flex-start; }
}
@media (max-width:660px) { .button { font-size:14px; min-height:44px; } .record-card h3 { font-size:16px; } .record-card p { font-size:14px; line-height:1.65; } .pagination,.page-button { font-size:13px; } }

@media screen {
  :root[data-theme="dark"] {
    color-scheme: dark;
    --paper: #15171b;
    --card: #23262c;
    --issue-raised: #30343c;
    --issue-field: #1c1f24;
    --issue-accent-bg: #233751;
    --issue-success-bg: #203b30;
    --issue-warning-bg: #443522;
    --issue-danger-bg: #452a30;
    --text: #f0f1f4;
    --navy: var(--text);
    --muted: #b3bbc7;
    --line: #41464f;
    --blue: #93bfff;
    --green: #83d9a8;
    --orange: #f2c17c;
    --red: #ffa5ae;
    --shadow: 0 3px 12px #0002;
  }

  :root[data-theme="dark"] body { background: var(--paper); }
  :root[data-theme="dark"] .sidebar { background: var(--issue-field); border-color: var(--line); }
  :root[data-theme="dark"] .nav-item.active { color: var(--blue); background: var(--issue-accent-bg); }
  :root[data-theme="dark"] .nav-item:hover { background: var(--issue-raised); }
  :root[data-theme="dark"] :is(.records-panel, .stat-card, .record-card, .report-section, .issue-overview,
    .resolution-overview div, .private-info-card, .form-section, .modal) { background: var(--card); }
  :root[data-theme="dark"] :is(.drawer, .drawer-header, .form-footer) { background: var(--issue-field); }
  :root[data-theme="dark"] :is(th, .issue-overview h3, .private-info-heading, .modal-close, .privacy-hint,
    .icon-button, .close-button, .page-button, .button.secondary) {
    color: var(--text);
    background: var(--issue-raised);
    border-color: var(--line);
  }
  :root[data-theme="dark"] th { color: var(--muted); }
  :root[data-theme="dark"] tbody tr:hover { background: var(--issue-raised); }
  :root[data-theme="dark"] :is(td, .issue-overview-grid div, .record-card-footer) { border-color: var(--line); }
  :root[data-theme="dark"] :is(.issue-overview-grid small, .resolution-overview small, .private-info-grid small,
    .detail-footer, .site-footer, .issue-overview h3 span) { color: var(--muted); }
  :root[data-theme="dark"] :is(.record-card p, .report-section p, .issue-overview > p,
    .editor-form label, .modal label, .choice-field legend) { color: var(--text); }
  :root[data-theme="dark"] .report-section .no-content { color: var(--muted); }
  :root[data-theme="dark"] .report-cover {
    color: #f1f5fb;
    background: linear-gradient(140deg, #202c40, #2b3d58);
    box-shadow: none;
  }
  :root[data-theme="dark"] :is(.report-meta span, .cover-topline) { color: #c7d1df; }

  :root[data-theme="dark"] :is(.filters input, .filters select, .editor-form input, .editor-form select,
    .editor-form textarea, .modal input, .choice-field, .upload-zone, .header-actions [data-site-language]) {
    color: var(--text);
    border-color: #555d68;
    background: var(--issue-field);
  }
  :root[data-theme="dark"] .upload-zone { color: var(--muted) !important; }
  :root[data-theme="dark"] .upload-zone.dragging { background: var(--issue-accent-bg); border-color: var(--blue); }
  :root[data-theme="dark"] :is(input, textarea)::placeholder { color: var(--muted); opacity: 1; }
  :root[data-theme="dark"] :is(button, a, input, select, textarea):focus-visible {
    outline: 2px solid var(--blue);
    outline-offset: 2px;
  }

  :root[data-theme="dark"] .button.primary { color: #0f1e31; background: #93bfff; }
  :root[data-theme="dark"] .button.danger { color: var(--red); background: var(--issue-danger-bg); border-color: #74454e; }
  :root[data-theme="dark"] :is(.status-temporary, .role-badge, .section-heading > span, .empty-icon) {
    color: var(--blue); background: var(--issue-accent-bg); border-color: #3b506a;
  }
  :root[data-theme="dark"] :is(.status-investigating, .private-info-heading span) { color: var(--orange); background: var(--issue-warning-bg); }
  :root[data-theme="dark"] :is(.status-resolved, .private-info-heading .full-access) { color: var(--green); background: var(--issue-success-bg); }
  :root[data-theme="dark"] .impact-no { color: var(--green) !important; background: var(--issue-success-bg); }
  :root[data-theme="dark"] .impact-yes { color: var(--red) !important; background: var(--issue-danger-bg); }
  :root[data-theme="dark"] :is(.thumbnail-stack img, .thumbnail-placeholder, .thumbnail-more) { border-color: var(--card); }
  :root[data-theme="dark"] :is(.preview-item, .gallery-button) { background: var(--issue-raised); }
  :root[data-theme="dark"] .spinner { border-color: var(--line); border-top-color: var(--blue); }
  :root[data-theme="dark"] .toast { color: var(--text); background: var(--issue-raised); border: 1px solid var(--line); }
  :root[data-theme="dark"] .toast.error { color: var(--red); background: var(--issue-danger-bg); border-color: #74454e; }
}

@media print {
  :root, :root[data-theme] { color-scheme: light; }
  body { background: white; color: #171a20; }
}
