* { box-sizing: border-box; }
:root {
  --ink: #172033;
  --muted: #667085;
  --line: #e6e8ee;
  --bg: #f4f6f8;
  --card: #fff;
  --brand: #1f4fd8;
  --brand-2: #163aa8;
  --ok: #0f7a45;
  --ok-bg: #e8f6ee;
  --err: #c2410c;
  --err-bg: #fff1f0;
}
body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
}
a { color: var(--brand); text-decoration: none; }
h1 { font-size: 26px; line-height: 1.25; margin: 0; letter-spacing: -0.03em; }
h2 { font-size: 16px; margin: 0; }
button, input, select, textarea { font-family: inherit; font-size: 14px; }
.app { display: flex; min-height: 100vh; }
aside {
  width: 232px;
  flex-shrink: 0;
  background: #121826;
  color: #fff;
  padding: 22px 14px 16px;
  display: flex;
  flex-direction: column;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; padding: 2px 10px 22px; }
.mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--brand);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}
aside nav { display: flex; flex-direction: column; gap: 4px; }
aside nav a,
aside button.link {
  display: block;
  width: 100%;
  text-align: left;
  color: #c5cdd8;
  background: transparent;
  border: 0;
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
}
aside nav a.on { background: #1d2636; color: #fff; }
aside nav a:hover,
aside button.link:hover { background: #1a2230; color: #fff; }
.aside-foot { margin-top: auto; padding: 16px 8px 0; border-top: 1px solid rgba(255,255,255,0.08); }
.who { color: #9aa6b6; font-size: 12px; padding: 0 4px 8px; }
main { flex: 1; padding: 28px 32px 48px; min-width: 0; }
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 18px;
}
.eyebrow {
  margin: 0 0 6px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.sub { margin: 8px 0 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.meta { color: var(--muted); font-size: 13px; }
.hint { color: var(--muted); font-size: 12px; margin-top: 4px; }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px 18px 16px;
}
.card span { color: var(--muted); font-size: 13px; }
.card b { display: block; margin-top: 8px; font-size: 30px; letter-spacing: -0.04em; }
.note, .block, .linkbar, .site-card, .table-wrap, .empty-block {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.note { padding: 16px 18px; margin-bottom: 16px; }
.note p { margin: 0 0 8px; }
pre {
  margin: 0 0 10px;
  background: #121826;
  color: #e8eef8;
  padding: 12px 14px;
  border-radius: 10px;
  overflow: auto;
  font-size: 13px;
}
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid #eef0f4; vertical-align: middle; }
th { color: var(--muted); font-weight: 600; background: #fafbfc; font-size: 12px; }
td.empty, .empty-block { text-align: center; color: #98a2b3; padding: 28px; }
.mono, code { font-family: Consolas, "Courier New", monospace; }
.url, .site-link code, .linkbar code { word-break: break-all; color: #475467; font-size: 12px; }
.flash { padding: 11px 14px; border-radius: 12px; margin-bottom: 14px; }
.flash.ok { background: var(--ok-bg); color: var(--ok); }
.flash.err { background: var(--err-bg); color: var(--err); }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 14px;
  border-radius: 10px;
  border: 0;
  background: var(--brand);
  color: #fff;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { background: var(--brand-2); }
.btn.ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn.ghost:hover { background: #f8fafc; }
.btn.danger { background: #fff; color: var(--err); border: 1px solid #ffd0c8; }
.btn.tiny { height: 30px; padding: 0 10px; font-size: 12px; }
.form-actions { margin-top: 8px; }
.form-actions .btn, .actions .btn, .actions form, .site-actions .btn, .site-actions form { margin-right: 8px; }
.actions form, .inline, .link-actions form, .site-actions form { display: inline; }
button.tag { border: 0; cursor: pointer; font: inherit; }
.tag {
  display: inline-block;
  min-width: 52px;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 12px;
  line-height: 20px;
}
.tag.on { background: var(--ok-bg); color: var(--ok); }
.tag.off { background: #f2f4f7; color: #667085; }
.form label { display: block; margin: 0 0 14px; }
.form .lbl { display: block; margin-bottom: 6px; color: #344054; font-weight: 600; }
.form input[type="text"],
.form input[type="password"],
.form input[type="number"],
.form input[type="url"],
.form select,
.form textarea {
  width: 100%;
  max-width: 520px;
  height: 42px;
  border: 1px solid #d5d9e2;
  border-radius: 10px;
  padding: 0 12px;
  background: #fff;
}
.form.narrow { max-width: 560px; }
.form textarea { height: 88px; padding: 8px 12px; }
.form input[type="file"] { height: auto; padding: 8px 0; border: 0; background: transparent; }
.cover-preview { width: 180px; max-width: 100%; border-radius: 12px; display: block; margin: 8px 0; border: 1px solid var(--line); }
.check { display: flex; align-items: flex-start; max-width: 640px; line-height: 1.5; }
.check input { margin: 3px 8px 0 0; }
.pager { margin-top: 16px; }
.pager a {
  display: inline-block;
  margin-right: 6px;
  padding: 6px 10px;
  background: #fff;
  border-radius: 8px;
  border: 1px solid var(--line);
}
.pager a.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.site-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.site-card { padding: 16px; }
.site-card h2 { font-size: 18px; letter-spacing: -0.02em; }
.site-card-top, .site-actions, .linkbar, .switch-row, .link-item { display: flex; justify-content: space-between; gap: 12px; }
.site-card-top { align-items: flex-start; }
.site-link, .linkbar {
  margin-top: 12px;
  padding: 10px 12px;
  background: #f7f8fb;
  border-radius: 12px;
}
.linkbar { align-items: center; margin-bottom: 16px; }
.site-link span, .linkbar .eyebrow { display: block; }
.site-meta { display: flex; gap: 12px; margin: 12px 0; color: var(--muted); font-size: 12px; }
.site-actions { align-items: center; flex-wrap: wrap; }
.block { padding: 18px; margin-bottom: 14px; }
.block-head { margin-bottom: 14px; }
.block-head p { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.switch-row {
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid #f0f2f6;
}
.switch-row b { display: block; }
.switch-row span { color: var(--muted); font-size: 12px; }
.switch {
  min-width: 64px;
  height: 32px;
  border: 0;
  border-radius: 99px;
  background: #d9dee7;
  color: #fff;
  cursor: pointer;
}
.switch.on { background: var(--ok); }
.link-add { display: grid; grid-template-columns: 180px 1fr auto; gap: 12px; align-items: end; }
.link-add label { margin: 0; }
.link-add .btn { margin-bottom: 14px; }
.link-list { display: flex; flex-direction: column; gap: 10px; }
.link-item { align-items: center; padding: 10px 0; border-top: 1px solid #f0f2f6; }
.link-qr svg { width: 72px; height: 72px; display: block; background: #fff; }
.link-qr span { display: flex; width: 72px; height: 72px; align-items: center; color: var(--err); font-size: 12px; }
.link-body { flex: 1; min-width: 0; }
.link-body b { display: block; }
.link-body p { margin: 4px 0; color: #475467; font-size: 12px; word-break: break-all; }
.link-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.auth-body { margin: 0; min-height: 100vh; background: #f4f6f8; }
.auth-split { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-side {
  background: #121826;
  color: #fff;
  padding: 48px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.auth-side h2 { font-size: 32px; letter-spacing: -0.04em; margin: 12px 0; }
.auth-side p { margin: 0; max-width: 420px; color: #c5cdd8; line-height: 1.7; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 32px; }
.auth-card { width: 420px; max-width: 100%; }
@media (max-width: 900px) {
  .app { display: block; }
  aside { width: auto; }
  .aside-foot { margin-top: 12px; }
  aside nav { flex-direction: row; flex-wrap: wrap; }
  main { padding: 18px; }
  .cards, .auth-split, .link-add { display: block; }
  .auth-side { display: none; }
  .page-head, .linkbar, .link-item, .site-card-top { display: block; }
  .link-add .btn { margin: 0 0 8px; }
  .link-actions { align-items: flex-start; margin-top: 8px; }
}
@media print {
  aside, .page-head .btn, .flash, .link-add, .link-actions { display: none !important; }
  .app { display: block; }
  main { padding: 0; }
  .link-item { break-inside: avoid; }
}
