:root {
  --ink: #1b2421;
  --muted: #5d6b66;
  --line: #d7ddd8;
  --paper: #f3f6f4;
  --card: #ffffff;
  --green: #0c6b4d;
  --green-dark: #084b36;
  --amber: #8a5a12;
  --danger: #8d2f2f;
  --ok: #0d6b3d;
  --shadow: 0 12px 30px rgba(20, 40, 32, 0.06);
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--green-dark); }
button, input, select { font: inherit; color: inherit; }
h1 { margin: 0; font-size: 28px; letter-spacing: -0.03em; }
h2 { margin: 28px 0 12px; font-size: 18px; }

.shell { display: flex; min-height: 100vh; }
.sider {
  width: 220px;
  flex: 0 0 220px;
  display: flex;
  flex-direction: column;
  padding: 18px 12px;
  background: #10241c;
  color: #f4f7f5;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 12px 18px;
  color: inherit;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
}
.brand .logo { width: 32px; height: 32px; flex: 0 0 32px; }
.brand span { font-size: 16px; line-height: 1.2; }
.sider nav { display: flex; flex-direction: column; gap: 4px; }
.sider nav a {
  color: inherit;
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 8px;
  opacity: 0.82;
}
.sider nav a.on, .sider nav a:hover { opacity: 1; background: rgba(255,255,255,.08); }
.sider nav a.on { font-weight: 700; }
.workspace { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 56px;
  padding: 0 24px;
  background: #fff;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
}
.topbar nav { display: flex; align-items: stretch; height: 100%; gap: 4px; }
.topbar nav a {
  display: flex;
  align-items: center;
  padding: 0 14px;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
}
.topbar nav a.on { color: var(--green-dark); font-weight: 700; border-bottom-color: var(--green); }
.who { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.who button, .filters button, .user-form button, .login-card button, .page-head .primary, .modal-head button {
  border: 0;
  border-radius: 8px;
  padding: 8px 14px;
  cursor: pointer;
}
.who button { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.primary { background: var(--green); color: white; }
.primary:hover { background: var(--green-dark); }

.wrap { width: min(1120px, calc(100% - 32px)); margin: 28px auto 48px; }
.page-head, .user-line { display: flex; justify-content: space-between; gap: 16px; align-items: end; }
a.back-btn {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 14px;
  background: white;
  text-decoration: none;
}
.eyebrow { margin: 0 0 6px; color: var(--green); font-size: 13px; letter-spacing: 0.08em; }
.scope, .count, .meta, .lead { color: var(--muted); }
.lead { line-height: 1.6; }

.filters, .user-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
  padding: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}
.filters label, .user-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.grow { grid-column: span 2; }
.filters input, .filters select, .user-form input, .user-form select, .login-card input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  background: #fff;
}
.user-form label.check,
.user-form .sites label {
  flex-direction: row;
  align-items: center;
  width: auto;
  white-space: nowrap;
  color: var(--ink);
}
.check input, .sites input { width: auto; }
.filters .primary, .user-form .primary { align-self: end; }

.table-wrap { overflow-x: auto; margin-top: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
th { font-size: 13px; color: var(--muted); font-weight: 600; background: #f7faf8; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.title { font-weight: 650; text-decoration: none; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 999px; background: #e7f3ee; color: var(--green-dark); font-size: 12px; white-space: nowrap; }
.tag-off { background: #fdecec; color: var(--danger); }
.tag-ok { background: #e8f6ee; color: var(--ok); }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 12px; word-break: break-all; }
.wx-facts { grid-column: 1 / -1; display: grid; grid-template-columns: 1.4fr 1fr; gap: 12px; }
.wx-facts div { background: #f7faf8; border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.wx-facts span { display: block; color: var(--muted); font-size: 12px; }
.wx-facts strong { display: block; margin-top: 6px; }
.pager { display: flex; gap: 16px; margin-top: 16px; }
.empty, .alert, .ok { padding: 12px 14px; border-radius: 10px; }
.empty { background: white; border: 1px dashed var(--line); }
.alert { background: #fdecec; color: var(--danger); }
.ok { background: #e8f6ee; color: var(--ok); }

.detail h1 { max-width: 40em; }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 20px 0; }
.facts div { background: white; border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.facts dt { color: var(--muted); font-size: 12px; }
.facts dd { margin: 6px 0 0; }
.intro, .tips, .body-text { line-height: 1.7; white-space: pre-wrap; }
.body-text { background: white; border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.tips { color: var(--amber); }
.back { margin-top: 0; }
.origin { font-weight: 650; }

.panel { margin-top: 18px; }
.panel h2 { margin-top: 0; }
.user-form { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.user-form fieldset, .user-line { grid-column: 1 / -1; }
fieldset { border: 1px solid var(--line); border-radius: 10px; }
.sites { display: flex; flex-wrap: wrap; gap: 8px 14px; }
.sites label { flex-direction: row; align-items: center; color: var(--ink); }

.login-stage {
  position: relative;
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(320px, 420px);
  align-items: center;
  gap: 64px;
  padding: 72px 8vw;
  overflow: hidden;
  color: #f4f7f5;
  background:
    radial-gradient(ellipse 70% 60% at 18% 40%, rgba(31, 143, 104, 0.38), transparent 60%),
    radial-gradient(ellipse 40% 50% at 78% 80%, rgba(8, 48, 34, 0.55), transparent 70%),
    linear-gradient(155deg, #06110d 0%, #0d241b 48%, #143528 100%);
}
.login-scene { position: absolute; inset: 0; pointer-events: none; }
.login-scene::before {
  content: "";
  position: absolute;
  inset: -30% 0;
  background-image:
    linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px);
  background-size: 80px 80px;
  mask-image: radial-gradient(circle at 28% 45%, #000 0%, transparent 68%);
  animation: grid-drift 32s linear infinite;
}
.orb { position: absolute; border-radius: 50%; filter: blur(8px); }
.orb-a { width: 280px; height: 280px; left: 8%; top: 18%; background: rgba(31,143,104,.28); animation: float-a 14s ease-in-out infinite; }
.orb-b { width: 180px; height: 180px; left: 42%; bottom: 12%; background: rgba(215,239,228,.12); animation: float-b 18s ease-in-out infinite; }
.login-hero { position: relative; z-index: 1; max-width: 760px; }
.login-hero .logo { width: 56px; height: 56px; }
.login-title {
  margin: 22px 0 16px;
  font-size: clamp(64px, 7.4vw, 112px);
  font-weight: 760;
  letter-spacing: 0.14em;
  line-height: 1;
}
.login-title span {
  display: inline-block;
  background: linear-gradient(110deg, #f7fbf8 0%, #f7fbf8 38%, #d9ffe8 50%, #f7fbf8 62%, #f7fbf8 100%);
  background-size: 240% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: title-rise 0.9s cubic-bezier(.16,1,.3,1) both, title-shine 5.6s ease-in-out calc(var(--i) * 0.12s + 0.7s) infinite;
  animation-delay: calc(var(--i) * 0.12s), calc(var(--i) * 0.12s + 0.7s);
}
.login-hero p { max-width: 34em; margin: 0; color: rgba(244,247,245,.72); font-size: 18px; line-height: 1.7; }
.login-card {
  position: relative;
  z-index: 1;
  width: 100%;
  background: rgba(255,255,255,.96);
  border: 1px solid rgba(255,255,255,.4);
  border-radius: 24px;
  padding: 40px 36px 36px;
  box-shadow: 0 30px 80px rgba(0,0,0,.28);
  color: var(--ink);
}
.login-card h2 { margin: 0 0 18px; font-size: 28px; letter-spacing: -0.03em; }
.login-card form { display: grid; gap: 16px; }
.login-card label { display: grid; gap: 8px; font-size: 13px; color: var(--muted); }
.login-card input { height: 46px; }
.login-card .primary { height: 48px; font-size: 16px; }
@keyframes grid-drift { from { transform: translateY(0); } to { transform: translateY(80px); } }
@keyframes float-a { 50% { transform: translate(24px, -18px); } }
@keyframes float-b { 50% { transform: translate(-20px, 16px); } }
@keyframes title-rise {
  from { opacity: 0; transform: translateY(36px); filter: blur(8px); }
  to { opacity: 1; transform: none; filter: none; }
}
@keyframes title-shine { from { background-position: 120% 0; } to { background-position: -120% 0; } }
@media (prefers-reduced-motion: reduce) {
  .login-scene::before, .orb, .login-title span { animation: none; }
  .login-title span { color: #f7fbf8; background: none; }
}

button.linkish { border: 0; background: none; padding: 0; color: var(--green-dark); cursor: pointer; font-weight: 650; }
.ops { white-space: nowrap; }
.ops .linkish, .ops a { margin-right: 10px; }
dialog.modal {
  width: min(640px, calc(100% - 32px));
  border: 0;
  border-radius: 16px;
  padding: 0;
  color: var(--ink);
  box-shadow: 0 24px 60px rgba(20, 40, 32, 0.2);
}
dialog.modal.wide { width: min(980px, calc(100% - 32px)); }
dialog.modal::backdrop { background: rgba(16, 36, 28, 0.45); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; }
.modal-head button { background: transparent; font-size: 22px; line-height: 1; padding: 0 4px; }
.modal-body { padding: 16px 18px 20px; max-height: min(70vh, 680px); overflow: auto; }
.modal .user-form, .modal .filters { margin-top: 0; padding: 0; border: 0; box-shadow: none; background: transparent; }
.modal .user-form { grid-template-columns: 1fr 1fr; }
.modal .filters { grid-template-columns: 1fr auto; align-items: end; }

.keyword-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.keyword-list form, .bind-code {
  display: inline-flex; align-items: center; gap: 8px;
  background: white; border: 1px solid var(--line); border-radius: 999px; padding: 6px 10px 6px 14px;
}
.keyword-list button, .m-bar button {
  border: 0; background: transparent; color: var(--danger); cursor: pointer; padding: 0;
}
.bind-code { font-size: 22px; font-weight: 700; letter-spacing: 0.04em; border-radius: 12px; }
textarea { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; font: inherit; }
.user-form .grow { grid-column: 1 / -1; }
code { background: #e7f3ee; padding: 2px 6px; border-radius: 6px; }

.m-bar {
  display: flex; align-items: center; gap: 16px;
  padding: 12px 16px; background: #10241c; color: #f4f7f5;
}
.m-bar a { color: inherit; text-decoration: none; font-weight: 650; }
.m-bar form { margin-left: auto; }
.m-wrap { margin-top: 0; }
.m-wrap h1 { font-size: 22px; margin-bottom: 12px; }
.m-list { display: grid; gap: 10px; }
.m-card {
  display: block; background: white; border: 1px solid var(--line); border-radius: 14px;
  padding: 14px; text-decoration: none; color: inherit;
}
.m-card.unread { border-color: #9dcdb8; }
.m-card strong { display: block; margin: 6px 0; line-height: 1.45; }
.m-card p, .m-meta { margin: 0; color: var(--muted); font-size: 13px; }
.m-meta { display: flex; justify-content: space-between; gap: 8px; }

@media (max-width: 800px) {
  .filters, .user-form, .facts, .wx-facts, .modal .user-form, .modal .filters { grid-template-columns: 1fr; }
  .grow, .user-form fieldset, .user-line, .wx-facts { grid-column: auto; }
  .shell { flex-direction: column; }
  .sider { width: auto; flex-basis: auto; flex-direction: row; align-items: center; gap: 8px; padding: 10px 12px; }
  .sider nav { flex-direction: row; overflow: auto; }
  .brand { padding: 8px 12px; }
  .topbar { height: auto; min-height: 48px; flex-wrap: wrap; padding: 8px 12px; }
  .page-head { flex-direction: column; align-items: start; }
  .login-stage { grid-template-columns: 1fr; gap: 28px; padding: 40px 20px 48px; }
  .login-title { font-size: 52px; letter-spacing: 0.08em; }
  .login-hero p { font-size: 15px; }
}
