/* ===== mine · Lime Flat · 4 大类 + 5 小类 · v12 ===== */

:root {
  /* 表面 */
  --bg: #EFEFE9;           /* 浅米灰背景 */
  --surface: #FFFFFF;      /* 卡片白 */
  --surface-2: #F5F5F0;    /* 次级浅米 */
  --surface-3: #0F0F0F;    /* 深色块 */

  /* 文字 */
  --text: #0F0F0F;         /* 主文字近黑 */
  --text-soft: #5C5C5C;    /* 副文字 */
  --text-mute: #A8A8A8;    /* 更淡 */

  /* 线 */
  --line: #E5E5E0;         /* 极淡米线 */
  --line-strong: #C8C8C0;

  /* 主色 */
  --primary: #D0F050;      /* 柠檬绿 */
  --primary-deep: #B8DC3A;
  --primary-soft: #EFFFD6; /* 极淡绿 */
  --accent: #F5F1B3;       /* 奶油黄 */
  --accent-soft: #FBF8E0;

  /* 4 大类色（生活/追星/工作/学习）— 浅色 */
  --cat-life-color: #0F7A3D;  --cat-life-bg: #DEEFD3;
  --cat-fan-color:  #B5345F;  --cat-fan-bg:  #F7D9E2;
  --cat-work-color: #B85C00;  --cat-work-bg: #FCE5C5;
  --cat-study-color:#1B5DA8;  --cat-study-bg:#DDE7F5;

  /* 5 小类型色（文案/图片/视频/链接/BGM） */
  --type-text-color: #0F7A3D;  --type-text-bg: #DEEFD3;
  --type-image-color:#3D7A6E;  --type-image-bg:#DCEBE3;
  --type-video-color:#1B5DA8;  --type-video-bg:#DDE7F5;
  --type-link-color: #2E5A8A;  --type-link-bg: #DCE5F2;
  --type-bgm-color:  #8A7A1A;  --type-bgm-bg:  #F5F1B3;

  /* 平台色（官方 logo 配色） */
  --plat-xhs: #FF2442;    /* 小红书 红 */
  --plat-douyin: #FE2C55; /* 抖音 红粉 */
  --plat-bili: #FB7299;   /* B站 粉 */
  --plat-weibo: #FF8200;  /* 微博 黄 */
  --plat-yt: #FF0000;     /* YouTube 红 */
  --plat-web: #6B7280;    /* 网页 灰 */

  /* 圆角 */
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 22px;
  --radius-xl: 28px;
  --radius-pill: 999px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

/* 所有输入框统一 ≥16px，避免 iOS 聚焦时自动放大页面 */
input, textarea, select { font-size: 16px; font-family: inherit; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC",
    "Helvetica Neue", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  touch-action: manipulation;
  overscroll-behavior-y: contain;
  overflow-x: hidden;
}

.app {
  max-width: 480px; min-height: 100vh; min-height: 100dvh; margin: 0 auto;
  position: relative;
  padding: 28px 20px calc(120px + env(safe-area-inset-bottom));
}

/* ===== 顶栏：紧凑 + 明确主题开关 ===== */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 0 18px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  background: var(--text); color: var(--bg);
  border-radius: 11px;
}
.brand-mark svg { width: 20px; height: 20px; stroke-width: 2.4; }
.brand-name {
  font-size: 28px; font-weight: 900; letter-spacing: -1.1px;
  color: var(--text); line-height: 1;
}

/* 主题开关：已移除（v16 起仅保留日间模式） */

.view { animation: fadeUp 0.28s ease; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* 标题更紧凑 */
h2.section-title {
  font-size: 32px; font-weight: 900; letter-spacing: -1.1px;
  margin: 4px 0 16px; color: var(--text);
  line-height: 1.05;
}
.section-sub {
  font-size: 12px; color: var(--text-mute);
  margin: -8px 0 18px; font-weight: 600;
}

/* ===== 捕获 composer ===== */
.composer {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 18px 18px 14px;
  border: 1px solid var(--line);
  margin-bottom: 18px;
}
.composer textarea {
  width: 100%; border: none; outline: none; resize: none;
  background: transparent; color: var(--text);
  font-size: 16px;
  min-height: 72px;
  font-family: inherit;
  line-height: 1.5;
}
.composer textarea::placeholder { color: var(--text-mute); }

/* 统一输入工具栏：4 附件 + 1 类型药丸 = 同行 5 个均分 */
.composer-toolbar {
  display: flex; align-items: center; gap: 6px;
  margin-top: 12px;
}
.attach-pill {
  flex: 1 1 0; min-width: 0;
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  padding: 8px 6px; border-radius: var(--radius-pill);
  background: var(--surface-2); color: var(--text);
  border: none; cursor: pointer; font-size: 12.5px;
  font-family: inherit; font-weight: 700;
  white-space: nowrap; overflow: hidden;
  transition: background 0.15s ease, transform 0.1s ease;
}
.attach-pill:active { transform: scale(0.96); background: var(--primary); }
.attach-pill.on { background: var(--primary-soft); color: var(--text); }
.attach-pill svg { width: 13px; height: 13px; stroke-width: 2.4; flex-shrink: 0; }

/* 类型药丸：清晰可点；提示用户当前类型可切换 */
.type-pill {
  flex: 1 1 0; min-width: 0;
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  padding: 8px 6px; border-radius: var(--radius-pill);
  background: var(--text); color: var(--bg);
  font-size: 12.5px; font-weight: 800;
  cursor: pointer; border: none; font-family: inherit;
  white-space: nowrap; overflow: hidden;
  position: relative;
  transition: background 0.15s ease, color 0.15s ease;
}
.type-pill[data-cat="text"]  { background: var(--type-text-color);  color: #fff; }
.type-pill[data-cat="image"] { background: var(--type-image-color); color: #fff; }
.type-pill[data-cat="video"] { background: var(--type-video-color); color: #fff; }
.type-pill[data-cat="bgm"]   { background: var(--type-bgm-color);   color: #1a1606; }
.type-pill[data-cat="link"]  { background: var(--type-link-color);  color: #fff; }
.type-pill .dot { background: rgba(255,255,255,0.7); }
.type-pill:active { transform: scale(0.96); }
.type-pill .dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--primary);
  animation: blink 1.4s ease-in-out infinite;
}
.type-pill .switch {
  width: 20px; height: 20px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(255,255,255,0.15); color: var(--bg);
  margin-left: 2px;
}
.type-pill .switch svg { width: 11px; height: 11px; stroke-width: 2.6; }
.type-pill[data-tip]::after {
  content: attr(data-tip);
  position: absolute; top: calc(100% + 8px); right: 0;
  background: var(--text); color: var(--bg);
  font-size: 11px; font-weight: 600;
  padding: 6px 10px; border-radius: 8px; white-space: nowrap;
  pointer-events: none; opacity: 0; transition: opacity 0.18s ease;
  z-index: 50;
}
.type-pill:hover[data-tip]::after,
.type-pill:active[data-tip]::after { opacity: 1; }
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }

.input-row { margin-top: 10px; display: flex; gap: 8px; align-items: center; }
.input-row input, .input-row textarea {
  flex: 1; padding: 11px 14px; border-radius: 14px;
  background: var(--surface-2); border: none;
  outline: none; color: var(--text); font-size: 16px; font-family: inherit;
  resize: none;
}
.input-row input:focus, .input-row textarea:focus { background: var(--primary-soft); }
.input-row .pill-close {
  background: var(--surface-2); border: none; cursor: pointer;
  width: 38px; height: 38px; border-radius: 12px; color: var(--text);
  display: grid; place-items: center;
}
.input-row .pill-close:active { background: var(--primary); }
.input-row .pill-close svg { width: 15px; height: 15px; stroke-width: 2.4; }

/* 链接模式下的二级面板：来源 chip + 备注 同一行 */
.link-panel {
  margin-top: 10px; padding: 6px 10px;
  background: var(--surface-2); border-radius: 14px;
  display: flex; flex-direction: row; align-items: center; gap: 8px;
}
.link-panel .plat-chip {
  flex-shrink: 0; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; border-radius: var(--radius-pill);
  font-size: 12px; font-weight: 800;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--line);
}
.link-panel .plat-chip .dot {
  width: 9px; height: 9px; border-radius: 50%;
}
.link-panel #linkNote {
  flex: 1; min-width: 0;
  border: none; outline: none; background: transparent;
  font-size: 16px; font-family: inherit; color: var(--text);
  padding: 7px 0;
}
.link-panel #linkNote::placeholder { color: var(--text-mute); }

/* 平台 chip 颜色（自动用 CSS 变量） */
.link-panel[data-plat="xhs"] .plat-chip { color: var(--plat-xhs); border-color: var(--plat-xhs); background: color-mix(in srgb, var(--plat-xhs) 12%, var(--surface)); }
.link-panel[data-plat="xhs"] .plat-chip .dot { background: var(--plat-xhs); }
.link-panel[data-plat="douyin"] .plat-chip { color: var(--plat-douyin); border-color: var(--plat-douyin); background: color-mix(in srgb, var(--plat-douyin) 12%, var(--surface)); }
.link-panel[data-plat="douyin"] .plat-chip .dot { background: var(--plat-douyin); }
.link-panel[data-plat="bili"] .plat-chip { color: var(--plat-bili); border-color: var(--plat-bili); background: color-mix(in srgb, var(--plat-bili) 12%, var(--surface)); }
.link-panel[data-plat="bili"] .plat-chip .dot { background: var(--plat-bili); }
.link-panel[data-plat="weibo"] .plat-chip { color: var(--plat-weibo); border-color: var(--plat-weibo); background: color-mix(in srgb, var(--plat-weibo) 12%, var(--surface)); }
.link-panel[data-plat="weibo"] .plat-chip .dot { background: var(--plat-weibo); }
.link-panel[data-plat="yt"] .plat-chip { color: var(--plat-yt); border-color: var(--plat-yt); background: color-mix(in srgb, var(--plat-yt) 12%, var(--surface)); }
.link-panel[data-plat="yt"] .plat-chip .dot { background: var(--plat-yt); }
.link-panel[data-plat="web"] .plat-chip { color: var(--plat-web); border-color: var(--plat-web); background: color-mix(in srgb, var(--plat-web) 12%, var(--surface)); }
.link-panel[data-plat="web"] .plat-chip .dot { background: var(--plat-web); }
.link-panel[data-plat="auto"] .plat-chip { color: var(--text-mute); }
.link-panel[data-plat="auto"] .plat-chip .dot { background: var(--text-mute); }

.preview-list { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.preview-chip {
  position: relative; width: 78px; height: 78px; border-radius: 14px;
  overflow: hidden; background: var(--surface-2);
}
.preview-chip img, .preview-chip video { width: 100%; height: 100%; object-fit: cover; }
.preview-chip.audio { display: grid; place-items: center; color: var(--text); }
.preview-chip .x {
  position: absolute; top: 5px; right: 5px;
  width: 22px; height: 22px; border-radius: 50%;
  background: rgba(0,0,0,0.55); color: #fff; border: none;
  display: grid; place-items: center; cursor: pointer; font-size: 13px;
}

.ocr-status {
  margin-top: 10px; padding: 11px 14px; border-radius: 14px;
  background: var(--accent-soft); color: var(--text);
  font-size: 12px; line-height: 1.5;
}

.save-btn {
  width: auto; min-width: 50%; margin: 14px auto 0; padding: 12px 26px;
  display: block;
  border: none; border-radius: var(--radius-pill);
  background: var(--primary); color: var(--text); font-size: 14px; font-weight: 700;
  font-family: inherit; cursor: pointer; letter-spacing: 0.3px;
  transition: transform 0.1s ease;
}
.save-btn:active { transform: scale(0.97); }

/* ===== 类别快入口：通用 3 列网格（兼容旧） + 大类 1行4列 ===== */
.cat-rail {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
  margin-bottom: 14px;
}
.cat-card {
  background: var(--surface); border-radius: 18px;
  padding: 14px 6px 12px;
  text-align: center; cursor: pointer; position: relative;
  transition: transform 0.1s ease;
  border: 1px solid var(--line);
  font-family: inherit; color: inherit;
}
.cat-card:active { transform: scale(0.96); }
.cat-card .ico {
  width: 36px; height: 36px; margin: 0 auto 6px;
  display: grid; place-items: center;
  background: var(--surface-2); border-radius: 11px;
  color: var(--text);
}
/* 大类按 --bc/--bb 着色（按钮 inline 风格变量） */
.cat-card[data-big="life"]  .ico { background: var(--cat-life-bg);  color: var(--cat-life-color); }
.cat-card[data-big="fan"]   .ico { background: var(--cat-fan-bg);   color: var(--cat-fan-color); }
.cat-card[data-big="work"]  .ico { background: var(--cat-work-bg);  color: var(--cat-work-color); }
.cat-card[data-big="study"] .ico { background: var(--cat-study-bg); color: var(--cat-study-color); }
.cat-card .ico svg { width: 18px; height: 18px; stroke-width: 2.2; }
.cat-card .name {
  font-size: 13px; color: var(--text); font-weight: 800;
  letter-spacing: -0.1px;
}
.cat-card .count {
  position: absolute; top: -5px; right: -2px; font-size: 10px;
  background: var(--text); color: var(--bg);
  padding: 2px 6px; border-radius: 999px; font-weight: 800;
  min-width: 18px; text-align: center;
}
.cat-card.on { background: var(--text); border-color: var(--text); }
.cat-card.on .name { color: var(--bg); }
.cat-card.on .ico { background: var(--bg); color: var(--text); }
/* 大类卡：更大一些，作为翻翻看主入口 */
.cat-card.big { padding: 18px 6px 14px; border-radius: 20px; }
.cat-card.big .ico { width: 44px; height: 44px; border-radius: 13px; }
.cat-card.big .ico svg { width: 22px; height: 22px; }
.cat-card.big .name { font-size: 14px; }
.cat-card.big.on {
  border-color: var(--text);
  background: var(--surface-2);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
/* tooltip：猫卡长按/悬停时显示具体用法 */
.cat-card[data-tip]::after {
  content: attr(data-tip);
  position: absolute; bottom: calc(100% + 6px); left: 50%;
  transform: translateX(-50%);
  background: var(--text); color: var(--bg);
  font-size: 11px; font-weight: 600;
  padding: 6px 10px; border-radius: 8px; white-space: nowrap;
  pointer-events: none; opacity: 0; transition: opacity 0.18s ease;
  z-index: 50;
  max-width: 220px;
}
.cat-card:hover[data-tip]::after,
.cat-card:active[data-tip]::after { opacity: 1; }

/* ===== 工具栏 ===== */
.toolbar {
  display: flex; gap: 8px; align-items: center; margin-bottom: 16px;
  flex-wrap: wrap;
}
.search-wrap { flex: 1; min-width: 140px; position: relative; }
.search-wrap > svg {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  width: 14px; height: 14px; color: var(--text-soft); stroke-width: 2.4;
  pointer-events: none;
}
.search-wrap input {
  width: 100%; padding: 11px 90px 11px 38px;
  border-radius: var(--radius-pill);
  background: var(--surface); border: 1px solid var(--line);
  color: var(--text); font-size: 16px; outline: none; font-family: inherit;
}
.search-wrap input:focus { border-color: var(--text); }
.search-btn {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  height: 36px; padding: 0 14px;
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  background: var(--text); color: var(--bg);
  border: 0; border-radius: var(--radius-pill);
  font-family: inherit; font-size: 13px; font-weight: 800;
  cursor: pointer; white-space: nowrap;
  transition: opacity 0.15s ease, transform 0.1s ease;
}
.search-btn svg { width: 13px; height: 13px; }
.search-btn:active { transform: translateY(-50%) scale(0.96); }
.search-btn:hover { opacity: 0.88; }
/* 收窄屏：按钮只保留图标 */
@media (max-width: 360px) {
  .search-btn { padding: 0; width: 36px; }
  .search-btn span { display: none; }
  .search-wrap input { padding-right: 50px; }
}

.filter-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-pill {
  padding: 8px 13px; border-radius: var(--radius-pill);
  background: var(--surface); border: 1px solid var(--line);
  color: var(--text); font-size: 12px; cursor: pointer;
  font-family: inherit; font-weight: 700;
}
.filter-pill.on { background: var(--text); color: var(--bg); border-color: var(--text); }

/* ===== 卡片 ===== */
.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 13px 15px 10px;
  margin-bottom: 10px; position: relative;
  border: 1px solid var(--line);
  transition: transform 0.1s ease;
}
.card:active { transform: scale(0.99); }
.card::before {
  content: ""; position: absolute; left: 0; top: 13px; bottom: 13px;
  width: 4px; border-radius: 0 4px 4px 0;
  background: var(--cat-color, var(--primary));
}
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 7px; }
.card-cat {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 11px; border-radius: var(--radius-pill);
  background: var(--cat-bg, var(--primary-soft));
  color: var(--cat-color, var(--text));
  font-size: 11px; font-weight: 800;
  border: none; cursor: pointer; font-family: inherit;
  transition: filter 0.15s ease, transform 0.1s ease;
}
.card-cat:active { filter: brightness(0.96); transform: scale(0.97); }
.card-cat svg { width: 11px; height: 11px; stroke-width: 2.4; }
.card-time { font-size: 11px; color: var(--text-mute); font-weight: 500; }

.card-text {
  font-size: 16px; line-height: 1.55; color: var(--text);
  word-break: break-word; white-space: pre-wrap;
  font-weight: 500;
  letter-spacing: -0.1px;
  margin: 0;
}
/* 长图/截图完整呈现，不再裁剪截断 */
.card-img {
  width: 100%; max-height: 560px; object-fit: contain; background: var(--surface-2);
  border-radius: 14px; margin-top: 8px; cursor: zoom-in;
}
/* 多图：网格缩略，点击任意一张查看完整原图并可缩放 */
.card-imgs {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px;
  margin-top: 8px;
}
.card-img-thumb {
  width: 100%; aspect-ratio: 1 / 1; object-fit: cover;
  border-radius: 12px; cursor: zoom-in; background: var(--surface-2);
}
.card-audio { margin-top: 8px; width: 100%; }

/* 链接卡片：平台 chip + 显式打开按钮 + 备注标签 */
.card-link {
  display: flex; flex-direction: column; gap: 8px;
  margin-top: 10px;
  padding: 12px 14px; border-radius: 14px;
  background: var(--surface-2); color: var(--text);
  font-size: 14px; font-weight: 600;
}
.card-link .row { display: flex; align-items: center; gap: 8px; }
.card-link .url {
  flex: 1; min-width: 0;
  font-size: 13px; color: var(--text-soft); font-weight: 500;
  word-break: break-all; white-space: normal;
}
.card-link .plat-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: var(--radius-pill);
  font-size: 11px; font-weight: 800; flex-shrink: 0;
}
.card-link .plat-chip .dot {
  width: 8px; height: 8px; border-radius: 50%;
}
.card-link .link-open {
  margin-left: auto; flex-shrink: 0;
  width: 30px; height: 30px; border-radius: 10px;
  border: none; background: var(--surface); color: var(--text-soft);
  display: grid; place-items: center; cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.card-link .link-open:active { background: var(--primary); color: var(--text); }
.card-link .link-open svg { width: 15px; height: 15px; stroke-width: 2.4; }
.card-link[data-plat="xhs"]    .plat-chip { color: var(--plat-xhs);    background: color-mix(in srgb, var(--plat-xhs)    12%, var(--surface)); }
.card-link[data-plat="xhs"]    .plat-chip .dot { background: var(--plat-xhs); }
.card-link[data-plat="douyin"] .plat-chip { color: var(--plat-douyin); background: color-mix(in srgb, var(--plat-douyin) 12%, var(--surface)); }
.card-link[data-plat="douyin"] .plat-chip .dot { background: var(--plat-douyin); }
.card-link[data-plat="bili"]   .plat-chip { color: var(--plat-bili);   background: color-mix(in srgb, var(--plat-bili)   12%, var(--surface)); }
.card-link[data-plat="bili"]   .plat-chip .dot { background: var(--plat-bili); }
.card-link[data-plat="weibo"]  .plat-chip { color: var(--plat-weibo);  background: color-mix(in srgb, var(--plat-weibo)  12%, var(--surface)); }
.card-link[data-plat="weibo"]  .plat-chip .dot { background: var(--plat-weibo); }
.card-link[data-plat="yt"]     .plat-chip { color: var(--plat-yt);     background: color-mix(in srgb, var(--plat-yt)     12%, var(--surface)); }
.card-link[data-plat="yt"]     .plat-chip .dot { background: var(--plat-yt); }
.card-link[data-plat="web"]    .plat-chip { color: var(--plat-web);    background: color-mix(in srgb, var(--plat-web)    12%, var(--surface)); }
.card-link[data-plat="web"]    .plat-chip .dot { background: var(--plat-web); }

.card-actions { display: flex; justify-content: flex-end; gap: 2px; margin-top: 5px; }
.card-actions button {
  background: transparent; border: none; cursor: pointer;
  width: 34px; height: 34px; border-radius: 11px;
  display: grid; place-items: center; color: var(--text-soft);
  transition: background 0.15s ease, color 0.15s ease;
}
.card-actions button:hover { background: var(--surface-2); color: var(--text); }
.card-actions button.on { color: var(--text); background: var(--primary); }
.card-actions svg { width: 17px; height: 17px; stroke-width: 2.4; }

/* ===== 空状态 ===== */
.empty { text-align: center; padding: 36px 16px 24px; color: var(--text-soft); }
.empty h3 {
  font-size: 18px; font-weight: 800; color: var(--text); margin: 0 0 6px;
  letter-spacing: -0.3px;
}
.empty p { font-size: 13px; color: var(--text-mute); margin: 0; }

/* ===== 底部导航 ===== */
.tabbar {
  position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  max-width: calc(480px - 36px); width: calc(100% - 36px);
  background: var(--surface);
  border-radius: var(--radius-pill);
  display: flex; padding: 6px;
  z-index: 30;
  border: 1px solid var(--line);
}
.tab {
  flex: 1; padding: 8px 0; border-radius: var(--radius-pill);
  background: transparent; border: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  color: var(--text-soft); font-size: 11px;
  font-family: inherit; font-weight: 700;
  transition: color 0.15s ease, background 0.15s ease;
}
.tab svg { width: 21px; height: 21px; stroke-width: 2.4; }
.tab.on { color: var(--text); background: var(--primary); }
.tab.on svg { stroke-width: 2.6; }

/* ===== 统计 ===== */
.stats-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px;
  margin-bottom: 22px;
}
.stat-card {
  background: var(--surface); border-radius: var(--radius-lg); padding: 16px;
  position: relative; overflow: hidden;
  border: 1px solid var(--line);
}
.stat-card .num {
  font-size: 36px; font-weight: 900; line-height: 1;
  color: var(--text); letter-spacing: -1.3px;
}
.stat-card .label {
  font-size: 12px; color: var(--text-soft); margin-top: 6px; font-weight: 600;
}
.stat-card.dark  { background: var(--text); border-color: var(--text); }
.stat-card.dark  .num { color: var(--bg); }
.stat-card.dark  .label { color: var(--bg); opacity: 0.65; }
.stat-card.lime  { background: var(--primary); border-color: var(--primary); }
.stat-card.lime  .num { color: var(--text); }
.stat-card.lime  .label { color: var(--text); opacity: 0.7; }
.stat-card.cream { background: var(--accent); border-color: var(--accent); }
.stat-card.cream .num { color: var(--text); }
.stat-card.cream .label { color: var(--text); opacity: 0.7; }

.about-card {
  background: var(--surface); border-radius: var(--radius-lg); padding: 16px;
  margin-bottom: 14px; border: 1px solid var(--line);
}
.about-card .text { font-size: 13px; color: var(--text-soft); line-height: 1.65; }
.about-card .text b { color: var(--text); font-weight: 800; }

.action-list { display: flex; flex-direction: column; gap: 10px; }
.action-item {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-md); padding: 14px;
  display: flex; align-items: center; gap: 12px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}
.action-item:active { transform: scale(0.99); background: var(--primary); }
.action-item .ico-box {
  width: 36px; height: 36px; border-radius: 11px;
  background: var(--surface-2);
  display: grid; place-items: center;
  color: var(--text);
}
.action-item svg { width: 17px; height: 17px; stroke-width: 2.4; }
.action-item .title { flex: 1; font-size: 14px; color: var(--text); font-weight: 700; }
.action-item .arrow { color: var(--text-mute); font-size: 16px; font-weight: 600; }
.action-item.secondary .ico-box { background: var(--surface); border: 1px solid var(--line); }

/* ===== 弹层 ===== */
.modal {
  position: fixed; inset: 0; background: rgba(15,15,15,0.5);
  display: flex; align-items: center; justify-content: center; z-index: 40;
  padding: 24px;
}
.modal[hidden] { display: none !important; }

.modal-card {
  background: var(--surface); border-radius: var(--radius-xl);
  width: 100%; max-width: 380px; padding: 28px 24px;
  position: relative; text-align: center;
  border: 1px solid var(--line);
}
@keyframes pop { from { transform: scale(0.94); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-card { animation: pop 0.26s cubic-bezier(.34,1.56,.64,1); }
.modal-close {
  position: absolute; top: 14px; right: 14px;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--surface-2); border: none;
  cursor: pointer; display: grid; place-items: center; color: var(--text);
}
.modal-close svg { width: 15px; height: 15px; stroke-width: 2.4; }

.blind-art {
  width: 56px; height: 56px;
  margin: 0 auto 18px;
  display: grid; place-items: center;
  background: var(--primary); color: var(--text);
  border-radius: 16px;
}
.blind-art svg { width: 26px; height: 26px; stroke-width: 2.2; }
.blind-quote {
  font-size: 17px; line-height: 1.5; color: var(--text);
  font-weight: 600; min-height: 56px; text-align: left;
  padding: 16px 18px; background: var(--surface-2);
  border-radius: 16px; margin-bottom: 18px;
  letter-spacing: -0.2px;
}
.blind-foot { display: flex; gap: 10px; }
.blind-foot button {
  flex: 1; padding: 13px; border-radius: var(--radius-md);
  border: none; cursor: pointer; font-size: 14px; font-weight: 700;
  font-family: inherit;
  background: var(--text); color: var(--bg);
  transition: transform 0.1s ease;
}
.blind-foot button:active { transform: scale(0.97); }
.blind-foot button.ghost {
  background: var(--surface-2); color: var(--text);
}

.lightbox {
  position: fixed; inset: 0; background: rgba(0,0,0,0.94);
  z-index: 60; display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.lightbox[hidden] { display: none !important; }
.lightbox-close {
  position: absolute; top: 20px; right: 20px;
  width: 42px; height: 42px; border-radius: 50%;
  background: rgba(255,255,255,0.18); color: #fff; border: none;
  cursor: pointer; display: grid; place-items: center; z-index: 4;
}
.lightbox-zoom-hint {
  position: absolute; top: 22px; left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.72); font-size: 12px; font-weight: 500;
  background: rgba(0,0,0,0.4); padding: 6px 12px; border-radius: 999px;
  pointer-events: none; z-index: 4;
}
.lightbox-controls {
  position: absolute; bottom: calc(22px + env(safe-area-inset-bottom)); left: 50%;
  transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px; z-index: 4;
}
.lightbox-controls button {
  width: 46px; height: 46px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(255,255,255,0.18); color: #fff;
  display: grid; place-items: center;
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  transition: background 0.15s ease, transform 0.1s ease;
}
.lightbox-controls button:active { background: rgba(255,255,255,0.34); transform: scale(0.94); }
.lightbox-controls svg { width: 22px; height: 22px; stroke-width: 2.4; }
.lightbox-controls .lb-reset {
  width: auto; padding: 0 16px; border-radius: 999px;
  font-family: inherit; font-size: 13px; font-weight: 800; letter-spacing: 0.5px;
}
.lightbox-img-wrap {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; cursor: zoom-in;
  touch-action: none;
}
.lightbox img {
  max-width: 100%; max-height: 100%; border-radius: 16px;
  transform-origin: center center; will-change: transform;
  transition: transform 0.15s ease;
  touch-action: none; user-select: none; -webkit-user-drag: none;
}

.toast {
  position: fixed; left: 50%; bottom: 110px;
  transform: translateX(-50%);
  background: var(--text); color: var(--bg);
  padding: 10px 20px; border-radius: var(--radius-pill);
  font-size: 13px; font-weight: 700;
  z-index: 80;
  animation: toastPop 0.3s ease;
}
@keyframes toastPop { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }

.hidden { display: none !important; }

/* ===== 记一笔：4 大类归类板 ===== */
.big-cat-section { margin-bottom: 22px; }
.big-cat-title {
  font-size: 13px; color: var(--text); font-weight: 800;
  margin: 0 4px 10px; letter-spacing: -0.1px;
  display: flex; align-items: baseline; gap: 8px;
}
.big-cat-title .sub {
  font-size: 11px; color: var(--text-mute); font-weight: 600;
}
.big-cat-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
}
.big-cat {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 18px; padding: 14px 4px 12px;
  text-align: center; cursor: pointer; position: relative;
  transition: transform 0.1s ease, background 0.15s ease;
  font-family: inherit; color: inherit;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.big-cat:active { transform: scale(0.96); }
.big-cat .ico {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  background: var(--bb, var(--surface-2)); color: var(--bc, var(--text));
  border-radius: 12px;
}
.big-cat .ico svg { width: 20px; height: 20px; stroke-width: 2.2; }
.big-cat .name {
  font-size: 13px; color: var(--text); font-weight: 800;
  letter-spacing: -0.1px;
}
.big-cat .cnt {
  position: absolute; top: -5px; right: -2px; font-size: 10px;
  background: var(--text); color: var(--bg);
  padding: 2px 6px; border-radius: 999px; font-weight: 800;
  min-width: 18px; text-align: center;
}
.big-cat.on { background: var(--bc); border-color: var(--bc); }
.big-cat.on .ico { background: rgba(255,255,255,0.95); color: var(--bc); }
.big-cat.on .name { color: #fff; }
.big-cat[data-big="life"]  { --bc: var(--cat-life-color);  --bb: var(--cat-life-bg); }
.big-cat[data-big="fan"]   { --bc: var(--cat-fan-color);   --bb: var(--cat-fan-bg); }
.big-cat[data-big="work"]  { --bc: var(--cat-work-color);  --bb: var(--cat-work-bg); }
.big-cat[data-big="study"] { --bc: var(--cat-study-color); --bb: var(--cat-study-bg); }
/* tooltip：长按/悬停看 tip */
.big-cat[data-tip]::after {
  content: attr(data-tip);
  position: absolute; bottom: calc(100% + 6px); left: 50%;
  transform: translateX(-50%);
  background: var(--text); color: var(--bg);
  font-size: 11px; font-weight: 600;
  padding: 6px 10px; border-radius: 8px; white-space: nowrap;
  pointer-events: none; opacity: 0; transition: opacity 0.18s ease;
  z-index: 50; max-width: 220px;
}
.big-cat:hover[data-tip]::after,
.big-cat:active[data-tip]::after { opacity: 1; }

/* ===== 翻翻看：5 小类 pill 行（6 等分网格，每格严格等宽；数字为右上角标） ===== */
.type-rail {
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px;
  margin-bottom: 18px;
}
.cat-pill {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  gap: 5px; padding: 9px 6px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  font-family: inherit; cursor: pointer;
  color: var(--text); font-size: 13px; font-weight: 800;
  transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease;
  min-width: 0;     /* 让 grid 子项可收缩 */
  overflow: visible;
}
.cat-pill:active { transform: scale(0.96); }
.cat-pill .dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.cat-pill .name { white-space: nowrap; }
.cat-pill .badge {
  position: absolute;
  top: -5px; right: -3px;
  min-width: 16px; height: 16px; padding: 0 4px;
  background: var(--text); color: var(--bg);
  font-size: 10px; font-weight: 800;
  border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  line-height: 1;
  border: 2px solid var(--bg);   /* 让角标和卡片背景分离 */
}
.cat-pill.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.cat-pill.on .dot { background: var(--primary) !important; }
.cat-pill.on .badge { background: var(--primary); color: var(--text); border-color: var(--text); }
[data-tip] { position: relative; }
.cat-pill[data-tip]::after {
  content: attr(data-tip);
  position: absolute; bottom: calc(100% + 6px); left: 50%;
  transform: translateX(-50%);
  background: var(--text); color: var(--bg);
  font-size: 11px; font-weight: 600;
  padding: 6px 10px; border-radius: 8px; white-space: nowrap;
  pointer-events: none; opacity: 0; transition: opacity 0.18s ease;
  z-index: 50;
}
.cat-pill:hover[data-tip]::after,
.cat-pill:active[data-tip]::after { opacity: 1; }

/* ===== 卡片：视频 ===== */
.card-video {
  width: 100%; max-height: 480px; border-radius: 14px;
  margin-top: 8px; background: #000; display: block;
}

/* 备注 / 链接备注：统一 #标签 形式展示 */
.card-tags {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-top: 8px;
}
.card-tag {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: var(--radius-pill);
  font-size: 12px; font-weight: 800; letter-spacing: -0.2px;
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--line);
}
.card-tag:first-child { margin-left: 0; }

/* ===== 改归类弹层（bottom sheet） ===== */
.cat-sheet {
  position: fixed; inset: 0; z-index: 80;
  display: flex; align-items: flex-end; justify-content: center;
}
.cat-sheet[hidden] { display: none !important; }
.cat-sheet-mask {
  position: absolute; inset: 0;
  background: rgba(15,15,15,0.42);
  animation: fadeIn 0.18s ease;
}
.cat-sheet-body {
  position: relative;
  width: 100%; max-width: 480px;
  background: var(--surface);
  border-radius: 22px 22px 0 0;
  padding: 18px 18px calc(env(safe-area-inset-bottom, 16px) + 16px) 18px;
  box-shadow: 0 -10px 30px rgba(0,0,0,0.12);
  animation: slideUp 0.22s cubic-bezier(.2,.7,.3,1);
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.cat-sheet-title {
  font-size: 13px; font-weight: 800; color: var(--text-soft);
  letter-spacing: 0.4px;
  margin-bottom: 12px;
}
.cat-sheet-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 8px; margin-bottom: 14px;
}
.cs-cell {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 12px 6px;
  background: var(--surface-2);
  border: 1.5px solid transparent;
  border-radius: 14px; cursor: pointer; font-family: inherit;
  transition: transform 0.1s ease, border-color 0.15s ease;
}
.cs-cell:active { transform: scale(0.96); }
.cs-cell.cur { border-color: var(--text); background: var(--bg); }
.cs-cell .ico {
  width: 38px; height: 38px; border-radius: 11px;
  display: grid; place-items: center;
}
.cs-cell .ico svg { width: 20px; height: 20px; stroke-width: 2.2; }
.cs-cell .name {
  font-size: 12px; font-weight: 700; color: var(--text);
}
.cat-sheet-cancel {
  width: 100%; padding: 12px;
  background: var(--surface-2); border: none;
  border-radius: 14px; cursor: pointer;
  font-family: inherit; font-size: 14px; font-weight: 700;
  color: var(--text);
}

/* 编辑备注弹层：输入框 + 操作区 */
.note-input {
  width: 100%; min-height: 88px; resize: vertical;
  padding: 12px 14px; border-radius: 14px;
  background: var(--surface-2); border: 1px solid var(--line);
  outline: none; color: var(--text); font-size: 16px; font-family: inherit;
  line-height: 1.5; margin-bottom: 14px;
}
.note-input:focus { background: var(--primary-soft); border-color: var(--primary-deep); }
.cat-sheet-actions { display: flex; gap: 10px; }
.cat-sheet-actions .cat-sheet-cancel { flex: 1; width: auto; }
.cat-sheet-save {
  flex: 1; padding: 12px; border: none; border-radius: 14px; cursor: pointer;
  background: var(--text); color: var(--bg);
  font-family: inherit; font-size: 14px; font-weight: 700;
  transition: transform 0.1s ease;
}
.cat-sheet-save:active { transform: scale(0.97); }

/* 导入备份弹层 */
.import-card { max-width: 420px; }
.import-card h3 { margin: 4px 0 6px; font-size: 17px; font-weight: 800; color: var(--text); }
.import-tip { margin: 0 0 12px; font-size: 13px; color: var(--text-soft); line-height: 1.5; }
#importFile {
  width: 100%; font-size: 14px; color: var(--text); margin-bottom: 12px;
  padding: 10px 12px; border-radius: 12px; background: var(--surface-2);
  border: 1px dashed var(--line-strong);
}
.import-text {
  width: 100%; min-height: 110px; resize: vertical;
  padding: 12px 14px; border-radius: 14px;
  background: var(--surface-2); border: 1px solid var(--line);
  outline: none; color: var(--text); font-size: 13px; font-family: ui-monospace, Menlo, Consolas, monospace;
  line-height: 1.5; margin-bottom: 14px;
}
.import-text:focus { background: var(--primary-soft); border-color: var(--primary-deep); }

/* 我的：操作项 —— 危险态 */
.action-item.danger .ico-box { color: #C0392B; }
.action-item.danger:active { background: #FBEAE8; }

