:root {
  --ink: #17221b;
  --muted: #68736c;
  --line: #dfe5df;
  --paper: #ffffff;
  --canvas: #f3f6f2;
  --green: #245f42;
  --green-2: #3e8d61;
  --mint: #e3f0e7;
  --amber: #9a5b10;
  --amber-bg: #fff0d8;
  --red: #a33a34;
  --red-bg: #fde9e7;
  --shadow: 0 14px 40px rgba(24, 50, 35, .07);
  --radius: 18px;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--canvas); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% -10%, rgba(89, 150, 110, .12), transparent 28rem),
    radial-gradient(circle at 100% 0%, rgba(190, 170, 95, .09), transparent 30rem),
    var(--canvas);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", sans-serif;
  line-height: 1.55;
}
a { color: var(--green); text-decoration: none; }
a:hover { color: var(--green-2); }
button, input, textarea, select { font: inherit; }
code {
  font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  background: #edf2ee;
  border: 1px solid #dde5df;
  border-radius: 7px;
  padding: 2px 6px;
}

.shell { width: min(1220px, calc(100% - 40px)); margin: 0 auto; }
.topbar {
  min-height: 86px;
  display: flex;
  align-items: center;
  gap: 34px;
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand-mark {
  width: 40px; height: 40px; display: grid; place-items: center;
  border-radius: 12px; color: white; font-family: Georgia, serif; font-size: 24px;
  background: linear-gradient(145deg, #183f2c, #3b815a);
  box-shadow: 0 8px 18px rgba(27, 76, 50, .22);
}
.brand strong { display: block; font-size: 16px; letter-spacing: .03em; }
.brand small { display: block; color: var(--muted); font-size: 11px; margin-top: 1px; }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a {
  color: #59655d; padding: 8px 14px; border-radius: 9px; font-size: 14px;
}
.nav a:hover, .nav a.active { background: rgba(255,255,255,.8); color: var(--green); }
.logout-form { margin: 0; }
.text-button {
  border: 0; background: transparent; color: var(--muted); cursor: pointer;
  font-size: 12px; padding: 8px;
}

main { padding: 24px 0 70px; }
.eyebrow {
  color: var(--green-2); font-size: 11px; font-weight: 800;
  letter-spacing: .14em; text-transform: uppercase;
}
.page-heading {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 24px; margin: 20px 0 28px;
}
.page-heading.compact { align-items: flex-start; margin-top: 4px; }
.page-heading h1 {
  margin: 5px 0 6px; font-family: Georgia, "Songti SC", serif;
  font-size: clamp(30px, 4vw, 46px); font-weight: 500; line-height: 1.1;
}
.page-heading p, .panel p { color: var(--muted); margin: 0; }
.heading-line { display: flex; align-items: center; gap: 12px; }
.heading-actions, .form-actions { display: flex; gap: 10px; align-items: center; }
.heading-actions form, .form-actions form { margin: 0; }
.back-link { display: inline-block; font-size: 13px; margin-bottom: 12px; }

.button {
  border: 1px solid transparent; border-radius: 10px; padding: 10px 16px;
  min-height: 42px; display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; font-weight: 700; font-size: 13px; transition: .18s ease;
}
.button:hover { transform: translateY(-1px); }
.button.primary { background: var(--green); color: white; box-shadow: 0 7px 16px rgba(36,95,66,.18); }
.button.primary:hover { background: #1e5138; color: white; }
.button.ghost { background: rgba(255,255,255,.64); color: #465149; border-color: var(--line); }
.button.danger { background: var(--red); color: white; }
.button.wide { width: 100%; }
.button:disabled { opacity: .4; cursor: not-allowed; transform: none; }

.flash {
  border-radius: 12px; padding: 12px 15px; margin-bottom: 16px; font-size: 14px;
  border: 1px solid;
}
.flash.success { background: #e9f4ec; border-color: #c8e2d0; color: #20583b; }
.flash.error { background: var(--red-bg); border-color: #f1c8c4; color: var(--red); }
.system-ok {
  display: flex; align-items: center; gap: 9px; color: #456452;
  background: rgba(255,255,255,.62); border: 1px solid #dce7df;
  border-radius: 12px; padding: 10px 14px; font-size: 13px; margin-bottom: 20px;
}
.pulse {
  width: 8px; height: 8px; border-radius: 50%; background: #3b9b61;
  box-shadow: 0 0 0 5px rgba(59,155,97,.12);
}
.system-alert {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  background: var(--amber-bg); border: 1px solid #f0d5a8; color: var(--amber);
  padding: 13px 16px; border-radius: 13px; margin-bottom: 20px;
}
.system-alert strong, .system-alert span { display: block; }
.system-alert span { font-size: 12px; opacity: .8; }

.metric-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px;
}
.metric {
  background: rgba(255,255,255,.78); border: 1px solid rgba(218,225,219,.9);
  border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow);
}
.metric > span { color: var(--muted); font-size: 12px; }
.metric strong {
  display: block; font-family: Georgia, "Songti SC", serif; font-size: 38px;
  font-weight: 500; margin: 4px 0 0; line-height: 1.1;
}
.metric small { color: #849087; font-size: 11px; }
.metric.accent { background: linear-gradient(145deg, #244f38, #376f4e); border-color: #376f4e; color: white; }
.metric.accent span, .metric.accent small { color: #c6d9cb; }

.panel {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 22px; margin-bottom: 18px;
}
.panel-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 20px;
  margin-bottom: 18px;
}
.panel-head h2 { margin: 0 0 2px; font-size: 17px; }
.panel-head p { font-size: 12px; }
.panel-head > a { font-size: 12px; white-space: nowrap; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th {
  color: #7b857e; font-size: 11px; font-weight: 700; letter-spacing: .04em;
  text-align: left; border-bottom: 1px solid var(--line); padding: 10px 12px;
}
td { padding: 14px 12px; border-bottom: 1px solid #edf0ed; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fafcfa; }
.row-sub { display: block; color: #89938c; font-size: 11px; margin-top: 2px; }
.account-name { color: var(--ink); font-weight: 700; }
.actions { text-align: right; }
.actions a { font-size: 12px; }
.muted-text { color: #9ba49e; font-size: 12px; }
.detail-cell { max-width: 360px; color: #626d65; font-size: 12px; }
.table-foot { text-align: right; padding-top: 12px; color: #8b948e; font-size: 11px; }

.badge {
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
  border-radius: 999px; padding: 4px 9px; font-size: 11px; font-weight: 700;
}
.badge.ok { color: #246042; background: var(--mint); }
.badge.warn { color: var(--amber); background: var(--amber-bg); }
.badge.bad { color: var(--red); background: var(--red-bg); }
.badge.muted { color: #748078; background: #eef1ee; }

.empty-state { padding: 52px 20px; text-align: center; }
.empty-state.small { padding: 20px; }
.empty-icon {
  margin: 0 auto 14px; width: 58px; height: 58px; display: grid; place-items: center;
  border: 1px dashed #b8c8bd; border-radius: 50%; color: #668170;
  font-family: Georgia, serif; font-size: 28px;
}
.empty-state h3 { margin: 0 0 4px; }
.empty-state p { margin: 0 0 18px; color: var(--muted); font-size: 13px; }

.auth-wrap {
  min-height: calc(100vh - 150px); display: grid; grid-template-columns: minmax(360px, 480px) 1fr;
  gap: 64px; align-items: center; max-width: 980px; margin: 0 auto; padding: 50px 0;
}
.auth-card {
  background: white; border: 1px solid var(--line); border-radius: 24px;
  padding: 38px; box-shadow: 0 24px 60px rgba(24,50,35,.1);
}
.auth-card h1 { margin: 8px 0 5px; font: 500 36px Georgia, "Songti SC", serif; }
.sub { color: var(--muted); font-size: 13px; margin: 0 0 25px; }
.auth-note { padding: 30px; color: #dceade; }
.auth-note h2 { margin: 12px 0; color: white; font: 400 32px Georgia, "Songti SC", serif; }
.auth-note p { color: #b9cdbf; font-size: 14px; }
.auth-note.clean { color: var(--ink); background: rgba(255,255,255,.45); border-radius: 22px; }
.auth-note.clean h2 { color: var(--ink); }
.auth-note.clean p { color: var(--muted); }
.security-note {
  margin-top: 60px; padding: 18px; border: 1px solid rgba(255,255,255,.12);
  border-radius: 14px; background: rgba(255,255,255,.06); font-size: 12px; color: #bfd2c4;
}
.mini-orbit { height: 150px; position: relative; }
.mini-orbit i {
  position: absolute; border: 1px solid rgba(167,210,180,.35); border-radius: 50%;
  inset: 0 20%; animation: breathe 4s ease-in-out infinite;
}
.mini-orbit i:nth-child(2) { inset: 20% 5%; animation-delay: .5s; }
.mini-orbit i:nth-child(3) { inset: 40% -10%; animation-delay: 1s; }
@keyframes breathe { 50% { transform: scale(1.06); opacity: .55; } }
.check-list { list-style: none; padding: 0; margin: 24px 0 0; }
.check-list li { border-top: 1px solid #dce5de; padding: 10px 0; font-size: 13px; }
.check-list li::before { content: "✓"; color: var(--green-2); margin-right: 9px; font-weight: 900; }

.stack-form { display: grid; gap: 17px; }
.stack-form label, .form-grid label { display: grid; gap: 7px; font-size: 12px; font-weight: 700; }
.stack-form small, .form-grid small { color: var(--muted); font-weight: 400; }
input, textarea, select {
  width: 100%; border: 1px solid #d5ddd7; background: #fbfcfb;
  border-radius: 10px; padding: 10px 12px; color: var(--ink); outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, textarea:focus, select:focus {
  border-color: #6b9b7e; box-shadow: 0 0 0 3px rgba(70,132,92,.1); background: white;
}
textarea { resize: vertical; }

.account-layout { display: grid; gap: 16px; }
.form-panel { padding: 26px; }
.section-title { display: flex; align-items: flex-start; gap: 13px; margin-bottom: 23px; }
.section-title > span {
  flex: 0 0 34px; height: 34px; display: grid; place-items: center;
  border-radius: 9px; background: var(--mint); color: var(--green); font-size: 11px; font-weight: 900;
}
.section-title h2 { margin: 0 0 2px; font-size: 17px; }
.section-title p { font-size: 12px; }
.form-grid { display: grid; gap: 16px; }
.form-grid.two { grid-template-columns: repeat(2, 1fr); }
.form-grid.four { grid-template-columns: repeat(4, 1fr); }
.form-grid .wide { grid-column: 1 / -1; }
.inline-tip, .security-note {
  border-radius: 9px; padding: 10px 12px; font-size: 12px; margin-top: 14px;
}
.inline-tip { background: #f5f7f5; color: #6e786f; }
.days-field { border: 0; padding: 20px 0 5px; margin: 0; }
.days-field legend { font-size: 12px; font-weight: 700; margin-bottom: 9px; }
.day-options { display: flex; gap: 8px; flex-wrap: wrap; }
.day-options label { cursor: pointer; }
.day-options input { position: absolute; opacity: 0; pointer-events: none; }
.day-options span {
  display: block; min-width: 68px; text-align: center; padding: 8px 12px;
  border: 1px solid var(--line); border-radius: 9px; font-size: 12px; color: #647068;
}
.day-options input:checked + span { background: var(--green); border-color: var(--green); color: white; }
.switch-row { display: flex; align-items: center; gap: 12px; border-top: 1px solid #edf0ed; padding-top: 18px; font-size: 13px; cursor: pointer; }
.switch-row input { position: absolute; opacity: 0; }
.switch { width: 42px; height: 24px; border-radius: 99px; background: #cfd7d1; position: relative; flex: 0 0 auto; transition: .2s; }
.switch::after { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; border-radius: 50%; background: white; transition: .2s; }
.switch-row input:checked + .switch { background: var(--green-2); }
.switch-row input:checked + .switch::after { transform: translateX(18px); }
.switch-row strong, .switch-row small { display: block; }
.switch-row small { color: var(--muted); font-weight: 400; }
.form-actions { justify-content: flex-end; margin-top: 2px; }

.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.state-box { border-radius: 12px; padding: 16px; margin-bottom: 16px; }
.state-box strong, .state-box span { display: block; }
.state-box span { font-size: 12px; margin-top: 3px; }
.state-box.good { background: #edf6f0; color: #2a653f; }
.state-box.warn { background: var(--amber-bg); color: var(--amber); }
.upload-form { display: grid; gap: 10px; }
.upload-form { margin-top: 12px; }
.file-drop {
  border: 1px dashed #b6c7bb; border-radius: 12px; padding: 16px; cursor: pointer;
  background: #fafcfa; color: #4d5c51; font-size: 13px;
}
.file-drop input { padding: 0; border: 0; background: transparent; font-size: 12px; margin-bottom: 7px; }
.file-drop span, .file-drop small { display: block; }
.file-drop small { color: var(--muted); margin-top: 2px; }
.manual-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.manual-actions form { margin: 0; }
.action-tile {
  width: 100%; border: 1px solid var(--line); border-radius: 13px; background: #fbfcfb;
  color: var(--ink); padding: 15px; text-align: left; cursor: pointer;
}
.action-tile:hover { border-color: #87ad94; background: #f5faf6; }
.action-tile:disabled { opacity: .45; cursor: not-allowed; }
.action-tile strong, .action-tile small { display: block; }
.action-tile small { color: var(--muted); font-size: 11px; margin-top: 2px; }
.action-icon { color: var(--green-2); font-size: 19px; }
.schedule-strip {
  display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line);
  margin-top: 18px; padding-top: 16px; gap: 8px;
}
.schedule-strip span, .schedule-strip strong { display: block; }
.schedule-strip span { color: var(--muted); font-size: 10px; }
.schedule-strip strong { font-size: 12px; margin-top: 2px; }
.help-panel { background: linear-gradient(140deg, #f9fbf9, #eef6ef); }
.help-panel h2 { margin: 4px 0; }
.command-box { margin: 18px 0; background: #1d2b22; border-radius: 12px; padding: 15px; overflow-x: auto; }
.command-box code { display: block; background: transparent; border: 0; color: #d9f0df; padding: 0; white-space: nowrap; }
.help-steps { display: flex; gap: 22px; flex-wrap: wrap; color: #56645a; font-size: 12px; }
.help-steps b { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--green); color: white; margin-right: 5px; font-size: 10px; }
.login-flow { max-width: 620px; margin: 0 auto; }
.login-steps {
  display: flex; align-items: center; gap: 10px; margin-bottom: 26px;
  color: #8a948e; font-size: 11px;
}
.login-steps span { white-space: nowrap; }
.login-steps span.active, .login-steps span.done { color: var(--green); font-weight: 700; }
.login-steps b {
  display: inline-grid; place-items: center; width: 21px; height: 21px;
  border-radius: 50%; background: #edf1ee; margin-right: 4px;
}
.login-steps span.active b { background: var(--green); color: white; }
.login-steps span.done b { background: var(--mint); color: var(--green); }
.login-steps i { height: 1px; background: var(--line); flex: 1; }
.phone-input { display: flex; align-items: center; border: 1px solid #d5ddd7; border-radius: 10px; background: #fbfcfb; overflow: hidden; }
.phone-input b { padding: 0 13px; border-right: 1px solid var(--line); color: #5e6a62; font-size: 13px; }
.phone-input input { border: 0; border-radius: 0; box-shadow: none; }
.centered-form { text-align: center; margin: 5px 0 0; }
.captcha-image { position: relative; max-width: 390px; margin: 0 auto 8px; border-radius: 12px; overflow: hidden; cursor: crosshair; }
.captcha-image img { display: block; width: 100%; height: auto; }
.live-captcha { touch-action: none; user-select: none; cursor: grab; }
.live-captcha:active { cursor: grabbing; }
.captcha-marker {
  display: none; position: absolute; top: 0; bottom: 0; width: 3px;
  background: #ff6b35; box-shadow: 0 0 0 2px rgba(255,255,255,.8);
  transform: translateX(-50%);
}
.captcha-hint { text-align: center; color: var(--muted); font-size: 12px; margin: 0 0 14px; }
.wechat-login { max-width: 420px; margin: 0 auto; }
.qr-frame {
  width: min(300px, 100%); margin: 12px auto 8px; padding: 12px;
  border: 1px solid var(--line); border-radius: 14px; background: white;
  box-shadow: 0 8px 24px rgba(24,50,35,.08);
}
.qr-frame img { display: block; width: 100%; height: auto; }
.wechat-benefit {
  display: grid; text-align: center; gap: 4px; padding: 22px;
  background: linear-gradient(145deg, #eef7f0, #fbfcf8);
  border: 1px solid #d9e8dd; border-radius: 14px;
}
.wechat-benefit span { color: var(--green-2); font-size: 11px; font-weight: 800; letter-spacing: .08em; }
.wechat-benefit strong { font: 500 24px Georgia, "Songti SC", serif; }
.wechat-benefit small { color: var(--muted); }
.wechat-benefit.compact { padding: 12px; }
.wechat-benefit.compact strong { font-size: 17px; }
.sms-fallback { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 14px; }
.sms-fallback summary { cursor: pointer; color: var(--muted); font-size: 12px; }
.sms-fallback .stack-form { margin-top: 14px; }
.button.is-loading { opacity: .72; pointer-events: none; }
.generate-hint { display: block; text-align: center; color: var(--muted); font-size: 11px; }
.danger-zone {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  border: 1px solid #efd5d2; background: rgba(253,248,247,.8); border-radius: 14px;
  padding: 15px 18px;
}
.danger-zone strong, .danger-zone span { display: block; }
.danger-zone span { color: var(--muted); font-size: 11px; }
.danger-zone form { display: flex; gap: 8px; }
.danger-zone input { width: 130px; }
.filter-bar {
  display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap;
  background: white; border: 1px solid var(--line); border-radius: 14px;
  padding: 14px; margin-bottom: 18px;
}
.filter-bar label { display: grid; gap: 4px; min-width: 150px; font-size: 11px; color: var(--muted); }
.filter-bar select { padding: 8px 10px; }
.filter-bar .button { min-height: 39px; }
.filter-reset { padding: 8px; font-size: 12px; }
.narrow { max-width: 680px; margin: 0 auto; }

footer {
  display: flex; justify-content: space-between; border-top: 1px solid #dbe2dc;
  padding: 20px 0 35px; color: #8a948d; font-size: 11px;
}

@media (max-width: 860px) {
  .shell { width: min(100% - 24px, 760px); }
  .topbar { flex-wrap: wrap; gap: 10px; padding-top: 14px; }
  .nav { order: 3; width: 100%; overflow-x: auto; margin-left: 0; }
  .logout-form { margin-left: auto; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .detail-grid, .auth-wrap { grid-template-columns: 1fr; }
  .auth-wrap { gap: 18px; }
  .auth-note { order: -1; background: #244f38; border-radius: 18px; }
  .mini-orbit { display: none; }
  .security-note { margin-top: 18px; }
  .form-grid.four { grid-template-columns: repeat(2, 1fr); }
  .danger-zone { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 560px) {
  .shell { width: calc(100% - 18px); }
  .brand small { display: none; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .page-heading h1 { font-size: 33px; }
  .metric { padding: 15px; }
  .metric strong { font-size: 31px; }
  .panel { padding: 16px; }
  .table-wrap table { min-width: 720px; }
  .form-grid.two, .form-grid.four { grid-template-columns: 1fr; }
  .form-grid .wide { grid-column: auto; }
  .auth-card { padding: 24px; }
  .manual-actions { grid-template-columns: 1fr; }
  .schedule-strip { grid-template-columns: repeat(2, 1fr); row-gap: 12px; }
  .heading-actions { flex-wrap: wrap; }
  .danger-zone form { flex-wrap: wrap; }
  footer { gap: 8px; flex-direction: column; }
}
