/* ============================================================
   回本助手 · 样式表
   ============================================================ */

:root {
  --bg: #f1f3f8;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e7ebf2;
  --border-strong: #d9e0ea;
  --text: #111c2d;
  --text-2: #5a6a80;
  --text-3: #909caf;
  --primary: #4a6cf7;
  --primary-dark: #3a58d6;
  --primary-soft: #eef2ff;
  --up: #e0403d;
  --up-soft: #fdeeee;
  --down: #0e9f5b;
  --down-soft: #e8f8f0;
  --warn: #d98a09;
  --radius-lg: 18px;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(17, 28, 45, 0.04), 0 1px 3px rgba(17, 28, 45, 0.03);
  --shadow-md: 0 10px 30px -16px rgba(17, 28, 45, 0.28);
  --shadow-lg: 0 24px 60px -24px rgba(17, 28, 45, 0.32);
  --font: "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: "SF Mono", "JetBrains Mono", Consolas, "Courier New", monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 12% -10%, #eaf0ff 0%, rgba(234, 240, 255, 0) 60%),
    radial-gradient(900px 500px at 88% 0%, #f0f7f4 0%, rgba(240, 247, 244, 0) 55%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
  line-height: 1.5;
}

button, input, select { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }

.app {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px 40px;
}

/* ------------------------------ 顶栏 ------------------------------ */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0 14px;
  margin-bottom: 20px;
  background: linear-gradient(to bottom, rgba(241, 243, 248, 0.96) 60%, rgba(241, 243, 248, 0));
  backdrop-filter: blur(10px);
}

.brand { display: flex; align-items: center; gap: 12px; }

.logo {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(140deg, #5b7bff, #3b52df);
  box-shadow: 0 8px 18px -8px rgba(74, 108, 247, 0.9);
}

.brand-text h1 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.brand-text p {
  font-size: 11.5px;
  color: var(--text-3);
  letter-spacing: 1.6px;
  margin-top: 1px;
}

.topbar-right { display: flex; align-items: center; gap: 8px; }

.market-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--text-2);
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
}

.market-chip .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-3);
}

.market-chip.open { color: var(--down); border-color: #cfeee0; background: #f2fbf7; }
.market-chip.open .dot { background: var(--down); box-shadow: 0 0 0 4px rgba(14, 159, 91, 0.13); animation: pulse 2.4s infinite; }

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(14, 159, 91, 0.16); }
  50% { box-shadow: 0 0 0 6px rgba(14, 159, 91, 0.04); }
}

.stamp { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; white-space: nowrap; }

.icon-btn {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-sm);
  transition: all 0.16s ease;
}

.icon-btn:hover { color: var(--primary); border-color: #cdd8ff; background: #fbfcff; transform: translateY(-1px); }
.icon-btn.small { width: 30px; height: 30px; font-size: 18px; line-height: 1; border-radius: 9px; }
.icon-btn.spin svg { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--up);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  display: grid;
  place-items: center;
  border: 2px solid var(--bg);
}

/* ------------------------------ 概览 ------------------------------ */

.summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.stat::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--primary);
  opacity: 0;
  transition: opacity 0.2s;
}

.stat.accent::after { opacity: 1; }
.stat .label { font-size: 12.5px; color: var(--text-3); display: flex; align-items: center; gap: 6px; }
.stat .value {
  font-size: 25px;
  font-weight: 700;
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
  font-family: var(--mono);
  letter-spacing: -0.4px;
}
.stat .sub { font-size: 12px; color: var(--text-3); margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat .value.up { color: var(--up); }
.stat .value.down { color: var(--down); }

/* ------------------------------ 工具条 ------------------------------ */

.board-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.search { position: relative; flex: 1; min-width: 260px; }

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  pointer-events: none;
}

.search input {
  width: 100%;
  height: 44px;
  padding: 0 40px 0 40px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  outline: none;
  transition: border-color 0.16s, box-shadow 0.16s;
}

.search input::placeholder { color: var(--text-3); }
.search input:focus { border-color: #c2cffb; box-shadow: 0 0 0 4px rgba(74, 108, 247, 0.1); }

.search-clear {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 8px;
  background: #f1f4f9;
  color: var(--text-3);
  font-size: 16px;
  line-height: 1;
  display: grid;
  place-items: center;
}

.board-tools { display: flex; align-items: center; gap: 10px; }

.select-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  font-size: 13px;
  color: var(--text-3);
}

.select-wrap select {
  border: none;
  background: transparent;
  outline: none;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
}

.ghost-btn {
  height: 44px;
  padding: 0 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  font-size: 13px;
  box-shadow: var(--shadow-sm);
  transition: all 0.16s;
  white-space: nowrap;
}

.ghost-btn:hover { border-color: var(--border-strong); color: var(--text); background: #fcfdff; }
.ghost-btn.small { height: 34px; padding: 0 12px; font-size: 12.5px; }

.primary-btn {
  height: 40px;
  padding: 0 20px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: linear-gradient(180deg, #5a7bff, var(--primary));
  color: #fff;
  font-weight: 600;
  font-size: 13.5px;
  box-shadow: 0 8px 18px -10px rgba(74, 108, 247, 0.95);
  transition: all 0.16s;
}

.primary-btn:hover { filter: brightness(1.04); transform: translateY(-1px); }
.primary-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.text-btn {
  border: none;
  background: none;
  color: var(--primary);
  font-size: 13px;
  padding: 4px 6px;
  border-radius: 6px;
}

.text-btn:hover { background: var(--primary-soft); }
.text-btn.danger { color: var(--up); }
.text-btn.danger:hover { background: var(--up-soft); }

/* ------------------------------ 卡片网格 ------------------------------ */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(318px, 1fr));
  gap: 16px;
}

.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px 14px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.22s, transform 0.22s, border-color 0.22s;
  animation: cardIn 0.34s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--border-strong); }
.card.hit { border-color: #f6c9c8; box-shadow: 0 0 0 3px rgba(224, 64, 61, 0.08), var(--shadow-md); }

.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }

.card-title { display: flex; flex-direction: column; min-width: 0; }

.card-title .name {
  font-size: 15.5px;
  font-weight: 650;
  letter-spacing: 0.2px;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-title .meta {
  font-size: 11.5px;
  color: var(--text-3);
  font-family: var(--mono);
  margin-top: 3px;
  letter-spacing: 0.3px;
}

.mkt-tag {
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 5px;
  background: #f1f4f9;
  color: var(--text-3);
  font-weight: 500;
  letter-spacing: 0.4px;
}

.card-actions { display: flex; gap: 4px; opacity: 0; transition: opacity 0.16s; }
.card:hover .card-actions, .card:focus-within .card-actions { opacity: 1; }

.mini-btn {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-3);
  display: grid;
  place-items: center;
  transition: all 0.14s;
}

.mini-btn:hover { background: #f2f5fa; color: var(--primary); border-color: var(--border); }
.mini-btn.del:hover { color: var(--up); background: var(--up-soft); }

.card-main { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-top: 10px; }

.price-block { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }

.price {
  font-size: 30px;
  font-weight: 700;
  font-family: var(--mono);
  letter-spacing: -1px;
  font-variant-numeric: tabular-nums;
  line-height: 1.05;
}

.price.up { color: var(--up); }
.price.down { color: var(--down); }
.price.flat { color: var(--text); }

.chg {
  font-size: 13px;
  font-weight: 600;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  padding: 2px 7px;
  border-radius: 7px;
}

.chg.up { color: var(--up); background: var(--up-soft); }
.chg.down { color: var(--down); background: var(--down-soft); }
.chg.flat { color: var(--text-2); background: #f2f5fa; }

.spark { width: 100%; height: 46px; margin: 8px 0 4px; display: block; overflow: visible; }

.mini-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 10px 0 2px;
  border-top: 1px dashed var(--border);
}

.mini-metrics div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mini-metrics label { font-size: 10.5px; color: var(--text-3); letter-spacing: 0.3px; }
.mini-metrics b {
  font-size: 13px;
  font-weight: 600;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mini-metrics b.up { color: var(--up); }
.mini-metrics b.down { color: var(--down); }

.card-alerts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }

.alert-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-family: var(--mono);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-2);
  transition: all 0.14s;
}

.alert-chip:hover { border-color: #cdd8ff; background: var(--primary-soft); color: var(--primary-dark); }
.alert-chip .arrow { font-size: 10px; font-weight: 700; color: var(--text-3); }
.alert-chip .gap { font-size: 10px; color: var(--text-3); font-family: var(--font); }
.alert-chip.above .arrow { color: var(--up); }
.alert-chip.below .arrow { color: var(--down); }
.alert-chip.done { opacity: 0.62; text-decoration: line-through; }
.alert-chip.off { opacity: 0.5; }
.alert-chip.near { border-color: #f7d9a8; background: #fffaf0; color: #b4750a; }
.alert-chip.near .gap { color: #b4750a; }

.add-alert {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px dashed var(--border-strong);
  background: transparent;
  color: var(--text-3);
  font-size: 11.5px;
  transition: all 0.14s;
}

.add-alert:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }

/* 10 年历史分位 */
.range-block {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}

.range-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.range-cap { font-size: 10.5px; color: var(--text-3); letter-spacing: 0.3px; }

.range-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 1px 8px;
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.lv-top { color: #cf3b36; }
.lv-high { color: #e2683c; }
.lv-mid { color: #6f7d92; }
.lv-low { color: #2f9e6b; }
.lv-bottom { color: #0e9f5b; }

.range-tag.lv-top { background: #fdeceb; }
.range-tag.lv-high { background: #fdf1e9; }
.range-tag.lv-mid { background: #f1f4f9; }
.range-tag.lv-low { background: #ebf7f1; }
.range-tag.lv-bottom { background: #e8f8f0; }

.range-bar {
  position: relative;
  height: 6px;
  border-radius: 999px;
  background: #eef1f6;
  margin: 8px 0 6px;
}

.range-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.42;
  transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.range-dot {
  position: absolute;
  top: 50%;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid currentColor;
  transform: translate(-50%, -50%);
  box-shadow: 0 1px 3px rgba(17, 28, 45, 0.18);
}

.range-foot {
  display: flex;
  justify-content: space-between;
  font-size: 10.5px;
  color: var(--text-3);
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

.range-mid { opacity: 0.85; }
.range-loading { font-size: 10.5px; color: var(--text-3); }

/* 空状态 */
.empty {
  grid-column: 1 / -1;
  padding: 60px 24px;
  text-align: center;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.6);
  color: var(--text-3);
}

.empty h3 { font-size: 15px; color: var(--text-2); margin-bottom: 6px; }

/* 骨架屏 */
.skeleton {
  height: 208px;
  border-radius: var(--radius-lg);
  background: linear-gradient(100deg, #eef1f7 20%, #f7f9fc 40%, #eef1f7 60%);
  background-size: 200% 100%;
  animation: shimmer 1.3s infinite linear;
}

@keyframes shimmer { to { background-position: -200% 0; } }

/* ------------------------------ 搜索建议 ------------------------------ */

.suggest {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 30;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  max-height: 320px;
  overflow: auto;
}

.suggest-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 9px;
  cursor: pointer;
}

.suggest-item:hover, .suggest-item.active { background: var(--primary-soft); }
.suggest-item .s-name { font-weight: 600; font-size: 13.5px; }
.suggest-item .s-code { font-family: var(--mono); font-size: 12px; color: var(--text-3); }
.suggest-item .s-add { margin-left: auto; font-size: 11.5px; color: var(--primary); }
.suggest-item .s-add.done { color: var(--text-3); }
.suggest-empty { padding: 14px; text-align: center; color: var(--text-3); font-size: 12.5px; }

/* ------------------------------ 抽屉 ------------------------------ */

.scrim {
  position: fixed;
  inset: 0;
  background: rgba(17, 28, 45, 0.28);
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s;
  z-index: 50;
}

.scrim.show { opacity: 1; pointer-events: auto; }

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 388px;
  max-width: 92vw;
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: -20px 0 60px -30px rgba(17, 28, 45, 0.4);
  transform: translateX(102%);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 60;
  display: flex;
  flex-direction: column;
}

.drawer.show { transform: none; }

.drawer-head {
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.drawer-head h2 { font-size: 15.5px; }
.drawer-head p { font-size: 12px; color: var(--text-3); margin-top: 3px; }
.drawer-actions { display: flex; align-items: center; gap: 2px; }
.drawer-body { flex: 1; overflow: auto; padding: 12px; }

.notify-item {
  padding: 12px 12px 12px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-2);
  margin-bottom: 8px;
  position: relative;
  animation: cardIn 0.3s ease both;
}

.notify-item.unread { background: #f7f9ff; border-color: #dbe3ff; }
.notify-item.unread::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 16px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--primary);
}

.notify-item .n-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.notify-item .n-title { font-weight: 650; font-size: 13.5px; }
.notify-item .n-time { font-size: 11px; color: var(--text-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.notify-item .n-body { font-size: 12.5px; color: var(--text-2); margin-top: 4px; line-height: 1.55; }

.notify-empty { text-align: center; color: var(--text-3); padding: 70px 20px; font-size: 13px; }
.notify-empty svg { opacity: 0.35; margin-bottom: 10px; }

/* ------------------------------ 弹窗 ------------------------------ */

.modal {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(17, 28, 45, 0.32);
  backdrop-filter: blur(3px);
}

.modal.show { display: flex; }

.modal-card {
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  background: var(--surface);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  animation: modalIn 0.26s cubic-bezier(0.22, 1, 0.36, 1) both;
  overflow: hidden;
}

.modal.wide .modal-card { max-width: 720px; }

@keyframes modalIn {
  from { opacity: 0; transform: translateY(12px) scale(0.985); }
  to { opacity: 1; transform: none; }
}

.modal-head {
  padding: 20px 22px 14px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.modal-head h2 { font-size: 17px; }
.modal-sub { font-size: 12.5px; color: var(--text-3); margin-top: 4px; font-family: var(--mono); }
.modal-body { padding: 4px 22px 18px; overflow: auto; }
.modal-foot {
  padding: 14px 22px 18px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: var(--surface-2);
}

.field { margin-bottom: 14px; position: relative; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field label { display: block; font-size: 12.5px; color: var(--text-2); margin-bottom: 6px; font-weight: 500; }
.label-note { color: var(--text-3); font-weight: 400; font-size: 11.5px; margin-left: 4px; }
.field-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.field-head label { margin: 0; }

.field input, .field select, .channel-body input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  outline: none;
  transition: border-color 0.16s, box-shadow 0.16s, background 0.16s;
}

.field input:focus, .field select:focus, .channel-body input:focus {
  border-color: #c2cffb;
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(74, 108, 247, 0.1);
}

.hint { font-size: 11.5px; color: var(--text-3); margin-top: 6px; line-height: 1.5; }
.hint code { background: #f1f4f9; padding: 1px 4px; border-radius: 4px; font-size: 11px; }

.symbol-search { position: relative; }
.stock-name-hint { min-height: 0; }

.section-title {
  font-size: 11.5px;
  color: var(--text-3);
  letter-spacing: 1.4px;
  text-transform: uppercase;
  margin: 18px 0 10px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.section-title:first-child { border-top: none; padding-top: 0; margin-top: 0; }

.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.switch input { display: none; }

.switch .track {
  width: 40px;
  height: 23px;
  border-radius: 999px;
  background: #dde3ec;
  position: relative;
  transition: background 0.2s;
  flex: none;
}

.switch .track::after {
  content: "";
  position: absolute;
  top: 2.5px;
  left: 2.5px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.16);
  transition: transform 0.2s;
}

.switch input:checked + .track { background: var(--primary); }
.switch input:checked + .track::after { transform: translateX(17px); }
.switch-text { font-size: 12.5px; color: var(--text-2); }

.setting-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
}

.setting-item b { font-size: 13.5px; font-weight: 600; }
.setting-item p { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
.setting-right { display: flex; align-items: center; gap: 10px; }

.channel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  background: var(--surface-2);
  overflow: hidden;
}

.channel summary {
  padding: 11px 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  list-style: none;
}

.channel summary::-webkit-details-marker { display: none; }
.channel summary::after { content: "+"; margin-left: auto; color: var(--text-3); font-size: 15px; }
.channel[open] summary::after { content: "−"; }
.channel .tag {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 5px;
  background: #eef2ff;
  color: var(--primary-dark);
  font-weight: 500;
}
.channel .tag.rec { background: #e8f3ff; color: #1a6bd6; }
.channel-body { padding: 0 14px 14px; display: flex; flex-direction: column; gap: 8px; }

/* 飞书自建应用 */
.channel-body select {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  outline: none;
  font-size: 13px;
}
.channel-body select:focus { border-color: #c2cffb; box-shadow: 0 0 0 3px rgba(74, 108, 247, 0.1); }
#feishuAppBox, #feishuHookBox { display: flex; flex-direction: column; gap: 8px; }
#feishuAppBox[hidden], #feishuHookBox[hidden], #feishuChatPick[hidden] { display: none; }
.feishu-recv { display: grid; grid-template-columns: 118px 1fr auto; gap: 8px; align-items: center; }
.feishu-recv .ghost-btn { white-space: nowrap; }
@media (max-width: 560px) {
  .feishu-recv { grid-template-columns: 1fr; }
}

/* 提醒规则编辑器 */
.alert-editor { display: flex; flex-direction: column; gap: 8px; }

.alert-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.alert-main {
  display: grid;
  grid-template-columns: 92px 1fr 104px 30px;
  gap: 8px;
  align-items: center;
}

.alert-row select, .alert-row input {
  height: 34px;
  padding: 0 8px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  outline: none;
  font-size: 12.5px;
}

.alert-row input:focus, .alert-row select:focus { border-color: #c2cffb; box-shadow: 0 0 0 3px rgba(74, 108, 247, 0.1); }
.alert-row .rm { border: none; background: transparent; color: var(--text-3); font-size: 17px; line-height: 1; }
.alert-row .rm:hover { color: var(--up); }

.alert-sub { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding-left: 2px; }
.alert-sub .a-preset {
  height: 26px;
  font-size: 11.5px;
  padding: 0 6px;
  border-radius: 6px;
  border: 1px dashed var(--border-strong);
  background: transparent;
  color: var(--text-3);
  max-width: 190px;
}
.alert-sub .a-preset:hover { border-color: var(--primary); color: var(--primary); }
.alert-sub .a-gap { font-size: 11px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.alert-sub .a-gap.hit { color: var(--warn); font-weight: 600; }

.alert-empty {
  padding: 14px;
  text-align: center;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text-3);
  font-size: 12.5px;
}

/* 详情 */
.tabs { display: flex; gap: 6px; margin-bottom: 12px; }

.tab {
  height: 32px;
  padding: 0 14px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 12.5px;
}

.tab.active { background: var(--primary-soft); border-color: #cdd8ff; color: var(--primary-dark); font-weight: 600; }

.chart-box {
  height: 300px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chart-box svg { width: 100%; height: 100%; }

.detail-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 14px;
}

.detail-stats div { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 9px 11px; }
.detail-stats label { display: block; font-size: 11px; color: var(--text-3); }
.detail-stats b { font-size: 13.5px; font-family: var(--mono); font-weight: 600; }

/* Toast */
.toast-wrap {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.toast {
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(17, 28, 45, 0.9);
  color: #fff;
  font-size: 13px;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.26s ease both;
  display: flex;
  align-items: center;
  gap: 8px;
  backdrop-filter: blur(6px);
}

.toast.err { background: rgba(190, 44, 42, 0.94); }
.toast.ok { background: rgba(12, 122, 71, 0.94); }
.toast.out { animation: toastOut 0.24s ease forwards; }

@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(6px); } }

/* 页脚 */
.footer {
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 11.5px;
  color: var(--text-3);
}

/* 响应式 */
@media (max-width: 900px) {
  .summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .app { padding: 0 16px 32px; }
  .brand-text p { display: none; }
  .stamp { display: none; }
}

@media (max-width: 560px) {
  .grid { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }
  .detail-stats { grid-template-columns: repeat(2, 1fr); }
  .summary { gap: 10px; }
  .stat .value { font-size: 20px; }
  .alert-main { grid-template-columns: 84px 1fr 92px 28px; gap: 6px; }
  .board-tools { width: 100%; }
  .select-wrap { flex: 1; }
  .card-actions { opacity: 1; }
}
