﻿* { box-sizing: border-box; margin: 0; padding: 0; letter-spacing: 0; }

:root {
  --bg: #f3f9f8;
  --surface: rgba(255,255,255,.82);
  --surface-strong: rgba(255,255,255,.94);
  --surface-soft: rgba(241,248,249,.72);
  --line: rgba(72,94,108,.16);
  --line-strong: rgba(58,82,97,.3);
  --text: #162b34;
  --muted: #5e7480;
  --primary: #0b8f86;
  --primary-dark: #06706a;
  --primary-soft: #e3f4f2;
  --green: #16865a;
  --green-soft: #e3f5ec;
  --red: #b54555;
  --red-soft: #fbe8eb;
  --amber: #9a681d;
  --amber-soft: #fff1d7;
  --blue: #3569a8;
  --blue-soft: #e9f0fa;
  --shadow: 0 20px 50px rgba(36,70,78,.13);
  --shadow-small: 0 6px 20px rgba(36,70,78,.09);
  --radius: 12px;
}

html { min-width: 320px; background: var(--bg); }
body {
  min-height: 100vh;
  color: var(--text);
  background: var(--bg);
  font: 14px/1.55 -apple-system,BlinkMacSystemFont,"Segoe UI","Microsoft YaHei",sans-serif;
}
button,input,textarea,select { font: inherit; }
button { border: 0; }
a { color: inherit; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  padding: 11px clamp(18px,4vw,52px);
  background: rgba(249,252,252,.82);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px) saturate(125%);
  -webkit-backdrop-filter: blur(16px) saturate(125%);
}
.brand { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 800; white-space: nowrap; text-decoration: none; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: #fff;
  background: var(--primary);
  border-radius: 7px;
  box-shadow: 0 5px 12px rgba(8,126,139,.2);
  font-size: 16px;
}
.brand-copy small { display: block; color: var(--muted); font-size: 9px; font-weight: 600; text-transform: uppercase; }
.top-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 7px; }

main { width: min(1240px,100%); margin: 0 auto; padding: 22px clamp(16px,4vw,52px) 56px; }
.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 0 0 16px;
  padding: 2px 1px;
}
.eyebrow { margin-bottom: 2px; color: var(--primary); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.page-head h1 { font-size: 26px; line-height: 1.2; }
.page-head p { margin-top: 4px; color: var(--muted); font-size: 12px; }
.page-head-side { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; color: var(--muted); font-size: 12px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #22a06b; box-shadow: 0 0 0 3px rgba(34,160,107,.13); }

.card {
  margin-bottom: 14px;
  padding: 21px;
  background: var(--surface);
  border: 1px solid rgba(255,255,255,.85);
  border-radius: var(--radius);
  box-shadow: var(--shadow-small);
  backdrop-filter: blur(18px) saturate(130%);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
  transition: box-shadow .22s ease, transform .22s ease;
}
.card h2 { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; font-size: 16px; }
.card h2 small { color: var(--muted); font-size: 12px; font-weight: 600; }
.card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.card-header h2 { margin-bottom: 2px; }
.card-header p { color: var(--muted); font-size: 12px; }
.hint { margin-bottom: 11px; color: var(--muted); font-size: 12px; }
.hint code { padding: 2px 6px; color: var(--primary-dark); background: var(--primary-soft); border-radius: 4px; font: 11px Consolas,"Courier New",monospace; }

#statusBar { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 0; padding: 11px; }
.admin-status { grid-template-columns: repeat(8,minmax(0,1fr)) !important; }
.stat { min-width: 0; padding: 10px 8px; text-align: center; border-left: 1px solid var(--line); }
.stat:first-child { border-left: 0; }
.stat-num { display: block; color: #1c4a52; font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat-label { display: block; overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }

.gate-card { border-left: 3px solid var(--primary); }
.gate-content { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: end; gap: 14px; }
.gate-input-wrap label,.field label { display: block; margin-bottom: 5px; color: var(--muted); font-size: 12px; font-weight: 700; }
.gate-actions { display: flex; gap: 7px; }
.gate-status { display: flex; align-items: center; gap: 8px; min-height: 25px; margin-top: 9px; color: var(--muted); font-size: 12px; }
.gate-status.valid { color: var(--green); }
.gate-status.invalid { color: var(--red); }
.state-icon { display: grid; place-items: center; width: 19px; height: 19px; border-radius: 50%; color: #fff; background: #93a3ad; font-size: 10px; font-weight: 800; }
.gate-status.valid .state-icon { background: var(--green); }
.gate-status.invalid .state-icon { background: var(--red); }
.gate-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-top: 12px; color: var(--muted); font-size: 11px; }
.gate-foot .btn { margin-left: auto; }
.lock-icon { font-size: 14px; }

input[type=text],input[type=password],input[type=number],input[type=datetime-local],textarea,select {
  width: 100%;
  padding: 10px 12px;
  color: var(--text);
  background: var(--surface-strong);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  outline: none;
  transition: border .16s,box-shadow .16s,background .16s;
}
input::placeholder,textarea::placeholder { color: #93a2ab; }
input:focus,textarea:focus,select:focus { border-color: rgba(11,143,134,.65); background: #fff; box-shadow: 0 0 0 3px rgba(11,143,134,.1); }
textarea { min-height: 126px; resize: vertical; font: 13px/1.6 Consolas,"Courier New",monospace; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(225px,1fr)); gap: 14px; }
.form-grid label,.field { display: block; color: var(--muted); font-size: 12px; }
.form-grid input { margin-top: 5px; }
.account-card { position: relative; }
.account-card.is-locked { opacity: .67; }
.account-card.is-locked::after { content: "閰嶉宸茬敤灏?路 鍙噸鏂版巿鏉冨凡缁戝畾璐︽埛"; display: block; margin-top: 9px; color: #5e6d75; font-size: 11px; font-weight: 700; }
.row-end { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 37px;
  padding: 7px 14px;
  color: #fff;
  background: var(--primary);
  border: 1px solid transparent;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(11,143,134,.18);
  font-size: 13px;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
  transition: box-shadow .18s,background .18s,opacity .18s,transform .12s;
}
.btn:hover { background: var(--primary-dark); box-shadow: 0 6px 16px rgba(11,143,134,.26); transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; transform: none; }
.btn-outline { color: var(--primary-dark); background: rgba(255,255,255,.68); border-color: rgba(11,143,134,.32); box-shadow: none; }
.btn-outline:hover { color: #fff; background: var(--primary); box-shadow: none; }
.btn-ghost { color: var(--muted); background: transparent; border-color: transparent; box-shadow: none; }
.btn-ghost:hover { color: var(--text); background: rgba(230,238,241,.75); box-shadow: none; }
.btn-danger { color: var(--red); background: var(--red-soft); border-color: rgba(181,69,85,.18); box-shadow: none; }
.btn-danger:hover { color: #fff; background: var(--red); box-shadow: none; }
.btn-mini { min-height: 29px; padding: 4px 8px; border-radius: 6px; font-size: 11px; box-shadow: none; }
.btn-lg { min-height: 43px; padding-inline: 19px; }

.msg { min-height: 19px; margin-top: 9px; color: var(--muted); font-size: 12px; }
.msg.ok { color: var(--green); }
.msg.err { color: var(--red); }
.msg.warn { color: var(--amber); }
.notice { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; color: #526873; background: rgba(231,239,242,.72); border-radius: 6px; font-size: 12px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.55); }
table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
th { padding: 11px; color: var(--muted); background: rgba(239,245,246,.7); border-bottom: 1px solid var(--line); font-size: 11px; font-weight: 800; text-align: left; white-space: nowrap; }
td { padding: 10px 11px; border-bottom: 1px solid rgba(72,94,108,.12); vertical-align: middle; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background-color .16s ease; }
tbody tr:hover td { background: rgba(232,242,243,.66); }
.empty { padding: 30px 14px; color: var(--muted); text-align: center; }
.mono { font-family: Consolas,"Courier New",monospace; font-size: 11.5px; }
.secret { filter: blur(4px); cursor: pointer; transition: filter .2s; }
.secret:hover { filter: none; }

.tag { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 6px; font-size: 11px; font-weight: 800; white-space: nowrap; }
.tag-green { color: #126a49; background: var(--green-soft); }
.tag-red { color: #9e394a; background: var(--red-soft); }
.tag-blue { color: var(--blue); background: var(--blue-soft); }
.tag-yellow { color: #8a6110; background: #fdf1d8; }
.tag-gray,.tag-muted { color: #60717b; background: #e9eff1; }
.tag-amber { color: var(--amber); background: var(--amber-soft); }

.tabs { display: flex; gap: 4px; margin: 2px 0 14px; padding: 0 0 5px; overflow-x: auto; border-bottom: 1px solid var(--line); }
.tab { flex: 0 0 auto; padding: 8px 13px; color: var(--muted); background: transparent; border-radius: 5px; cursor: pointer; font-size: 12px; font-weight: 750; white-space: nowrap; transition: color .16s,background .16s; }
.tab:hover { color: var(--text); background: rgba(255,255,255,.55); }
.tab.active { color: var(--primary-dark); background: var(--primary-soft); box-shadow: inset 0 -2px 0 var(--primary); }
.hidden { display: none !important; }

.split-grid { display: grid; grid-template-columns: minmax(280px,.74fr) minmax(0,1.5fr); gap: 22px; }
.sub-card { min-width: 0; padding: 0; background: transparent; border: 0; border-radius: 0; }
.sub-card + .sub-card { padding-left: 22px; border-left: 1px solid var(--line); }
.sub-card h3 { margin-bottom: 2px; font-size: 14px; }
.sub-card p { margin-bottom: 12px; color: var(--muted); font-size: 12px; }
.cdk-result { margin-top: 13px; padding: 12px; background: var(--primary-soft); border: 1px solid rgba(8,126,139,.18); border-radius: 6px; }
.cdk-result code { display: block; margin: 5px 0 8px; color: var(--primary-dark); font: 700 14px Consolas,"Courier New",monospace; word-break: break-all; white-space: pre-wrap; }
.cdk-result-actions { display: flex; gap: 7px; }
.cdk-note-cell { width: clamp(150px,20vw,280px); max-width: 280px; white-space: normal; }
.cdk-note-text { display: block; overflow-wrap: anywhere; word-break: break-word; }

.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 18px; background: rgba(24,42,50,.32); backdrop-filter: blur(8px); }
.modal-box { display: flex; flex-direction: column; width: min(760px,100%); max-height: 82vh; overflow: hidden; background: rgba(252,254,254,.94); border: 1px solid rgba(255,255,255,.85); border-radius: 14px; box-shadow: var(--shadow); backdrop-filter: blur(24px) saturate(150%); animation: modal-in .24s cubic-bezier(.22,.68,.35,1) both; }
@keyframes modal-in { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: translateY(0) scale(1); } }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); font-weight: 800; }
.log-body { flex: 1; overflow: auto; padding: 16px 18px; color: #dce7ea; background: #203139; font: 12px/1.65 Consolas,"Courier New",monospace; white-space: pre-wrap; word-break: break-all; }
.history-list { overflow-y: auto; padding: 15px 18px; }
.history-subtitle { margin-top: 2px; color: var(--muted); font-size: 12px; font-weight: 400; }
.history-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.history-row:last-child { border-bottom: 0; }
.history-row strong { display: block; font-size: 12px; }
.history-row span { color: var(--muted); font-size: 11px; }

.login-body { display: grid; place-items: center; min-height: 100vh; padding: 20px; }
.login-shell { width: min(430px,100%); }
.login-card { padding: 32px; background: var(--surface); border: 1px solid rgba(255,255,255,.85); border-radius: 16px; box-shadow: var(--shadow); backdrop-filter: blur(24px) saturate(160%); }
.login-card .brand { justify-content: center; margin-bottom: 24px; }
.login-card h1 { margin-bottom: 6px; font-size: 24px; text-align: center; }
.login-card .login-subtitle { margin-bottom: 21px; color: var(--muted); font-size: 12px; text-align: center; }
.login-card input { margin-bottom: 4px; }
.login-card .btn { width: 100%; margin-top: 10px; }
.login-foot { margin-top: 17px; color: var(--muted); font-size: 11px; text-align: center; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.compact-grid { grid-template-columns: 1fr 1fr; }
.single-grid { grid-template-columns: 1fr; }
.spaced { margin-top: 13px; }
.full-width { width: 100%; }
.field-hint,.table-subtext { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
.table-actions { display: flex; align-items: center; gap: 5px; }
.history-main { min-width: 0; }
.history-main strong { overflow-wrap: anywhere; }
.history-main span { display: block; }
.history-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 7px; }
.compact-modal { max-width: 500px; }
.modal-form { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 21px; }
.modal-message { padding: 9px 18px 15px; margin: 0; }
#adminMsg:empty { display: none; }
#adminMsg { margin: 0 0 13px; padding: 9px 12px; background: rgba(255,255,255,.6); border-radius: 6px; }
button:focus-visible,a:focus-visible { outline: 3px solid rgba(11,143,134,.38); outline-offset: 2px; }

/* 閫氱敤寰姩鏁堬細鍛煎惛鎸囩ず鐐?/ 鍏ュ満 */
.live-dot { animation: live-pulse 2.2s ease-in-out infinite; }
@keyframes live-pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(34,160,107,.32); } 50% { box-shadow: 0 0 0 6px rgba(34,160,107,0); } }
@keyframes fade-up { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fade-down { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }

@media (prefers-reduced-motion:reduce) { *,*::before,*::after { transition: none !important; } }
@media (max-width:920px) {
  #statusBar,.admin-status { grid-template-columns: repeat(4,minmax(0,1fr)) !important; }
  .stat:nth-child(4n+1) { border-left: 0; }
  .split-grid { grid-template-columns: 1fr; }
  .sub-card + .sub-card { padding: 20px 0 0; border-top: 1px solid var(--line); border-left: 0; }
}
@media (max-width:640px) {
  .topbar { align-items: flex-start; flex-direction: column; padding: 10px 14px; }
  .top-actions { width: 100%; justify-content: flex-start; }
  main { padding: 17px 13px 42px; }
  .page-head { align-items: flex-start; flex-direction: column; gap: 7px; margin-bottom: 13px; }
  .page-head h1 { font-size: 23px; }
  #statusBar,.admin-status { grid-template-columns: repeat(2,minmax(0,1fr)) !important; }
  .stat { border-top: 1px solid var(--line); }
  .stat:nth-child(odd) { border-left: 0; }
  .stat:nth-child(-n+2) { border-top: 0; }
  .gate-content { grid-template-columns: 1fr; }
  .gate-actions .btn { flex: 1; }
  .account-card.is-locked::after { position: static; display: inline-block; margin: 2px 0 12px; }
  .card { padding: 17px; }
  .login-card { padding: 26px 20px; }
  .history-row { align-items: flex-start; flex-direction: column; gap: 9px; }
  .history-actions { justify-content: flex-start; }
  .gate-foot .btn { margin-left: 0; }
}
