:root {
  color-scheme: light;
  --bg: #f7f9fb;
  --panel: #fff;
  --ink: #172033;
  --muted: #657184;
  --line: #dfe6ee;
  --brand: #176b87;
  --brand-strong: #0f536b;
  --accent: #f2a541;
  --danger: #b42318;
  --ok: #157347;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Arial, "Microsoft YaHei", sans-serif;
  line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }

.site-page { min-height: 100vh; display: flex; flex-direction: column; }
.site-page > main { flex: 1 0 auto; }
.site-page .site-footer { margin-top: auto; }

.site-shell { width: min(1120px, calc(100% - 32px)); margin: 0 auto; }
.site-header { position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.94); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); }
.site-nav { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 20px; }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 8px; background: var(--brand); color: #fff; }
.nav-links { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.nav-item { position: relative; padding-bottom: 6px; }
.nav-link, .nav-label { display: inline-flex; min-height: 38px; align-items: center; padding: 0 12px; border-radius: 6px; color: #263244; font-size: 14px; }
.nav-link:hover, .nav-label:hover { background: #edf4f7; }
.sub-menu { position: absolute; top: 100%; left: 50%; transform: translateX(-50%); width: max-content; max-width: min(320px, calc(100vw - 32px)); background: #fff; border: 1px solid var(--line); box-shadow: 0 14px 34px rgba(23,32,51,.12); border-radius: 8px; padding: 6px; display: none; }
.nav-item:hover .sub-menu, .nav-item:focus-within .sub-menu { display: grid; }
.sub-menu a { max-width: 100%; padding: 8px 10px; border-radius: 6px; font-size: 14px; overflow-wrap: anywhere; white-space: normal; }
.sub-menu a:hover { background: #edf4f7; }

.hero { min-height: calc(100vh - 120px); display: grid; align-items: center; padding: 72px 0 56px; background: linear-gradient(rgba(247,249,251,.1), rgba(247,249,251,.92)), url("/assets/site/hero-study.svg") center/cover no-repeat; }
.hero-content { width: min(680px, 100%); }
.hero h1 { margin: 0 0 18px; font-size: clamp(42px, 7vw, 76px); line-height: 1.05; color: #102231; }
.hero p { margin: 0 0 28px; color: #344256; font-size: 20px; max-width: 620px; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 18px; border: 0; border-radius: 6px; background: var(--brand); color: #fff; font-weight: 700; cursor: pointer; }
.button.secondary { background: #fff; color: var(--brand-strong); border: 1px solid #b9d3dc; }
.button:disabled, .button.secondary:disabled { background: #e8edf3; border: 1px solid #c6ced8; color: #778293; cursor: not-allowed; opacity: 1; box-shadow: none; }
.button:disabled:hover, .button.secondary:disabled:hover { background: #e8edf3; color: #778293; }
.section { padding: 56px 0; }
.section h2 { margin: 0 0 20px; font-size: 30px; }
.feature-grid, .metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 18px; }
.prose { width: min(840px, calc(100% - 32px)); margin: 0 auto; padding: 48px 0; }
.prose a { color: var(--brand); text-decoration: underline; }
.download-band { background: #123447; color: #fff; }
.download-grid { display: grid; grid-template-columns: 1fr 220px; gap: 28px; align-items: center; }
.qr-placeholder { aspect-ratio: 1; display: grid; place-items: center; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.26); border-radius: 8px; color: rgba(255,255,255,.78); text-align: center; padding: 16px; }
.light-page { background: #fff; }
.light-page .prose { width: min(680px, calc(100% - 24px)); padding: 20px 0; font-size: 15px; }
.site-footer { border-top: 1px solid var(--line); padding: 28px 0; color: var(--muted); background: #fff; font-size: 14px; }
.footer-content { text-align: center; }
.footer-content p { margin: 0 0 8px; }
.footer-content .footer-line, .footer-line { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; margin: 0; }
.footer-content a { color: var(--brand); text-decoration: underline; }
.footer-beian { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.footer-beian img { width: 16px; height: 16px; flex: 0 0 auto; }

.admin-layout { min-height: 100vh; display: grid; grid-template-columns: 240px minmax(0, 1fr); }
.admin-sidebar { background: #102231; color: #fff; padding: 24px 18px; }
.admin-sidebar h2 { margin: 0 0 18px; font-size: 20px; }
.admin-sidebar nav { display: grid; gap: 8px; }
.admin-sidebar a, .admin-sidebar button { width: 100%; min-height: 38px; border: 0; border-radius: 6px; padding: 0 10px; display: flex; align-items: center; background: transparent; color: #eaf3f7; text-align: left; cursor: pointer; font: inherit; }
.admin-sidebar a:hover, .admin-sidebar button:hover { background: rgba(255,255,255,.1); }
.admin-main { padding: 32px; overflow-x: auto; }
.admin-home-main { display: flex; flex-direction: column; min-height: 0; }
.admin-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.admin-top h1, .admin-main h1 { margin-top: 0; }

.form { display: grid; gap: 14px; max-width: 980px; }
.admin-home-main .form { flex: 1; max-width: 1040px; display: flex; flex-direction: column; }
.admin-home-main .home-content-editor { flex: 1; min-height: 320px; display: flex; }
.admin-home-main .home-content-editor > label { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.admin-home-main .home-content-editor textarea { flex: 1; min-height: 0; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
label { display: grid; gap: 6px; font-weight: 700; }
input, select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; background: #fff; color: var(--ink); font: inherit; }
input:disabled, select:disabled, textarea:disabled, input[readonly], select[readonly], textarea[readonly], .readonly-modal input, .readonly-modal select, .readonly-modal textarea { background: #eef1f4; border-color: #c6ced8; color: #778293; cursor: not-allowed; opacity: 1; }
textarea { min-height: 180px; resize: vertical; }
.table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); }
.table th, .table td { border-bottom: 1px solid var(--line); padding: 10px 12px; text-align: left; vertical-align: top; }
.table th { background: #edf4f7; white-space: nowrap; }
.menu-row-parent { background: #fff; }
.menu-row-child { background: #f6f9fc; }
.menu-row-child td { color: #344256; }
.menu-name-child { padding-left: 28px !important; }
.table-scroll { width: 100%; overflow: auto; border: 1px solid var(--line); background: #fff; }
.table-scroll .table { border: 0; }
.selectable-table tr { cursor: pointer; }
.selectable-table tr.selected td, .table tr.selected td { background: #e8f2f5; }
.truncate-cell { max-width: 240px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.alert { padding: 12px 14px; border: 1px solid #f3b8b2; background: #fff4f2; color: var(--danger); border-radius: 6px; }
.alert.ok, .alert.success { border-color: #a8d5bd; background: #effaf4; color: var(--ok); }
.login-shell, .login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card, .login-box { width: min(420px, 100%); background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 24px; }
.collect-shell.embedded { width: min(720px, 100%); margin: 0 auto; }
.muted { color: var(--muted); }
.danger { color: var(--danger); }
.field-block { display: grid; gap: 6px; }
.field-label { font-weight: 700; }
.form label.inline-check, .inline-check { display: inline-flex; align-items: center; gap: 8px; font-weight: 400; }
.form label.inline-check input, .inline-check input { width: auto; }
.radio-row { display: flex; gap: 16px; flex-wrap: wrap; }
.collect-page { padding: 48px 16px; }
.collect-shell { width: min(720px, 100%); margin: 0 auto; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 28px; }
.collect-shell.embedded { width: 100%; }
.collect-form { margin-top: 20px; }
.collect-page-mobile { min-height: 100vh; padding: 16px 12px; background: #fff; }
.collect-page-mobile .collect-shell { border: 0; padding: 0; }
.collect-page-mobile .form textarea { min-height: 132px; }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.tabs button { min-height: 36px; border: 1px solid var(--line); border-bottom: 0; background: #fff; border-radius: 6px 6px 0 0; padding: 0 12px; cursor: pointer; }
.tabs button.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.tab-chip { display: inline-flex; align-items: stretch; }
.tab-chip button + button { border-left: 0; min-width: 34px; padding: 0 8px; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.modal-backdrop { position: fixed; z-index: 100; inset: 0; background: rgba(16,34,49,.42); display: grid; place-items: center; padding: 24px; }
.modal-backdrop[hidden] { display: none; }
.modal { width: min(720px, 100%); max-height: calc(100vh - 48px); overflow: auto; background: #fff; border-radius: 8px; border: 1px solid var(--line); box-shadow: 0 20px 70px rgba(23,32,51,.22); padding: 22px; }
.large-modal { width: min(1120px, 100%); }
.modal-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.modal-title h2 { margin: 0; }
.modal-title button { border: 1px solid var(--line); background: #fff; border-radius: 6px; min-width: 34px; min-height: 34px; cursor: pointer; }
.modal-form { max-width: none; }
.vertical-detail { display: grid; gap: 12px; }
.detail-row { display: grid; gap: 6px; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.long-text-box { max-height: 180px; overflow: auto; white-space: pre-wrap; border: 1px solid var(--line); border-radius: 6px; padding: 10px; background: #fbfdff; }
.attachment-list { display: flex; gap: 10px; flex-wrap: wrap; }
.attachment-preview { width: 120px; height: 120px; object-fit: cover; border: 1px solid var(--line); border-radius: 6px; }
.workbench { display: grid; gap: 16px; }
.data-grid { max-height: calc(100vh - 250px); }
.compact-toolbar { margin-top: 10px; }
.inline-input-group { display: grid; grid-template-columns: minmax(0, 1fr) 96px; gap: 8px; }
.field-card { display: grid; gap: 10px; }
.example-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.example-code { min-height: 220px; max-height: 360px; overflow: auto; margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: 6px; background: #102231; color: #f4fbff; white-space: pre-wrap; word-break: break-word; }
.field-description-table code { white-space: nowrap; }

@media (max-width: 820px) {
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-row, .feature-grid, .metric-grid, .example-grid { grid-template-columns: 1fr; }
  .admin-main { padding: 20px 16px; }
}
