/* ===================================================================
   My Navigator · 个人数字工作台
   深浅两套主题都用同一组变量切换，背景图上的玻璃层对比度分别调。
   =================================================================== */

:root[data-theme="dark"] {
  color-scheme: dark;
  --scrim-1: rgba(5, 11, 21, .66);
  --scrim-2: rgba(5, 11, 21, .34);
  --scrim-3: rgba(5, 11, 21, .58);

  --text: #f2f7ff;
  --text-2: rgba(228, 240, 254, .72);
  --muted: rgba(214, 231, 251, .55);
  --faint: rgba(214, 231, 251, .34);

  --glass: rgba(255, 255, 255, .065);
  --glass-2: rgba(255, 255, 255, .11);
  --glass-line: rgba(255, 255, 255, .115);
  --glass-line-2: rgba(255, 255, 255, .2);
  --sidebar-bg: rgba(7, 13, 24, .52);
  --sidebar-line: rgba(255, 255, 255, .085);

  --nav-idle: rgba(226, 240, 255, .66);
  --nav-active-bg: rgba(255, 255, 255, .12);
  --nav-active-text: #fff;

  --accent: #7ec2ff;
  --accent-2: #4b8fff;
  --ok: #46d69a;
  --warn: #ffc061;
  --danger: #ff7b84;

  --shadow: 0 18px 48px rgba(0, 0, 0, .42);
  --card-shadow: 0 10px 34px rgba(0, 0, 0, .22);
  --blur: 20px;
  --img-filter: brightness(.78) saturate(1.08);
}

:root[data-theme="light"] {
  color-scheme: light;
  --scrim-1: rgba(238, 245, 252, .74);
  --scrim-2: rgba(238, 245, 252, .42);
  --scrim-3: rgba(238, 245, 252, .66);

  --text: #14263a;
  --text-2: rgba(20, 38, 58, .74);
  --muted: rgba(20, 38, 58, .56);
  --faint: rgba(20, 38, 58, .34);

  --glass: rgba(255, 255, 255, .62);
  --glass-2: rgba(255, 255, 255, .82);
  --glass-line: rgba(255, 255, 255, .75);
  --glass-line-2: rgba(20, 40, 60, .13);
  --sidebar-bg: rgba(246, 251, 255, .5);
  --sidebar-line: rgba(20, 40, 60, .09);

  --nav-idle: rgba(20, 38, 58, .68);
  --nav-active-bg: rgba(255, 255, 255, .8);
  --nav-active-text: #14263a;

  --accent: #1f6fc4;
  --accent-2: #0d5bb5;
  --ok: #128a5d;
  --warn: #b5761a;
  --danger: #c2333f;

  --shadow: 0 18px 48px rgba(24, 58, 96, .16);
  --card-shadow: 0 8px 26px rgba(24, 58, 96, .10);
  --blur: 18px;
  /* 浅色主题下背景图必须压得更暗，否则浅色玻璃卡会糊在亮部上 */
  --img-filter: brightness(.74) saturate(.95);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
svg.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ico { width: 1.15em; height: 1.15em; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
/* 图标库里的实心 SVG（自动发现的那批），和雪碧图区分开 */
.ic { width: 1.15em; height: 1.15em; flex: none; fill: currentColor; }
.ic-emoji { display: grid; place-items: center; width: auto; height: auto; font-size: 1.05em; line-height: 1; }

/* ---------------- 背景层 ---------------- */
.bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  background: #0b1526;
  transition: background-image .6s ease;
}
.bg-img {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: var(--img-filter);
  transition: background-image .6s ease;
}
.bg-img::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, var(--scrim-1) 0%, var(--scrim-2) 38%, var(--scrim-3) 78%, var(--scrim-1) 100%);
}
:root[data-theme="light"] .bg-img::after {
  background: linear-gradient(180deg, var(--scrim-1) 0%, var(--scrim-2) 45%, var(--scrim-3) 85%, var(--scrim-1) 100%);
}

/* ---------------- 骨架 ---------------- */
.app { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 22px 14px 18px;
  background: var(--sidebar-bg);
  backdrop-filter: blur(var(--blur)) saturate(150%);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(150%);
  border-right: 1px solid var(--sidebar-line);
  z-index: 6;
}
.brand { display: flex; gap: 11px; align-items: center; padding: 0 10px 24px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  display: grid; place-items: center;
  background: linear-gradient(140deg, #8fd8ff, #3f7fe8);
  color: #08131f; box-shadow: 0 6px 18px rgba(80, 160, 240, .35);
}
.brand-mark .ico { stroke-width: 2.1; }
.brand b { display: block; font-size: 15px; letter-spacing: .2px; line-height: 1.25; }
.brand small { color: var(--muted); font-size: 11px; }

.nav { display: grid; gap: 3px; overflow-y: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  width: 100%; padding: 10px 12px; border-radius: 10px;
  color: var(--nav-idle); text-align: left; font-size: 14px;
  transition: background .18s, color .18s;
}
.nav-item:hover { background: var(--glass); color: var(--text); }
.nav-item.active { background: var(--nav-active-bg); color: var(--nav-active-text); font-weight: 600; }
.nav-item .ico { width: 18px; height: 18px; opacity: .92; }
.nav-sep { height: 1px; background: var(--sidebar-line); margin: 10px 12px; }
.nav-add { color: var(--accent); }

.sidebar-foot { margin-top: auto; padding-top: 16px; }
.wx {
  display: flex; gap: 11px; align-items: center;
  padding: 12px; border-radius: 13px;
  background: var(--glass); border: 1px solid var(--glass-line);
}
.wx-glyph { font-size: 26px; line-height: 1; flex: none; }
.wx-t { font-size: 19px; font-weight: 600; line-height: 1.15; }
.wx-d { font-size: 11.5px; color: var(--muted); }
.wx-clock { margin-top: 10px; font-size: 11px; color: var(--faint); display: flex; justify-content: space-between; gap: 8px; }

/* ---------------- 主区 ---------------- */
.main { min-width: 0; padding: 20px clamp(16px, 3vw, 46px) 40px; }

.topbar { display: flex; justify-content: flex-end; align-items: center; gap: 12px; min-height: 58px; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.tb-btn {
  height: 40px; min-width: 40px; padding: 0 11px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--glass-line); border-radius: 12px;
  background: var(--glass); color: var(--text-2);
  transition: background .18s, border-color .18s, color .18s, transform .18s;
}
.tb-btn:hover { background: var(--glass-2); border-color: var(--glass-line-2); color: var(--text); transform: translateY(-1px); }
.tb-btn:active { transform: translateY(0); }
.tb-btn .ico { width: 16px; height: 16px; }
.tb-me { padding: 0 13px 0 8px; }
.tb-me .avatar {
  width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 11px; font-weight: 700; line-height: 1;
  background: linear-gradient(140deg, #6fb6f5, #3f6fd0); color: #fff;
}
.tb-me.on { border-color: var(--accent); background: rgba(126, 194, 255, .16); color: var(--accent); }
.tb-me.on .avatar { box-shadow: 0 0 0 2px rgba(126, 194, 255, .5); }

.hero { text-align: center; padding: 26px 0 22px; }
.clock {
  font-size: clamp(52px, 9vw, 96px);
  font-weight: 250;
  letter-spacing: -2.5px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 4px 30px rgba(0, 0, 0, .45);
}
.clock > span:first-child { letter-spacing: -2.5px; }
.clock > span:last-child { margin-left: 4px; letter-spacing: 0; vertical-align: 12%; }
.dateline { margin-top: 12px; font-size: 13px; color: var(--text-2); }
.dateline .lunar { color: var(--muted); }

.search-wrap { display: flex; justify-content: center; margin: 6px 0 26px; }
.search {
  display: flex; align-items: center; gap: 11px;
  width: min(620px, 100%);
  padding: 11px 13px 11px 17px;
  border-radius: 14px;
  background: var(--glass-2);
  border: 1px solid var(--glass-line-2);
  backdrop-filter: blur(var(--blur)) saturate(150%);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(150%);
  box-shadow: var(--card-shadow);
}
.search .ico { color: var(--muted); width: 18px; height: 18px; }
.search input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; font-size: 14.5px; }
.search input::placeholder { color: var(--muted); }
.search kbd {
  font-size: 11px; color: var(--muted);
  border: 1px solid var(--glass-line-2); border-radius: 6px; padding: 3px 7px;
  background: var(--glass); white-space: nowrap;
}
.search button { color: var(--accent); font-size: 13px; padding: 4px 8px; border-radius: 8px; }
.search button:hover { background: var(--glass); }

/* ---------------- 卡片网格 ---------------- */
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.card {
  border-radius: 17px;
  background: var(--glass);
  border: 1px solid var(--glass-line);
  backdrop-filter: blur(var(--blur)) saturate(150%);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(150%);
  box-shadow: var(--card-shadow);
  overflow: hidden;
  transition: background .2s;
}
.card:hover { background: var(--glass-2); }
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 13px 15px 10px;
}
.card-tools { display: flex; align-items: center; gap: 2px; flex: none; }
.card-title { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; min-width: 0; }
.card-title .ico { width: 16px; height: 16px; color: var(--accent); }
.card-title .ic { width: 16px; height: 16px; color: var(--accent); }
.card-title .ic-emoji { width: auto; height: auto; font-size: 14px; }
.card-more { display: flex; align-items: center; gap: 3px; font-size: 12px; color: var(--muted); padding: 3px 6px; border-radius: 7px; }
.card-more:hover { color: var(--accent); background: var(--glass-2); }
.card-more .ico { width: 12px; height: 12px; }
.card-add { font-size: 16px; padding: 2px 9px; line-height: 1; }
.card-body { padding: 0 15px 15px; }
.card-note { font-size: 11.5px; color: var(--faint); padding: 0 15px 13px; }

/* 入口宫格 */
.tile-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 6px; }
.tile { position: relative; display: flex; flex-direction: column; align-items: center; gap: 7px; min-width: 0; border-radius: 11px; padding: 4px 2px; }
.tile-go { display: flex; flex-direction: column; align-items: center; gap: 7px; min-width: 0; width: 100%; }
.tile-ico {
  width: 40px; height: 40px; border-radius: 12px; flex: none;
  display: grid; place-items: center;
  background: linear-gradient(145deg, var(--c1, #3d7fc4), var(--c2, #234a80));
  color: #fff; font-size: 17px; font-weight: 700;
  border: 1px solid rgba(255, 255, 255, .16);
  box-shadow: 0 5px 14px rgba(0, 0, 0, .22);
  overflow: hidden;
}
.tile-ico svg { width: 22px; height: 22px; fill: currentColor; stroke: none; }
.tile-ico svg [stroke] { stroke: none; }
.tile-name {
  font-size: 11.5px; color: var(--text-2); max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tile:hover .tile-go { transform: translateY(-2px); }
.tile-go { transition: transform .18s; }
.tile:hover .tile-ico { box-shadow: 0 8px 20px rgba(0, 0, 0, .3); }
.tile-edit {
  position: absolute; top: -2px; right: -2px;
  width: 19px; height: 19px; border-radius: 6px;
  display: none; place-items: center;
  background: var(--glass-2); border: 1px solid var(--glass-line-2);
  color: var(--muted); font-size: 11px; line-height: 1;
}
body.editing .tile-edit { display: grid; }
body.editing .tile-edit:hover { color: var(--accent); }

/* 列表（最近访问 / 待办） */
.list { display: grid; gap: 2px; }
.row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 8px; border-radius: 10px; min-width: 0;
  transition: background .16s;
}
.row:hover { background: var(--glass); }
.row-ico {
  width: 28px; height: 28px; border-radius: 8px; flex: none;
  display: grid; place-items: center; font-size: 13px;
  background: var(--glass-2); color: var(--text-2);
  overflow: hidden;
}
.row-ico svg { width: 16px; height: 16px; fill: currentColor; }
.row-main { min-width: 0; flex: 1; }
.row-t { display: block; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-s { display: block; font-size: 10.5px; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-r { font-size: 11px; color: var(--faint); flex: none; }

/* 待办 */
.todo-add { display: flex; gap: 7px; margin-bottom: 10px; }
.todo-add input {
  flex: 1; min-width: 0; padding: 8px 11px; border-radius: 10px;
  background: var(--glass); border: 1px solid var(--glass-line); outline: 0; font-size: 13px;
}
.todo-add input:focus { border-color: var(--accent); }
.todo-add button { padding: 8px 12px; border-radius: 10px; background: var(--accent); color: #06111f; font-weight: 600; font-size: 13px; }
:root[data-theme="light"] .todo-add button { color: #fff; }
.todo-sum { display: flex; align-items: center; justify-content: space-between; font-size: 11.5px; color: var(--muted); margin-bottom: 8px; gap: 10px; }
.bar { flex: 1; height: 3px; border-radius: 2px; background: var(--glass-2); overflow: hidden; max-width: 96px; }
.bar > i { display: block; height: 100%; background: var(--ok); border-radius: 2px; transition: width .3s; }
.check {
  width: 17px; height: 17px; flex: none; border-radius: 5px;
  border: 1.5px solid var(--glass-line-2); display: grid; place-items: center;
  color: transparent; transition: .16s;
}
.check:hover { border-color: var(--accent); }
.row.done .check { background: var(--ok); border-color: var(--ok); color: #061b12; }
.row.done .row-t { text-decoration: line-through; opacity: .45; }
.row.overdue .row-t { color: var(--danger); }
.row .badge { font-size: 10px; color: var(--accent); flex: none; }

/* 计量条（系统信息） */
/* 值列用 auto 而不是固定 46px，否则「负载 0.04 / 0.12 / 0.09」这种长值会换行 */
.meter { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 9px; padding: 5px 8px; font-size: 12px; }
.meter-track { height: 5px; border-radius: 3px; background: var(--glass-2); overflow: hidden; }
.meter-track > i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .5s; }
.meter-track > i.warn { background: linear-gradient(90deg, #ffc061, #ff8a4c); }
.meter-track > i.hot { background: linear-gradient(90deg, #ff7b84, #ff4d6d); }
.meter-v { text-align: right; color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.sys-os { display: flex; align-items: center; gap: 9px; padding: 4px 8px 10px; font-size: 12.5px; }
.sys-os .os-badge {
  width: 22px; height: 22px; border-radius: 6px; flex: none;
  background: linear-gradient(140deg, #4aa3f0, #2563c9); display: grid; place-items: center;
  color: #fff; font-size: 10px; font-weight: 700;
}
.sys-sub { font-size: 10.5px; color: var(--faint); }
.sys-ip { padding: 8px; font-size: 11.5px; color: var(--muted); display: flex; align-items: center; gap: 7px; }
.sys-ip b { color: var(--text-2); font-weight: 600; font-variant-numeric: tabular-nums; }

/* 空状态 */
.empty { padding: 18px 6px; text-align: center; font-size: 12px; color: var(--faint); }

/* ---------------- 弹层 ---------------- */
.overlay {
  position: fixed; inset: 0; z-index: 40;
  display: none; align-items: center; justify-content: center; padding: 18px;
  background: rgba(3, 8, 16, .62);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.overlay.open { display: flex; }
.modal {
  width: min(560px, 100%); max-height: 88vh; overflow: auto;
  border-radius: 20px; padding: 24px;
  background: #0e1a2b; border: 1px solid rgba(255, 255, 255, .12);
  box-shadow: var(--shadow); color: #eaf2ff;
}
:root[data-theme="light"] .modal { background: #fbfdff; border-color: rgba(20, 40, 60, .12); color: #14263a; }
.modal h2 { margin: 0 0 5px; font-size: 19px; }
.modal p.sub { margin: 0 0 18px; font-size: 12.5px; color: var(--muted); }
.field { display: grid; gap: 5px; margin: 12px 0; }
.field label { font-size: 11.5px; color: var(--muted); }
.field input, .field select, .field textarea {
  width: 100%; padding: 10px 12px; border-radius: 11px;
  background: rgba(255, 255, 255, .06); border: 1px solid var(--glass-line); outline: 0; font-size: 13.5px;
}
:root[data-theme="light"] .field input, :root[data-theme="light"] .field select, :root[data-theme="light"] .field textarea { background: #f1f6fb; border-color: rgba(20, 40, 60, .14); }
.field input:focus, .field select:focus { border-color: var(--accent); }
.field-row { display: flex; gap: 9px; }
.field-row > * { flex: 1; }
.modal-actions { display: flex; align-items: center; gap: 9px; margin-top: 20px; }
.modal-actions .spacer { margin-left: auto; }
.btn { padding: 9px 15px; border-radius: 10px; font-size: 13px; border: 1px solid var(--glass-line); background: var(--glass); }
.btn:hover { border-color: var(--glass-line-2); }
.btn.primary { background: var(--accent); border-color: transparent; color: #06111f; font-weight: 600; }
:root[data-theme="light"] .btn.primary { color: #fff; }
.btn.danger { color: var(--danger); }
.btn.ghost-danger { color: var(--danger); }

/* 图标选择器 */
.icon-pick { display: flex; gap: 8px; align-items: flex-start; }
.icon-pick .grid {
  flex: 1; display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 6px;
  max-height: 190px; overflow: auto; padding: 8px;
  border: 1px solid var(--glass-line); border-radius: 12px; background: rgba(255, 255, 255, .04);
}
.icon-opt {
  aspect-ratio: 1; border-radius: 10px; display: grid; place-items: center;
  border: 1px solid transparent; color: var(--text-2); font-size: 15px; overflow: hidden;
}
.icon-opt svg { width: 22px; height: 22px; fill: currentColor; }
.icon-opt:hover { border-color: var(--glass-line-2); }
.icon-opt.sel { border-color: var(--accent); background: rgba(126, 194, 255, .16); }
.icon-preview {
  width: 46px; height: 46px; flex: none; border-radius: 13px;
  display: grid; place-items: center; color: #fff; font-size: 18px; font-weight: 700;
  background: linear-gradient(145deg, var(--c1, #3d7fc4), var(--c2, #234a80)); overflow: hidden;
}
.icon-preview svg { width: 24px; height: 24px; fill: currentColor; }

/* 分类管理 */
.cat-list { display: grid; gap: 6px; }
.cat-row { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 10px; background: rgba(255, 255, 255, .05); }
.cat-row .g { width: 24px; text-align: center; font-size: 15px; display: grid; place-items: center; }
.cat-row .g .ic { width: 15px; height: 15px; }
.cat-row .g .ic-emoji { width: auto; height: auto; font-size: 14px; }
.cat-row .n { flex: 1; font-size: 13px; }
.cat-row .c { font-size: 11px; color: var(--faint); }
.cat-row button { color: var(--faint); padding: 3px 5px; border-radius: 6px; }
.cat-row button:hover { color: var(--accent); background: var(--glass); }

/* 背景切换 */
.bg-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.bg-opt { border-radius: 10px; overflow: hidden; border: 2px solid transparent; aspect-ratio: 16/9; position: relative; }
.bg-opt img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bg-opt span {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 3px 5px;
  font-size: 10px; color: #fff; background: linear-gradient(transparent, rgba(0, 0, 0, .75));
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.bg-opt.sel { border-color: var(--accent); }

/* ---------------- 提示条 ---------------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 18px);
  z-index: 60; padding: 10px 17px; border-radius: 11px; font-size: 13px;
  background: rgba(14, 26, 43, .95); color: #eaf2ff;
  border: 1px solid rgba(255, 255, 255, .13);
  box-shadow: var(--shadow);
  opacity: 0; pointer-events: none; transition: .24s;
  max-width: min(90vw, 460px); text-align: center;
}
:root[data-theme="light"] .toast { background: rgba(255, 255, 255, .96); color: #14263a; border-color: rgba(20, 40, 60, .13); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { border-color: rgba(255, 123, 132, .5); }

/* 编辑模式徽标 */
.edit-flag {
  position: fixed; right: 18px; bottom: 18px; z-index: 30;
  display: none; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 999px; font-size: 12px;
  background: rgba(14, 26, 43, .92); color: #d8e8fb;
  border: 1px solid rgba(126, 194, 255, .4);
  box-shadow: var(--shadow);
}
:root[data-theme="light"] .edit-flag { background: rgba(255, 255, 255, .94); color: #14263a; }
body.editing .edit-flag { display: flex; }
.edit-flag .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); }

/* ---------------- 平板：图标栏 ---------------- */
.tabbar { display: none; }

@media (max-width: 1100px) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

@media (max-width: 1180px) {
  .app { grid-template-columns: 68px minmax(0, 1fr); }
  .sidebar { padding-inline: 9px; align-items: center; }
  .brand { padding-inline: 0; }
  .brand-text { display: none; }
  .nav { width: 100%; }
  .nav-item { justify-content: center; padding: 11px 0; }
  .nav-item span:not(.ico) { display: none; }
  .sidebar-foot { display: none; }
  .tile-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .cards { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  :root { --blur: 14px; }
  .app { display: block; padding-bottom: 64px; }
  .sidebar { display: none; }
  .main { padding: 14px 13px 22px; }
  .topbar { min-height: 0; justify-content: flex-end; }
  .tb-btn { height: 36px; min-width: 36px; padding: 0 9px; border-radius: 11px; }
  .tb-me { padding: 0 11px 0 7px; }
  .tb-me .avatar { width: 21px; height: 21px; font-size: 10px; }
  .hero { padding: 14px 0 18px; }
  .clock { font-size: 58px; letter-spacing: -1.5px; }
  .dateline { font-size: 12px; }
  .search { padding: 10px 11px 10px 14px; }
  .search kbd { display: none; }
  .search-wrap { margin-bottom: 18px; }
  .tile-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 4px; }
  .tile-ico { width: 38px; height: 38px; }
  /* 手机上编辑标记别压住卡片，压扁成一枚小胶囊 */
  .edit-flag { bottom: 66px; right: 10px; padding: 4px 10px; font-size: 11px; gap: 5px; }
  .edit-flag #editTip { display: none; }

  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    justify-content: space-around; gap: 2px;
    padding: 7px 8px calc(7px + env(safe-area-inset-bottom));
    background: rgba(7, 14, 26, .9); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
    border-top: 1px solid var(--sidebar-line);
  }
  :root[data-theme="light"] .tabbar { background: rgba(250, 253, 255, .92); }
  .tabbar button {
    display: grid; gap: 3px; justify-items: center; flex: 1;
    font-size: 10px; color: var(--muted); padding: 5px 4px; border-radius: 10px;
  }
  .tabbar button.active { color: var(--accent); }
  .tabbar .ico { width: 19px; height: 19px; }
}

@media (max-width: 380px) {
  .tile-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .clock { font-size: 50px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  html { scroll-behavior: auto !important; }
}

/* ===================================================================
   外观皮肤
   -------------------------------------------------------------------
   :root[data-skin]   = 玻璃(默认) / 控制台 / 杂志报头
   :root[data-theme]  = 深色 / 浅色
   两者正交：换皮肤只换排版规则，换深浅只换配色基底，任意组合都成立。
   玻璃皮肤就是原来那套，一行没改，所有覆盖都写在其后。
   =================================================================== */

:root {
  --mono: ui-monospace, "Cascadia Mono", Consolas, "SF Mono", Menlo, monospace;
  --serif: Georgia, "Songti SC", "Noto Serif SC", "Source Han Serif SC", SimSun, serif;
}

/* 分类色：卡片没有 data-cat 时回落到强调色 */
.card { --cat: var(--accent); }
.card-title .ico, .card-title .ic { color: var(--cat); }
:root[data-theme="light"] .card-title .ico,
:root[data-theme="light"] .card-title .ic { filter: saturate(.9) brightness(.8); }
/* 入口宫格的数据条也跟着分类走 */
.row-ico { border: 1px solid var(--tile-line, transparent); }

/* ===================================================================
   皮肤二：控制台
   发丝分隔线、实心面板、等宽数据。照片退成背景纹理，不参与阅读。
   =================================================================== */

:root[data-skin="console"] { --blur: 0px; --card-shadow: none; --tile-line: rgba(255, 255, 255, .1); }

:root[data-skin="console"][data-theme="dark"] {
  --bg-base: #0b0e13;
  --scrim-1: rgba(11, 14, 19, .93); --scrim-2: rgba(11, 14, 19, .86); --scrim-3: rgba(11, 14, 19, .93);
  --text: #e6ebf3; --text-2: #96a0b1; --muted: #6b7484; --faint: #4d5666;
  --glass: #12161d; --glass-2: #1a2029;
  --glass-line: #222836; --glass-line-2: #2e3646;
  --sidebar-bg: #0e1219; --sidebar-line: #1e2430;
  --nav-idle: #8b95a6; --nav-active-bg: #182031; --nav-active-text: #e6ebf3;
  --accent: #4ade80; --accent-2: #22c55e;
  --shadow: 0 16px 40px rgba(0, 0, 0, .5);
  --img-filter: grayscale(.75) brightness(.34) contrast(1.06);
  --scan: rgba(255, 255, 255, .022);
  --on-btn: rgba(74, 222, 128, .15);
  --badge-fg: #04160d;
}

:root[data-skin="console"][data-theme="light"] {
  --bg-base: #f1f3f7;
  --scrim-1: rgba(241, 243, 247, .93); --scrim-2: rgba(241, 243, 247, .88); --scrim-3: rgba(241, 243, 247, .94);
  --text: #16202c; --text-2: #55606f; --muted: #78828f; --faint: #9aa3af;
  --glass: #ffffff; --glass-2: #eaeef3;
  --glass-line: #dee3ea; --glass-line-2: #c3ccd8;
  --sidebar-bg: #f7f9fb; --sidebar-line: #e2e7ee;
  --nav-idle: #5d6874; --nav-active-bg: #e3e9f0; --nav-active-text: #16202c;
  --accent: #0f9d58; --accent-2: #0a7a44;
  --shadow: 0 14px 34px rgba(24, 58, 96, .13);
  --img-filter: grayscale(1) brightness(1.5) contrast(.45);
  --scan: rgba(20, 32, 44, .022);
  --on-btn: rgba(15, 157, 88, .14);
  --badge-fg: #ffffff;
  --tile-line: rgba(20, 32, 44, .12);
}

:root[data-skin="console"] .bg { background: var(--bg-base); }
/* CRT 扫描线：盖在最上层但不吃点击，弹层在它之上 */
:root[data-skin="console"] body::after {
  content: ""; position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background: repeating-linear-gradient(180deg, var(--scan) 0 1px, transparent 1px 3px);
}
:root[data-skin="console"] .card,
:root[data-skin="console"] .sidebar,
:root[data-skin="console"] .search,
:root[data-skin="console"] .modal { backdrop-filter: none; -webkit-backdrop-filter: none; }

/* 卡片无缝拼接：靠 1px 间隙漏出发丝线 */
:root[data-skin="console"] .cards {
  gap: 1px; align-items: stretch;
  background: var(--glass-line);
  border: 1px solid var(--glass-line);
}
:root[data-skin="console"] .card { border: 0; border-radius: 0; overflow: hidden; }

:root[data-skin="console"] .brand-mark {
  border-radius: 7px; background: var(--accent); color: var(--badge-fg); box-shadow: none;
}
:root[data-skin="console"] .brand b { letter-spacing: .08em; font-size: 14px; }
:root[data-skin="console"] .nav-item { border-radius: 5px; }
:root[data-skin="console"] .nav-item.active { font-family: var(--mono); letter-spacing: .04em; }
:root[data-skin="console"] .nav-sep { background: var(--glass-line); }
:root[data-skin="console"] .wx { border-radius: 6px; font-family: var(--mono); }
:root[data-skin="console"] .wx-t { font-weight: 500; }

:root[data-skin="console"] .tb-btn { border-radius: 6px; }
:root[data-skin="console"] .tb-me .avatar { border-radius: 5px; }
:root[data-skin="console"] .tb-me.on { border-color: var(--accent); background: var(--on-btn); }
:root[data-skin="console"] .tb-me.on .avatar { box-shadow: 0 0 0 2px var(--on-btn); }

:root[data-skin="console"] .clock { text-shadow: none; letter-spacing: -1px; }
:root[data-skin="console"] .dateline { font-family: var(--mono); font-size: 12px; letter-spacing: .04em; }
:root[data-skin="console"] .search { border-radius: 6px; box-shadow: none; }
:root[data-skin="console"] .search kbd { border-radius: 4px; font-family: var(--mono); }
:root[data-skin="console"] .search button { border-radius: 5px; }

:root[data-skin="console"] .card-more { border-radius: 4px; font-family: var(--mono); }
:root[data-skin="console"] .card-title { font-size: 13px; font-family: var(--mono); letter-spacing: .04em; }
:root[data-skin="console"] .tile-ico { border-radius: 7px; box-shadow: none; }
:root[data-skin="console"] .tile-edit { border-radius: 4px; }
:root[data-skin="console"] .row-ico { border-radius: 5px; }
:root[data-skin="console"] .row { border-radius: 5px; }
:root[data-skin="console"] .row-r, :root[data-skin="console"] .row-s { font-family: var(--mono); }
:root[data-skin="console"] .todo-add input, :root[data-skin="console"] .todo-add button { border-radius: 5px; }
:root[data-skin="console"] .todo-sum { font-family: var(--mono); }
:root[data-skin="console"] .check { border-radius: 3px; }
:root[data-skin="console"] .row .badge { font-family: var(--mono); }
:root[data-skin="console"] .meter { font-family: var(--mono); }
:root[data-skin="console"] .meter-track { border-radius: 2px; }
:root[data-skin="console"] .sys-os .os-badge { border-radius: 4px; background: var(--accent); color: var(--badge-fg); }
:root[data-skin="console"] .sys-ip, :root[data-skin="console"] .sys-ip b { font-family: var(--mono); }
:root[data-skin="console"] .empty { font-family: var(--mono); }

:root[data-skin="console"] .modal { border-radius: 10px; font-family: var(--mono); }
:root[data-skin="console"] .modal h2 { font-size: 16px; letter-spacing: .06em; }
:root[data-skin="console"] .field input, :root[data-skin="console"] .field select,
:root[data-skin="console"] .field textarea { border-radius: 5px; }
:root[data-skin="console"] .btn { border-radius: 5px; }
:root[data-skin="console"] .icon-opt { border-radius: 4px; }
:root[data-skin="console"] .icon-pick .grid { border-radius: 6px; }
:root[data-skin="console"] .icon-preview { border-radius: 6px; }
:root[data-skin="console"] .cat-row { border-radius: 5px; background: var(--glass-2); }
:root[data-skin="console"] .bg-opt { border-radius: 4px; }
:root[data-skin="console"] .toast { border-radius: 5px; font-family: var(--mono); }
:root[data-skin="console"] .edit-flag { border-radius: 5px; font-family: var(--mono); }
:root[data-skin="console"] .tabbar button { border-radius: 5px; font-family: var(--mono); }

/* ===================================================================
   皮肤三：杂志报头
   衬线排版、栏线分隔、圆形图标。卡片不再是盒子，是一栏一栏的内容。
   浅色版走冷调新闻纸灰 + 墨蓝，不走暖奶油色那套路。
   =================================================================== */

:root[data-skin="masthead"] {
  --blur: 14px; --card-shadow: none;
  --tile-line: rgba(255, 255, 255, .16);
  --rule: 1px solid var(--glass-line);
}

:root[data-skin="masthead"][data-theme="dark"] {
  --bg-base: #07090d;
  --scrim-1: rgba(6, 9, 15, .9); --scrim-2: rgba(6, 9, 15, .82); --scrim-3: rgba(6, 9, 15, .93);
  --text: #f2efe7; --text-2: rgba(242, 239, 231, .76); --muted: rgba(242, 239, 231, .52); --faint: rgba(242, 239, 231, .36);
  --glass: transparent; --glass-2: rgba(255, 255, 255, .05);
  --glass-line: rgba(242, 239, 231, .26); --glass-line-2: rgba(242, 239, 231, .4);
  --sidebar-bg: rgba(6, 9, 15, .52); --sidebar-line: rgba(242, 239, 231, .16);
  --nav-idle: rgba(242, 239, 231, .62); --nav-active-bg: transparent; --nav-active-text: #f2efe7;
  --accent: #e6d9b8; --accent-2: #c9b78d;
  --shadow: 0 20px 50px rgba(0, 0, 0, .6);
  --img-filter: grayscale(.5) saturate(.55) brightness(.4);
  --on-btn: rgba(230, 217, 184, .12);
  --badge-fg: #14161a;
}

:root[data-skin="masthead"][data-theme="light"] {
  --bg-base: #eceef1;
  --scrim-1: rgba(236, 238, 241, .93); --scrim-2: rgba(236, 238, 241, .88); --scrim-3: rgba(236, 238, 241, .95);
  --text: #14161a; --text-2: rgba(20, 22, 26, .78); --muted: rgba(20, 22, 26, .58); --faint: rgba(20, 22, 26, .42);
  --glass: transparent; --glass-2: rgba(20, 22, 26, .045);
  --glass-line: rgba(20, 22, 26, .24); --glass-line-2: rgba(20, 22, 26, .42);
  --sidebar-bg: rgba(236, 238, 241, .7); --sidebar-line: rgba(20, 22, 26, .2);
  --nav-idle: rgba(20, 22, 26, .66); --nav-active-bg: transparent; --nav-active-text: #14161a;
  --accent: #1c4f8a; --accent-2: #143c6b;
  --shadow: 0 16px 38px rgba(20, 22, 26, .16);
  --img-filter: grayscale(1) brightness(1.55) contrast(.4);
  --on-btn: rgba(28, 79, 138, .12);
  --badge-fg: #ffffff;
  --tile-line: rgba(20, 22, 26, .18);
}

:root[data-skin="masthead"] .bg { background: var(--bg-base); }
:root[data-skin="masthead"] .card,
:root[data-skin="masthead"] .search,
:root[data-skin="masthead"] .modal { backdrop-filter: none; -webkit-backdrop-filter: none; }

/* 卡片变成「栏目」：没有盒子，只有底部栏线 */
:root[data-skin="masthead"] .cards { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 30px; }
:root[data-skin="masthead"] .card {
  background: none; border: 0; border-bottom: var(--rule); border-radius: 0;
  box-shadow: none; overflow: visible; padding-bottom: 16px; margin-bottom: 24px;
}
:root[data-skin="masthead"] .card:hover { background: none; }
:root[data-skin="masthead"] .card-head { padding: 0 0 11px; }
:root[data-skin="masthead"] .card-title { font-family: var(--serif); font-size: 16.5px; font-weight: 400; letter-spacing: .05em; }
:root[data-skin="masthead"] .card-title .ico, :root[data-skin="masthead"] .card-title .ic { color: var(--cat); opacity: .9; }
:root[data-skin="masthead"] .card-body { padding: 0; }
:root[data-skin="masthead"] .card-note { padding: 0 0 10px; font-family: var(--serif); font-style: italic; }
:root[data-skin="masthead"] .card-more { border-radius: 0; font-family: var(--serif); letter-spacing: .06em; }
:root[data-skin="masthead"] .card-more:hover { background: none; text-decoration: underline; }

/* 报头：左边时间，右边日期，下面一条粗线 */
:root[data-skin="masthead"] .hero {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 26px;
  text-align: left; padding: 18px 0 14px; margin-bottom: 22px;
  border-bottom: 2px solid var(--glass-line);
}
:root[data-skin="masthead"] .clock {
  font-family: var(--serif); font-size: 46px; font-weight: 400;
  letter-spacing: 0; text-shadow: none; line-height: 1;
}
:root[data-skin="masthead"] .clock > span:first-child { letter-spacing: 0; }
:root[data-skin="masthead"] .clock > span:last-child { font-size: .42em; vertical-align: 14%; margin-left: 3px; }
:root[data-skin="masthead"] .dateline {
  margin-top: 0; padding-bottom: 5px; text-align: right;
  font-size: 11.5px; letter-spacing: .2em; text-transform: uppercase;
}

:root[data-skin="masthead"] .search {
  border-radius: 0; background: none; border-width: 0 0 1px 0;
  border-color: var(--glass-line-2); box-shadow: none;
  font-family: var(--serif); font-size: 15px; padding: 12px 4px;
}
:root[data-skin="masthead"] .search kbd { background: none; border: 0; letter-spacing: .16em; text-transform: uppercase; font-size: 10px; }
:root[data-skin="masthead"] .search button { border-radius: 0; font-family: var(--serif); }

:root[data-skin="masthead"] .brand { padding: 0 0 16px; border-bottom: 2px solid var(--glass-line); margin-bottom: 18px; display: block; }
:root[data-skin="masthead"] .brand-mark { display: none; }
:root[data-skin="masthead"] .brand b { font-family: var(--serif); font-size: 20px; font-weight: 400; letter-spacing: .03em; }
:root[data-skin="masthead"] .nav-item {
  border-radius: 0; border-bottom: 1px solid var(--glass-line);
  padding: 9px 2px; font-family: var(--serif); letter-spacing: .06em;
}
:root[data-skin="masthead"] .nav-item:hover { background: none; }
:root[data-skin="masthead"] .nav-item.active { background: none; }
:root[data-skin="masthead"] .nav-item.active::after {
  content: ""; flex: none; width: 14px; height: 2px; background: var(--accent);
}
:root[data-skin="masthead"] .wx {
  border-radius: 0; background: none; border-width: 1px 0 0 0;
  border-color: var(--glass-line); font-family: var(--serif);
}
:root[data-skin="masthead"] .tb-btn { border-radius: 0; background: none; font-family: var(--serif); letter-spacing: .06em; }
:root[data-skin="masthead"] .tb-btn:hover { background: var(--glass-2); transform: none; }
:root[data-skin="masthead"] .tb-me { padding: 0 12px 0 6px; }
:root[data-skin="masthead"] .tb-me .avatar { border-radius: 50%; }
:root[data-skin="masthead"] .tb-me.on { background: var(--on-btn); }

:root[data-skin="masthead"] .tile-ico { border-radius: 50%; border-width: 1px; }
:root[data-skin="masthead"] .tile { border-radius: 0; }
:root[data-skin="masthead"] .tile:hover .tile-go { transform: none; }
:root[data-skin="masthead"] .tile-name { font-size: 11px; }
:root[data-skin="masthead"] .tile-edit { border-radius: 50%; }
:root[data-skin="masthead"] .row { border-radius: 0; border-bottom: 1px dotted var(--glass-line); }
:root[data-skin="masthead"] .row:hover { background: none; }
:root[data-skin="masthead"] .row-ico { border-radius: 50%; }
:root[data-skin="masthead"] .row-r, :root[data-skin="masthead"] .row-s { font-family: var(--mono); }
:root[data-skin="masthead"] .todo-add input, :root[data-skin="masthead"] .todo-add button { border-radius: 0; }
:root[data-skin="masthead"] .todo-sum { font-family: var(--serif); letter-spacing: .05em; }
:root[data-skin="masthead"] .check { border-radius: 50%; }
:root[data-skin="masthead"] .row .badge { font-family: var(--mono); letter-spacing: .06em; }
:root[data-skin="masthead"] .meter { font-family: var(--serif); }
:root[data-skin="masthead"] .meter-v { font-family: var(--mono); }
:root[data-skin="masthead"] .meter-track { height: 2px; border-radius: 0; }
:root[data-skin="masthead"] .sys-os .os-badge { border-radius: 50%; }
:root[data-skin="masthead"] .sys-sub, :root[data-skin="masthead"] .sys-ip { font-family: var(--serif); letter-spacing: .04em; }
:root[data-skin="masthead"] .sys-ip b { font-family: var(--mono); }
:root[data-skin="masthead"] .empty { text-align: left; font-family: var(--serif); font-style: italic; padding: 14px 0; }

:root[data-skin="masthead"] .modal { border-radius: 2px; }
:root[data-skin="masthead"] .modal h2 { font-family: var(--serif); font-weight: 400; letter-spacing: .04em; }
:root[data-skin="masthead"] .field input, :root[data-skin="masthead"] .field select,
:root[data-skin="masthead"] .field textarea, :root[data-skin="masthead"] .btn,
:root[data-skin="masthead"] .icon-opt, :root[data-skin="masthead"] .icon-pick .grid,
:root[data-skin="masthead"] .icon-preview, :root[data-skin="masthead"] .cat-row,
:root[data-skin="masthead"] .bg-opt, :root[data-skin="masthead"] .toast,
:root[data-skin="masthead"] .edit-flag, :root[data-skin="masthead"] .tabbar button { border-radius: 2px; }
:root[data-skin="masthead"] .tabbar button { font-family: var(--serif); letter-spacing: .08em; }

/* ---------------- 皮肤 × 断点 ---------------- */

@media (max-width: 1180px) {
  :root[data-skin="masthead"] .brand-mark { display: grid; }
  :root[data-skin="masthead"] .brand { display: flex; align-items: center; justify-content: center; padding: 0 0 14px; }
  :root[data-skin="masthead"] .nav-item { border-bottom: 0; padding: 11px 0; }
  :root[data-skin="masthead"] .nav-item.active::after { display: none; }
}

@media (max-width: 860px) {
  :root[data-skin="masthead"] .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 22px; }
}

@media (max-width: 720px) {
  :root[data-skin="masthead"] .cards { grid-template-columns: 1fr; }
  :root[data-skin="masthead"] .hero { flex-direction: column; align-items: flex-start; gap: 8px; }
  :root[data-skin="masthead"] .dateline { text-align: left; padding-bottom: 0; }
  :root[data-skin="masthead"] .clock { font-size: 40px; }
  :root[data-skin="masthead"] .tb-btn { height: 34px; border-radius: 2px; }
  :root[data-skin="console"] .tb-btn { height: 36px; border-radius: 5px; }
}

/* ===================================================================
   浮层：弹层 / 提示条 / 编辑徽标 也跟随皮肤基底
   （底色原本写死在 :root[data-theme] 上，这里按皮肤再压一层）
   =================================================================== */

:root[data-skin="console"] .overlay { background: rgba(6, 9, 14, .72); backdrop-filter: none; -webkit-backdrop-filter: none; }
:root[data-skin="masthead"] .overlay { background: rgba(4, 7, 12, .74); backdrop-filter: none; -webkit-backdrop-filter: none; }

:root[data-skin="console"][data-theme="dark"] .modal,
:root[data-skin="console"][data-theme="dark"] .toast,
:root[data-skin="console"][data-theme="dark"] .edit-flag { background: #12161d; color: var(--text); border-color: var(--glass-line-2); }
:root[data-skin="console"][data-theme="light"] .modal,
:root[data-skin="console"][data-theme="light"] .toast,
:root[data-skin="console"][data-theme="light"] .edit-flag { background: #ffffff; color: var(--text); border-color: var(--glass-line-2); }
:root[data-skin="console"] .field input, :root[data-skin="console"] .field select,
:root[data-skin="console"] .field textarea { background: var(--glass); border-color: var(--glass-line); }
:root[data-skin="console"] .icon-pick .grid { background: var(--glass); }
:root[data-skin="console"] .cat-row { background: var(--glass); }
:root[data-skin="console"] .edit-flag { border-color: var(--accent); }

:root[data-skin="masthead"][data-theme="dark"] .modal,
:root[data-skin="masthead"][data-theme="dark"] .toast,
:root[data-skin="masthead"][data-theme="dark"] .edit-flag { background: rgba(11, 15, 22, .985); color: var(--text); border-color: var(--glass-line-2); }
:root[data-skin="masthead"][data-theme="light"] .modal,
:root[data-skin="masthead"][data-theme="light"] .toast,
:root[data-skin="masthead"][data-theme="light"] .edit-flag { background: rgba(247, 248, 250, .99); color: var(--text); border-color: var(--glass-line-2); }
:root[data-skin="masthead"] .field input, :root[data-skin="masthead"] .field select,
:root[data-skin="masthead"] .field textarea { background: var(--glass-2); border-color: var(--glass-line-2); }
:root[data-skin="masthead"] .icon-pick .grid { background: var(--glass-2); }
:root[data-skin="masthead"] .cat-row { background: var(--glass-2); }
:root[data-skin="masthead"] .edit-flag { border-color: var(--accent); }
/* 弹层里的正文跟着衬线，但输入框和按钮不能，否则不好读 */
:root[data-skin="masthead"] .field label, :root[data-skin="masthead"] .modal p.sub { letter-spacing: .03em; }
