/* 数据备份 · 导出与恢复 */
:root {
  --paper: #f5f4ee;
  --surface: #fffdf8;
  --ink: #1b211d;
  --muted: #6d746c;
  --line: #e0dfd4;
  --line-soft: #eceae1;
  --accent: #2f5d8a;
  --accent-soft: #e6edf4;
  --gold: #b5842f;
  --red: #a33a2c;
  --green: #4a7a54;
  --serif: "Noto Serif SC", "Songti SC", "STSong", serif;
  --sans: "Noto Sans SC", -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --max: 1000px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #161916;
    --surface: #1d211d;
    --ink: #e9e8e1;
    --muted: #9aa197;
    --line: #2e332e;
    --line-soft: #262b26;
    --accent: #8fb4d6;
    --accent-soft: #22303b;
    --gold: #d2a453;
    --red: #d98a7c;
    --green: #8fbd97;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px 72px; }
.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;
}

/* 顶栏 */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 16px; padding: 18px 0 14px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  font-size: 13px;
}
.brand {
  font-family: var(--serif); font-weight: 700;
  letter-spacing: .08em; white-space: nowrap;
}
.brand::before {
  content: ""; display: inline-block;
  width: 6px; height: 6px; margin-right: 7px;
  border-radius: 50%; background: var(--gold); vertical-align: 2px;
}
.topbar nav { display: flex; gap: 18px; color: var(--muted); flex-wrap: wrap; }
.topbar nav a { white-space: nowrap; }
.topbar nav a:hover { color: var(--ink); }
.topbar nav a.on { color: var(--ink); border-bottom: 1px solid var(--gold); }
/* 站名右边的 GitHub 入口 */
.topbar .ghbtn {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  gap: 5px; height: 24px; padding: 0 9px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--muted);
  font-size: 11px; line-height: 1; letter-spacing: .02em; white-space: nowrap;
  margin-left: -5px; margin-right: auto; align-self: center;
  transition: color .15s, border-color .15s;
}
.topbar .ghbtn svg { width: 13px; height: 13px; display: block; }
.topbar .ghbtn:hover { color: var(--ink); border-color: var(--ink); }
@media (max-width: 620px) {
  .topbar .ghbtn { width: 24px; padding: 0; gap: 0; }
  .topbar .ghbtn span { display: none; }
}

/* 刊头 */
.masthead { display: flex; align-items: center; gap: 22px; padding: 54px 0 36px; }
.seal {
  flex: none; width: 62px; height: 62px;
  display: grid; place-items: center;
  border: 2px solid var(--red); border-radius: 10px;
  color: var(--red);
  font-family: var(--serif); font-size: 30px; font-weight: 700; line-height: 1;
  box-shadow: inset 0 0 0 3px var(--paper), inset 0 0 0 4px var(--red);
  opacity: .9;
}
.kicker {
  margin: 0 0 6px;
  font-family: var(--mono); font-size: 11.5px;
  letter-spacing: .16em; color: var(--muted); text-transform: uppercase;
}
h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(30px, 5vw, 44px);
  font-weight: 700; letter-spacing: .04em; line-height: 1.2;
}
.sub { margin: 10px 0 0; color: var(--muted); font-size: 14.5px; max-width: 62ch; }

/* 板块切换：数据备份 / macOS 桌面版 */
.tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding-bottom: 14px;
  margin-bottom: 26px;
  border-bottom: 1px solid var(--line);
}
.tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
  -webkit-tap-highlight-color: transparent;
}
.tab:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tab.on {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}
@media (prefers-color-scheme: dark) {
  .tab.on { color: var(--paper); }
}
.tabs-link {
  margin-left: auto;
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
}
.tabs-link:hover { color: var(--accent); }

.pane[hidden] { display: none !important; }

/* 备份面板 */
.board {
  margin-bottom: 46px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 22px 24px 20px;
}
.board-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
  border-radius: 3px;
  overflow: hidden;
}
.bs {
  display: flex; flex-direction: column; gap: 2px;
  padding: 12px 14px;
  background: var(--surface);
}
.bs span {
  font-size: 11.5px; color: var(--muted);
  letter-spacing: .04em;
}
.bs b {
  font-family: var(--mono); font-size: 19px; font-weight: 600;
  letter-spacing: -.01em; font-variant-numeric: tabular-nums;
}
.bs b.dim { color: var(--muted); font-weight: 500; }

.board-actions {
  display: grid;
  grid-template-columns: 1.15fr 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}
.act {
  display: flex; flex-direction: column; gap: 3px;
  padding: 13px 16px 12px;
  text-align: left;
  font-family: inherit;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--ink);
  cursor: pointer;
  transition: border-color .16s, background .16s, transform .16s, box-shadow .16s;
}
.act:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.act:active:not(:disabled) { transform: translateY(1px); }
.act:disabled { cursor: not-allowed; opacity: .55; }
.act-primary:disabled {
  background: var(--line-soft);
  border-color: var(--line);
  color: var(--muted);
  opacity: 1;
}
.act-primary:disabled .act-d { color: var(--muted); }
.act-t { font-size: 14.5px; font-weight: 600; letter-spacing: .02em; }
.act-d { font-size: 12px; color: var(--muted); line-height: 1.5; }
.act-primary {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}
.act-primary .act-d { color: rgba(255, 255, 255, .62); }
.act-primary:hover:not(:disabled) {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
@media (prefers-color-scheme: dark) {
  .act-primary { background: var(--accent-soft); border-color: var(--accent); color: var(--ink); }
  .act-primary .act-d { color: var(--muted); }
  .act-primary:hover:not(:disabled) { background: var(--accent); color: var(--paper); }
}
.act-ghost { background: transparent; border-style: dashed; }

.board-foot {
  display: flex; flex-wrap: wrap; align-items: center;
  justify-content: space-between; gap: 8px 20px;
  margin-top: 14px; padding-top: 12px;
  border-top: 1px solid var(--line-soft);
}
.chk {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12.5px; color: var(--muted); cursor: pointer;
}
.chk input { width: 14px; height: 14px; accent-color: var(--accent); margin: 0; }
.chk:hover { color: var(--ink); }
.board-hint { margin: 0; font-size: 12px; color: var(--muted); }

/* 板块标题 */
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 16px; margin-bottom: 14px; padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.section-head h2 {
  margin: 0; font-family: var(--serif);
  font-size: 19px; letter-spacing: .06em;
}
.sh-note { font-size: 12.5px; color: var(--muted); }

/* 板块行 */
.sec-list { display: flex; flex-direction: column; gap: 0; }
.sec-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 84px 78px auto;
  align-items: center;
  gap: 16px;
  padding: 14px 2px;
  border-bottom: 1px solid var(--line-soft);
}
.sec-row:first-child { border-top: 1px solid var(--line-soft); }
.sec-row.hit {
  background: var(--accent-soft);
  box-shadow: -10px 0 0 var(--accent-soft), 10px 0 0 var(--accent-soft);
  transition: background .4s;
}
.sec-row.empty .sec-code { color: var(--muted); opacity: .5; }
.sec-row.empty .sec-num b { color: var(--muted); font-weight: 500; }
.sec-code {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--paper);
  color: var(--accent);
  font-family: var(--serif);
  font-size: 17px; font-weight: 700;
  line-height: 1;
}
.sec-main { min-width: 0; }
.sec-main h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 15.5px; font-weight: 700; letter-spacing: .03em;
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
}
.sec-main h3 a:hover { color: var(--accent); }
.sec-main p {
  margin: 2px 0 0;
  font-size: 12.5px; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sec-num { text-align: right; }
.sec-num b {
  font-family: var(--mono); font-size: 15px; font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.sec-num span { font-size: 11px; color: var(--muted); margin-left: 3px; }
.sec-size {
  font-family: var(--mono); font-size: 12px; color: var(--muted);
  text-align: right; font-variant-numeric: tabular-nums;
}
.sec-acts { display: flex; gap: 6px; justify-content: flex-end; }
.sec-acts button {
  font-family: var(--mono);
  font-size: 11.5px; letter-spacing: .03em;
  padding: 5px 10px;
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 3px;
  cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
  white-space: nowrap;
}
.sec-acts button:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}
.sec-acts button:disabled { opacity: .35; cursor: not-allowed; }

/* 说明 */
.notes {
  margin-top: 46px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.notes h2 {
  margin: 0 0 10px;
  font-family: var(--serif); font-size: 15px; letter-spacing: .06em;
}
.notes ul {
  margin: 0; padding: 0; list-style: none;
  display: flex; flex-direction: column; gap: 7px;
  font-size: 13px; color: var(--muted); line-height: 1.72;
}
.notes li { padding-left: 14px; position: relative; }
.notes li::before {
  content: ""; position: absolute; left: 3px; top: .76em;
  width: 3.5px; height: 3.5px; border-radius: 50%;
  background: var(--muted); opacity: .72;
}
.notes b { color: var(--ink); font-weight: 600; }

/* ---------- macOS 桌面版 ---------- */
.appcard {
  display: flex;
  align-items: center;
  gap: 30px;
  padding: 4px 0 30px;
  border-bottom: 1px solid var(--line);
}
.appicon {
  width: 112px;
  height: 112px;
  flex: none;
  display: block;
  filter: drop-shadow(0 14px 26px rgba(13, 42, 74, .22));
}
.apptxt { min-width: 0; }
.apptxt .kicker { color: var(--gold); }
.apptxt h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(26px, 4vw, 34px);
  font-weight: 700;
  letter-spacing: .04em;
  line-height: 1.18;
}
.appsub {
  margin: 10px 0 0;
  max-width: 54ch;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.72;
}
.appact {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 20px;
}
.dlbtn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 11px 22px;
  border-radius: 6px;
  background: #0d2a4a;
  border: 1px solid #0d2a4a;
  color: #f7f6ef;
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: .02em;
  transition: background .16s, transform .16s, box-shadow .16s;
}
.dlbtn:hover {
  background: #17406b;
  transform: translateY(-1px);
  box-shadow: 0 10px 22px -12px rgba(13, 42, 74, .7);
}
.dlbtn svg { width: 15px; height: 15px; fill: currentColor; }
.dlbtn[aria-disabled="true"] {
  background: var(--line-soft);
  border-color: var(--line);
  color: var(--muted);
  pointer-events: none;
}
.dlmeta {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
  letter-spacing: .02em;
}
@media (prefers-color-scheme: dark) {
  .dlbtn { background: #1e4a76; border-color: #1e4a76; color: #f2f4f0; }
  .dlbtn:hover { background: #2a5d8f; }
  .appicon { filter: drop-shadow(0 14px 26px rgba(0, 0, 0, .5)); }
}

.appfeat {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  padding: 26px 0;
  border-bottom: 1px solid var(--line);
}
.af {
  padding: 16px 17px 15px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
}
.af h3 {
  margin: 0 0 6px;
  font-family: var(--serif);
  font-size: 15px;
  letter-spacing: .02em;
}
.af p { margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.66; }

.asteps {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: st;
}
.asteps li {
  position: relative;
  padding: 0 0 15px 40px;
  counter-increment: st;
  font-size: 13.5px;
  line-height: 1.7;
}
.asteps li:last-child { padding-bottom: 0; }
.asteps li::before {
  content: counter(st);
  position: absolute;
  left: 0;
  top: 2px;
  width: 23px;
  height: 23px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 600;
}
.asteps b { font-weight: 600; }
.asteps code, .atip code {
  font-family: var(--mono);
  font-size: 12px;
  background: var(--line-soft);
  border-radius: 3px;
  padding: 1.5px 5px;
}
.atip {
  margin: 16px 0 0;
  padding: 12px 14px;
  background: var(--accent-soft);
  border-left: 2px solid var(--accent);
  border-radius: 0 4px 4px 0;
  font-size: 12.5px;
  line-height: 1.72;
  color: var(--muted);
}
.atip b { color: var(--ink); font-weight: 600; }

.pane#pane-mac .section-head { margin-top: 26px; }

.vlist { margin: 0; padding: 0; list-style: none; }
.vlist li {
  display: flex;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px dotted var(--line);
  font-size: 13px;
  line-height: 1.6;
}
.vlist li:last-child { border-bottom: 0; }
.vv {
  flex: none;
  min-width: 62px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
}
.vd {
  flex: none;
  min-width: 88px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
}
.vt { color: var(--muted); }
.nempty { color: var(--muted); font-size: 13px; }

footer {
  margin-top: 40px; padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 12.5px; color: var(--muted);
  display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between;
}
footer .fl { display: flex; gap: 16px; }
footer a:hover { color: var(--accent); }

/* 提示条 */
.toast {
  position: fixed;
  left: 50%; bottom: 26px;
  transform: translate(-50%, 16px);
  max-width: min(560px, calc(100vw - 32px));
  padding: 10px 16px;
  background: var(--ink);
  color: var(--paper);
  font-size: 13px; line-height: 1.6;
  border-radius: 3px;
  box-shadow: 0 12px 30px -18px rgba(0, 0, 0, .6);
  opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 200;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { background: var(--red); color: #fff; }
.toast.good { background: var(--green); color: #fff; }

/* 恢复确认层 */
.confirm {
  position: fixed; inset: 0; z-index: 300;
  display: grid; place-items: center;
  padding: 20px;
  background: rgba(20, 24, 20, .46);
  backdrop-filter: blur(2px);
}
.confirm[hidden] { display: none; }
.confirm-box {
  width: min(440px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 22px 22px 18px;
  box-shadow: 0 24px 60px -30px rgba(0, 0, 0, .6);
}
.confirm-box h3 {
  margin: 0 0 8px;
  font-family: var(--serif); font-size: 17px; letter-spacing: .03em;
}
.confirm-box p {
  margin: 0 0 12px;
  font-size: 13px; color: var(--muted); line-height: 1.7;
}
.confirm-box dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 14px;
  margin: 0 0 14px;
  padding: 10px 12px;
  background: var(--paper);
  border: 1px solid var(--line-soft);
  border-radius: 3px;
  font-size: 12.5px;
}
.confirm-box dt { color: var(--muted); }
.confirm-box dd {
  margin: 0;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}
.confirm-box .chk { margin-bottom: 16px; }
.confirm-acts { display: flex; gap: 8px; justify-content: flex-end; }
.confirm-acts button {
  font-family: inherit; font-size: 13px;
  padding: 7px 16px;
  border-radius: 3px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
}
.confirm-acts button:hover { border-color: var(--accent); color: var(--accent); }
.confirm-acts .ok {
  background: var(--ink); border-color: var(--ink); color: var(--paper);
}
.confirm-acts .ok:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
@media (prefers-color-scheme: dark) {
  .confirm-acts .ok { background: var(--accent); border-color: var(--accent); color: var(--paper); }
}

@media (max-width: 760px) {
  .wrap { padding: 0 18px 56px; }
  .masthead { padding: 40px 0 28px; gap: 16px; }
  .seal { width: 52px; height: 52px; font-size: 25px; }
  .board { padding: 16px 14px 14px; }
  .board-stats { grid-template-columns: repeat(2, 1fr); }
  .board-actions { grid-template-columns: 1fr; }
  .sec-row {
    grid-template-columns: 30px minmax(0, 1fr) auto;
    grid-template-areas:
      "code main main"
      "code meta acts";
    row-gap: 4px;
    column-gap: 11px;
    align-items: center;
  }
  .sec-code { grid-area: code; align-self: center; width: 30px; height: 30px; font-size: 15px; }
  .sec-main { grid-area: main; }
  .sec-main p { white-space: normal; }
  .sec-acts { grid-area: acts; }
  .sec-num { grid-area: meta; text-align: left; }
  .sec-size { display: none; }
  .sec-num::after {
    content: " · " attr(data-size);
    color: var(--muted);
    font-family: var(--mono);
    font-size: 11px;
  }
  .appcard { flex-direction: column; align-items: flex-start; gap: 18px; padding-bottom: 24px; }
  .appicon { width: 88px; height: 88px; }
  .appact { gap: 10px; margin-top: 16px; }
  .dlbtn { width: 100%; justify-content: center; }
  .vlist li { flex-wrap: wrap; gap: 4px 12px; }
  .vd { min-width: 0; }
}
@media (max-width: 480px) {
  .tab { padding: 6px 12px; font-size: 12.5px; }
  .tabs { gap: 5px; margin-bottom: 20px; }
  .tabs-link { font-size: 12px; }

  .topbar { align-items: center; gap: 10px; padding: 10px 0 9px; }
  .topbar nav {
    flex: 1 1 auto; min-width: 0; margin-left: auto;
    flex-wrap: nowrap; justify-content: flex-start;
    gap: 12px; font-size: 12.5px;
    overflow-x: auto; overflow-y: hidden; scrollbar-width: none;
    padding-right: 18px;
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 18px), transparent 100%);
    mask-image: linear-gradient(to right, #000 calc(100% - 18px), transparent 100%);
  }
  .topbar nav a { flex: none; }
  .topbar nav::-webkit-scrollbar { display: none; }
  .board-actions { gap: 8px; }
  .act { padding: 11px 13px 10px; }
  .sec-acts button { padding: 5px 8px; font-size: 11px; }
}
