/* ==========================================================================
   氢日记 Web 版 · 抹茶星云 VI
   色板：#166558 深青 / #58884B 苔绿 / #FFFBF3 米白 / #D5E4DA 浅鼠尾草
   一套代码同时服务桌面（≥900px 左栏布局）与手机（底部 tab 单列）
   ========================================================================== */

/* ---------- 英文字体（自托管，国内直连） ---------- */
/* Clash Display：其他英文一律用它（Fontshare 免费授权，ITF 出品） */
@font-face {
  font-family: 'Clash Display';
  src: url('../assets/fonts/ClashDisplay-400.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Clash Display';
  src: url('../assets/fonts/ClashDisplay-500.woff2') format('woff2');
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Clash Display';
  src: url('../assets/fonts/ClashDisplay-600.woff2') format('woff2');
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Clash Display';
  src: url('../assets/fonts/ClashDisplay-700.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap;
}
/* Montserrat：参考稿里「月日」那一行（OCTOBER 07）用的字，自托管 latin 子集 */
@font-face {
  font-family: 'Montserrat';
  src: url('../assets/fonts/Montserrat-latin.woff2') format('woff2');
  font-weight: 400 600; font-style: normal; font-display: swap;
}

/* 星期/月日：优先 Avenir Next（iOS/macOS 系统自带 Heavy/Regular），
   非 Apple 设备按参考稿回落 Arial Black / Montserrat */

:root {
  --font-en: 'Clash Display', 'Avenir Next', -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-week: 'Avenir Next', 'AvenirNext-Heavy', 'Arial Black', 'Clash Display', 'PingFang SC', sans-serif;
  --font-month: 'Montserrat', 'Avenir Next', 'AvenirNext-Regular', 'Helvetica Neue', Arial, sans-serif;

  /* 主色 */
  --ink: #166558;
  --ink-2: #1E7A6A;
  --ink-deep: #0F4C42;
  --leaf: #58884B;
  --leaf-soft: #7BA46E;
  --paper: #FFFBF3;
  --sage: #D5E4DA;
  --sage-2: #EAF3EC;
  --card: #FFFFFF;
  --ph-lime: #dfff24;   /* 青柠强调色：手机首页 + 胶囊 tabbar 选中态共用 */

  /* 文字 */
  --text: #22322E;
  --text-2: #4A5C57;
  --muted: #7C8B86;
  --faint: #A9B6B1;

  /* 线 / 影 */
  --line: rgba(22, 101, 88, .12);
  --line-2: rgba(22, 101, 88, .07);
  --shadow: 0 2px 14px rgba(22, 101, 88, .07);
  --shadow-lg: 0 14px 44px rgba(22, 101, 88, .16);

  /* 情绪语义 */
  --pos: #58884B;
  --neu: #8FA09A;
  --neg: #C2695E;

  /* 尺度 */
  --r: 18px;
  --r-sm: 12px;
  --side: 236px;
  --read: 760px;

  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC",
          "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  --serif: Georgia, "Times New Roman", ui-serif, serif;
}

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

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--text);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

/* 米白纸上的一层极淡鼠尾草光晕，避免大面积死白 */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 60% 42% at 78% -6%, rgba(213, 228, 218, .55), transparent 70%),
    radial-gradient(ellipse 46% 36% at 4% 2%, rgba(22, 101, 88, .05), transparent 68%);
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
kbd { font-family: var(--sans); }

::selection { background: var(--sage); color: var(--ink-deep); }

/* ---------- 滚动条（桌面） ---------- */
@media (min-width: 900px) {
  * { scrollbar-width: thin; scrollbar-color: rgba(22, 101, 88, .2) transparent; }
  *::-webkit-scrollbar { width: 9px; height: 9px; }
  *::-webkit-scrollbar-thumb {
    background: rgba(22, 101, 88, .18);
    border-radius: 9px;
    border: 2px solid transparent;
    background-clip: content-box;
  }
  *::-webkit-scrollbar-thumb:hover { background: rgba(22, 101, 88, .3); background-clip: content-box; }
}

/* ==========================================================================
   布局骨架
   ========================================================================== */
#app { position: relative; z-index: 1; min-height: 100vh; }

.sidebar { display: none; }
.topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  position: sticky;
  top: 0;
  z-index: 30;
  height: 52px;
  padding: 0 14px;
  padding-top: env(safe-area-inset-top);
  background: rgba(255, 251, 243, .88);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line-2);
}
.brand-mini { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.brand-mini b { font-size: 16px; letter-spacing: .5px; color: var(--ink); font-weight: 600; }
.brand-mini .brand-mark { width: 24px; height: 24px; color: var(--ink); }

/* 首页（记录）手机端不显示顶栏：大日期头已经足够，品牌位重复 */
body.route-write .topbar { display: none; }
/* 管理后台：隐藏桌面侧栏、移动底栏，主内容满屏（普通页面不受影响） */
body.route-admin .sidebar { display: none !important; }
body.route-admin .main { margin-left: 0 !important; }
body.route-admin .tabbar { display: none !important; }
/* 记录页（手机）参考稿的单屏固定布局：外底色 + 页内浅灰蓝，整页不出滚动条 */
@media (max-width: 899px) {
  body.route-write { background: #bac8c8; overflow: hidden; }
  body.route-write::before { display: none; }
  body.route-write #app { height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; }
  body.route-write .main {
    height: 100%; min-height: 0; padding: 0;
    overflow: hidden; animation: none;
  }
}

.icon-btn {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border: none; background: transparent;
  border-radius: 10px; color: var(--ink);
}
.icon-btn:active { background: var(--sage-2); }

.main {
  min-height: calc(100vh - 52px);
  padding: 18px 14px calc(118px + env(safe-area-inset-bottom));
  max-width: 100%;
  animation: fade-in .32s ease both;
}
@keyframes fade-in { from { opacity: 0; transform: translateY(6px); } }

@media (min-width: 900px) {
  #app { display: block; }

  .sidebar {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: var(--side);
    padding: 22px 14px 16px;
    background: rgba(255, 251, 243, .72);
    border-right: 1px solid var(--line-2);
    z-index: 30;
  }
  .topbar, .tabbar { display: none; }
  .main {
    margin-left: var(--side);
    padding: 40px 48px 64px;
    min-height: 100vh;
  }
}

/* ==========================================================================
   侧栏
   ========================================================================== */
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 22px; }
.brand-mark { width: 34px; height: 34px; color: var(--ink); flex: none; }
.brand-mark svg { width: 100%; height: 100%; display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text b { font-size: 18px; letter-spacing: 1.5px; color: var(--ink); }
.brand-text i {
  font-style: normal; font-size: 10.5px; color: var(--faint);
  letter-spacing: .4px; margin-top: 2px;
}

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 11px;
  border-radius: 11px;
  color: var(--text-2);
  font-size: 14.5px;
  position: relative;
  transition: background .16s, color .16s;
}
.nav-item svg { width: 19px; height: 19px; flex: none; opacity: .78; }
.nav-item span { flex: 1; }
.nav-item kbd {
  font-size: 10.5px; color: var(--faint);
  border: 1px solid var(--line);
  border-radius: 5px; padding: 0 5px; line-height: 16px;
  opacity: 0; transition: opacity .16s;
}
.nav-item:hover { background: rgba(213, 228, 218, .5); color: var(--ink); }
.nav-item:hover kbd { opacity: 1; }
.nav-item.on { background: var(--sage); color: var(--ink-deep); font-weight: 600; }
.nav-item.on svg { opacity: 1; }
.nav-item.on::before {
  content: ''; position: absolute; left: -14px; top: 50%;
  width: 3px; height: 20px; border-radius: 0 3px 3px 0;
  background: var(--ink); transform: translateY(-50%);
}
.nav-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--leaf); flex: none;
  box-shadow: 0 0 0 3px rgba(88, 136, 75, .18);
}

.side-foot { margin-top: auto; padding: 0 8px; }
.spectrum-strip {
  position: relative; height: 22px; margin-bottom: 10px;
  border-top: 1px dashed var(--line);
  padding-top: 9px;
}
.spectrum-strip i {
  position: absolute; top: 6px; width: 2.5px; height: 11px;
  border-radius: 2px; opacity: .85;
  filter: blur(.2px);
}
.side-status {
  display: flex; align-items: center; gap: 7px;
  font-size: 11.5px; color: var(--faint);
}
.side-status .dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--faint); flex: none;
}
.side-status .dot.ok { background: var(--leaf); box-shadow: 0 0 0 3px rgba(88, 136, 75, .16); }
.side-status .dot.err { background: var(--neg); }

/* ---- 侧栏账号区（桌面端，国际惯例放左下角） ---- */
.acct { display: none; }
@media (min-width: 900px) {
  .acct {
    display: flex; align-items: center; gap: 9px;
    width: 100%; margin-bottom: 12px;
    padding: 8px 9px;
    border: 1px solid var(--line-2); border-radius: 13px;
    background: var(--card); cursor: pointer; text-align: left;
    box-shadow: var(--shadow);
    transition: background .16s, border-color .16s;
  }
  .acct:hover { background: rgba(213, 228, 218, .45); }
  .acct.on { background: rgba(213, 228, 218, .65); }
}
.acct-ava {
  width: 34px; height: 34px; border-radius: 50%;
  overflow: hidden; flex: none; background: var(--sage);
}
.acct-ava img { width: 100%; height: 100%; object-fit: cover; display: block; }
.acct-ava-ph {
  width: 100%; height: 100%; display: grid; place-items: center;
  font-size: 15px; font-weight: 600; color: var(--ink-deep);
}
.acct-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.acct-txt b {
  font-size: 13.5px; font-weight: 600; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.acct-txt i {
  font-style: normal; font-size: 11px; color: var(--faint);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.acct-chev { width: 14px; height: 14px; flex: none; color: var(--faint); }

/* 账号弹出菜单 */
.acct-pop {
  position: fixed; z-index: 60; width: 208px;
  background: var(--card);
  border: 1px solid var(--line-2); border-radius: 14px;
  box-shadow: 0 14px 36px rgba(51, 57, 91, .16);
  padding: 6px;
  animation: pop-in .16s ease both;
}
@keyframes pop-in { from { opacity: 0; transform: translateY(6px); } }
.acct-pop button {
  display: flex; align-items: center; gap: 9px;
  width: 100%; padding: 9px 10px;
  border: none; background: transparent; cursor: pointer;
  border-radius: 9px; font-size: 13.5px; color: var(--ink); text-align: left;
}
.acct-pop button:hover { background: rgba(213, 228, 218, .5); }
.acct-pop button svg { width: 16px; height: 16px; opacity: .75; flex: none; }
.acct-pop .sep { height: 1px; background: var(--line-2); margin: 5px 8px; }

/* 桌面端：登录信息收进侧栏左下角，资料卡里不再重复 */
@media (min-width: 900px) {
  .m-login-rows { display: none; }
}

/* ==========================================================================
   移动端底部 tab（参考稿：米白胶囊 + 深色描边，中间「主页」恒为青柠圆）
   ========================================================================== */
.tabbar {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(13px + env(safe-area-inset-bottom));
  width: calc(100% - 36px); max-width: 370px;
  height: 70px;
  padding: 8px 12px;
  z-index: 40;
  display: flex; justify-content: space-around; align-items: center;
  background: #f4f6ed;
  border: 1px solid #d6dfd7;
  border-radius: 36px;
  box-shadow: 0 12px 24px rgba(98, 115, 109, .19);
}
.tabbar a {
  width: 78px; height: 52px;
  display: flex; flex-direction: column; gap: 2px;
  align-items: center; justify-content: center;
  font-size: 10px; font-weight: 600; color: #74817d;
  line-height: normal;
  transition: color .16s;
}
.tabbar a .ico { width: 38px; height: 30px; display: grid; place-items: center; }
.tabbar a .ico svg { width: 19px; height: 19px; }
.tabbar a.on { color: #17201f; }
.tabbar a.on .ico {
  background: #17201f; color: #dfff24;
  border-radius: 50%;
  outline: 1px dashed #17201f; outline-offset: 3px;
}
.tabbar a.center { color: #17201f; }
.tabbar a.center .ico { width: 34px; height: 34px; background: #dfff24; border-radius: 50%; color: #17201f; }
.tabbar a.center .ico svg { width: 18px; height: 18px; }
.tabbar a.center.on .ico { background: #dfff24; color: #637b80; outline: 1px dashed #17201f; outline-offset: 3px; }

@media (min-width: 900px) { .tabbar { display: none; } }

/* ==========================================================================
   通用组件
   ========================================================================== */

/* 页面头 */
.page-head { margin-bottom: 18px; }
.page-title {
  font-size: 25px; font-weight: 700; color: var(--ink);
  letter-spacing: .6px; margin: 0 0 4px;
}
.page-sub { font-size: 13px; color: var(--muted); margin: 0; }
@media (min-width: 900px) {
  .page-title { font-size: 30px; }
  .page-head { margin-bottom: 26px; }
}

/* 卡片 */
.card {
  background: var(--card);
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  padding: 18px;
  box-shadow: var(--shadow);
  margin-bottom: 14px;
}
.card.tight { padding: 14px 16px; }
.card-title {
  font-size: 14px; font-weight: 600; color: var(--ink);
  display: flex; align-items: center; gap: 7px; margin-bottom: 12px;
}
.card-title .bars { display: flex; gap: 2px; align-items: flex-end; height: 12px; }
.card-title .bars i { width: 2px; background: var(--leaf); border-radius: 2px; }
.hint { font-size: 12.5px; color: var(--muted); }
.empty {
  text-align: center; color: var(--faint); font-size: 13.5px;
  padding: 34px 10px; line-height: 1.9;
}
.empty .glyph { display: block; margin: 0 auto 10px; width: 40px; height: 40px; opacity: .35; }

/* 按钮 */
.btn {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text-2);
  border-radius: 11px;
  padding: 9px 16px;
  font-size: 14px;
  transition: background .16s, border-color .16s, transform .1s, color .16s;
}
.btn:hover { border-color: rgba(22, 101, 88, .28); color: var(--ink); }
.btn:active { transform: scale(.985); }
.btn-main {
  width: 100%;
  border: none;
  background: var(--ink);
  color: #FFFDF8;
  border-radius: 13px;
  padding: 14px 20px;
  font-size: 15.5px;
  font-weight: 600;
  letter-spacing: 1px;
  box-shadow: 0 6px 20px rgba(22, 101, 88, .22);
  transition: background .16s, transform .1s, box-shadow .16s;
}
.btn-main:hover { background: var(--ink-deep); box-shadow: 0 8px 26px rgba(22, 101, 88, .3); }
.btn-main:active { transform: scale(.99); }
.btn-main[disabled] { opacity: .55; box-shadow: none; cursor: default; }
.btn-ghost {
  background: transparent; border: 1px solid var(--line);
  color: var(--muted); border-radius: 999px;
  padding: 7px 14px; font-size: 13px;
}
.btn-ghost:hover { color: var(--ink); border-color: rgba(22, 101, 88, .3); background: rgba(213, 228, 218, .35); }
.btn-danger { color: var(--neg); border-color: rgba(194, 105, 94, .3); }
.btn-danger:hover { background: rgba(194, 105, 94, .08); color: var(--neg); border-color: rgba(194, 105, 94, .5); }

/* 胶囊 */
.chip {
  display: inline-block;
  background: var(--sage-2);
  color: var(--ink);
  border-radius: 999px;
  padding: 3px 11px;
  font-size: 12.5px;
  margin: 3px 5px 3px 0;
  line-height: 1.6;
  transition: background .16s, transform .1s;
}
.chip.clickable { cursor: pointer; }
.chip.clickable:hover { background: var(--sage); transform: translateY(-1px); }
.chip.person { background: rgba(22, 101, 88, .1); }
.chip.leaf { background: rgba(88, 136, 75, .13); color: #40663A; }
.chip.local { background: rgba(88, 136, 75, .13); color: #40663A; }
/* 圈定的专有名词 */
.chip.term { background: rgba(22, 101, 88, .14); color: var(--pine); font-weight: 600; }
.term-tip { font-size: 11.5px; line-height: 1.6; color: var(--faint); margin-top: 9px; }
.term-tip b { color: var(--pine); font-weight: 600; }
.term-wrap { display: flex; flex-wrap: wrap; gap: 6px; }
.term-add { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
.term-add .input { flex: 1; }

/* 分段控件 */
.seg {
  display: inline-flex; background: rgba(213, 228, 218, .5);
  border-radius: 999px; padding: 3px; gap: 2px;
}
.seg button {
  border: none; background: transparent; color: var(--muted);
  border-radius: 999px; padding: 6px 16px; font-size: 13px;
  transition: background .18s, color .18s;
}
.seg button.on { background: var(--card); color: var(--ink); font-weight: 600; box-shadow: 0 1px 4px rgba(22, 101, 88, .1); }

/* 时间线页主分段：谱线 / 循环与提醒 */
.tl-tabs {
  display: inline-flex; gap: 4px;
  background: rgba(213, 228, 218, .55);
  border-radius: 999px; padding: 4px;
  margin-bottom: 18px;
}
.tl-tabs button {
  border: none; background: transparent; color: var(--muted);
  border-radius: 999px; padding: 8px 22px; cursor: pointer;
  font-family: inherit; font-size: 14px;
  transition: background .18s, color .18s;
}
.tl-tabs button.on {
  background: #166558; color: #FFFBF3; font-weight: 600;
  box-shadow: 0 2px 10px rgba(22, 101, 88, .24);
}

/* 表单 */
.input, textarea.input {
  width: 100%; border: none; outline: none;
  background: transparent; color: var(--text);
  font-family: inherit; font-size: 16px; line-height: 1.75;
  resize: none;
}
.input::placeholder { color: var(--faint); }
.field {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .7);
  border-radius: var(--r-sm);
  padding: 11px 14px;
  display: flex; align-items: center; gap: 9px;
  min-width: 0;
}
.field:focus-within { border-color: rgba(22, 101, 88, .34); background: #fff; }
.field input { border: none; outline: none; background: transparent; flex: 1; font-family: inherit; font-size: 14.5px; color: var(--text); min-width: 0; }
.field svg { width: 17px; height: 17px; color: var(--faint); flex: none; }

/* 开关 */
.switch {
  position: relative; width: 44px; height: 26px; flex: none;
  border-radius: 999px; background: rgba(22, 101, 88, .16);
  transition: background .2s; border: none; padding: 0;
}
.switch::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 20px; height: 20px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .18);
  transition: transform .22s cubic-bezier(.34, 1.4, .64, 1);
}
.switch.on { background: var(--ink); }
.switch.on::after { transform: translateX(18px); }

/* 行 */
.row { display: flex; align-items: center; gap: 12px; }
.row + .row { margin-top: 12px; }
.row .grow { flex: 1; min-width: 0; }
.row-label { font-size: 14.5px; color: var(--text); }
.row-desc { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* 情绪点 */
.emo-positive { color: var(--pos); }
.emo-neutral { color: var(--neu); }
.emo-negative { color: var(--neg); }

/* ==========================================================================
   记录页
   ========================================================================== */
.hero-card {
  position: relative; overflow: hidden;
  border-radius: var(--r);
  margin-bottom: 20px;
  box-shadow: var(--shadow);
  background: var(--sage);
}
.hero-card img { width: 100%; display: block; max-height: 210px; object-fit: cover; object-position: center 68%; }
.hero-badge {
  position: absolute; right: 12px; bottom: 12px;
  background: rgba(22, 101, 88, .88);
  color: #FFFDF8; font-size: 11px; letter-spacing: 2px;
  padding: 4px 10px; border-radius: 999px;
  backdrop-filter: blur(6px);
}
.hero-note {
  position: absolute; left: 16px; bottom: 12px; right: 90px;
  color: #163A33; font-size: 13px; text-shadow: 0 1px 6px rgba(255, 255, 255, .8);
  font-weight: 500;
}

.greet {
  font-size: 22px; font-weight: 700; color: var(--ink);
  letter-spacing: 1px; margin: 0 0 3px;
}
.greet-sub { margin: 0 0 16px; }

.input-wrap { position: relative; }
.input-foot {
  display: flex; align-items: center; gap: 8px;
  margin-top: 12px; padding-top: 12px;
  border-top: 1px dashed var(--line);
}
.spectral-line {
  height: 2px; margin: 13px 0 0;
  background: linear-gradient(90deg, transparent, var(--leaf) 12%, var(--sage) 46%, rgba(213, 228, 218, 0) 96%);
  border-radius: 2px;
  opacity: .5;
}
.mood-row { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-top: 12px; }
.mood-label { font-size: 12.5px; color: var(--muted); }
.mood-opts { display: flex; gap: 6px; }
/* 公开开关（记录页，与时间线公开按钮同风格） */
.pub-toggle {
  border: 1px solid var(--line); background: transparent; cursor: pointer;
  font-family: inherit; font-size: 12.5px; color: var(--muted);
  padding: 5px 13px; border-radius: 999px; line-height: 1.5;
  transition: all .16s;
}
.pub-toggle:hover { background: var(--sage-2); }
.pub-toggle.on { color: var(--leaf); border-color: rgba(88, 136, 75, .45); font-weight: 600; background: rgba(88, 136, 75, .08); }
.mood {
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center; font-size: 18px;
  background: rgba(213, 228, 218, .45);
  border: 1.5px solid transparent;
  transition: transform .16s, background .16s, border-color .16s;
}
.mood:hover { transform: translateY(-2px); }
.mood.on { background: #fff; border-color: var(--ink); box-shadow: 0 3px 10px rgba(22, 101, 88, .16); transform: translateY(-2px) scale(1.04); }

.date-chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.date-chip {
  border: 1px solid var(--line); background: transparent;
  color: var(--muted); border-radius: 999px;
  padding: 5px 13px; font-size: 12.5px;
  transition: all .16s;
}
.date-chip:hover { color: var(--ink); border-color: rgba(22, 101, 88, .3); }
.date-chip.on { background: var(--ink); border-color: var(--ink); color: #FFFDF8; font-weight: 600; }
.date-chip input { position: absolute; opacity: 0; pointer-events: none; width: 0; height: 0; }
#wDatePicker { position: absolute; opacity: 0; pointer-events: none; width: 0; height: 0; }

.submit-bar { margin: 4px 0 18px; }
.kbd-tip { text-align: center; font-size: 11.5px; color: var(--faint); margin-top: 9px; }

/* 轻反馈 */
.feedback { border-left: 3px solid var(--leaf); }
.fb-group { margin-top: 12px; }
.fb-group:first-of-type { margin-top: 8px; }
.fb-label { font-size: 11.5px; color: var(--faint); letter-spacing: .5px; display: block; margin-bottom: 2px; }
.fb-line { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.fb-emo { font-size: 15px; font-weight: 600; }
.fb-offline { margin-top: 12px; font-size: 11.5px; color: var(--faint); }

/* 最近一条 */
.last-card { background: linear-gradient(180deg, var(--sage-2), #fff); }
.last-content { font-size: 14.5px; color: var(--text-2); margin-top: 6px; line-height: 1.75; }
.last-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }

/* 移动端专属头图槽（桌面隐藏，桌面用右栏头图） */
.hero-mobile { display: none; }
@media (max-width: 899px) {
  .hero-mobile { display: block; }
  .write-side .hero-card { display: none; }
}

/* 记录页桌面两栏 */
@media (min-width: 900px) {
  .write-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(300px, .8fr); gap: 26px; align-items: start; }
  .write-main { min-width: 0; }
  .write-side { min-width: 0; position: sticky; top: 40px; }
  .hero-card img { max-height: 168px; }
  .greet { font-size: 27px; }
  .write-side .card { margin-bottom: 16px; }
}

/* ==========================================================================
   时间线
   ========================================================================== */
.tl-tools {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 16px; flex-wrap: wrap;
  max-width: var(--read);
}
@media (min-width: 900px) { .tl-tools { margin-left: auto; margin-right: auto; } }
.tl-tools .field { flex: 1; min-width: 190px; max-width: 380px; }
.tl-groups { max-width: var(--read); }
@media (min-width: 900px) { .tl-groups { margin-left: auto; margin-right: auto; } }
.tl-group { margin-bottom: 24px; }
.tl-group-head {
  display: flex; align-items: baseline; gap: 9px;
  margin-bottom: 10px; padding-left: 2px;
}
.tl-group-head .k { font-size: 15px; font-weight: 700; color: var(--ink); letter-spacing: .4px; }
.tl-group-head .n { font-size: 11.5px; color: var(--faint); }

/* 左侧竖直谱线 */
.tl-list { position: relative; padding-left: 20px; }
.tl-list::before {
  content: ''; position: absolute; left: 5px; top: 6px; bottom: 6px;
  width: 1.5px;
  background: linear-gradient(180deg, var(--sage), rgba(213, 228, 218, .28));
  border-radius: 2px;
}
.tl-entry { position: relative; margin-bottom: 10px; }
.tl-entry::before {
  content: ''; position: absolute; left: -19px; top: 19px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--card); border: 2px solid var(--leaf);
  box-shadow: 0 0 0 3px var(--paper);
}
.tl-entry.m-pos::before { border-color: var(--pos); }
.tl-entry.m-neg::before { border-color: var(--neg); }
.tl-card {
  background: var(--card); border: 1px solid var(--line-2);
  border-radius: 14px; padding: 13px 15px;
  box-shadow: var(--shadow);
  transition: box-shadow .18s, transform .18s;
}
.tl-card:hover { box-shadow: 0 6px 22px rgba(22, 101, 88, .1); }
.tl-content { font-size: 14.5px; line-height: 1.78; color: var(--text); white-space: pre-wrap; word-break: break-word; }
.tl-meta { display: flex; align-items: center; gap: 8px; margin-top: 9px; flex-wrap: wrap; }
.tl-time { font-size: 11.5px; color: var(--faint); font-variant-numeric: tabular-nums; }
.tl-del {
  opacity: 0; border: none; background: transparent;
  color: var(--faint); font-size: 12px; padding: 2px 6px; border-radius: 6px;
  transition: opacity .16s, color .16s;
}
.tl-card:hover .tl-del { opacity: 1; }
.tl-del:hover { color: var(--neg); }
@media (max-width: 899px) { .tl-del { opacity: .55; } }

/* ==========================================================================
   复盘
   ========================================================================== */
.grid-review { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 900px) {
  .grid-review { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
  .span-2 { grid-column: span 2; }
}

.cloud { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 6px 0 2px; }
.cloud span {
  cursor: pointer; line-height: 1.35; color: var(--ink);
  transition: transform .16s, opacity .16s; padding: 2px 0;
}
.cloud span:hover { transform: scale(1.06); text-decoration: underline; text-decoration-color: var(--sage); }

.p-row { display: flex; align-items: center; gap: 11px; padding: 9px 0; }
.p-row + .p-row { border-top: 1px dashed var(--line-2); }
.p-name { font-size: 14px; color: var(--ink); font-weight: 600; flex: none; min-width: 46px; }
.p-track { flex: 1; height: 6px; background: rgba(22, 101, 88, .07); border-radius: 4px; overflow: hidden; min-width: 40px; }
.p-fill {
  display: block;
  height: 100%; border-radius: 4px;
  background: linear-gradient(90deg, var(--leaf), var(--leaf-soft));
}
.p-fill.stale { background: linear-gradient(90deg, #C8A76A, #DDC48F); }
.p-info { font-size: 11.5px; color: var(--faint); flex: none; font-variant-numeric: tabular-nums; }

.cluster { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.cluster + .cluster { border-top: 1px dashed var(--line-2); }
.cluster .w { font-size: 14px; color: var(--text); flex: 1; }
.cluster .c { font-size: 12px; color: var(--leaf); font-variant-numeric: tabular-nums; }
.cluster .t { width: 60px; height: 5px; background: rgba(88, 136, 75, .14); border-radius: 4px; overflow: hidden; }
.cluster .t i { display: block; height: 100%; background: var(--leaf); border-radius: 4px; }

/* 月度总结卡（视觉锚点） */
.summary-card {
  background: linear-gradient(150deg, var(--ink) 0%, #104F45 62%, #0C3F38 100%);
  color: #F4FBF7; border: none; position: relative; overflow: hidden;
}
.summary-card::after {
  content: ''; position: absolute; right: -30px; top: -46px;
  width: 190px; height: 190px; border-radius: 50%;
  border: 1px solid rgba(213, 228, 218, .16);
  box-shadow: 0 0 0 34px rgba(213, 228, 218, .05);
}
.summary-card .card-title { color: #F4FBF7; position: relative; z-index: 1; }
.summary-card .card-title .bars i { background: var(--sage); }
.summary-text {
  font-size: 15.5px; line-height: 1.9; position: relative; z-index: 1;
  letter-spacing: .3px;
}
.summary-meta {
  margin-top: 14px; padding-top: 12px;
  border-top: 1px solid rgba(213, 228, 218, .18);
  font-size: 11.5px; color: rgba(244, 251, 247, .55);
  position: relative; z-index: 1;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.summary-actions { display: flex; gap: 8px; margin-top: 14px; position: relative; z-index: 1; }
.summary-card .btn-ghost {
  border-color: rgba(213, 228, 218, .3); color: rgba(255, 253, 248, .9);
}
.summary-card .btn-ghost:hover { background: rgba(255, 255, 255, .12); color: #fff; border-color: rgba(213, 228, 218, .55); }

.search-res { margin-top: 12px; }
.res-item { padding: 9px 0; border-top: 1px dashed var(--line-2); font-size: 14px; line-height: 1.7; }
.res-item .d { font-size: 11.5px; color: var(--faint); margin-right: 8px; font-variant-numeric: tabular-nums; }
mark { background: rgba(213, 228, 218, .85); color: var(--ink-deep); border-radius: 3px; padding: 0 2px; }

/* ==========================================================================
   循环
   ========================================================================== */
.cyc-grid { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .cyc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; } }

.cyc { position: relative; }
.cyc-name { font-size: 17px; font-weight: 700; color: var(--ink); letter-spacing: .4px; }
.cyc-tags { display: flex; align-items: center; gap: 7px; margin-top: 7px; flex-wrap: wrap; }
.cyc-period { font-size: 12.5px; color: var(--leaf); font-weight: 600; }
.conf-wrap { display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--muted); }
.conf-track { width: 54px; height: 5px; background: rgba(88, 136, 75, .14); border-radius: 4px; overflow: hidden; }
.conf-fill { height: 100%; background: var(--leaf); border-radius: 4px; }
.cyc-reason {
  font-size: 12.5px; color: var(--text-2); margin-top: 10px;
  padding: 9px 12px; background: var(--sage-2); border-radius: 10px; line-height: 1.7;
}
.cyc-evidence { margin-top: 10px; }
.ev-item {
  font-size: 13px; color: var(--text-2); padding: 6px 0 6px 12px;
  border-left: 2px solid rgba(88, 136, 75, .3); line-height: 1.7;
}
.ev-item .d { color: var(--faint); font-size: 11.5px; margin-right: 6px; font-variant-numeric: tabular-nums; }
.cyc-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.cyc-actions .btn { flex: 1; min-width: 96px; text-align: center; }
.cyc-actions .btn.primary { background: var(--ink); border-color: var(--ink); color: #FFFDF8; font-weight: 600; }
.cyc-actions .btn.primary:hover { background: var(--ink-deep); }

.rm-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0;
}
.rm-row + .rm-row { border-top: 1px dashed var(--line-2); }
.rm-title { font-size: 14.5px; color: var(--text); }
.rm-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; display: flex; gap: 8px; align-items: center; }
.rm-time {
  font-variant-numeric: tabular-nums; color: var(--ink); font-weight: 600;
  font-size: 13.5px;
}
.badge {
  font-size: 10.5px; padding: 1px 8px; border-radius: 999px;
  background: rgba(88, 136, 75, .14); color: #40663A;
}
.badge.paused { background: rgba(22, 101, 88, .09); color: var(--muted); }

/* ==========================================================================
   设置
   ========================================================================== */
.set-grid { display: grid; gap: 14px; grid-template-columns: 1fr; max-width: 720px; }
.set-row { display: flex; align-items: center; gap: 14px; padding: 13px 0; }
.set-row + .set-row { border-top: 1px dashed var(--line-2); }
.set-label { font-size: 14.5px; color: var(--text); }
.set-desc { font-size: 12px; color: var(--muted); margin-top: 3px; line-height: 1.6; }
.time-input {
  border: 1px solid var(--line); border-radius: 10px;
  padding: 7px 11px; font-size: 14px; font-family: inherit;
  color: var(--ink); font-weight: 600; background: #fff;
  font-variant-numeric: tabular-nums;
}
.code-box {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 12.5px; color: var(--ink);
  background: var(--sage-2); border-radius: 10px;
  padding: 10px 12px; word-break: break-all; line-height: 1.6;
  border: 1px dashed rgba(22, 101, 88, .2);
}
.about-lines { font-size: 12.5px; color: var(--muted); line-height: 2; }
.about-lines b { color: var(--ink); font-weight: 600; }

/* ==========================================================================
   提示 / 弹窗
   ========================================================================== */
.toast {
  position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom));
  transform: translate(-50%, 14px);
  background: rgba(22, 50, 45, .92);
  color: #FFFDF8; font-size: 13.5px;
  padding: 10px 18px; border-radius: 999px;
  opacity: 0; pointer-events: none;
  transition: opacity .24s, transform .3s cubic-bezier(.34, 1.4, .64, 1);
  z-index: 90; max-width: 84vw; text-align: center;
  backdrop-filter: blur(8px);
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }
@media (min-width: 900px) { .toast { bottom: 42px; } }

.modal-mask {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(18, 42, 38, .34);
  backdrop-filter: blur(3px);
  display: grid; place-items: center; padding: 20px;
  animation: fade-in .2s ease both;
}
/* hidden 属性必须能真正隐藏（display:grid 会覆盖 UA 的 display:none） */
.modal-mask[hidden] { display: none; }
.modal {
  background: var(--card); border-radius: 20px;
  padding: 22px; width: 100%; max-width: 400px;
  box-shadow: var(--shadow-lg);
  animation: modal-in .3s cubic-bezier(.34, 1.4, .64, 1) both;
}
@keyframes modal-in { from { opacity: 0; transform: translateY(12px) scale(.97); } }
.modal h3 { margin: 0 0 8px; font-size: 17px; color: var(--ink); }
.modal p { margin: 0 0 18px; font-size: 13.5px; color: var(--text-2); line-height: 1.75; }
.modal-actions { display: flex; gap: 10px; }
.modal-actions .btn { flex: 1; }

/* ---- 移动端适配兜底 ---- */
@media (max-width: 899px) {
  /* 卡片拖拽/装饰卡旋转的溢出不再引发横向滚动
     ⚠️ html 与 body 同时 overflow-x:hidden 会触发安卓微信(X5/XWeb)内核
     「整页竖向滚动失效」的 bug，故 html 用 clip（不建立滚动上下文），
     body 才用 hidden 兜底 */
  html { overflow-x: clip; }
  body { overflow-x: hidden; }
  /* 弹窗改为底部抽屉（手机习惯），宽屏仍是居中卡片 */
  .modal-mask { align-items: end; padding: 12px 0 0; }
  .modal {
    max-width: 100%;
    border-radius: 22px 22px 0 0;
    padding: 20px 18px calc(18px + env(safe-area-inset-bottom));
    animation: sheet-up .3s cubic-bezier(.32, .72, .35, 1) both;
  }
  /* 输入框 ≥16px，避免 iOS 聚焦时整页自动放大 */
  .field input, .nick-input, .date-input, .lock-input, .time-input { font-size: 16px !important; }
}
@keyframes sheet-up { from { opacity: .4; transform: translateY(46px); } }

/* 骨架屏 */
.skeleton {
  background: linear-gradient(90deg, rgba(213, 228, 218, .45) 25%, rgba(213, 228, 218, .22) 37%, rgba(213, 228, 218, .45) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s infinite linear;
  border-radius: 8px; height: 14px;
}
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ==========================================================================
   记录页 · 手机端卡片式首页
   与参考稿 home-preview.html 逐项对齐（单屏固定布局，整页不滚动）
   ========================================================================== */
.ph {
  --ph-lime: #dfff24;
  --ph-dark: #17201f;
  --ph-soft: #f4f6ed;
  --ph-muted: #92a29e;

  height: 100%;
  max-width: 406px;
  margin: 0 auto;
  box-sizing: border-box;
  background: #e8eef0;
  display: flex;
  flex-direction: column;
  padding: 0 18px calc(100px + env(safe-area-inset-bottom));
  overflow: hidden;
  overscroll-behavior: none;
  line-height: normal;   /* 参考稿用 font 简写重置了行高，这里统一跟齐 */
}

/* --- 大日期：● 23° · SUNNY · SHANGHAI / WEDNESDAY / OCTOBER 07 / 把今天，折成一句话。 --- */
.ph-date { flex: none; margin-top: 14px; }
.ph-weather {
  display: flex; align-items: center; gap: 7px;
  font-family: var(--font-en);
  color: #6e7a78; font-size: 12px; font-weight: 600;
}
.ph-sun {
  width: 19px; height: 19px; border-radius: 50%;
  background: var(--ph-lime);
  box-shadow: 0 0 0 4px rgba(223, 255, 36, .25);
  flex: none;
}
.ph-date h2 {
  margin: 5px 0 0;
  font-family: var(--font-week);
  font-size: 48px; line-height: .86; font-weight: 800;
  letter-spacing: -.075em; color: #0e1b1b;
}
.ph-date h2 em {
  font-family: var(--font-month);
  font-style: normal; font-weight: 400;
  font-size: 30px; line-height: .9; letter-spacing: -.055em; color: #7e8a88;
}
.ph-sub {
  font-family: var(--font-en);
  font-size: 12px; font-weight: 500; color: #75817f;
  margin-top: 9px; letter-spacing: .03em;
}

/* --- 卡片堆叠（一手牌：顶层卡满尺寸，背后两张逐层错开） --- */
.deck {
  position: relative;
  flex: 1; min-height: 0; max-height: 480px;
  margin-top: 22px; margin-bottom: 10px;
  perspective: 1000px;
}
.ph-card {
  position: absolute; inset: 0;
  border-radius: 29px;
  padding: 22px 21px;
  transform-origin: 50% 90%;
  transition: transform .4s, opacity .35s;
  touch-action: pan-y;
  -webkit-user-select: none;
  user-select: none;
}
.ph-card.dragging { transition: none; cursor: grabbing; }
/* 顶层卡：正在写的那张 / 翻到的那张 */
.ph-card.is-main {
  background: var(--ph-dark); color: var(--ph-soft);
  box-shadow: 0 20px 34px rgba(63, 87, 83, .2);
  display: flex; flex-direction: column;
  cursor: grab;
}
/* 背后两层：日记卡，越深越靠外，露出边角 */
.ph-card.is-mid,
.ph-card.is-back {
  color: #0e1b1b;
  display: flex; flex-direction: column;
  cursor: grab;
}
.ph-card.is-mid { background: #92aaa6; transform: translate(11px, 10px) rotate(-3deg) scale(.95); opacity: .98; }
.ph-card.is-back { background: #b7c9c6; transform: translate(22px, 18px) rotate(6deg) scale(.91); opacity: .95; }
/* 露在外面的只有右/下两条边：把内容往里收，露出的边条保持干净色块（参考稿如此） */
.ph-card.is-mid, .ph-card.is-back { padding-right: 48px; padding-bottom: 36px; }

/* 日记卡内容（date + 正文 + 标签） */
.pec-head {
  flex: none; display: flex; align-items: center; justify-content: space-between;
}
.pec-head b {
  font-family: var(--font-en);
  font-size: 11px; font-weight: 600; letter-spacing: .12em;
  text-transform: uppercase;
}
.pec-head span { font-size: 14px; }
.pec-text {
  flex: 1; min-height: 0; overflow: hidden;
  margin-top: 12px;
  font-size: 15px; line-height: 1.7;
  word-break: break-word;
  display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical;
}
.pec-tags {
  flex: none; margin-top: 10px;
  font-family: var(--font-en);
  font-size: 11px; font-weight: 500;
}
.ph-card.is-main .pec-head b { color: var(--ph-lime); }
.ph-card.is-main .pec-text { color: #dfe7e2; }
.ph-card.is-main .pec-tags { color: #9fb0aa; }
.ph-card.is-mid .pec-head b, .ph-card.is-back .pec-head b { color: #4d5a58; }
.ph-card.is-mid .pec-text, .ph-card.is-back .pec-text { color: #22322e; }
.ph-card.is-mid .pec-tags, .ph-card.is-back .pec-tags { color: #4d5a58; }
/* --- 顶层卡内容（写日记） --- */
.ph-star {
  position: absolute; right: 21px; top: 20px;
  color: var(--ph-lime); font-size: 25px; font-weight: 400;
}
.ph-title {
  font-family: var(--font-en);
  font-size: 14px; font-weight: 500; color: #bbc8c3;
  flex: none;
}
.ph-title strong {
  display: block; color: var(--ph-soft);
  font-size: 26px; line-height: 1.04;
  margin-top: 5px; letter-spacing: -.06em;
}
.ph-entry {
  flex: 1; min-height: 0;
  margin-top: 16px;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.ph-entry textarea {
  width: 100%; flex: 1; height: 100%; min-height: 0;
  overflow: hidden;
  background: transparent; border: 0; outline: 0;
  color: var(--ph-soft); resize: none;
  font-family: inherit;
  font-size: 20px; line-height: 1.38; font-weight: 500;
  padding: 0;
}
.ph-entry textarea::placeholder { color: #738380; }

.ph-foot {
  flex: none;
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 10px; margin-top: 10px;
  font-family: var(--font-en);
  font-size: 11px; font-weight: 500; color: var(--ph-muted);
}
.ph-moods { display: flex; gap: 8px; align-items: center; }
.ph-mood {
  border: 0; background: transparent;
  font-family: var(--font-en);
  color: #90a09b;
  font-size: 21px; font-weight: 600;
  padding: 0; min-width: 24px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: transform .16s, color .16s;
}
.ph-mood[data-m="neutral"], .ph-mood[data-m="negative"] { color: #a8b3ad; font-size: 0; }
.ph-mood.selected { color: var(--ph-lime); }
.ph-mood.selected[data-m="positive"] { font-size: 23px; }
.ph-mood:active { transform: scale(.9); }
/* 无表情圆脸 / 炸弹（参考稿为纯 CSS 画形，不用图标字体） */
.neutral-face {
  display: inline-flex; width: 20px; height: 20px;
  box-sizing: border-box;
  border: 1.5px solid currentColor; border-radius: 50%;
  flex-direction: column; justify-content: center; gap: 2px;
  padding: 0 4px;
}
.neutral-face i { display: block; height: 1px; background: currentColor; width: 100%; }
.bomb-icon {
  display: inline-block; width: 18px; height: 18px;
  box-sizing: border-box;
  border: 2px solid currentColor; border-radius: 50%;
  position: relative;
}
.bomb-icon::before {
  content: ''; position: absolute;
  width: 7px; height: 6px;
  border-left: 2px solid currentColor; border-top: 2px solid currentColor;
  right: -5px; top: -6px; transform: rotate(18deg);
}
.bomb-icon::after {
  content: '✦'; position: absolute;
  font-size: 8px; right: -10px; top: -11px; color: #ff8753;
}
.ph-pub {
  border: 0; background: transparent;
  font-family: var(--font-en);
  font-size: 11px; font-weight: 500;
  color: #92a29e;
  padding: 0; border-radius: 8px;
  white-space: nowrap;
}
.ph-pub:active { background: rgba(255, 255, 255, .06); }

/* --- 滑动保存 --- */
.ph-publish { flex: none; margin-top: 12px; display: flex; align-items: center; }
.ph-track {
  position: relative; flex: 1;
  height: 50px; border-radius: 27px;
  background: var(--ph-lime);
  padding: 5px;
  box-shadow: 0 5px 0 #b5c720;
  overflow: hidden;
  cursor: pointer;
}
.ph-knob {
  position: absolute; right: 5px; top: 5px;
  height: 40px; width: 48px; border-radius: 22px;
  background: #fff;
  display: grid; place-items: center;
  color: #0e1b1b; font-size: 19px;
  box-shadow: 0 2px 5px rgba(94, 106, 41, .18);
  transition: right .25s, transform .25s;
  z-index: 1;
}
.ph-track span {
  display: block; text-align: left; padding-left: 16px;
  font-family: var(--font-en);
  color: #0e1b1b; font-size: 9px; font-weight: 700;
  letter-spacing: .04em; line-height: 40px;
  white-space: nowrap;
}
.ph-track.done .knob { transform: rotate(180deg); }
.ph-track.done .knob { right: calc(100% - 53px); }

.ph-hint {
  flex: none; margin-top: 4px;
  text-align: center;
  font-family: var(--font-en);
  font-size: 10px; font-weight: 600;
  color: #6d7c79;
}

/* --- 最近记录统计 --- */
.ph-recent {
  flex: none; margin-top: 15px;
  display: flex; align-items: center; justify-content: space-between;
}
.ph-recent b { font-family: var(--font-en); font-size: 15px; font-weight: 700; letter-spacing: -.04em; color: #0e1b1b; }
.ph-recent span { font-family: var(--font-en); font-size: 10px; font-weight: 600; color: #778582; cursor: pointer; }

/* 矮屏整体收一档（参考稿 @container (max-height:700px)） */
@media (max-height: 700px) {
  .ph-date { margin-top: 8px; }
  .ph-date h2 { font-size: 35px; }
  .ph-date h2 em { font-size: 24px; }
  .deck { margin-top: 15px; }
  .ph-title strong { font-size: 23px; }
  .ph-card { padding: 17px; }
  .ph-entry { margin-top: 10px; }
  .ph-recent { margin-top: 10px; }
  .ph { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
}

/* 单屏布局里，写完后弹出的反馈卡改为浮层（不占版心、不出滚动条） */
#phPark { display: none; }
.fb-x {
  position: absolute; top: 8px; right: 10px;
  width: 26px; height: 26px; border: 0; border-radius: 50%;
  background: rgba(22, 101, 88, .08); color: var(--text-2);
  font-size: 15px; line-height: 1;
}
@media (max-width: 899px) {
  body.route-write #fbSlot {
    position: fixed; left: 0; right: 0;
    bottom: calc(96px + env(safe-area-inset-bottom));
    z-index: 38;
    max-width: 406px; margin: 0 auto;
    padding: 0 18px;
    max-height: 56vh; overflow: auto;
    pointer-events: none;
  }
  body.route-write #fbSlot > * { pointer-events: auto; }
  body.route-write #fbSlot .card.feedback { position: relative; box-shadow: 0 16px 36px rgba(14, 27, 27, .18); }
}

/* 记录设置折叠条已按用户要求移除（原日期补记/生成卡片入口随之撤下，桌面端保留） */

/* ==========================================================================
   管理后台（#admin，隐藏路由）+ 站长公告条
   ========================================================================== */
.announce-bar {
  display: flex; align-items: center; gap: 10px;
  margin: 14px 14px 0;
  padding: 10px 14px;
  background: var(--sage-2);
  border: 1px solid var(--line-2);
  border-radius: 14px;
  font-size: 13.5px; color: var(--text-2); line-height: 1.6;
}
.announce-bar span { flex: 1; min-width: 0; }
.announce-bar .ann-x {
  flex: none; border: none; background: transparent; cursor: pointer;
  color: var(--muted); font-size: 14px; padding: 2px 6px;
}
@media (min-width: 900px) { .announce-bar { margin: 0 0 18px; } }

.ad-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.ad-tab {
  border: 1px solid var(--line-2); background: var(--card); color: var(--text-2);
  border-radius: 999px; padding: 7px 18px; font-size: 13.5px; cursor: pointer;
}
.ad-tab.on { background: var(--ink); border-color: var(--ink); color: #fff; }

.ad-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}
.ad-stat { padding: 14px 16px; }
.ad-stat i { display: block; font-style: normal; font-size: 12px; color: var(--muted); }
.ad-stat b { font-size: 22px; font-weight: 600; color: var(--ink); font-family: var(--font-en); }

.ad-bars { display: flex; align-items: flex-end; gap: 6px; padding: 10px 2px 0; overflow-x: auto; }
.ad-bar { flex: none; width: 34px; text-align: center; }
.ad-bar i {
  display: block; margin: 0 auto 6px; width: 18px;
  background: var(--leaf-soft); border-radius: 4px 4px 0 0;
  min-height: 2px;
}
.ad-bar span { font-size: 10px; color: var(--faint); }

.ad-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ad-table th {
  text-align: left; font-weight: 500; color: var(--muted);
  padding: 10px 12px; border-bottom: 1px solid var(--line-2);
  white-space: nowrap;
}
.ad-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.ad-table tr.ad-banned td { background: #fdf5f0; }
.ad-table .btn-ghost { padding: 3px 10px; font-size: 12px; }
@media (max-width: 720px) {
  .ad-table { display: block; overflow-x: auto; }
}

.ad-entry .btn-ghost { padding: 3px 10px; font-size: 12px; }
.ad-entry { margin-bottom: 10px; }

/* ============ 登录页（PC 端唯一入口，未登录全站引导至此） ============ */
.login-wrap { display: flex; justify-content: center; padding: 8vh 16px 40px; min-height: 70vh; }
.login-card { width: 100%; max-width: 380px; padding: 34px 30px 26px; text-align: center; }
.login-brand { font-family: var(--font-en); font-size: 13px; letter-spacing: 3px; color: var(--leaf); margin-bottom: 10px; }
.login-title { font-size: 22px; font-weight: 600; color: var(--ink-deep); margin: 0 0 8px; }
.login-sub { font-size: 13px; line-height: 1.7; color: var(--muted); margin: 0 0 18px; }
.login-msg { min-height: 20px; font-size: 12.5px; margin-bottom: 6px; color: var(--leaf); }
.login-msg.bad { color: #C2543A; }
.login-card .field { margin-bottom: 12px; text-align: left; }
.login-links { margin: 12px 0 14px; }
.login-links a { font-size: 12.5px; color: var(--ink-2); text-decoration: none; }
.login-links a:hover { text-decoration: underline; }
.login-foot { font-size: 12px; line-height: 1.7; color: var(--faint); border-top: 1px dashed var(--line); padding-top: 14px; }
.sms-row { display: flex; gap: 8px; }
.sms-row input { flex: 1; min-width: 0; }
.sms-row .btn { flex: none; white-space: nowrap; }

/* 扫码登录 */
.login-or { display: flex; align-items: center; gap: 10px; margin: 14px 0; color: var(--faint); font-size: 12px; }
.login-or::before, .login-or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.btn-ghost { background: transparent; border: 1px solid var(--line-2); color: var(--ink); }
.btn-ghost:hover { background: var(--sage-2); }
.qr-wrap { position: relative; display: inline-block; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.qr-wrap img { display: block; }
.qr-mask { position: absolute; inset: 0; background: rgba(255,251,243,.92); display: flex; flex-direction: column; gap: 8px; align-items: center; justify-content: center; border-radius: 12px; font-size: 13px; color: var(--ink-deep); }

/* 新版 logo（白色立体日记本，位图素材）：侧栏与移动端顶栏共用 */
.brand-mark img { width: 100%; height: 100%; display: block; border-radius: 8px; box-shadow: 0 1px 5px rgba(26,38,36,.14); }
.brand-mini .brand-mark img { border-radius: 6px; }
