/* ==================================================================
   学霸笔记（付费 · 整库订阅）  样式
   notebook.css — 学生端 .nb-* + 运营端 .nba-*

   ★ 三条 CSS 纪律（都是这个项目里踩过的坑）
   -------------------------------------------
   1. **全部限定在 .nb-page / .nba-page 内**，不写裸选择器。
      主系统 style.css 已经有全局 button / input 规则，裸写会污染全站。

   2. **优先用字面色值，慎用「惰性引用」的 CSS 变量**。
      踩过的坑：.gzh-scope 上 `--g-primary-light: var(--primary-light, #dbeafe)`
      在 Chromium 的**伪元素**（如 ::file-selector-button）上解析会拿到空串，
      整条声明失效。本文件没有伪元素，但为保持一致仍以字面色值为主，
      只有确实安全的浅色变量才用 var()。

   3. **.nb-note 用 <button> 但必须清掉默认样式**。浏览器给 button 的
      font / text-align / background 默认值会让「一行行笔记」看起来像
      一堆灰按钮；这里显式重置。也顺手解决 Safari 的 appearance，
      否则 iOS 上圆角会消失。
   ================================================================== */

/* ==================================================================
   一、学生端
   ================================================================== */
.nb-page {
  max-width: 1080px;
  margin: 0 auto;
  padding: 18px 18px 60px;
}

/* ---------- 骨架屏 ---------- */
.nb-skel {
  height: 14px;
  border-radius: 7px;
  margin-bottom: 12px;
  background: linear-gradient(90deg, #eef2f7 25%, #f7fafc 37%, #eef2f7 63%);
  background-size: 400% 100%;
  animation: nb-shimmer 1.3s ease infinite;
}
@keyframes nb-shimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

/* ---------- 页头 ---------- */
.nb-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}
.nb-head h2 {
  margin: 0 0 5px;
  font-size: 21px;
  font-weight: 700;
  color: #0f172a;
}
.nb-sub {
  font-size: 13px;
  color: #64748b;
  line-height: 1.6;
}
.nb-head-badge {
  flex: none;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  color: #64748b;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
}
.nb-head-badge.on {
  color: #15803d;
  background: #dcfce7;
  border-color: #bbf7d0;
}

/* ---------- 订阅状态条 ---------- */
.nb-subb {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  margin-bottom: 14px;
  border-radius: 12px;
  background: linear-gradient(135deg, #ffffff, #f8fafc);
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .04);
}
.nb-subb-on {
  background: linear-gradient(135deg, #f0fdf4, #ecfdf5);
  border-color: #bbf7d0;
}
.nb-subb-ic {
  flex: none;
  width: 26px;
  height: 26px;
  line-height: 26px;
  text-align: center;
  border-radius: 50%;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  background: #22c55e;
}
.nb-subb-tx {
  font-size: 13.5px;
  color: #15803d;
  line-height: 1.6;
}
.nb-subb-l { flex: 1; min-width: 0; }
.nb-subb-t {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 3px;
}
.nb-subb-d {
  font-size: 12.5px;
  color: #64748b;
}

/* ---------- 按钮 ---------- */
.nb-btn {
  flex: none;
  padding: 9px 20px;
  border: 1px solid #cbd5e1;
  border-radius: 9px;
  background: #fff;
  color: #334155;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s, box-shadow .15s;
}
.nb-btn:hover { background: #f8fafc; border-color: #94a3b8; }
.nb-btn:disabled { opacity: .6; cursor: not-allowed; }
/* ★ 购买按钮用字面色值，不用 var(--primary, ...) —— 避免惰性引用坑 */
.nb-btn-buy {
  background: linear-gradient(135deg, #fb923c, #f97316);
  border-color: #f97316;
  color: #fff;
  box-shadow: 0 2px 8px rgba(249, 115, 22, .25);
}
.nb-btn-buy:hover {
  background: linear-gradient(135deg, #f97316, #ea580c);
  border-color: #ea580c;
}
.nb-btn-ghost { background: #f8fafc; }

/* ---------- 学科筛选条 ---------- */
.nb-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.nb-chip {
  padding: 6px 15px;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: #fff;
  color: #475569;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: all .15s;
}
.nb-chip:hover { border-color: #93c5fd; color: #2563eb; }
.nb-chip.on {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
  font-weight: 600;
}

/* ---------- 卡片 ---------- */
.nb-card {
  background: #fff;
  border: 1px solid #e8edf3;
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 14px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .04);
}

/* ---------- 笔记集 ---------- */
.nb-coll-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  margin-bottom: 6px;
  border-bottom: 1px dashed #eef2f7;
}
.nb-coll-title {
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
}
.nb-coll-sub {
  margin-top: 3px;
  font-size: 12.5px;
  color: #64748b;
}
.nb-coll-meta {
  flex: none;
  display: flex;
  align-items: center;
  gap: 7px;
}
.nb-tag {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #1d4ed8;
  background: #dbeafe;
}
.nb-tag-g {
  color: #b45309;
  background: #fef3c7;
}
.nb-coll-cnt {
  font-size: 12.5px;
  color: #94a3b8;
}
.nb-coll-empty {
  padding: 14px 0 4px;
  font-size: 13px;
  color: #94a3b8;
  text-align: center;
}

/* ---------- 笔记行 ---------- */
.nb-notes { display: flex; flex-direction: column; }
.nb-note {
  /* ★ 重置 button 默认样式（见文件头纪律 3） */
  appearance: none;
  -webkit-appearance: none;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px 10px;
  border: none;
  border-bottom: 1px solid #f1f5f9;
  background: transparent;
  font-family: inherit;
  font-size: 13.5px;
  text-align: left;
  cursor: pointer;
  border-radius: 8px;
  transition: background .13s;
}
.nb-note:last-child { border-bottom: none; }
.nb-note:hover { background: #f8fafc; }
.nb-note-ic {
  flex: none;
  width: 30px;
  height: 30px;
  line-height: 30px;
  text-align: center;
  border-radius: 9px;
  font-size: 15px;
  background: #eff6ff;
}
.nb-note.locked .nb-note-ic { background: #f1f5f9; }
.nb-note-main { flex: 1; min-width: 0; }
.nb-note-t {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 2px;
}
.nb-note.locked .nb-note-t { color: #64748b; }
.nb-note-s {
  display: block;
  font-size: 12.5px;
  color: #94a3b8;
  line-height: 1.5;
}
.nb-note-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 5px;
}
.nb-mini {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 5px;
  font-size: 11.5px;
  color: #64748b;
  background: #f1f5f9;
}
.nb-mini-ai {
  color: #7c3aed;
  background: #f3e8ff;
}
.nb-note-go {
  flex: none;
  font-size: 12.5px;
  font-weight: 600;
  color: #2563eb;
}
.nb-note.locked .nb-note-go { color: #f97316; }

/* ---------- 空态 ---------- */
.nb-empty {
  padding: 36px 20px;
  text-align: center;
}
.nb-empty-ic {
  font-size: 40px;
  line-height: 1;
  margin-bottom: 12px;
}
.nb-empty p {
  margin: 0 0 6px;
  font-size: 14.5px;
  font-weight: 600;
  color: #475569;
}
.nb-empty-d {
  font-size: 12.5px;
  color: #94a3b8;
  line-height: 1.7;
}

/* ---------- 弹窗 ---------- */
.nb-mask {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, .48);
}
.nb-mask[hidden] { display: none; }
.nb-dlg {
  width: 100%;
  max-width: 540px;
  max-height: 86vh;
  overflow: auto;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 20px 48px rgba(15, 23, 42, .22);
}
.nb-dlg-head {
  padding: 17px 20px;
  border-bottom: 1px solid #eef2f7;
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
}
.nb-dlg-from {
  margin-left: 9px;
  font-size: 12px;
  font-weight: 500;
  color: #94a3b8;
}
.nb-dlg-body { padding: 18px 20px; }
.nb-dlg-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px 18px;
  border-top: 1px solid #eef2f7;
}

/* ---------- 购买框 ---------- */
.nb-buybox {
  padding: 18px;
  border-radius: 12px;
  background: linear-gradient(135deg, #fff7ed, #ffedd5);
  border: 1px solid #fed7aa;
}
.nb-buy-tt {
  font-size: 15.5px;
  font-weight: 700;
  color: #9a3412;
  margin-bottom: 10px;
}
.nb-buy-price {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 14px;
}
.nb-buy-price b {
  font-size: 30px;
  font-weight: 800;
  color: #ea580c;
  line-height: 1;
}
.nb-buy-price span {
  font-size: 12.5px;
  color: #b45309;
}
.nb-buy-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.nb-buy-list li {
  font-size: 13.5px;
  color: #7c2d12;
  line-height: 2;
}
.nb-buy-note {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 9px;
  font-size: 12.5px;
  color: #92400e;
  background: #fffbeb;
  border: 1px solid #fde68a;
  line-height: 1.6;
}

/* ---------- 锁定态 ---------- */
.nb-lockbox {
  padding: 26px 20px;
  text-align: center;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
}
.nb-lock-ic {
  font-size: 40px;
  margin-bottom: 10px;
}
.nb-lock-tt {
  font-size: 15.5px;
  font-weight: 700;
  color: #334155;
  margin-bottom: 8px;
}
.nb-lock-d {
  font-size: 13px;
  color: #64748b;
  line-height: 1.8;
  margin-bottom: 14px;
}
.nb-lock-price {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 700;
  color: #ea580c;
  background: #fff7ed;
  border: 1px solid #fed7aa;
}
.nb-lock-price span {
  font-weight: 500;
  color: #b45309;
}

/* ---------- 阅读态 ---------- */
.nb-read-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}
.nb-read-body {
  font-size: 14px;
  line-height: 1.95;
  color: #334155;
  word-break: break-word;
}
.nb-read-body strong {
  color: #0f172a;
  font-weight: 700;
}

/* ==================================================================
   二、运营端
   ================================================================== */
.nba-page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 18px 18px 60px;
}
.nba-skel {
  height: 14px;
  border-radius: 7px;
  margin-bottom: 12px;
  background: linear-gradient(90deg, #eef2f7 25%, #f7fafc 37%, #eef2f7 63%);
  background-size: 400% 100%;
  animation: nb-shimmer 1.3s ease infinite;
}
.nba-card {
  background: #fff;
  border: 1px solid #e8edf3;
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 14px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .04);
}
.nba-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}
.nba-head h2 {
  margin: 0 0 5px;
  font-size: 21px;
  font-weight: 700;
  color: #0f172a;
}
.nba-sub {
  font-size: 13px;
  color: #64748b;
  line-height: 1.6;
}
.nba-head-ops {
  flex: none;
  display: flex;
  gap: 8px;
}
.nba-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 14px;
  border-bottom: 1px solid #e8edf3;
}
.nba-tab {
  padding: 9px 17px;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: #64748b;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: color .15s, border-color .15s;
}
.nba-tab:hover { color: #2563eb; }
.nba-tab.on {
  color: #2563eb;
  border-bottom-color: #2563eb;
}

/* ---------- 表格 ---------- */
.nba-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.nba-table th {
  padding: 9px 10px;
  text-align: left;
  font-size: 12.5px;
  font-weight: 600;
  color: #64748b;
  background: #f8fafc;
  border-bottom: 1px solid #e8edf3;
  white-space: nowrap;
}
.nba-table td {
  padding: 10px;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
  vertical-align: middle;
}
.nba-table tbody tr:hover { background: #fbfdff; }
.nba-tt {
  font-size: 13.5px;
  font-weight: 600;
  color: #1e293b;
}
.nba-sub2 {
  margin-top: 2px;
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.5;
}
.nba-slug {
  margin-top: 2px;
  font-size: 11.5px;
  color: #cbd5e1;
  font-family: ui-monospace, Menlo, Consolas, monospace;
}
.nba-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 5px;
}
.nba-mini {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 5px;
  font-size: 11.5px;
  color: #64748b;
  background: #f1f5f9;
}
.nba-mono {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 12px;
}
.nba-dim { color: #94a3b8; }
.nba-forever {
  color: #15803d;
  font-weight: 600;
}
.nba-ops {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

/* ---------- 徽标 ---------- */
.nba-badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: #64748b;
  background: #f1f5f9;
}
.nba-badge.on {
  color: #15803d;
  background: #dcfce7;
}
.nba-badge.off {
  color: #94a3b8;
  background: #f1f5f9;
}
.nba-badge.warn {
  color: #b45309;
  background: #fef3c7;
}
.nba-badge.ai {
  color: #7c3aed;
  background: #f3e8ff;
}

/* ---------- 统计卡 ---------- */
.nba-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.nba-stat {
  padding: 15px 17px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #e8edf3;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .04);
}
.nba-stat-v {
  font-size: 24px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.2;
}
.nba-stat-v span {
  margin-left: 3px;
  font-size: 12.5px;
  font-weight: 500;
  color: #94a3b8;
}
.nba-stat-l {
  margin-top: 4px;
  font-size: 12.5px;
  color: #64748b;
}

/* ---------- 区块标题 / 工具条 ---------- */
.nba-sec-tt {
  font-size: 14.5px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 12px;
}
.nba-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 16px;
}
.nba-fl {
  font-size: 13px;
  font-weight: 600;
  color: #475569;
}
.nba-bar-cnt {
  font-size: 13px;
  color: #94a3b8;
}
.nba-empty {
  padding: 36px 20px;
  text-align: center;
  font-size: 14px;
  color: #94a3b8;
}
.nba-empty-ic {
  font-size: 40px;
  margin-bottom: 12px;
}
.nba-empty p {
  margin: 0 0 6px;
  font-size: 14.5px;
  font-weight: 600;
  color: #475569;
}
.nba-empty-d {
  font-size: 12.5px;
  color: #94a3b8;
  line-height: 1.7;
}

/* ---------- 表单 ---------- */
.nba-field { margin-bottom: 15px; }
.nba-field > label {
  display: block;
  margin-bottom: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: #475569;
}
.nba-row2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.nba-input {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 11px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: #1e293b;
  font-family: inherit;
  font-size: 13.5px;
  transition: border-color .15s, box-shadow .15s;
}
.nba-input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}
.nba-input:disabled {
  background: #f8fafc;
  color: #94a3b8;
}
.nba-textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 11px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 9px;
  background: #fff;
  color: #1e293b;
  font-family: ui-monospace, Menlo, Consolas, "PingFang SC", monospace;
  font-size: 13px;
  line-height: 1.75;
  resize: vertical;
  transition: border-color .15s, box-shadow .15s;
}
.nba-textarea:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}
.nba-hint {
  margin-top: 6px;
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.65;
}
.nba-inline label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: #475569;
  cursor: pointer;
}
.nba-cfg-now {
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  color: #1d4ed8;
  background: #eff6ff;
  border: 1px solid #dbeafe;
}

/* ---------- AI 生成条 ---------- */
.nba-genbar {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 9px;
}
.nba-genbar-in {
  flex: 1;
  font-size: 12.5px;
  padding: 6px 10px;
}
.nba-aihint {
  color: #b45309;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 7px;
  padding: 7px 10px;
  margin-bottom: 9px;
}
.nba-aihint b { color: #92400e; }

/* ---------- 运营端弹窗 ---------- */
.nba-mask {
  position: fixed;
  inset: 0;
  z-index: 3100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, .48);
}
.nba-modal {
  width: 100%;
  max-width: 660px;
  max-height: 88vh;
  overflow: auto;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 20px 48px rgba(15, 23, 42, .24);
}
.nba-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #eef2f7;
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
}
.nba-x {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #94a3b8;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.nba-x:hover { background: #f1f5f9; color: #475569; }
.nba-modal-body { padding: 18px 20px; }
.nba-modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px 18px;
  border-top: 1px solid #eef2f7;
}

/* ---------- 运营端 toast ---------- */
.nba-toast {
  position: fixed;
  left: 50%;
  bottom: 44px;
  transform: translateX(-50%);
  z-index: 3200;
  max-width: 76vw;
  padding: 11px 20px;
  border-radius: 10px;
  background: rgba(15, 23, 42, .9);
  color: #fff;
  font-size: 13.5px;
  line-height: 1.5;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .28);
  animation: nba-toast-in .2s ease;
}
.nba-toast.err { background: rgba(185, 28, 28, .93); }
@keyframes nba-toast-in {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* ==================================================================
   三、响应式
   ================================================================== */
@media (max-width: 720px) {
  .nb-page, .nba-page { padding: 14px 12px 50px; }
  .nb-head, .nba-head {
    flex-direction: column;
    align-items: stretch;
  }
  .nb-subb {
    flex-direction: column;
    align-items: stretch;
    gap: 11px;
  }
  .nb-btn { width: 100%; }
  .nba-row2 { grid-template-columns: 1fr; }
  .nb-dlg, .nba-modal { max-width: 100%; }
  .nba-table { font-size: 12.5px; }
  .nba-table th, .nba-table td { padding: 8px 7px; }
  .nba-genbar { flex-direction: column; align-items: stretch; }
}
