/* ═══════════════════════════════════════════
   老板思维库 · 清爽简洁风
   ═══════════════════════════════════════════ */
:root {
  --bg: #f5f6fa;
  --card: #ffffff;
  --line: #e8eaf1;
  --blue: #2b5fd9;
  --blue-dark: #1e4bb0;
  --blue-bg: #eef3fd;
  --text: #2c3242;
  --muted: #7a8299;
  --faint: #a6adbf;
  --pink: #d9536f;
  --purple: #7a5fd0;
  --teal: #10949c;
  --gold: #b07d18;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { font-size: 15px; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
#app { max-width: 640px; margin: 0 auto; background: var(--bg); min-height: 100vh; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  padding: calc(var(--safe-top) + 10px) 14px 10px;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px;
}
.topbar .logo {
  width: 34px; height: 34px; border-radius: 9px; flex: none;
  background: var(--blue); color: #fff;
  display: grid; place-items: center;
  font-weight: 800; font-size: 16px;
}
.topbar .tt { flex: 1; min-width: 0; }
.topbar .tt h1 { font-size: 1.08rem; font-weight: 700; color: var(--text); letter-spacing: 0.02em; }
.topbar .tt p { font-size: 0.66rem; color: var(--faint); letter-spacing: 0.1em; margin-top: 1px; }
.topbar .back {
  border: 1px solid var(--line); background: #fff;
  color: var(--blue); border-radius: 9px; padding: 7px 12px;
  font-size: 0.85rem; cursor: pointer; flex: none;
}

/* ---------- 字体缩放 ---------- */
.zoombox { display: flex; gap: 6px; flex: none; }
.zoom {
  width: 34px; height: 34px; border-radius: 9px;
  border: 1px solid var(--line); background: #fff; color: var(--blue);
  font-size: 0.95rem; font-weight: 700; cursor: pointer;
  display: grid; place-items: center; line-height: 1;
}
.zoom:active { background: var(--blue-bg); }
.zoom:disabled { color: var(--faint); opacity: 0.45; }
.zoomlv {
  min-width: 40px; height: 34px; border-radius: 9px;
  background: var(--blue-bg); color: var(--blue-dark);
  font-size: 0.72rem; font-weight: 700; font-family: Consolas, monospace;
  display: grid; place-items: center;
}

/* ---------- 主内容 ---------- */
main { padding: 14px 14px calc(80px + var(--safe-bottom)); }

/* ---------- 首页 ---------- */
.hero { text-align: center; padding: 24px 0 20px; }
.hero .badge {
  display: inline-block; font-size: 0.68rem; letter-spacing: 0.22em;
  color: var(--blue); background: var(--blue-bg);
  border-radius: 999px; padding: 4px 14px; margin-bottom: 14px;
}
.hero h2 { font-size: 1.6rem; font-weight: 800; line-height: 1.35; color: var(--text); }
.hero p { color: var(--muted); font-size: 0.82rem; margin-top: 10px; }
.hero .mark {
  width: 84px; height: 84px; margin: 18px auto 0; border-radius: 24px;
  background: linear-gradient(160deg, #3a72e6, #2b5fd9);
  display: grid; place-items: center;
  color: #fff; font-size: 2.5rem; font-weight: 900;
  box-shadow: 0 10px 24px rgba(43, 95, 217, 0.28);
}

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.entry {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 17px 15px 14px; cursor: pointer; position: relative;
  transition: transform .12s ease;
}
.entry:active { transform: scale(0.97); }
.entry .k { font-size: 1.7rem; line-height: 1; margin-bottom: 10px; }
.entry h3 { font-size: 1rem; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.entry p { font-size: 0.7rem; color: var(--muted); line-height: 1.5; }
.entry .cnt {
  position: absolute; top: 12px; right: 12px; font-size: 0.64rem;
  font-family: Consolas, monospace; font-weight: 700;
  color: var(--blue); background: var(--blue-bg);
  padding: 2px 9px; border-radius: 999px;
}
.entry.wide { grid-column: 1 / -1; display: flex; align-items: center; gap: 14px; }
.entry.wide .k { margin: 0; }
.entry.a1 .k { color: var(--pink); } .entry.a1 .cnt { color: var(--pink); background: #fbeef1; }
.entry.a2 .k { color: var(--purple); } .entry.a2 .cnt { color: var(--purple); background: #f1eefb; }
.entry.a3 .k { color: var(--blue); }

/* ---------- 分区标题 ---------- */
.sec { display: flex; align-items: center; gap: 8px; margin: 24px 2px 11px; }
.sec::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.sec h2 { font-size: 0.95rem; font-weight: 700; color: var(--text); letter-spacing: 0.06em; }
.sec .n { font-size: 0.64rem; color: var(--faint); font-family: Consolas, monospace; }

/* ---------- 列表 ---------- */
.note-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 13px; padding: 13px 14px; margin-bottom: 9px; cursor: pointer;
  transition: transform .1s ease;
}
.note-item:active { transform: scale(0.98); }
.note-item .idx {
  flex: none; width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center;
  font-family: Consolas, monospace; font-size: 0.78rem; font-weight: 700;
}
.note-item.t-九大战略 .idx { background: #fbeef1; color: var(--pink); }
.note-item.t-平级要素 .idx { background: #f1eefb; color: var(--purple); }
.note-item.t-方法库56环 .idx { background: var(--blue-bg); color: var(--blue); }
.note-item.t-总纲 .idx, .note-item.t-原始语料 .idx { background: #faf3e0; color: var(--gold); }
.note-item .nx { flex: 1; min-width: 0; }
.note-item .nx h3 { font-size: 0.92rem; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.note-item .nx p { font-size: 0.68rem; color: var(--faint); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.note-item .arr { color: var(--faint); font-size: 1rem; }

/* ---------- 详情页 ---------- */
.detail-head { padding: 20px 2px 6px; }
.detail-head .crumb { font-size: 0.66rem; letter-spacing: 0.16em; color: var(--blue); margin-bottom: 10px; font-family: Consolas, "Microsoft YaHei", monospace; }
.detail-head h2 { font-size: 1.45rem; font-weight: 800; line-height: 1.4; color: var(--text); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 4px; }
.chip {
  font-size: 0.66rem; padding: 3px 10px; border-radius: 999px;
  background: var(--blue-bg); color: var(--blue-dark);
  font-family: Consolas, "Microsoft YaHei", monospace;
}
.note-body { padding-top: 8px; }

/* markdown 渲染 */
.note-body h2 {
  color: var(--text); font-size: 1.05rem; font-weight: 700;
  margin: 24px 0 10px; padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}
.note-body h3 { color: var(--text); font-size: 0.95rem; font-weight: 700; margin: 20px 0 8px; }
.note-body p { line-height: 1.9; margin: 10px 0; color: #3c4356; }
.note-body strong { color: #1a1f2e; font-weight: 700; }
.note-body ul { margin: 8px 0 8px 4px; list-style: none; }
.note-body li { position: relative; padding: 4px 0 4px 20px; line-height: 1.8; color: #3c4356; }
.note-body li::before {
  content: ''; position: absolute; left: 2px; top: 13px;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--blue);
}
.note-body blockquote {
  border-left: 3px solid #b8c6e8; border-radius: 0 10px 10px 0;
  background: #f3f6fc;
  padding: 10px 14px; margin: 12px 0; color: #4a5266;
  line-height: 1.8; font-size: 0.88rem;
}
.note-body hr { border: none; height: 1px; background: var(--line); margin: 22px 0; }
.tablewrap { overflow-x: auto; margin: 12px 0; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.note-body table { border-collapse: collapse; width: 100%; font-size: 0.78rem; }
.note-body th { background: #f4f6fb; color: var(--text); white-space: nowrap; font-weight: 700; }
.note-body th, .note-body td { border-bottom: 1px solid var(--line); padding: 8px 10px; text-align: left; line-height: 1.65; vertical-align: top; }
.note-body tr:last-child td { border-bottom: none; }
.wlink { color: var(--blue); border-bottom: 1px solid rgba(43, 95, 217, 0.35); cursor: pointer; }
.wlink.un { color: var(--pink); border-bottom-color: rgba(217, 83, 111, 0.35); }

/* 相关推荐 */
.relbox { margin-top: 24px; }

/* ---------- 搜索 ---------- */
.searchbar {
  display: flex; gap: 10px; align-items: center;
  background: #fff; border: 1px solid var(--line);
  border-radius: 12px; padding: 11px 14px; margin-bottom: 14px;
}
.searchbar input {
  flex: 1; background: none; border: none; outline: none;
  color: var(--text); font-size: 0.95rem; font-family: inherit;
}
.searchbar input::placeholder { color: var(--faint); }
.searchbar .ic { color: var(--blue); font-size: 1rem; }
.hint { text-align: center; color: var(--faint); font-size: 0.75rem; padding: 30px 0; }

/* ---------- 底部导航 ---------- */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 60;
  max-width: 640px; margin: 0 auto;
  display: flex;
  background: #ffffff;
  border-top: 1px solid var(--line);
  padding: 7px 6px calc(7px + var(--safe-bottom));
}
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  color: var(--faint); cursor: pointer; padding: 4px 0; border-radius: 10px;
}
.tab .ti { font-size: 1.15rem; line-height: 1; }
.tab span { font-size: 0.62rem; }
.tab.on { color: var(--blue); font-weight: 600; }

/* ---------- 启动页 ---------- */
#splash {
  position: fixed; inset: 0; z-index: 200; background: #fff;
  display: grid; place-items: center; transition: opacity .4s ease;
}
#splash.hide { opacity: 0; pointer-events: none; }
#splash .in { text-align: center; }
#splash .mark2 {
  width: 76px; height: 76px; margin: 0 auto 16px; border-radius: 22px;
  background: linear-gradient(160deg, #3a72e6, #2b5fd9);
  display: grid; place-items: center;
  color: #fff; font-size: 2.1rem; font-weight: 900;
  box-shadow: 0 10px 24px rgba(43, 95, 217, 0.28);
}
#splash h2 { font-size: 1.1rem; letter-spacing: 0.3em; font-weight: 700; color: var(--text); }
#splash p { font-size: 0.64rem; color: var(--faint); letter-spacing: 0.24em; margin-top: 8px; }

/* ---------- 安装提示 ---------- */
.install-tip {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid #e3ddc4; background: #fdf9ec;
  border-radius: 12px; padding: 11px 14px; margin: 14px 0; font-size: 0.74rem; color: #8a6d1a;
  cursor: pointer; line-height: 1.6;
}
.install-tip .x { margin-left: auto; color: var(--faint); flex: none; }

/* ---------- 字号提示气泡 ---------- */
#zoomToast {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(92px + var(--safe-bottom)); z-index: 120;
  background: rgba(30, 36, 48, 0.92); color: #fff;
  font-size: 0.78rem; padding: 8px 16px; border-radius: 999px;
  opacity: 0; transition: opacity .25s ease; pointer-events: none;
}
#zoomToast.show { opacity: 1; }

@media (min-width: 641px) { body { border-left: 1px solid var(--line); border-right: 1px solid var(--line); } }
