/* =========================================================
   nav.wuyiai.top — 设计变量
   4 套主题 + 跟随系统；所有颜色只允许走变量
   ========================================================= */

/* ---------- 1. 雾白（亮色，默认） ---------- */
:root,
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #F4F6F9;
  --bg-2: #EEF1F6;
  --panel: #FFFFFF;
  --panel-2: #F2F4F8;
  --panel-3: #E9EDF3;
  --ink: #101319;
  --ink-2: #333B49;
  --muted: #626C7D;
  --dim: #98A1B0;
  --line: rgba(16, 19, 25, 0.075);
  --line-2: rgba(16, 19, 25, 0.13);
  --line-3: rgba(16, 19, 25, 0.22);
  --accent: #2F6BFF;
  --accent-2: #1AA391;
  --on-accent: #FFFFFF;
  --accent-soft: rgba(47, 107, 255, 0.10);
  --glow-a: rgba(72, 132, 255, 0.20);
  --glow-b: rgba(160, 118, 255, 0.16);
  --glow-c: rgba(60, 200, 180, 0.13);
  --glow-op: 1;
  --grain-op: 0.05;
  --shadow-s: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-m: 0 2px 4px rgba(16, 24, 40, 0.05), 0 12px 28px -14px rgba(16, 24, 40, 0.20);
  --shadow-l: 0 4px 10px rgba(16, 24, 40, 0.06), 0 32px 64px -24px rgba(16, 24, 40, 0.28);
  --card-grad-a: rgba(255, 255, 255, 0.92);
  --card-grad-b: rgba(255, 255, 255, 0.72);
  --hover: rgba(16, 19, 25, 0.045);
  --sel: rgba(47, 107, 255, 0.10);
  --scrim: rgba(16, 19, 25, 0.34);
}

/* ---------- 2. 曜石（暗色） ---------- */
:root[data-theme="obsidian"] {
  color-scheme: dark;
  --bg: #06070B;
  --bg-2: #0A0C12;
  --panel: #0E1016;
  --panel-2: #14171F;
  --panel-3: #1B1F29;
  --ink: #F0F2F7;
  --ink-2: #C4CAD7;
  --muted: #7E8697;
  --dim: #4C5464;
  --line: rgba(240, 242, 247, 0.08);
  --line-2: rgba(240, 242, 247, 0.15);
  --line-3: rgba(240, 242, 247, 0.26);
  --accent: #7FD8FF;
  --accent-2: #A8E9C6;
  --on-accent: #05121A;
  --accent-soft: rgba(127, 216, 255, 0.12);
  --glow-a: rgba(96, 136, 255, 0.55);
  --glow-b: rgba(178, 120, 255, 0.44);
  --glow-c: rgba(70, 220, 198, 0.30);
  --glow-op: 0.85;
  --grain-op: 0.15;
  --shadow-s: 0 1px 2px rgba(0, 0, 0, 0.5);
  --shadow-m: 0 2px 6px rgba(0, 0, 0, 0.45), 0 14px 30px -16px rgba(0, 0, 0, 0.8);
  --shadow-l: 0 6px 16px rgba(0, 0, 0, 0.5), 0 36px 72px -28px rgba(0, 0, 0, 0.9);
  --card-grad-a: rgba(255, 255, 255, 0.085);
  --card-grad-b: rgba(255, 255, 255, 0.03);
  --hover: rgba(240, 242, 247, 0.05);
  --sel: rgba(127, 216, 255, 0.10);
  --scrim: rgba(0, 0, 0, 0.58);
}

/* ---------- 3. 靛青（暗色 / 冷蓝科技） ---------- */
:root[data-theme="indigo"] {
  color-scheme: dark;
  --bg: #060A14;
  --bg-2: #0A1120;
  --panel: #0C1322;
  --panel-2: #111A2C;
  --panel-3: #17233A;
  --ink: #E9F0FF;
  --ink-2: #B9C6E0;
  --muted: #7486A6;
  --dim: #46536C;
  --line: rgba(180, 205, 255, 0.09);
  --line-2: rgba(180, 205, 255, 0.17);
  --line-3: rgba(180, 205, 255, 0.30);
  --accent: #5B8CFF;
  --accent-2: #6FE3D0;
  --on-accent: #FFFFFF;
  --accent-soft: rgba(91, 140, 255, 0.14);
  --glow-a: rgba(60, 110, 255, 0.50);
  --glow-b: rgba(90, 220, 220, 0.26);
  --glow-c: rgba(120, 90, 255, 0.30);
  --glow-op: 0.9;
  --grain-op: 0.13;
  --shadow-s: 0 1px 2px rgba(0, 0, 0, 0.45);
  --shadow-m: 0 2px 6px rgba(0, 0, 0, 0.4), 0 16px 34px -18px rgba(0, 0, 0, 0.85);
  --shadow-l: 0 8px 18px rgba(0, 0, 0, 0.45), 0 40px 80px -30px rgba(0, 0, 0, 0.9);
  --card-grad-a: rgba(150, 190, 255, 0.10);
  --card-grad-b: rgba(140, 180, 255, 0.035);
  --hover: rgba(180, 205, 255, 0.06);
  --sel: rgba(91, 140, 255, 0.13);
  --scrim: rgba(2, 6, 16, 0.60);
}

/* ---------- 4. 暖砂（亮色 / 纸感） ---------- */
:root[data-theme="sand"] {
  color-scheme: light;
  --bg: #F7F3EB;
  --bg-2: #F2ECE1;
  --panel: #FFFCF7;
  --panel-2: #F2ECE0;
  --panel-3: #E8E0D1;
  --ink: #221E18;
  --ink-2: #4A4137;
  --muted: #7B7061;
  --dim: #A89C8B;
  --line: rgba(34, 30, 24, 0.085);
  --line-2: rgba(34, 30, 24, 0.15);
  --line-3: rgba(34, 30, 24, 0.25);
  --accent: #B4632A;
  --accent-2: #4E7A5E;
  --on-accent: #FFF9F2;
  --accent-soft: rgba(180, 99, 42, 0.11);
  --glow-a: rgba(226, 160, 96, 0.22);
  --glow-b: rgba(120, 160, 130, 0.16);
  --glow-c: rgba(210, 130, 110, 0.14);
  --glow-op: 1;
  --grain-op: 0.07;
  --shadow-s: 0 1px 2px rgba(90, 70, 45, 0.07);
  --shadow-m: 0 2px 4px rgba(90, 70, 45, 0.07), 0 12px 26px -14px rgba(90, 70, 45, 0.22);
  --shadow-l: 0 4px 10px rgba(90, 70, 45, 0.08), 0 32px 60px -26px rgba(90, 70, 45, 0.28);
  --card-grad-a: rgba(255, 253, 248, 0.95);
  --card-grad-b: rgba(252, 247, 238, 0.75);
  --hover: rgba(34, 30, 24, 0.05);
  --sel: rgba(180, 99, 42, 0.10);
  --scrim: rgba(58, 44, 28, 0.36);
}

/* ---------- 通用 ---------- */
:root {
  --sans: "Inter Tight", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Mono", Consolas, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --r-s: 8px;
  --r-m: 12px;
  --r-l: 18px;
  --pad: clamp(14px, 3.2vw, 40px);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
a {
  color: inherit;
  text-decoration: none;
}
button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}
input {
  font: inherit;
  color: inherit;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
  overflow-x: hidden;
  transition: background 0.35s var(--ease), color 0.35s var(--ease);
}
.mono {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

/* 背景：弥散光 + 极细网格 + 噪点 */
.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.bg__glow {
  position: absolute;
  inset: -20%;
  opacity: var(--glow-op);
  transition: opacity 0.4s var(--ease);
}
.bg__glow i {
  position: absolute;
  display: block;
  border-radius: 50%;
  will-change: transform;
}
.bg__glow .g1 {
  width: 64vw;
  height: 64vw;
  left: 0;
  top: -6%;
  background: radial-gradient(closest-side, var(--glow-a), transparent 88%);
  animation: drift1 26s var(--ease) infinite alternate;
}
.bg__glow .g2 {
  width: 58vw;
  height: 58vw;
  right: -4%;
  top: 0;
  background: radial-gradient(closest-side, var(--glow-b), transparent 88%);
  animation: drift2 32s var(--ease) infinite alternate;
}
.bg__glow .g3 {
  width: 52vw;
  height: 52vw;
  left: 28%;
  bottom: -16%;
  background: radial-gradient(closest-side, var(--glow-c), transparent 88%);
  animation: drift3 38s var(--ease) infinite alternate;
}
@keyframes drift1 {
  to {
    transform: translate3d(7vw, 5vh, 0) scale(1.12);
  }
}
@keyframes drift2 {
  to {
    transform: translate3d(-6vw, 8vh, 0) scale(1.08);
  }
}
@keyframes drift3 {
  to {
    transform: translate3d(5vw, -6vh, 0) scale(1.16);
  }
}
.bg__grid {
  position: absolute;
  inset: 0;
  opacity: 0.55;
  background:
    linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 64px 64px,
    linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 64px 64px;
  mask-image: radial-gradient(115% 85% at 50% 0%, #000 22%, transparent 100%);
  -webkit-mask-image: radial-gradient(115% 85% at 50% 0%, #000 22%, transparent 100%);
}
.bg__grain {
  position: absolute;
  inset: 0;
  opacity: var(--grain-op);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
}
html[data-fx="off"] .bg__glow i {
  animation: none;
}
html[data-fx="off"] .bg__glow {
  opacity: calc(var(--glow-op) * 0.72);
}

.wrap {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

/* =========================================================
   顶栏
   ========================================================= */
.bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 var(--pad);
  height: 58px;
  flex: 0 0 auto;
  border-bottom: 1px solid var(--line);
  transition: border-color 0.35s var(--ease);
}
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink);
}
.brand svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
}
.brand b {
  font-weight: 500;
}
.brand span {
  color: var(--muted);
}
.bar__sp {
  flex: 1;
}

/* 通用小控件 */
.ico {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: var(--r-s);
  color: var(--muted);
  border: 1px solid transparent;
  transition: color 0.18s var(--ease), background 0.18s var(--ease), border-color 0.18s var(--ease);
}
.ico:hover {
  color: var(--ink);
  background: var(--hover);
  border-color: var(--line);
}
.ico svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ico.is-on {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: transparent;
}

/* 布局切换 */
.seg {
  display: flex;
  gap: 2px;
  padding: 2px;
  border-radius: 9px;
  background: var(--panel-2);
  border: 1px solid var(--line);
}
.seg button {
  display: grid;
  place-items: center;
  width: 30px;
  height: 26px;
  border-radius: 6px;
  color: var(--dim);
  transition: color 0.16s, background 0.16s, box-shadow 0.16s;
}
.seg button:hover {
  color: var(--ink-2);
}
.seg button.is-on {
  color: var(--ink);
  background: var(--panel);
  box-shadow: var(--shadow-s);
}
.seg svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
}

/* 档案 / 主题 下拉 */
.pop {
  position: relative;
}
.pop__btn {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 10px;
  border-radius: var(--r-s);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  transition: color 0.18s, border-color 0.18s, background 0.18s;
  max-width: 180px;
}
.pop__btn:hover {
  color: var(--ink);
  border-color: var(--line-2);
  background: var(--hover);
}
.pop__btn .nm {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pop__btn .av {
  display: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  font-family: var(--mono);
  font-size: 10px;
  line-height: 18px;
  text-align: center;
  flex: 0 0 auto;
}
.pop__btn svg {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}
.menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 210px;
  padding: 6px;
  border-radius: var(--r-m);
  background: var(--panel);
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow-l);
  display: none;
  z-index: 70;
}
.menu.on {
  display: block;
  animation: pop-in 0.2s var(--ease);
}
@keyframes pop-in {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
}
.menu__h {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--dim);
  padding: 7px 9px 5px;
}
.menu__i {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px 9px;
  border-radius: 7px;
  font-size: 13px;
  color: var(--ink-2);
  text-align: left;
  transition: background 0.15s, color 0.15s;
}
.menu__i:hover {
  background: var(--hover);
  color: var(--ink);
}
.menu__i.is-on {
  color: var(--accent);
}
.menu__i .sw {
  width: 15px;
  height: 15px;
  border-radius: 5px;
  border: 1px solid var(--line-3);
  flex: 0 0 auto;
}
.menu__i .tick {
  margin-left: auto;
  opacity: 0;
  font-size: 11px;
}
.menu__i.is-on .tick {
  opacity: 1;
}
.menu__sep {
  height: 1px;
  background: var(--line);
  margin: 5px 4px;
}

/* =========================================================
   舞台 / 搜索
   ========================================================= */
.stage {
  flex: 1;
  padding: 0 var(--pad) 26px;
  min-width: 0;
}

.qbar {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: clamp(18px, 3.4vh, 34px) 0 clamp(16px, 2.8vh, 26px);
}
.qbar__box {
  display: flex;
  align-items: center;
  gap: 11px;
  flex: 1;
  min-width: 0;
  height: 54px;
  padding: 0 6px 0 16px;
  border-radius: 14px;
  background: var(--panel);
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow-m);
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease),
    background 0.35s var(--ease);
}
.qbar__box:focus-within {
  border-color: var(--accent);
  box-shadow: var(--shadow-m), 0 0 0 4px var(--accent-soft);
}
.qbar__box > svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  color: var(--dim);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
}
#q {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: none;
  font-size: 15.5px;
}
#q::placeholder {
  color: var(--dim);
}
.qbar__eng {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border-radius: 9px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  transition: color 0.18s, border-color 0.18s;
}
.qbar__eng:hover {
  color: var(--ink);
  border-color: var(--line-2);
}
.qbar__go {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border-radius: 11px;
  background: var(--accent);
  color: var(--on-accent);
}
.qbar__go svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* 搜索建议 */
.sug {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 9px);
  z-index: 40;
  padding: 6px;
  border-radius: var(--r-m);
  background: var(--panel);
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow-l);
  display: none;
}
.sug.on {
  display: block;
  animation: pop-in 0.2s var(--ease);
}
.sug__i {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 11px;
  border-radius: 8px;
  font-size: 14px;
}
.sug__i.is-sel,
.sug__i:hover {
  background: var(--sel);
}
.sug__tag {
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dim);
  flex: 0 0 44px;
}
.sug__t {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sug__t small {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--dim);
  margin-left: 9px;
}

/* =========================================================
   分组 / 条目（三套布局共用同一份 DOM）
   ========================================================= */
.grp {
  min-width: 0;
}
.grp__h {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 9px;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}
.grp__h em {
  font-style: normal;
  color: var(--dim);
  letter-spacing: 0.1em;
}
.grp__h i {
  flex: 1;
  height: 1px;
  background: var(--line);
}
.grp__h button {
  display: none;
  padding: 2px 7px;
  border-radius: 5px;
  border: 1px solid var(--line);
  color: var(--dim);
  font-size: 11px;
  line-height: 1.3;
  transition: color 0.16s, border-color 0.16s;
}
.grp__h button:hover {
  color: var(--ink);
  border-color: var(--line-2);
}
html[data-edit="on"] .grp__h button {
  display: block;
}

.item__top {
  display: contents;
}
.item__arrow {
  display: none;
}
.item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  border-radius: var(--r-s);
  transition: background 0.16s var(--ease), border-color 0.2s var(--ease),
    box-shadow 0.2s var(--ease), transform 0.2s var(--ease);
}
.item__dot {
  flex: 0 0 auto;
  border-radius: 4px;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-weight: 500;
  color: #fff;
}
.item__t {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13.5px;
  letter-spacing: -0.005em;
}
.item__u {
  display: block;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.03em;
  color: var(--dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.item__del {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: none;
  place-items: center;
  background: var(--panel-3);
  border: 1px solid var(--line-2);
  color: var(--muted);
  font-size: 11px;
  line-height: 1;
  z-index: 2;
}
html[data-edit="on"] .item__del {
  display: grid;
}

/* ---------- 布局 A：命令台（列表） ---------- */
[data-layout="list"] .groups {
  display: flex;
  flex-direction: column;
  gap: clamp(16px, 2.8vh, 26px);
}
[data-layout="list"] .items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 288px), 1fr));
  gap: 1px 10px;
}
[data-layout="list"] .item {
  padding: 7px 9px;
  border: 1px solid transparent;
}
[data-layout="list"] .item:hover {
  background: var(--hover);
  border-color: var(--line);
}
[data-layout="list"] .item__dot {
  width: 26px;
  height: 26px;
  font-size: 11px;
}
[data-layout="list"] .item__txt {
  min-width: 0;
  flex: 1;
}
[data-layout="list"] .item__u {
  margin-top: 1px;
}
[data-layout="list"] .item__k {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--dim);
  opacity: 0;
  transition: opacity 0.18s;
}
[data-layout="list"] .item:hover .item__k {
  opacity: 1;
}

/* ---------- 布局 B：空间（卡片） ---------- */
[data-layout="cards"] .groups {
  display: flex;
  flex-direction: column;
  gap: clamp(18px, 3vh, 30px);
}
[data-layout="cards"] .items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 158px), 1fr));
  gap: 11px;
  perspective: 1200px;
}
[data-layout="cards"] .item {
  flex-direction: column;
  align-items: stretch;
  justify-content: space-between;
  min-height: 100px;
  padding: 13px;
  border-radius: 16px;
  background: linear-gradient(152deg, var(--card-grad-a) 0%, var(--card-grad-b) 100%);
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow-s);
  transform: rotateX(0deg) rotateY(0deg);
  transition: transform 0.4s var(--ease), border-color 0.2s var(--ease),
    box-shadow 0.2s var(--ease);
}
[data-layout="cards"] .item.is-live {
  transition: transform 0s, border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
[data-layout="cards"] .item:hover {
  border-color: var(--line-3);
  box-shadow: var(--shadow-m);
}
[data-layout="cards"] .item__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
[data-layout="cards"] .item__dot {
  width: 25px;
  height: 25px;
  font-size: 10.5px;
  border-radius: 8px;
}
[data-layout="cards"] .item__arrow {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--dim);
  opacity: 0;
  transform: translate(-3px, 3px);
  transition: 0.24s var(--ease);
}
[data-layout="cards"] .item:hover .item__arrow {
  opacity: 1;
  transform: none;
}
[data-layout="cards"] .item__txt {
  min-width: 0;
  margin-top: auto;
  padding-top: 11px;
}
[data-layout="cards"] .item__u {
  margin-top: 3px;
}
[data-layout="cards"] .item__k {
  display: none;
}
html[data-edit="on"] [data-layout="cards"] .item__arrow,
[data-layout="cards"] .item.is-edit .item__arrow {
  display: none;
}

/* ---------- 布局 C：工作台（Bento） ---------- */
[data-layout="bento"] .groups {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: clamp(8px, 1vw, 12px);
  align-items: stretch;
}
[data-layout="bento"] .tiles {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: clamp(8px, 1vw, 12px);
  margin-bottom: clamp(4px, 1vw, 10px);
}
.tile {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: clamp(12px, 1.4vw, 18px);
  min-width: 0;
  box-shadow: var(--shadow-s);
  transition: background 0.35s var(--ease), border-color 0.35s var(--ease);
}
.tile--clock {
  grid-column: span 4;
  min-height: 152px;
  display: flex;
  flex-direction: column;
}
.tile--info {
  grid-column: span 8;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.tile__label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--dim);
}
.tile__label em {
  font-style: normal;
  margin-left: auto;
  color: var(--dim);
}
.clock__t {
  font-size: clamp(38px, 4.6vw, 62px);
  line-height: 0.94;
  letter-spacing: -0.045em;
  font-variant-numeric: tabular-nums;
}
.clock__s {
  margin-top: 9px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.clock__gap {
  flex: 1;
  min-height: 18px;
}
.daybar {
  height: 2px;
  border-radius: 2px;
  background: var(--line-2);
  overflow: hidden;
  margin-top: 12px;
}
.daybar i {
  display: block;
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 1s var(--ease);
}
.daymeta {
  display: flex;
  justify-content: space-between;
  margin-top: 7px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
}
.info__h {
  font-size: clamp(15px, 1.8vw, 20px);
  letter-spacing: -0.02em;
}
.info__h b {
  font-weight: 500;
  color: var(--accent);
}
.info__p {
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.6;
}
.info__stats {
  display: flex;
  gap: 22px;
  margin-top: auto;
  padding-top: 12px;
}
.stat b {
  display: block;
  font-size: 18px;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.stat span {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dim);
}
[data-layout="bento"] .grp {
  grid-column: span 3;
  grid-row: span 1;
  padding: clamp(12px, 1.4vw, 16px);
  border-radius: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  min-height: 140px;
  box-shadow: var(--shadow-s);
  transition: background 0.35s var(--ease), border-color 0.35s var(--ease);
}
[data-layout="bento"] .items ,
[data-layout="columns"] .items  {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
[data-layout="bento"] .item ,
[data-layout="columns"] .item  {
  padding: 6px 7px;
}
[data-layout="bento"] .item:hover ,
[data-layout="columns"] .item:hover  {
  background: var(--hover);
}
[data-layout="bento"] .item__dot ,
[data-layout="columns"] .item__dot  {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  font-size: 0;
  color: transparent;
}
[data-layout="bento"] .item__txt ,
[data-layout="columns"] .item__txt  {
  flex: 1;
  min-width: 0;
}
[data-layout="bento"] .item__u ,
[data-layout="columns"] .item__u  {
  display: none;
}
[data-layout="bento"] .item__k ,
[data-layout="columns"] .item__k  {
  display: none;
}
.grp__empty {
  display: grid;
  place-items: center;
  min-height: 62px;
  border: 1px dashed var(--line-2);
  border-radius: 9px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dim);
}
html[data-edit="on"] .grp__empty {
  color: var(--muted);
}

/* =========================================================
   底栏
   ========================================================= */
.foot {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px var(--pad);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dim);
  border-top: 1px solid var(--line);
  background: var(--bg);
  transition: background 0.35s var(--ease), border-color 0.35s var(--ease);
}
.foot b {
  color: var(--muted);
  font-weight: 400;
}
.foot__sp {
  margin-left: auto;
  display: flex;
  gap: 8px;
  align-items: center;
}
.btn-s {
  padding: 5px 11px;
  border-radius: 6px;
  border: 1px solid var(--line-2);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  transition: color 0.18s, border-color 0.18s, background 0.18s;
}
.btn-s:hover {
  color: var(--ink);
  border-color: var(--line-3);
}
.btn-s.is-on {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}

/* =========================================================
   抽屉 / 弹层
   ========================================================= */
.veil {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
  background: var(--scrim);
}
.veil.on {
  display: block;
  animation: fade 0.2s var(--ease);
}
@keyframes fade {
  from {
    opacity: 0;
  }
}
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  width: min(400px, 100%);
  background: var(--panel);
  border-left: 1px solid var(--line-2);
  box-shadow: var(--shadow-l);
  display: flex;
  flex-direction: column;
  transform: translateX(102%);
  transition: transform 0.34s var(--ease);
}
.drawer.on {
  transform: none;
}
.drawer__h {
  display: flex;
  align-items: center;
  padding: 0 18px;
  height: 56px;
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
}
.drawer__h h2 {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 400;
}
.drawer__b {
  flex: 1;
  overflow: auto;
  padding: 16px 18px 30px;
}
.dsec {
  margin-bottom: 22px;
}
.dsec > h3 {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--dim);
  font-weight: 400;
  margin-bottom: 9px;
}
.drow {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  font-size: 13px;
  color: var(--ink-2);
  margin-bottom: 7px;
  transition: border-color 0.18s, background 0.18s, color 0.18s;
  text-align: left;
}
.drow:hover {
  border-color: var(--line-2);
  color: var(--ink);
}
.drow.is-on {
  border-color: var(--accent);
  color: var(--ink);
  background: var(--accent-soft);
}
.drow .sw {
  width: 16px;
  height: 16px;
  border-radius: 5px;
  border: 1px solid var(--line-3);
  flex: 0 0 auto;
}
.drow .end {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  color: var(--dim);
  text-transform: uppercase;
}
.drow.is-on .end {
  color: var(--accent);
}
.dnote {
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--dim);
  padding: 0 2px 6px;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: none;
  place-items: center;
  padding: 20px;
  background: var(--scrim);
}
.modal.on {
  display: grid;
}
.sheet {
  width: min(420px, 100%);
  background: var(--panel);
  border: 1px solid var(--line-2);
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--shadow-l);
  animation: pop-in 0.24s var(--ease);
}
.sheet h3 {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--dim);
  font-weight: 400;
  margin-bottom: 15px;
}
.fld {
  margin-bottom: 12px;
}
.fld label {
  display: block;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 6px;
}
.fld input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border-radius: 9px;
  border: 1px solid var(--line-2);
  background: var(--panel-2);
  outline: 0;
  font-size: 13.5px;
  transition: border-color 0.18s;
}
.fld input:focus {
  border-color: var(--accent);
}
.sws {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.sw-i {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid var(--line-3);
  position: relative;
}
.sw-i.is-on::after {
  content: "";
  position: absolute;
  inset: -4px;
  border: 1.5px solid var(--accent);
  border-radius: 50%;
}
.sheet__f {
  display: flex;
  gap: 9px;
  justify-content: flex-end;
  margin-top: 18px;
}
.btn {
  padding: 9px 16px;
  border-radius: 9px;
  border: 1px solid var(--line-2);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  transition: color 0.18s, border-color 0.18s, background 0.18s;
}
.btn:hover {
  color: var(--ink);
  border-color: var(--line-3);
}
.btn--p {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}
.btn--p:hover {
  color: var(--on-accent);
  filter: brightness(1.06);
}
.btn--d {
  color: #e0555f;
  border-color: color-mix(in srgb, #e0555f 35%, transparent);
}
.btn--d:hover {
  color: #e0555f;
  background: color-mix(in srgb, #e0555f 10%, transparent);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 200;
  transform: translate(-50%, 20px);
  opacity: 0;
  padding: 9px 16px;
  border-radius: 9px;
  background: var(--ink);
  color: var(--bg);
  font-size: 12.5px;
  pointer-events: none;
  transition: opacity 0.24s var(--ease), transform 0.24s var(--ease);
}
.toast.on {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* =========================================================
   响应式
   ========================================================= */
/* ---------- 布局 D：分栏（默认） ---------- */
[data-layout="columns"] .groups {
  column-count: 4;
  column-gap: clamp(16px, 2vw, 30px);
}
[data-layout="columns"] .grp {
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  page-break-inside: avoid;
  margin: 0 0 clamp(16px, 2.6vh, 26px);
}
[data-layout="columns"] .grp__h {
  margin-bottom: 7px;
}
[data-layout="columns"] .items {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* ---------- 智能区：常用 / 最近 ---------- */
.smart {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: clamp(10px, 1.2vw, 14px);
  margin-bottom: clamp(18px, 2.8vh, 28px);
}
.smart__col {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  box-shadow: var(--shadow-s);
  min-width: 0;
  transition: background 0.35s var(--ease), border-color 0.35s var(--ease);
}
.smart__h {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--dim);
}
.smart__h em {
  font-style: normal;
  margin-left: auto;
  color: var(--dim);
  letter-spacing: 0.1em;
}
.smart__list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--ink-2);
  transition: color 0.16s, border-color 0.16s, background 0.16s;
}
.chip:hover {
  color: var(--ink);
  border-color: var(--line-2);
  background: var(--panel-3);
}
.chip__d {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex: 0 0 6px;
}
.chip__n {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.04em;
  color: var(--dim);
}
.chip__t {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 首次使用时的提示条 */
.hintbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: clamp(16px, 2.4vh, 24px);
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px dashed var(--line-2);
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
}
.hintbar b {
  color: var(--ink);
  font-weight: 500;
}
.hintbar button {
  margin-left: auto;
  flex: 0 0 auto;
  padding: 5px 11px;
  border-radius: 7px;
  border: 1px solid var(--line-2);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.hintbar button:hover {
  color: var(--ink);
  border-color: var(--line-3);
}

@media (max-width: 1320px) {
  [data-layout="columns"] .groups {
    column-count: 3;
  }
}
@media (max-width: 1180px) {
  [data-layout="bento"] .grp {
    grid-column: span 4;
  }
}
@media (max-width: 940px) {
  [data-layout="columns"] .groups {
    column-count: 2;
  }
  .smart {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 900px) {
  .tile--clock {
    grid-column: span 5;
  }
  .tile--info {
    grid-column: span 7;
  }
  [data-layout="bento"] .grp {
    grid-column: span 6;
  }
}
@media (max-width: 720px) {
  :root {
    --pad: 14px;
  }
  .bar {
    height: 52px;
    gap: 6px;
  }
  .brand span,
  .brand b {
    display: none;
  }
  .seg button {
    width: 27px;
  }
  .pop__btn {
    padding: 0 8px;
  }
  .pop__btn .nm {
    display: none;
  }
  .pop__btn .av {
    display: block;
  }
  .qbar {
    margin: 14px 0 16px;
  }
  .qbar__box {
    height: 48px;
    padding-left: 12px;
  }
  #q {
    font-size: 15px;
  }
  .qbar__eng {
    display: none;
  }
  .qbar__go {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
  }
  .foot {
    gap: 10px;
  }
  .foot .hide-s {
    display: none;
  }
  [data-layout="columns"] .groups {
    column-count: 1;
  }
  [data-layout="bento"] .groups {
    grid-template-columns: repeat(2, 1fr);
  }
  [data-layout="bento"] .tiles {
    grid-template-columns: repeat(2, 1fr);
  }
  .tile--clock,
  .tile--info {
    grid-column: span 2;
    grid-row: auto;
  }
  .tile--clock {
    min-height: 130px;
  }
  [data-layout="bento"] .grp {
    grid-column: span 1;
  }
  [data-layout="cards"] .items {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 140px), 1fr));
    gap: 9px;
  }
  .drawer {
    width: 100%;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

