/* ============================================================
   CalNote 便签历 · 设计系统 v3 ——「翡翠书桌」
   冷近白桌面 + 翡翠主绿 + 琥珀内容点。清爽撞色、现代克制。
   规则说明:保留全部类名与 DOM 结构(JS 兼容),仅重建视觉。
   ============================================================ */

:root {
  color-scheme: light;

  /* 中性 —— 冷近白,非暖纸,非纯白 */
  --bg:        #f4f6f9;
  --surface:   #ffffff;
  --surface-2: #f8fafc;   /* 轻灰面:hover底/输入底 */
  --ink:       #1c2430;   /* 墨蓝黑正文 */
  --ink-2:     #4a5468;   /* 次级正文 */
  --dim:       #8b96a8;   /* 弱化信息 */
  --line:      #e4e8ef;   /* 发丝线 */
  --line-strong:#ccd3de;

  /* 翡翠主 —— 今天/选中/主按钮/品牌 */
  --accent:      #0d8a6f;
  --accent-deep: #0a6b56;
  --accent-ink:  #0a6b56;  /* 彩色文字(按钮白字除外) */
  --accent-bg:   #e3f2ec;  /* 柔翡翠底 */
  --accent-ring: rgba(13, 138, 111, .18);

  /* 琥珀辅 —— 日期内容点/置顶,跳出主绿可扫 */
  --amber:      #d4880f;
  --amber-bg:   #faf0dd;

  /* 功能色 */
  --danger:     #d64550;
  --danger-deep:#bb3641;
  --danger-bg:  #fbeaec;
  --ok:         #0d8a6f;

  /* 形状分级 —— 主纸16 / 控件10 / 徽6 */
  --radius-lg: 16px;
  --radius:    10px;
  --radius-sm: 6px;

  /* 便签彩色(卡片淡底 + 左侧色条)。
     mint/sky/violet/rose/amber 为五档卡片色;
     卡片 amber 用深暖底(--amber-deep)区别于月历亮琥珀指示点(原 --amber)。 */
  --mint:        #0d8a6f;  --mint-bg:        #e6f3ee;
  --sky:         #2563eb;  --sky-bg:         #e7eefb;
  --violet:      #7c3aed;  --violet-bg:      #f0eafd;
  --rose:        #d63a57;  --rose-bg:        #fce9ee;
  --amber-deep:  #b45309;  --amber-deep-bg:  #f9efdb;

  /* 冷蓝灰影,分层三档 —— 不用暖棕、不用 rgba(0,0,0,.1) 通用灰 */
  --shadow-xs:  0 1px 2px rgba(16, 24, 40, .04);
  --shadow:     0 1px 2px rgba(16, 24, 40, .04), 0 2px 6px rgba(16, 24, 40, .05);
  --shadow-lift:0 4px 12px rgba(16, 24, 40, .06), 0 14px 34px rgba(16, 24, 40, .10);

  --ease: cubic-bezier(.25, .6, .3, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "HarmonyOS Sans SC", "MiSans", "Noto Sans SC",
    "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

input, textarea { font-family: inherit; color: inherit; }

[hidden] { display: none !important; }

/* 标题统一黑体,层级靠字重/字号而非衬线 */
h1, h2, h3, h4,
.brand-title, .cal-title, .day-title, .modal-title, .page-title {
  font-family: inherit;
  font-weight: 700;
  letter-spacing: 0;
}

/* 数字/时间用表格数字,竖直对齐不跳动 */
.cal-num, .stat-value, .note-time, .search-sub, .user-status,
.tag-bar-count, input[type], .auth-tab, .nav-btn {
  font-variant-numeric: tabular-nums;
}

/* 键盘可达性 */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  transition: background .16s var(--ease), color .16s var(--ease),
    box-shadow .16s var(--ease), transform .08s var(--ease), border-color .16s var(--ease);
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow-xs), inset 0 1px 0 rgba(255,255,255,.18);
}
.btn-primary:hover { background: var(--accent-deep); }

.btn-danger {
  background: var(--danger);
  color: #fff;
  box-shadow: var(--shadow-xs), inset 0 1px 0 rgba(255,255,255,.14);
}
.btn-danger:hover { background: var(--danger-deep); }

.btn-ghost {
  background: transparent;
  color: var(--ink-2);
}
.btn-ghost:hover { background: var(--surface-2); color: var(--ink); }

.btn-block { width: 100%; }
.btn-sm { padding: 4px 12px; font-size: 13px; border-radius: var(--radius-sm); }

/* 图标钮 */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  line-height: 1;
  color: var(--ink-2);
  transition: background .15s var(--ease), color .15s var(--ease);
}
.icon-btn svg {
  width: 17px; height: 17px;
  fill: none; stroke: currentColor;
  stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round;
}
.icon-btn:hover { background: var(--surface-2); color: var(--accent); }
.icon-btn-danger:hover { background: var(--danger-bg); color: var(--danger); }

/* ---------- 认证页 ---------- */
#auth-view {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(1000px 520px at 85% -8%, rgba(13, 138, 111, .09), transparent 62%),
    radial-gradient(760px 480px at -8% 108%, rgba(99, 102, 241, .07), transparent 60%),
    var(--bg);
}
.auth-card {
  width: 100%;
  max-width: 388px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lift);
  padding: 34px 32px 30px;
}
.auth-brand { text-align: center; margin-bottom: 24px; }
.brand-logo {
  width: 62px; height: 62px;
  margin: 0 auto 10px;
  color: var(--accent);
}
.brand-logo svg { width: 100%; height: 100%; }
.brand-title {
  font-size: 26px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 2px;
}
.brand-sub {
  color: var(--dim);
  font-size: 13px;
  margin-top: 4px;
}

.auth-tabs {
  display: flex;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 3px;
  margin-bottom: 20px;
}
.auth-tab {
  flex: 1;
  padding: 7px 0;
  border-radius: calc(var(--radius) - 3px);
  font-size: 14px;
  color: var(--dim);
  font-weight: 500;
  transition: all .18s var(--ease);
}
.auth-tab.is-active {
  background: var(--surface);
  color: var(--accent-ink);
  font-weight: 600;
  box-shadow: var(--shadow-xs);
}

.field { display: block; margin-bottom: 15px; }
.field-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 6px;
}

.input {
  width: 100%;
  padding: 10px 13px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  font-size: 15px;
  background: var(--surface);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.input::placeholder { color: var(--dim); }
.input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}
.textarea { min-height: 140px; resize: vertical; line-height: 1.75; }
.auth-hint {
  font-size: 12.5px;
  color: var(--dim);
  text-align: center;
  margin: -2px 0 16px;
}
.auth-form .btn-block { margin-top: 6px; }

/* ---------- 顶栏 —— 近白磨砂,发丝底边 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, .82);
  -webkit-backdrop-filter: saturate(1.6) blur(12px);
  backdrop-filter: saturate(1.6) blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 920px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 22px;
  flex-wrap: wrap;
}
.topbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 16px;
  color: var(--ink);
  letter-spacing: .5px;
  white-space: nowrap;
}
.topbar-brand svg { width: 22px; height: 22px; flex: none; }
.topbar-nav { display: flex; gap: 2px; }
.nav-btn {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--ink-2);
  font-weight: 500;
  transition: all .15s var(--ease);
}
.nav-btn:hover { color: var(--accent-ink); background: var(--surface-2); }
.nav-btn.is-active {
  color: var(--accent-ink);
  background: var(--accent-bg);
  font-weight: 700;
}
.topbar-search {
  flex: 1;
  min-width: 150px;
  position: relative;
}
.topbar-search input {
  width: 100%;
  padding: 8px 14px 8px 36px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 14px;
  background: var(--surface-2);
  transition: all .18s var(--ease);
}
.topbar-search::before {
  content: "";
  position: absolute;
  left: 13px; top: 50%;
  width: 13px; height: 13px;
  margin-top: -7.5px;
  border: 1.6px solid var(--dim);
  border-radius: 50%;
  pointer-events: none;
}
.topbar-search::after {
  content: "";
  position: absolute;
  left: 24px; top: 50%;
  width: 6px; height: 1.7px;
  margin-top: 5px;
  background: var(--dim);
  transform: rotate(45deg);
  pointer-events: none;
}
.topbar-search input:focus {
  outline: none;
  background: var(--surface);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}
.topbar-user {
  display: flex;
  align-items: center;
  gap: 4px;
}
.user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  margin-right: 4px;
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.topbar-user .btn-ghost {
  font-size: 13px;
  padding: 6px 10px;
  color: var(--dim);
}
.topbar-user .btn-ghost:hover { color: var(--ink); }

/* ---------- 主区 ---------- */
.main {
  max-width: 920px;
  margin: 0 auto;
  padding: 26px 22px 110px;
}
.page { animation: pageIn .22s var(--ease); }
@keyframes pageIn {
  from { opacity: 0; transform: translateY(5px); }
  to   { opacity: 1; transform: none; }
}
.page-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 16px;
}
.page-subtitle {
  font-size: 15px;
  font-weight: 600;
  margin: 10px 0;
  color: var(--ink);
}

/* ---------- 月历 —— 一张白纸浮上桌面,格线织界 ---------- */
/* 月历主区:全宽、日历靠左、便签为右侧长条;窄屏上下 */
.cal-main {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  width: 100vw;
  max-width: none;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  padding: 2px 24px 0;
}
.cal-card {
  flex: none;
  width: 460px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 16px 10px 10px;
  box-shadow: var(--shadow-lift);
  animation: cardIn 1.2s cubic-bezier(.22, 1, .36, 1);
}
/* 主页(未点日期):日历+黄历整卡在窗口中央 */
.cal-main.cal-home {
  display: block;
  width: auto;
  max-width: 560px;
  margin: 0 auto;
  padding: 2px 0 0;
}
.cal-main.cal-home .cal-card {
  margin: 0 auto;
  width: 540px;
}
/* 主页 ↔ 双栏切换动画 */
@keyframes cardIn {
  from { opacity: 0; transform: translateY(30px) scale(.96); }
  to   { opacity: 1; transform: none; }
}
@keyframes slideRight {
  from { opacity: 0; transform: translateX(52px); }
  to   { opacity: 1; transform: none; }
}
.cal-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 10px 10px;
}
.cal-title {
  flex: 1;
  text-align: center;
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
}
.cal-head .icon-btn {
  width: 34px; height: 34px;
  color: var(--ink-2);
  font-size: 20px;
}
.cal-head .icon-btn:hover { color: var(--accent); background: var(--surface-2); }
.cal-head .btn-ghost.btn-sm {
  color: var(--accent-ink);
  border: 1px solid var(--accent);
  background: var(--surface);
  font-weight: 600;
}
.cal-head .btn-ghost.btn-sm:hover { background: var(--accent-bg); }

.cal-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin: 0 4px 2px;
}
.cal-week-cell {
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--dim);
  padding: 6px 0 8px;
  letter-spacing: 2px;
}
.cal-week-cell:first-child,
.cal-week-cell:last-child { color: var(--amber); }

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  margin: 0 4px;
  padding-bottom: 4px;
}
.cal-cell {
  position: relative;
  height: 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: 5px;
  gap: 1px;
  cursor: pointer;
  color: var(--ink-2);
  border-radius: 10px;
  transition: background .12s var(--ease);
}
.cal-cell:hover { background: var(--surface-2); }
.cal-cell-empty { cursor: default; }
.cal-cell-empty:hover { background: transparent; }
/* 数字(顶)与农历小字(底)两行 */
.cal-num {
  font-size: 14px;
  line-height: 1.2;
  color: inherit;
  font-weight: 500;
}
.cal-sub {
  max-width: 90%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 10px;
  line-height: 1.15;
  color: var(--dim);
  font-weight: 400;
}
.cal-sub.is-fest { color: var(--danger); font-weight: 600; }
.cal-sub.is-work { color: var(--amber); }
/* 选中(展开)日:整格淡底 + 数字描边变绿 */
.cal-cell.is-selected {
  background: var(--accent-bg);
  box-shadow: inset 0 0 0 1.5px var(--accent);
  border-radius: 10px;
}
.cal-cell.is-selected .cal-num { font-weight: 700; color: var(--accent); }
.cal-cell.is-selected .cal-sub { color: var(--accent-ink); }
/* 今天:数字绿圆白字。需在 is-selected 之后,保证同时选中/今天时白字不被绿覆盖 */
.cal-cell.is-today .cal-num {
  color: #fff !important;
  font-weight: 700;
  width: 24px; height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--accent);
}
.cal-cell.is-today .cal-sub { color: var(--accent-ink); font-weight: 600; }
/* 有便签点:数字右上小圆点 */
.cal-dot {
  position: absolute;
  top: 3px;
  right: 6px;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--amber);
}
.cal-cell.is-today .cal-dot { background: var(--surface); box-shadow: 0 0 0 1px var(--accent); }
.cal-cell.is-selected .cal-dot { background: var(--accent); }

/* ---------- 星座黄历卡(月历下方,丰富版) ---------- */
.fortune-card {
  margin: 6px 4px 0;
  padding: 12px 14px 14px;
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line);
  font-size: 12px;
}
/* 头:农历大字 */
.fortune-head {
  text-align: center;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--line);
}
.fortune-luna {
  display: block;
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: .5px;
}
.fortune-datesub {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 7px;
  margin-top: 3px;
  font-size: 11.5px;
  color: var(--dim);
}
.fortune-tag {
  font-size: 11px;
  font-weight: 600;
  color: var(--danger);
  background: var(--danger-bg);
  border-radius: 999px;
  padding: 0 8px;
}
/* 星座/生肖/干支 */
.fortune-zodiac {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 9px;
  flex-wrap: wrap;
}
.fortune-zod {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-ink);
  background: var(--accent-bg);
  border: 1px solid #d4e9df;
  padding: 1px 11px;
  border-radius: 999px;
}
/* 星座特点一句话 + 当日小语 */
.fortune-xz {
  margin-top: 9px;
  padding: 7px 11px;
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, rgba(13,138,111,.08), rgba(13,138,111,.02));
  border: 1px solid #d7eae2;
}
.xz-desc {
  font-size: 12.5px;
  color: var(--accent-ink);
  font-weight: 600;
}
.xz-tip {
  margin-top: 3px;
  font-size: 12px;
  color: var(--ink-2);
  line-height: 1.55;
}
/* 宜/忌 双栏 */
.fortune-yiji {
  display: flex;
  gap: 10px;
  margin-top: 11px;
}
.yiji-col {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 7px;
  align-content: flex-start;
}
.yiji-col.is-yi { background: #f2fbf6; border-color: #d5ebe0; }
.yiji-col.is-ji { background: #fdf6f4; border-color: #f1ddd8; }
.yiji-title {
  width: 100%;
  font-size: 12px;
  letter-spacing: 2px;
  padding-bottom: 3px;
}
.is-yi .yiji-title { color: var(--ok); }
.is-ji .yiji-title { color: var(--danger); }
.yiji-item { font-size: 12px; color: var(--ink-2); }
/* 老黄历小字 */
.fortune-almanac {
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 11.5px;
  color: var(--dim);
}
.fortune-peng { width: 100%; margin: 2px 0 0; color: var(--amber-deep); }
/* 四维运势 */
.fortune-dims {
  margin-top: 11px;
  padding-top: 9px;
  border-top: 1px dashed var(--line);
}
.dims-title { font-size: 12px; color: var(--ink); display: block; margin-bottom: 6px; }
.dims-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; }
.dim { display: flex; align-items: center; gap: 7px; }
.dim-name { width: 2em; font-size: 11.5px; color: var(--ink-2); flex-shrink: 0; }
.dim-track { display: flex; gap: 3px; flex: 1; }
.dim-seg {
  height: 7px; flex: 1;
  border-radius: 2px;
  background: var(--line-strong);
}
.dim-seg.on {
  background: linear-gradient(90deg, #31b492, var(--accent));
}
/* 幸运 + 吉言 */
.fortune-lucky { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.lucky-chip {
  font-size: 11px;
  font-weight: 600;
  color: var(--amber-deep);
  background: var(--amber-deep-bg);
  border-radius: 999px;
  padding: 1px 10px;
}
.fortune-word {
  margin-top: 9px;
  font-size: 12.5px;
  color: var(--ink-2);
  line-height: 1.65;
  border-left: 3px solid var(--accent);
  padding: 2px 0 2px 10px;
  background: linear-gradient(90deg, rgba(13,138,111,.04), transparent 70%);
}
/* 抽签 */
.fortune-qian {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  display: flex;
  align-items: center;
  gap: 10px;
}
.qian-btn {
  color: #fff;
  background: var(--accent);
  font-weight: 600;
}
.qian-btn:hover { background: var(--accent-deep); color: #fff; }
.qian-result {
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0;
}
.qian-result.show { opacity: 1; animation: pageIn .25s var(--ease); }
.qian-grade {
  font-size: 15px;
  font-weight: 700;
  padding: 1px 10px;
  border-radius: 999px;
  color: #fff;
}
.qian-grade.is-high { background: var(--danger); }
.qian-grade.is-mid { background: var(--amber); }
.qian-grade.is-low { background: #6b7280; }
.qian-text { font-size: 12.5px; color: var(--ink-2); }

/* ---------- 月历右侧便签栏(点日期显示当日) ---------- */
.day-pane {
  flex: 1;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  box-shadow: var(--shadow);
  animation: slideRight 1.2s cubic-bezier(.22, 1, .36, 1);
}
.day-pane .day-head {
  margin: 0 0 16px;
  justify-content: space-between;
}
.day-pane .day-title { font-size: 20px; }
.day-pane-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 320px;
  color: var(--dim);
  font-size: 15px;
}

/* ---------- 某天视图 ---------- */
.day-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
}
.day-title {
  font-size: 19px;
  font-weight: 700;
  color: var(--ink);
}
.day-head .btn { color: var(--accent-ink); }
.note-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.note-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow);
  cursor: pointer;
  position: relative;
  transition: transform .16s var(--ease), box-shadow .16s var(--ease), border-color .16s var(--ease);
}
.note-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lift);
  border-color: var(--line-strong);
}
/* 便签卡片五色标记:白卡 + 左侧彩条(便签签条),色不喧宾 */
.note-card { border-left: 5px solid transparent; }
.note-card::before {
  content: "";
  position: absolute;
  left: -1px; top: 0; bottom: 0;
  width: 3px;
  background: transparent;
}
.c-mint   { border-left-color: var(--mint); }
.c-sky    { border-left-color: var(--sky); }
.c-violet { border-left-color: var(--violet); }
.c-rose   { border-left-color: var(--rose); }
.c-amber  { border-left-color: var(--amber-deep); }
.note-card.is-pinned { border-left-color: var(--amber); }
.note-card.is-pinned .pin-badge { color: #8a5400; background: var(--amber-bg); border-color: #ecdcb0; }
.note-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 3px;
}
.note-title {
  font-size: 18px;
  font-weight: 700;
  word-break: break-word;
  color: var(--ink);
  line-height: 1.45;
}
.pin-badge {
  font-size: 11px;
  font-weight: 700;
  color: var(--amber);
  background: var(--amber-bg);
  border: 1px solid #f2dfb8;
  padding: 1px 8px;
  border-radius: 999px;
  flex-shrink: 0;
  letter-spacing: 1px;
}
.note-content {
  font-size: 15.5px;
  line-height: 1.7;
  color: var(--ink-2);
  white-space: pre-wrap;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.tag {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-ink);
  background: var(--accent-bg);
  border: 1px solid #cfe6dc;
  padding: 1px 9px;
  border-radius: 999px;
  letter-spacing: .5px;
}
/* 编辑器颜色选择 swatch */
.color-row { display: flex; gap: 10px; flex-wrap: wrap; }
.color-swatch {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1.5px var(--line-strong);
  cursor: pointer;
  transition: transform .12s var(--ease), box-shadow .12s var(--ease);
}
.color-swatch:hover { transform: scale(1.12); }
.color-swatch.is-mint   { background: var(--mint); }
.color-swatch.is-sky    { background: var(--sky); }
.color-swatch.is-violet { background: var(--violet); }
.color-swatch.is-rose   { background: var(--rose); }
.color-swatch.is-amber  { background: var(--amber-deep); }
.color-swatch.is-selected {
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px currentColor;
  transform: scale(1.1);
}
.color-swatch.is-mint.is-selected   { color: var(--mint); }
.color-swatch.is-sky.is-selected    { color: var(--sky); }
.color-swatch.is-violet.is-selected { color: var(--violet); }
.color-swatch.is-rose.is-selected   { color: var(--rose); }
.color-swatch.is-amber.is-selected  { color: var(--amber-deep); }

.note-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}
.note-time {
  font-size: 12px;
  color: var(--dim);
}
.note-actions { display: flex; gap: 2px; }

.attach-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.attach-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 10px 4px 5px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: var(--surface-2);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.attach-chip:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}
.attach-chip { position: relative; padding-right: 26px; }
.attach-del {
  position: absolute;
  top: 2px; right: 2px;
  width: 18px; height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--dim);
  background: rgba(255, 255, 255, .9);
  transition: background .12s, color .12s;
}
.attach-del svg { width: 10px; height: 10px; }
.attach-del:hover { background: var(--danger); color: #fff; }
.attach-thumb {
  width: 42px; height: 42px;
  object-fit: cover;
  border-radius: var(--radius-sm);
}
.attach-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px; height: 18px;
  flex: none;
  color: var(--accent);
}
.attach-icon svg { width: 100%; height: 100%; }

/* 空状态 */
.empty {
  text-align: center;
  color: var(--dim);
  padding: 46px 20px;
  font-size: 14px;
}
.empty-icon { font-size: 30px; margin-bottom: 6px; }
.empty-sub {
  font-size: 13px;
  margin-top: 4px;
  opacity: .85;
}

/* 新建便签 FAB */
.fab {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: #fff;
  padding: 12px 26px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 8px 24px rgba(13, 138, 111, .35);
  transition: transform .1s var(--ease), background .15s var(--ease), box-shadow .2s var(--ease);
  z-index: 30;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.fab svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; }
.fab:hover {
  background: var(--accent-deep);
  transform: translateX(-50%) translateY(-1px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 12px 28px rgba(13, 138, 111, .42);
}
.fab:active { transform: translateX(-50%) translateY(1px) scale(.98); }

/* ---------- 搜索 ---------- */
.search-sec {
  font-size: 12px;
  font-weight: 600;
  color: var(--dim);
  margin: 12px 0 6px;
  letter-spacing: 1px;
}
.search-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 10px;
  transition: transform .16s var(--ease), box-shadow .16s var(--ease), border-color .16s var(--ease);
}
.search-item:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-lift);
  border-color: var(--line-strong);
}
.search-item { border-left: 4px solid transparent; }
.search-item.c-mint   { border-left-color: var(--mint); }
.search-item.c-sky    { border-left-color: var(--sky); }
.search-item.c-violet { border-left-color: var(--violet); }
.search-item.c-rose   { border-left-color: var(--rose); }
.search-item.c-amber  { border-left-color: var(--amber-deep); }
.search-main { flex: 1; min-width: 0; }
.search-label { font-weight: 700; font-size: 14px; display: block; color: var(--ink); }
.search-content {
  font-size: 13px;
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.search-sub { font-size: 12px; color: var(--dim); flex-shrink: 0; }

mark.hit {
  background: #fff0b3;
  color: #8a5a00;
  border-radius: 2px;
  padding: 0 1px;
}

/* ---------- 回收站 ---------- */
.trash-card { cursor: default; }
.trash-card:hover { transform: none; }
.trash-card .note-actions { margin-top: 10px; }
.trash-day {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--amber);
  margin-bottom: 4px;
}

/* ---------- 统计 ---------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 14px;
}
@media (max-width: 620px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 16px;
  box-shadow: var(--shadow);
  text-align: center;
}
.stat-value {
  display: block;
  font-size: 30px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.2;
}
.stat-label {
  font-size: 12px;
  color: var(--dim);
  font-weight: 600;
  letter-spacing: 1px;
  margin-top: 2px;
}
.stats-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  margin-bottom: 14px;
}
.stats-card .page-subtitle { margin-top: 0; }
/* 近12月柱状 */
.month-chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 150px;
  margin-top: 12px;
  padding: 0 4px;
}
.month-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  gap: 3px;
}
.month-val { font-size: 11px; color: var(--dim); font-variant-numeric: tabular-nums; }
.month-bar {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.month-bar-fill {
  width: 100%;
  max-width: 26px;
  min-height: 2px;
  border-radius: 5px 5px 2px 2px;
  background: linear-gradient(180deg, var(--accent), #31b492);
  transition: height .4s var(--ease);
}
.month-bar-fill:empty { background: var(--surface-2); }
.month-label { font-size: 10.5px; color: var(--dim); }
.tag-bars { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.tag-bar-row { display: flex; align-items: center; gap: 10px; }
.tag-bar-label {
  width: 84px;
  font-size: 13px;
  color: var(--ink-2);
  flex-shrink: 0;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tag-bar-track {
  flex: 1;
  height: 8px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
}
.tag-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #31b492, var(--accent));
  border-radius: 999px;
  transition: width .4s var(--ease);
}
.tag-bar-count {
  width: 30px;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: var(--dim);
  text-align: right;
}

/* ---------- 管理后台 ---------- */
.admin-tabs {
  display: flex;
  gap: 4px;
  margin: 4px 0 14px;
  border-bottom: 1px solid var(--line);
}
.admin-tab {
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--dim);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color .15s, border-color .15s;
}
.admin-tab:hover { color: var(--ink); }
.admin-tab.is-active {
  color: var(--accent-ink);
  border-bottom-color: var(--accent);
}
.user-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 5px;
  font-size: 12px;
  color: var(--dim);
}
.log-list { display: flex; flex-direction: column; }
.log-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 4px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.log-row:hover { background: var(--surface-2); }
.log-act {
  flex: none;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 8px;
  border-radius: 999px;
}
.log-act.is-del { color: var(--danger); background: var(--danger-bg); }
.log-act.is-auth { color: var(--accent-ink); background: var(--accent-bg); }
.log-act.is-act { color: #5b6472; background: var(--surface-2); }
.log-user { flex: none; font-weight: 600; color: var(--ink); }
.log-detail { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.log-time { flex: none; font-size: 12px; color: var(--dim); }
.user-list { display: flex; flex-direction: column; gap: 10px; }
.user-row {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.user-info { flex: 1; min-width: 150px; }
.user-name-line { display: flex; align-items: center; gap: 8px; }
.user-name { font-weight: 700; font-size: 15px; color: var(--ink); }
.user-role {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-ink);
  background: var(--accent-bg);
  border: 1px solid #cfe6dc;
  padding: 1px 8px;
  border-radius: 999px;
  letter-spacing: .5px;
}
.user-me {
  font-size: 11px;
  color: var(--dim);
  font-weight: 500;
}
.user-status {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 9px;
  border-radius: 999px;
  margin-top: 5px;
  letter-spacing: .5px;
}
.user-status.is-active { color: #fff; background: var(--ok); }
.user-status.is-disabled { color: var(--danger); background: var(--danger-bg); }
.user-row .note-actions { margin-top: 0; }

/* ---------- modal ---------- */
#modal-root {
  position: fixed;
  inset: 0;
  z-index: 100;
}
.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(28, 36, 48, .46);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn .16s var(--ease);
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
  width: 100%;
  max-width: 460px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lift);
  animation: slideUp .2s var(--ease);
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(14px) scale(.99); }
  to   { opacity: 1; transform: none; }
}
.modal-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--ink);
}
.modal-message {
  font-size: 14px;
  color: var(--ink-2);
  margin-bottom: 16px;
  line-height: 1.7;
}
.export-fmt-btn { justify-content: flex-start; }
.modal-message + .export-fmt-btn { margin-top: 2px; }
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 0;
}
.switch-text { font-size: 14px; color: var(--ink); }
.switch {
  position: relative;
  display: inline-block;
  width: 44px; height: 24px;
  flex-shrink: 0;
}
.switch input { opacity: 0; width: 0; height: 0; }
.switch-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--line-strong);
  border-radius: 999px;
  transition: background .2s var(--ease);
}
.switch-slider::before {
  content: "";
  position: absolute;
  height: 18px; width: 18px;
  left: 3px; top: 3px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(16, 24, 40, .25);
  transition: transform .2s var(--ease);
}
.switch input:checked + .switch-slider { background: var(--accent); }
.switch input:checked + .switch-slider::before { transform: translateX(20px); }
.switch input:focus-visible + .switch-slider {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- toast ---------- */
.toast-root {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}
.toast {
  background: #2a3342;
  color: #f4f7fb;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-lift);
  opacity: 0;
  transform: translateY(-10px) scale(.98);
  transition: opacity .2s var(--ease), transform .2s var(--ease);
  max-width: 90vw;
}
.toast.show { opacity: 1; transform: none; }
.toast-error { background: var(--danger); color: #fff; }
.toast-success { background: var(--accent); color: #fff; }

/* ---------- 响应式 ---------- */
/* 中屏:左右栏挤则改上下 */
@media (max-width: 900px) {
  .cal-main {
    flex-direction: column;
    align-items: stretch;
  }
  .cal-card {
    width: 100%;
    max-width: 460px;
    margin: 0 auto;
  }
  .day-pane {
    min-height: 200px;
  }
}

@media (max-width: 560px) {
  .topbar-inner { padding: 8px 14px; gap: 8px; }
  .topbar-brand { font-size: 15px; }
  .main { padding: 16px 12px 100px; }
  .cal-num { font-size: 15px; }
  .cal-card { padding: 12px 4px 8px; }
  .cal-head { margin: 0 8px 8px; }
  .day-pane { padding: 16px 14px; }
  .stats-grid { gap: 10px; }
  .stat-card { padding: 16px 10px; }
  .topbar-search { order: 3; width: 100%; min-width: 100%; }
  .topbar-nav { order: 4; }
  .topbar-user { margin-left: auto; }
}

/* ---------- 减弱动效 ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .note-card:hover, .search-item:hover { transform: none; }
}
