:root {
  --navy: #13213a;
  --navy-soft: #1b2c4a;
  --blue: #2f6bff;
  --blue-dark: #2455d6;
  --surface: #ffffff;
  --canvas: #f4f7fb;
  --line: #e6eaf1;
  --text: #172033;
  --muted: #778196;
  --green: #16865c;
  --orange: #c97712;
  --red: #d44747;
  --notice: #eef4ff;
  --shadow: 0 12px 34px rgba(25, 43, 73, .08);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--text);
  background: var(--canvas);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; }
body { background: var(--canvas); }
body.no-scroll { overflow: hidden; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.eyebrow { margin: 0 0 7px; color: #7790b8; font-size: 11px; font-weight: 800; letter-spacing: .16em; }

.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(420px, 1.15fr) minmax(420px, .85fr); background: #fff; }
.login-art { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; padding: clamp(42px, 7vw, 90px); color: #fff; background: radial-gradient(circle at 85% 15%, rgba(84,137,255,.6), transparent 32%), linear-gradient(145deg, #12203a 0%, #1d3e7b 100%); }
.login-art h1 { margin: 14px 0 24px; font-size: clamp(40px, 5vw, 72px); line-height: 1.1; letter-spacing: -.05em; }
.login-art p:not(.eyebrow) { max-width: 590px; color: #c8d7ef; font-size: 17px; line-height: 1.8; }
.brand-mark { display: inline-flex; width: 42px; height: 42px; align-items: center; justify-content: center; border-radius: 13px; color: #fff; background: linear-gradient(135deg, #5d91ff, #2f6bff); box-shadow: 0 8px 24px rgba(47,107,255,.3); font-weight: 900; }
.brand-mark.large { width: 60px; height: 60px; border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.12); box-shadow: none; font-size: 25px; }
.art-orbit { position: absolute; right: -110px; bottom: -110px; width: 360px; height: 360px; border: 1px solid rgba(255,255,255,.14); border-radius: 50%; }
.art-orbit i { position: absolute; inset: 20%; border: 1px solid rgba(255,255,255,.12); border-radius: inherit; }
.art-orbit i:nth-child(2) { inset: 39%; }
.art-orbit i:nth-child(3) { inset: 57%; background: rgba(255,255,255,.1); }
.login-card { width: min(440px, calc(100% - 52px)); margin: auto; padding: 46px; border: 1px solid var(--line); border-radius: 24px; background: #fff; box-shadow: var(--shadow); }
.login-card h2 { margin: 4px 0 8px; font-size: 29px; }
.login-card label, .form-grid label { display: flex; flex-direction: column; gap: 8px; color: #4d5870; font-size: 13px; font-weight: 700; }
.login-card label { margin-top: 22px; }
.login-card input, .form-grid input, .form-grid select, .form-grid textarea, .toolbar input, .toolbar select { width: 100%; min-height: 44px; border: 1px solid #dfe4ed; border-radius: 10px; outline: none; padding: 10px 13px; color: var(--text); background: #fff; transition: border .2s, box-shadow .2s; }
.login-card input:focus, .form-grid input:focus, .form-grid select:focus, .form-grid textarea:focus, .toolbar input:focus, .toolbar select:focus { border-color: #84a7ff; box-shadow: 0 0 0 3px rgba(47,107,255,.1); }
.form-error { min-height: 20px; color: var(--red); font-size: 12px; }
.login-tip { margin: 18px 0 0; color: var(--muted); text-align: center; font-size: 12px; }
.mobile-brand { display: none; }

.primary, .secondary, .icon-btn, .actions button, .actions a, .pagination button, .candidate button { border: 0; border-radius: 9px; padding: 9px 14px; text-decoration: none; transition: transform .15s, background .15s, opacity .15s; }
.primary { color: #fff; background: var(--blue); box-shadow: 0 6px 16px rgba(47,107,255,.2); }
.primary:hover { background: var(--blue-dark); }
.secondary { border: 1px solid var(--line); color: #4f5c72; background: #fff; }
.secondary:hover, .pagination button:hover:not(:disabled) { background: #f2f5fa; }
.full { width: 100%; min-height: 46px; }
button:active, .actions a:active { transform: translateY(1px); }
button:disabled { cursor: not-allowed; opacity: .42; }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; z-index: 30; inset: 0 auto 0 0; display: flex; width: 250px; flex-direction: column; color: #dce5f3; background: linear-gradient(180deg, var(--navy), #111c31); box-shadow: 12px 0 35px rgba(10,23,44,.08); }
.brand { display: flex; height: 84px; align-items: center; gap: 13px; padding: 0 22px; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand strong, .brand small { display: block; }
.brand small { margin-top: 3px; color: #8292ad; font-size: 11px; letter-spacing: .08em; }
.sidebar nav { flex: 1; overflow-y: auto; padding: 16px 12px; }
.sidebar nav p { margin: 21px 11px 7px; color: #6f809c; font-size: 10px; font-weight: 800; letter-spacing: .14em; }
.sidebar nav button { position: relative; display: flex; width: 100%; align-items: center; gap: 12px; margin: 3px 0; border: 0; border-radius: 10px; padding: 11px 12px; color: #aebbd0; background: transparent; text-align: left; }
.sidebar nav button:hover { color: #fff; background: rgba(255,255,255,.06); }
.sidebar nav button.active { color: #fff; background: linear-gradient(90deg, rgba(72,124,255,.34), rgba(72,124,255,.12)); }
.sidebar nav button.active::before { position: absolute; left: -12px; width: 3px; height: 22px; border-radius: 0 3px 3px 0; background: #6e9aff; content: ""; }
.sidebar nav button span { width: 21px; color: #8da7d3; font-size: 17px; text-align: center; }
.sidebar nav button em { display: inline-flex; min-width: 20px; height: 20px; align-items: center; justify-content: center; margin-left: auto; border-radius: 999px; color: #fff; background: #e65f5f; font-size: 10px; font-style: normal; }
.sidebar-foot { display: flex; align-items: center; gap: 10px; padding: 17px 16px; border-top: 1px solid rgba(255,255,255,.08); }
.sidebar-foot > span { display: inline-flex; width: 36px; height: 36px; align-items: center; justify-content: center; border-radius: 11px; background: #2e4770; font-weight: 800; }
.sidebar-foot div { min-width: 0; flex: 1; }
.sidebar-foot strong, .sidebar-foot small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-foot small { margin-top: 2px; color: #8292ad; font-size: 10px; }
.sidebar-foot button { border: 0; color: #92a1b9; background: transparent; font-size: 19px; }
.sidebar-mask { display: none; }

.main { min-height: 100vh; margin-left: 250px; }
.topbar { position: sticky; z-index: 20; top: 0; display: flex; height: 84px; align-items: center; justify-content: space-between; padding: 0 30px; border-bottom: 1px solid rgba(220,226,236,.85); background: rgba(255,255,255,.9); backdrop-filter: blur(16px); }
.topbar h1 { margin: 0; font-size: 24px; letter-spacing: -.02em; }
.top-actions { display: flex; align-items: center; gap: 15px; color: var(--muted); font-size: 12px; }
.icon-btn { display: inline-flex; width: 36px; height: 36px; align-items: center; justify-content: center; padding: 0; border: 1px solid var(--line); color: #566178; background: #fff; }
.menu-btn { display: none; }
.content { width: min(1500px, 100%); margin: 0 auto; padding: 27px 30px 55px; }
.loading, .empty { padding: 54px 20px; color: var(--muted); text-align: center; }

.metrics { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 15px; margin-bottom: 20px; }
.metric { border: 1px solid var(--line); border-radius: 15px; padding: 19px; background: var(--surface); box-shadow: 0 5px 18px rgba(23,42,72,.035); }
.metric header { display: flex; align-items: center; justify-content: space-between; }
.metric p { margin: 0; color: var(--muted); font-size: 12px; font-weight: 700; }
.metric strong { display: block; margin-top: 13px; font-size: 29px; letter-spacing: -.04em; }
.metric-icon { display: inline-flex; width: 36px; height: 36px; align-items: center; justify-content: center; border-radius: 11px; color: var(--blue); background: #eef4ff; }
.grid-2 { display: grid; grid-template-columns: minmax(0,1.15fr) minmax(320px,.85fr); gap: 20px; }
.panel, .table-panel { overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: #fff; box-shadow: 0 5px 18px rgba(23,42,72,.035); }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 22px; border-bottom: 1px solid #edf0f5; }
.panel-head h2 { margin: 0 0 4px; font-size: 16px; }
.panel-head p { margin: 0; color: var(--muted); font-size: 11px; }
.pipeline { padding: 19px 22px; }
.pipeline-row { display: grid; grid-template-columns: 100px 1fr 32px; align-items: center; gap: 12px; margin: 13px 0; color: #5f6980; font-size: 12px; }
.pipeline-row strong { color: var(--text); text-align: right; }
.pipeline-track { overflow: hidden; height: 7px; border-radius: 99px; background: #edf1f7; }
.pipeline-track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #4b7fff, #7da1ff); }
.activity-list { padding: 9px 22px; }
.activity { display: flex; gap: 13px; padding: 14px 0; border-bottom: 1px solid #f0f2f6; }
.activity:last-child { border-bottom: 0; }
.activity-dot { width: 8px; height: 8px; flex-shrink: 0; margin-top: 5px; border: 2px solid #b5c8ff; border-radius: 50%; background: var(--blue); }
.activity strong { font-size: 12px; }
.activity p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }

.notice { margin-bottom: 16px; padding: 14px 17px; border: 1px solid #dbe6ff; border-radius: 12px; color: #43608f; background: var(--notice); font-size: 13px; line-height: 1.65; }
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.toolbar .search { width: min(400px, 42vw); }
.toolbar select { width: 150px; }
.toolbar .primary { margin-left: auto; }
.table-scroll { overflow-x: auto; }
.data-table { width: 100%; min-width: 900px; border-collapse: collapse; font-size: 12px; }
.data-table th { padding: 12px 15px; color: #6f7a8e; background: #f8fafc; font-size: 10px; letter-spacing: .04em; text-align: left; white-space: nowrap; }
.data-table td { max-width: 300px; padding: 14px 15px; border-top: 1px solid #edf0f5; color: #4f5b70; vertical-align: middle; }
.data-table tbody tr:hover { background: #fbfcff; }
.cell-main, .cell-sub { display: block; }
.cell-main { color: var(--text); font-weight: 700; }
.cell-sub { overflow-wrap: anywhere; margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.tag { display: inline-flex; align-items: center; border-radius: 999px; padding: 4px 8px; color: #677185; background: #eef1f5; font-size: 10px; font-weight: 700; white-space: nowrap; }
.tag.green { color: var(--green); background: #e8f7f0; }
.tag.orange { color: var(--orange); background: #fff4df; }
.tag.red { color: var(--red); background: #ffeded; }
.tag.blue { color: #3166d8; background: #eaf1ff; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; min-width: 86px; }
.actions button, .actions a { border: 1px solid #dbe3f3; padding: 6px 9px; color: #315fae; background: #fff; font-size: 10px; white-space: nowrap; }
.actions button:hover, .actions a:hover { border-color: #aec5f5; background: #f2f6ff; }
.file-link { display: inline-block; margin-top: 6px; color: var(--blue); font-size: 11px; font-weight: 700; text-decoration: none; }
.file-link:hover { text-decoration: underline; }
.pagination { display: flex; align-items: center; justify-content: space-between; padding: 13px 15px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.pagination div { display: flex; gap: 7px; }
.pagination button { border: 1px solid var(--line); padding: 6px 10px; color: #536078; background: #fff; font-size: 11px; }
.candidate-list { display: grid; gap: 6px; min-width: 180px; max-height: 260px; overflow-y: auto; overscroll-behavior: contain; }
.candidate { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 8px; border-radius: 7px; background: #f7f9fd; font-size: 10px; }
.candidate-main { display: grid; gap: 2px; }
.candidate-main small { color: var(--muted); font-size: 10px; }
.candidate b { color: var(--blue); }
.candidate button { border: 1px solid #cbd8f7; padding: 4px 8px; color: var(--blue); background: white; font-size: 10px; }

.modal { position: fixed; z-index: 100; inset: 0; display: flex; align-items: center; justify-content: center; padding: 24px; background: rgba(10,20,37,.58); backdrop-filter: blur(3px); }
.modal-card { width: min(660px, 100%); max-height: calc(100vh - 48px); overflow-y: auto; border-radius: 18px; background: #fff; box-shadow: 0 30px 80px rgba(7,18,36,.28); }
.modal-card > header { position: sticky; z-index: 1; top: 0; display: flex; align-items: center; justify-content: space-between; padding: 19px 22px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.95); }
.modal-card h2 { margin: 0; font-size: 19px; }
.modal-card form { padding: 22px; }
.modal-card footer { display: flex; justify-content: flex-end; gap: 9px; margin-top: 22px; padding-top: 17px; border-top: 1px solid var(--line); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .wide { grid-column: 1 / -1; }
.form-grid textarea { min-height: 94px; resize: vertical; }
.form-grid input[type="file"] { min-width: 0; overflow: hidden; padding: 8px; }
.detail-card { margin-bottom: 18px; border: 1px solid var(--line); border-radius: 12px; padding: 15px; color: #59657a; background: #f8fafc; font-size: 13px; line-height: 1.65; }
.detail-card p { margin: 0; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; }
.detail-grid p { display: flex; flex-direction: column; gap: 2px; }
.detail-grid p.wide { grid-column: 1 / -1; }
.detail-grid span { color: var(--muted); font-size: 10px; }
.detail-grid strong { color: var(--text); font-size: 12px; }
.warning-text { color: var(--orange); }
.toast { position: fixed; z-index: 130; left: 50%; bottom: 34px; pointer-events: none; transform: translate(-50%, 18px); border-radius: 10px; padding: 11px 17px; color: #fff; background: rgba(21,31,49,.94); box-shadow: var(--shadow); font-size: 12px; opacity: 0; transition: .2s; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }

@media (max-width: 1100px) {
  .metrics { grid-template-columns: repeat(2,1fr); }
  .grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 800px) {
  :root { --canvas: #f5f7fb; }
  .login-shell { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .mobile-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 34px; }
  .login-card { padding: 30px; }
  .sidebar { width: min(86vw, 320px); padding-top: env(safe-area-inset-top); transform: translateX(-105%); box-shadow: 20px 0 50px rgba(8,20,40,.2); transition: transform .25s ease; }
  .sidebar.open { transform: none; }
  .brand { height: 72px; padding: 0 18px; }
  .sidebar nav { padding: 10px 12px 18px; }
  .sidebar nav p { margin-top: 17px; }
  .sidebar nav button { min-height: 48px; margin: 2px 0; border-radius: 13px; padding: 12px 13px; font-size: 14px; }
  .sidebar-foot { padding: 14px 16px calc(14px + env(safe-area-inset-bottom)); }
  .sidebar-mask { position: fixed; z-index: 29; inset: 0; display: block; pointer-events: none; background: rgba(9,17,31,.45); opacity: 0; transition: opacity .25s; }
  .sidebar-mask.show { pointer-events: auto; opacity: 1; }
  .main { margin: 0; }
  .menu-btn { display: inline-flex; width: 42px; height: 42px; flex: 0 0 42px; margin-right: 11px; border-radius: 13px; }
  .topbar { min-height: 66px; height: auto; justify-content: flex-start; padding: 10px 14px; }
  .topbar > div:nth-child(2) { flex: 1; }
  .topbar .eyebrow { display: none; }
  .topbar h1 { font-size: 18px; }
  .topbar .icon-btn { width: 42px; height: 42px; border-radius: 13px; }
  .top-actions #clock, .top-actions > .tag { display: none; }
  .content { padding: 14px 12px calc(34px + env(safe-area-inset-bottom)); }
  .loading, .empty { padding: 38px 14px; }
  .metrics { gap: 10px; margin-bottom: 14px; }
  .metric { min-height: 108px; border-radius: 18px; padding: 15px; box-shadow: 0 5px 16px rgba(23,42,72,.04); }
  .metric strong { margin-top: 12px; font-size: 25px; }
  .panel, .table-panel { border-radius: 18px; }
  .grid-2 { gap: 13px; }
  .notice { margin-bottom: 12px; border-radius: 15px; padding: 13px 14px; font-size: 12px; }
  .toolbar { align-items: stretch; flex-wrap: wrap; }
  .toolbar .search { width: 100%; flex-basis: 100%; }
  .toolbar input, .toolbar select { min-height: 48px; border-radius: 14px; padding-inline: 14px; }
  .toolbar select { min-width: 0; flex: 1; width: auto; }
  .toolbar > button { min-height: 48px; border-radius: 14px; padding-inline: 19px; }
  .toolbar .primary { width: 100%; margin-left: 0; }

  .table-panel { overflow: visible; border: 0; background: transparent; box-shadow: none; }
  .table-scroll { overflow: visible; }
  .data-table { display: block; min-width: 0; font-size: 13px; }
  .data-table thead { display: none; }
  .data-table tbody { display: grid; gap: 12px; }
  .data-table tbody tr { display: block; overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: 0 5px 16px rgba(23,42,72,.04); }
  .data-table tbody tr:hover { background: #fff; }
  .data-table td { display: grid; width: 100%; max-width: none; grid-template-columns: 88px minmax(0, 1fr); gap: 12px; align-items: start; padding: 11px 14px; border-top: 1px solid #f0f2f6; line-height: 1.55; }
  .data-table td:first-child { border-top: 0; padding-top: 15px; }
  .data-table td:last-child { padding-bottom: 15px; }
  .data-table td::before { color: #8a94a6; font-size: 11px; font-weight: 600; line-height: 1.75; content: attr(data-label); }
  .data-table .cell-sub { font-size: 11px; }
  .data-table td > .cell-sub, .data-table td > .file-link { grid-column: 2; }
  .data-table td > .tag { justify-self: start; }
  .data-table td[data-label="操作"] { display: block; padding-top: 13px; }
  .data-table td[data-label="操作"]::before { display: block; margin-bottom: 8px; content: attr(data-label); }
  .data-table td.empty-cell { display: block; padding: 0; border: 0; }
  .data-table td.empty-cell::before { display: none; }
  .actions { display: grid; min-width: 0; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); gap: 8px; }
  .actions button, .actions a { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; border-radius: 12px; padding: 9px 12px; font-size: 12px; }
  .candidate-list { min-width: 0; }
  .candidate { min-height: 38px; padding: 8px 10px; font-size: 11px; }
  .candidate button { min-height: 34px; border-radius: 10px; padding: 6px 11px; }
  .pagination { margin-top: 12px; border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; background: #fff; }
  .pagination button { min-height: 40px; border-radius: 11px; padding: 8px 13px; }

  .modal { align-items: flex-end; padding: 0; }
  .modal-card { width: 100%; max-height: 92dvh; border-radius: 22px 22px 0 0; padding-bottom: env(safe-area-inset-bottom); animation: sheet-in .2s ease-out; }
  .modal-card > header { padding: 17px 16px; }
  .modal-card > header::before { position: absolute; top: 7px; left: 50%; width: 38px; height: 4px; border-radius: 99px; background: #dfe4ec; content: ""; transform: translateX(-50%); }
  .modal-card h2 { font-size: 18px; }
  .modal-card form { padding: 16px; }
  .modal-card footer { position: sticky; bottom: calc(-16px - env(safe-area-inset-bottom)); margin: 20px -16px calc(-16px - env(safe-area-inset-bottom)); padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: rgba(255,255,255,.96); backdrop-filter: blur(12px); }
  .modal-card footer button { min-height: 46px; flex: 1; border-radius: 13px; }
  .form-grid, .detail-grid { grid-template-columns: 1fr; }
  .form-grid .wide, .detail-grid p.wide { grid-column: auto; }
  .form-grid input, .form-grid select { min-height: 48px; border-radius: 13px; }
  .form-grid textarea { min-height: 110px; border-radius: 13px; }
  .detail-card { border-radius: 15px; padding: 14px; }
  .toast { bottom: calc(22px + env(safe-area-inset-bottom)); max-width: calc(100% - 32px); text-align: center; }
}

@media (max-width: 470px) {
  .metrics { grid-template-columns: 1fr 1fr; }
  .metric p { font-size: 10px; }
  .metric-icon { width: 31px; height: 31px; }
  .panel-head { padding: 16px; }
  .pipeline { padding: 15px; }
  .pipeline-row { grid-template-columns: 86px 1fr 26px; }
  .login-card { width: calc(100% - 28px); }
  .pagination { align-items: center; gap: 10px; }
  .pagination > span { max-width: 130px; line-height: 1.5; }
}

@keyframes sheet-in { from { transform: translateY(24px); opacity: .7; } }
/* 分管理员授权表单：小程序 web-view 下也可滚动到提交区。 */
[hidden] { display: none !important; }
.member-search { margin-bottom: 20px; }
.member-result { display: flex; align-items: center; justify-content: space-between; gap: 16px; border-top: 1px solid #e5eaf1; padding: 16px 0; overflow-wrap: anywhere; }
.member-result p { margin: 6px 0; }
.permission-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 16px 0; }
.permission-groups fieldset { min-width: 0; border: 1px solid #dce3ee; border-radius: 10px; padding: 12px; }
.permission-groups legend { padding: 0 6px; font-weight: 600; }
.permission-option { display: flex; align-items: center; gap: 10px; padding: 10px 0; cursor: pointer; }
.permission-option input { width: 20px; height: 20px; flex: 0 0 20px; }
@media (max-width: 600px) { .permission-groups { grid-template-columns: 1fr; } .member-result { align-items: flex-start; flex-direction: column; } }
