/* ================= 红薯小站 · 全局样式 =================
   设计风格：苹果风 Bento 卡片，雾霾蓝 + 奶白 + 淡珊瑚粉
   ===================================================== */
:root {
  --bg: #F0F4F8;        /* 主背景 雾霾蓝基调 */
  --card: #FEFCF9;      /* 卡片底 奶白 */
  --primary: #8FA8C8;   /* 主色 雾霾蓝 */
  --accent: #E8A598;    /* 强调 淡珊瑚粉 */
  --text: #3D3D3D;      /* 文字主色 */
  --text-2: #8C8C8C;    /* 文字次色 */
  --success: #9CB89C;   /* 成功/完成 */
  --warn: #D4766A;      /* 警告/截止 */
  --border: #E5E9F0;    /* 边框 */
  --radius: 20px;
  --shadow: 0 2px 12px rgba(143, 168, 200, .10);
  --shadow-hover: 0 6px 20px rgba(143, 168, 200, .18);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; } /* 确保 hidden 属性不被 #login-view 的 display:flex 覆盖 */
/* 自托管 emoji 子集字体（23KB，Noto Color Emoji）：Linux 缺彩色 emoji 字体时兜底显示小图标 */
@font-face {
  font-family: 'HS Emoji';
  src: url('/fonts/hs-emoji.woff2') format('woff2');
  font-display: swap;
}
html { font-size: 15px; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif,
    "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", "HS Emoji", "Segoe UI Symbol", "Noto Sans Symbols 2";
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding-bottom: env(safe-area-inset-bottom);
}
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select { font-family: inherit; font-size: 1rem; }
a { color: var(--primary); text-decoration: none; }

/* ---------- 登录页 ---------- */
#login-view {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px;
}
.login-card {
  background: var(--card); border-radius: 24px; box-shadow: var(--shadow);
  padding: 44px 36px; width: 100%; max-width: 360px; text-align: center;
  animation: fadeIn .5s ease;
}
.login-card h1 { font-size: 1.5rem; margin-bottom: 6px; }
.login-card .sub { color: var(--text-2); font-size: .9rem; margin-bottom: 28px; }
.login-card input {
  width: 100%; padding: 13px 16px; border: 1px solid var(--border); border-radius: 12px;
  background: #fff; outline: none; margin-bottom: 14px; transition: border-color .2s;
}
.login-card input:focus { border-color: var(--primary); }
.login-err { color: var(--warn); font-size: .85rem; min-height: 1.2em; margin-bottom: 10px; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  padding: 9px 18px; border-radius: 12px; font-size: .92rem;
  background: var(--primary); color: #fff; transition: opacity .2s, transform .15s;
}
.btn:hover { opacity: .88; }
.btn:active { transform: scale(.97); }
.btn.block { width: 100%; }
.btn.ghost { background: transparent; color: var(--primary); border: 1px solid var(--primary); }
.btn.accent { background: var(--accent); }
.btn.danger { background: var(--warn); }
.btn.small { padding: 5px 12px; font-size: .82rem; border-radius: 9px; }
.btn.gray { background: var(--border); color: var(--text); }

/* ---------- 主布局（目标：1080P 一屏放下全部模块） ---------- */
#app-view { max-width: 1600px; margin: 0 auto; padding: 12px 16px 24px; }

/* ---------- 底部备案号 ---------- */
.site-footer { margin-top: 16px; padding: 8px 0; text-align: center; }
.site-footer a { color: var(--text-2); font-size: .76rem; text-decoration: none; transition: color .2s; }
.site-footer a:hover { color: var(--primary); }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 8px; margin-bottom: 12px;
}
.topbar .brand { font-size: 1.25rem; font-weight: 700; }
.topbar .clock { color: var(--text-2); font-size: .92rem; font-variant-numeric: tabular-nums; }
.topbar-right { display: flex; align-items: center; gap: 10px; }

/* 身份切换 */
.identity-switch {
  display: inline-flex; background: var(--card); border-radius: 999px; padding: 3px;
  box-shadow: var(--shadow);
}
.identity-switch button {
  padding: 6px 16px; border-radius: 999px; font-size: .88rem; color: var(--text-2);
  transition: all .2s;
}
.identity-switch button.active { background: var(--accent); color: #fff; }

/* 随手记快捷输入（位于日历卡底部） */
.quick-note { position: relative; display: flex; align-items: center; width: 100%; }
.quick-note.cal-note { margin: 10px 0 0; max-width: none; }
#qn-input {
  width: 100%; padding: 9px 44px 9px 14px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--bg);
  font-size: .88rem; color: var(--text); outline: none;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
#qn-input::placeholder { color: #a8b0ba; }
#qn-input:focus {
  border-color: var(--primary); background: #fff;
  box-shadow: 0 0 0 3px rgba(78,118,200,.13);
}
.qn-list-btn {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px; border: none; background: transparent;
  font-size: 1.02rem; line-height: 1; cursor: pointer; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.qn-list-btn:hover { background: #fff; }
.qn-badge {
  position: absolute; top: -3px; right: -3px; min-width: 15px; height: 15px;
  padding: 0 4px; border-radius: 999px; background: var(--accent); color: #fff;
  font-size: .6rem; font-weight: 700; display: flex; align-items: center; justify-content: center;
}
@keyframes qnShake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-4px)} 75%{transform:translateX(4px)} }
#qn-input.invalid { animation: qnShake .18s ease 2; border-color: var(--warn); }
/* 随手记记录弹窗列表 */
.qn-modal-list { display: flex; flex-direction: column; gap: 6px; max-height: 50vh; overflow-y: auto; }
.qn-item {
  display: flex; align-items: flex-start; gap: 8px; background: var(--bg);
  border-radius: 10px; padding: 9px 12px; font-size: .88rem;
}
.qn-item .qn-text { flex: 1; word-break: break-word; }
.qn-item .qn-time { display: block; font-size: .68rem; color: var(--text-2); margin-top: 3px; }
.qn-item .qn-del { flex-shrink: 0; border: none; background: transparent; color: var(--text-2); cursor: pointer; font-size: .9rem; padding: 0 2px; }
.qn-item .qn-del:hover { color: var(--warn); }
.qn-empty { color: var(--text-2); text-align: center; padding: 24px 0; font-size: .86rem; }

.icon-btn {
  width: 38px; height: 38px; border-radius: 12px; background: var(--card);
  box-shadow: var(--shadow); font-size: 1.05rem; display: inline-flex;
  align-items: center; justify-content: center; transition: transform .15s;
}
.icon-btn:hover { transform: translateY(-2px); }
/* 小图标按钮（卡片标题栏用，比如"+ 新增"缩成"+"） */
.icon-btn.small { width: 26px; height: 26px; border-radius: 8px; font-size: .9rem; font-weight: 700; color: var(--primary); line-height: 1; padding: 0; }
.icon-btn.small:hover { background: var(--bg); }

/* ---------- Bento 网格 ---------- */
.bento {
  display: grid; gap: 12px;
  grid-template-columns: repeat(12, 1fr);
}
.card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 14px 16px; animation: fadeIn .45s ease both;
  transition: box-shadow .25s, transform .25s;
  overflow: hidden;
}
.card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.card h2 {
  font-size: 1rem; font-weight: 600; margin-bottom: 10px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  flex-wrap: wrap;
}
.card h2 .card-tools { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

/* 各模块占位（12 列网格）
   第一行：我们在一起(2) + 今年过了(2) + 今日诗词(2) + 快捷入口(6)
   第二行：日历(4) + 招聘信息(5) + RSS 订阅(3)
   第三行：时光机(5) + 日常清单(3) + 天气(4) */
.m-love       { grid-column: span 2; }
.m-year       { grid-column: span 2; }
.m-poem       { grid-column: span 2; }
.m-links      { grid-column: span 6; }
.m-calendar   { grid-column: span 4; }
.m-jobs       { grid-column: span 5; min-height: 200px; }  /* 加宽，招聘条目多 */
.m-rss        { grid-column: span 3; }   /* 收窄，标题列表不需要太宽 */
.m-timemachine{ grid-column: span 5; }
.m-lists      { grid-column: span 3; }
.m-weather    { grid-column: span 4; }

/* ---------- 我们在一起 ---------- */
.love-days { font-size: 2.2rem; font-weight: 700; color: var(--accent); line-height: 1.15; }
.love-days small { font-size: 1rem; color: var(--text-2); font-weight: 400; }
.love-detail { color: var(--text-2); margin-top: 4px; font-size: .88rem; }

/* ---------- 今年过了 ---------- */
.year-wrap { display: flex; align-items: center; justify-content: center; }
.year-ring { position: relative; width: 104px; height: 104px; flex-shrink: 0; }
.year-ring svg { transform: rotate(-90deg); width: 100%; height: 100%; display: block; }
.year-ring .pct {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; line-height: 1.25;
  font-size: 1.1rem; font-weight: 700; color: var(--primary);
}
.year-ring .pct small { font-size: .68rem; font-weight: 400; color: var(--text-2); }

/* ---------- 日历 ---------- */
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.cal-head { text-align: center; font-size: .78rem; color: var(--text-2); padding: 2px 0; }
.cal-cell {
  position: relative; text-align: center; padding: 2px 1px 2px; border-radius: 8px;
  min-height: 38px; background: #fff; border: 1px solid transparent;
}
.cal-cell.other { opacity: .32; }
.cal-cell .d { font-size: .92rem; font-weight: 600; }
.cal-cell .l { font-size: .66rem; color: var(--text-2); margin-top: 1px; white-space: nowrap; overflow: hidden; }
.cal-cell .l.festival { color: var(--accent); }
.cal-cell .l.term { color: var(--primary); }
/* 日历底部栏：当日提示（左）+次节日倒计时（右） */
.cal-footer {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  margin-top: 10px; padding: 8px 14px; background: #fff; border-radius: 10px;
  border: 1px solid var(--border); font-size: .82rem;
}
.cal-footer-left { color: var(--text); }
.cal-footer-right { color: var(--text-2); }
.cal-footer-right b { color: var(--accent); font-weight: 600; }
/* 纪念日提醒：珊瑚粉高亮 + 加粗 + 浅粉底色，比普通节日更凸显 */
.cal-ann {
  color: var(--accent); font-weight: 700; font-size: .88rem;
  background: rgba(232, 165, 152, .14); padding: 2px 8px; border-radius: 999px;
  display: inline-flex; align-items: center; gap: 3px;
}
.cal-ann b { color: var(--accent); font-weight: 800; }
.cal-cell.today { border-color: var(--accent); background: #FFF6F3; }
.cal-cell.today .d { color: var(--accent); }
/* 可点选的当月日期 */
.cal-cell[data-day] { cursor: pointer; }
.cal-cell[data-day]:hover { border-color: var(--primary); }
.cal-cell.selected { border-color: var(--primary); background: #EEF4FF; box-shadow: 0 0 0 1px var(--primary); }
.cal-cell .badge {
  position: absolute; top: 2px; right: 2px; font-size: .58rem; padding: 1px 4px;
  border-radius: 6px; color: #fff;
}
.cal-cell .badge.off { background: var(--success); }
.cal-cell .badge.work { background: var(--warn); }
.cal-cell .ann-dot {
  position: absolute; bottom: 3px; left: 50%; transform: translateX(-50%);
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 2px #fff, 0 0 6px rgba(232,107,107,.7);
  animation: annPulse 1.8s ease-in-out infinite;
}
@keyframes annPulse {
  0%, 100% { box-shadow: 0 0 0 2px #fff, 0 0 4px rgba(232,107,107,.55); }
  50%      { box-shadow: 0 0 0 2px #fff, 0 0 9px rgba(232,107,107,.95); }
}
/* 选中日详情面板：单行紧凑显示 */
.cal-sel {
  margin-top: 10px; padding: 7px 14px; background: #fff; border-radius: 10px;
  border: 1px solid var(--border); border-left: 4px solid var(--primary);
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-size: .82rem; animation: fadeIn .18s ease;
}
.cal-sel .sel-date { font-weight: 700; color: var(--text); white-space: nowrap; }
.cal-sel .sel-ann { color: var(--accent); font-weight: 700; }
.cal-sel .sel-work { color: var(--text-2); }
.cal-sel .sel-empty { color: var(--text-2); }
/* 近期节日提醒：放在日历标题栏右侧，不单独占行 */
.upcoming { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.upcoming .chip {
  background: #fff; border: 1px solid var(--border); border-radius: 999px;
  padding: 2px 9px; font-size: .7rem; color: var(--text); white-space: nowrap;
}
.upcoming .chip b { color: var(--accent); }

/* ---------- 天气 ---------- */
.weather-grid { display: grid; grid-template-columns: 1fr; gap: 6px; }
.weather-card {
  background: #fff; border: 1px solid var(--border); border-radius: 10px;
  padding: 6px 10px; position: relative;
  display: flex; flex-direction: column;
}
/* 卡片级弱底色 */
.weather-card.severe-rain { background: #f3f8fc; border-color: #d6e4f0; }
.weather-card.severe-hot  { background: #fff7ee; border-color: #f0d8b6; }
/* 城市名 + 预警标签 同行，垂直居中 */
.weather-card .w-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-height: 22px; }
.weather-card .city { font-size: .85rem; font-weight: 600; line-height: 1.2; }
/* 预警标签 调大：高对比、易识别（强降水/高温） */
.weather-card .severe-tag { font-size: .76rem; padding: 2px 8px; border-radius: 5px; font-weight: 700; line-height: 1.3; }
.weather-card .severe-tag.rain { background: #b3261e; color: #fff; }
.weather-card .severe-tag.hot  { background: #d95c1e; color: #fff; }
/* 发布时间 调大：从 0.62rem → 0.78rem（与时间机器/jobs 的发布感统一） */
.weather-upd { font-size: .78rem; color: #6b7785; white-space: nowrap; font-weight: 500; }
.job-upd { font-size: .72rem; color: var(--text-2); white-space: nowrap; }
.job-upd-tag { font-size: .68rem; padding: 1px 6px; border-radius: 999px; margin-left: 4px; vertical-align: 1px; }
.job-upd-tag.empty { background: #f0f4f8; color: var(--text-2); }
.job-upd-tag.ok    { background: #e6f4ea; color: #1e7a3a; }
.job-upd-tag.err   { background: #fde7e9; color: #b3261e; }
/* 模块标题：日期 用常规字号、发布时间 用小灰字 */
.weather-title-date { font-size: .82rem; color: var(--text); font-weight: 500; margin-right: 4px; }
/* ========== 单行布局：今日 + 竖线 + 明日 横向并排 ========== */
.weather-card .day-row { display: flex; align-items: stretch; gap: 0; }
.weather-card .day-block { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0; padding: 2px 0; }
.weather-card .day-block.tomo { flex: 1; }
.weather-card .day-vline { width: 1px; align-self: stretch; background: var(--border); margin: 2px 8px; flex-shrink: 0; }
/* 温度/天气/风级 一组（弹性占满） */
.weather-card .now-temp-cond,
.weather-card .tomo-cond { display: flex; flex-direction: column; line-height: 1.15; flex: 1; min-width: 0; }
/* now-row / tomo-row 在 day-block 内扁平化（display: contents） */
.weather-card .now-row,
.weather-card .tomo-row { display: contents; }
/* 今日：图标 26px，温度 1rem 700，天气 0.78rem 默认深色 */
.weather-card .w-icon { width: 26px; height: 26px; flex-shrink: 0; color: var(--text); }
.weather-card .w-icon.small { width: 20px; height: 20px; }  /* 明日 -23%，接近 -20% */
.weather-card .w-icon svg { width: 100%; height: 100%; }
.weather-card .now-temp { font-size: 1rem; font-weight: 700; white-space: nowrap; }
.weather-card .now-temp.hot { color: var(--warn); }
.weather-card .now-cond-line { display: flex; gap: 4px; align-items: baseline; flex-wrap: wrap; }
.weather-card .cond { font-size: .78rem; font-weight: 400; color: var(--text); }
.weather-card .wind { font-size: .66rem; color: var(--text-2); }
/* 明日：温度 0.84rem 600（-1 号），天气 0.7rem 浅灰，风级 0.6rem 浅灰 */
.weather-card .tomo-temp { font-size: .84rem; font-weight: 600; white-space: nowrap; flex-shrink: 0; }
.weather-card .tomo-temp.hot { color: var(--warn); }
.weather-card .tomo-cond .cond { font-size: .7rem; color: var(--text-2); }
.weather-card .tomo-cond .wind { font-size: .6rem; color: var(--text-2); }
/* 高影响文字色 + 加粗 */
.weather-card .hot { color: var(--warn); font-weight: 700; }
.weather-card .rain { color: var(--primary); font-weight: 600; }
.weather-empty { color: var(--text-2); font-size: .85rem; padding: 18px 0; text-align: center; }

/* ---------- 今日诗词 ---------- */
.m-poem { display: flex; flex-direction: column; }
.poem-loading { color: var(--text-2); font-size: .85rem; padding: 18px 0; text-align: center; }
.poem-content { font-size: .98rem; line-height: 1.65; color: var(--text); font-weight: 500; letter-spacing: .02em; margin-bottom: 8px; }
.poem-line { display: block; }   /* 每句独占一行，按句读标点断句 */
.poem-meta { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; font-size: .74rem; color: var(--text-2); }
.poem-title { font-weight: 600; color: var(--text); }
.poem-author { color: var(--text-2); }
.poem-tags { display: flex; gap: 4px; margin-top: 6px; flex-wrap: wrap; }
.poem-tag { font-size: .64rem; padding: 1px 6px; border-radius: 999px; background: var(--bg); color: var(--text-2); }
.poem-tip { margin-top: 6px; font-size: .62rem; color: #b0b8c0; font-style: italic; }

/* ---------- RSS 订阅（miniflux） ---------- */
.rss-loading { color: var(--text-2); font-size: .85rem; padding: 18px 0; text-align: center; }
.rss-empty { color: var(--text-2); font-size: .85rem; padding: 18px 0; text-align: center; line-height: 1.6; }
.rss-empty small { font-size: .72rem; color: #b0b8c0; }
.rss-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.rss-item { display: flex; flex-direction: column; gap: 2px; padding-bottom: 8px; border-bottom: 1px dashed var(--border); }
.rss-item:last-child { border-bottom: none; padding-bottom: 0; }
.rss-title { color: var(--text); font-size: .84rem; line-height: 1.4; text-decoration: none; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-weight: 500; }
.rss-title:hover { color: var(--primary); }
.rss-meta { display: flex; align-items: center; gap: 6px; font-size: .68rem; color: var(--text-2); }
.rss-feed { color: var(--primary); font-weight: 500; }
.rss-time { color: #b0b8c0; }
.rss-more { margin-top: 8px; padding-top: 6px; border-top: 1px solid var(--border); text-align: center; }
.rss-more a { font-size: .74rem; color: var(--primary); text-decoration: none; }
.rss-more a:hover { text-decoration: underline; }

/* ---------- 每日复盘 ---------- */
.rv { display: flex; flex-direction: column; gap: 8px; }
.rv-nav { display: flex; align-items: center; gap: 6px; font-size: .72rem; font-weight: 600; }
.rv-arrow {
  width: 22px; height: 22px; border: 1px solid var(--border); border-radius: 7px;
  background: var(--bg); color: var(--text); cursor: pointer; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center; font-size: .62rem;
}
.rv-arrow:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.rv-arrow:disabled { opacity: .3; cursor: default; }
.rv-date { text-align: center; white-space: nowrap; }
.rv-date small { color: var(--warn); font-weight: 500; }
.rv-save { font-size: .62rem; color: var(--text-2); font-weight: 400; margin-left: 2px; white-space: nowrap; }
.rv-save.err { color: var(--warn); }
.rv-body { max-height: 400px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding-right: 3px; }
.rv-group { display: flex; flex-direction: column; gap: 6px; }
.rv-label { font-size: .8rem; font-weight: 700; }
.rv-label-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.rv-field { display: flex; flex-direction: column; gap: 3px; }
.rv-sub-label { font-size: .72rem; color: var(--text-2); padding-left: 2px; }
.rv-ta {
  width: 100%; border: 1px solid var(--border); border-radius: 8px; background: var(--bg);
  padding: 6px 9px; font-size: .8rem; line-height: 1.55; resize: none; outline: none;
  font-family: inherit; overflow: hidden; min-height: 32px; color: var(--text);
}
.rv-ta:focus { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 2px rgba(78,118,200,.1); }
.rv-ta::placeholder { color: #b0b8c0; }

/* ---------- Memos 回顾 ---------- */
.memo-box { display: flex; flex-direction: column; gap: 9px; min-height: 160px; }
.memo-loading { color: var(--text-2); font-size: .84rem; padding: 28px 0; text-align: center; }
.memo-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: .72rem; color: var(--text-2); }
.memo-time { white-space: nowrap; font-variant-numeric: tabular-nums; }
.memo-tags { display: flex; gap: 5px; flex-wrap: wrap; }
.memo-tag { color: var(--primary); background: rgba(78,118,200,.1); border-radius: 6px; padding: 1px 7px; font-size: .68rem; }
.memo-content {
  font-size: .86rem; line-height: 1.7; color: var(--text);
  max-height: 260px; overflow-y: auto; word-break: break-word;
}
.memo-content p { margin: 0 0 6px; }
.memo-content p:last-child { margin-bottom: 0; }
.memo-content ul, .memo-content ol { margin: 0 0 6px; padding-left: 1.3em; }
.memo-content li { margin: 2px 0; }
.memo-content .md-h { font-weight: 700; margin: 4px 0; }
.memo-content blockquote { border-left: 3px solid var(--border); padding-left: 9px; color: var(--text-2); margin: 4px 0; }
.memo-content code { background: var(--bg); border-radius: 4px; padding: 1px 5px; font-size: .78rem; }
.memo-content pre { background: var(--bg); border-radius: 8px; padding: 8px 10px; overflow-x: auto; margin: 4px 0; }
.memo-content pre code { background: none; padding: 0; }
.memo-content a { color: var(--primary); }
.memo-content .md-tag { color: var(--primary); }
.memo-imgs { display: flex; flex-wrap: wrap; gap: 6px; }
.memo-img {
  max-height: 130px; max-width: 100%; border-radius: 8px; cursor: zoom-in;
  border: 1px solid var(--border); object-fit: cover;
}
.memo-actions { display: flex; gap: 8px; align-items: center; margin-top: auto; padding-top: 4px; flex-wrap: wrap; }
/* 就地改错 */
.memo-edit-ta {
  width: 100%; min-height: 150px; resize: vertical; box-sizing: border-box;
  border: 1px solid var(--border); border-radius: 10px; padding: 9px 11px;
  font-family: inherit; font-size: .82rem; line-height: 1.6; background: var(--bg); color: var(--text);
}
.memo-edit-ta:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px rgba(214,90,92,.12); }
.memo-edit-ta.invalid { border-color: var(--danger, #d33); animation: qnShake .3s; }
.memo-edit-ops { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.memo-edit-st { font-size: .7rem; color: var(--text-2); }
.memo-lightbox {
  position: fixed; inset: 0; z-index: 2000; background: rgba(0,0,0,.82);
  display: flex; align-items: center; justify-content: center; padding: 24px; cursor: zoom-out;
}
.memo-lightbox img { max-width: 94vw; max-height: 92vh; border-radius: 10px; box-shadow: 0 10px 40px rgba(0,0,0,.5); }

/* ---------- 标签页 ---------- */
.tabs { display: inline-flex; background: var(--bg); border-radius: 10px; padding: 3px; }
.tabs button { padding: 5px 14px; border-radius: 8px; font-size: .84rem; color: var(--text-2); }
.tabs button.active { background: #fff; color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,.06); }
/* 标题栏内嵌 tabs（招聘卡片用）：更紧凑 */
.tabs.job-tabs-inline { padding: 2px; border-radius: 8px; }
.tabs.job-tabs-inline button { padding: 3px 10px; border-radius: 6px; font-size: .76rem; }

/* ---------- 招聘 ---------- */
/* 招聘卡内层顶栏：抓取时间 + 待办/已办 + 加号 */
.job-subbar { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.job-subbar .job-upd { margin-right: auto; }
.job-meta-tag {
  font-size: .72rem; background: var(--bg); color: var(--text-2);
  padding: 2px 9px; border-radius: 999px; white-space: nowrap;
}
.job-tabs-row { margin-bottom: 8px; }
.job-list { display: flex; flex-direction: column; gap: 6px; max-height: 300px; overflow-y: auto; }
.job-item {
  background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 9px 12px;
}
.job-item .row1 { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.job-item .title { font-weight: 600; font-size: .92rem; flex: 1; }
.job-item .row2 { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 6px; font-size: .78rem; color: var(--text-2); }
.job-item .nature { background: var(--bg); border-radius: 6px; padding: 2px 8px; }
.job-item .deadline.urgent { color: var(--warn); font-weight: 600; }
.job-item .ops { display: flex; gap: 6px; flex-shrink: 0; }
.job-item .main-ops .btn { min-width: 58px; }
.job-item .handler { color: var(--success); }
.job-item .row2 { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 6px; font-size: .78rem; color: var(--text-2); }
.job-item .job-icons { margin-left: auto; display: inline-flex; gap: 5px; }
.icon-action {
  width: 24px; height: 24px; border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .85rem; color: var(--text-2); background: var(--bg);
  transition: background .15s, transform .15s;
}
.icon-action:hover { background: var(--border); transform: translateY(-1px); }
.empty-tip { color: var(--text-2); font-size: .86rem; text-align: center; padding: 18px 0; }

/* ---------- 清单 ---------- */
.check-list { display: flex; flex-direction: column; gap: 5px; max-height: 210px; overflow-y: auto; margin: 8px 0; }
.check-item {
  display: flex; align-items: center; gap: 8px; background: #fff;
  border: 1px solid var(--border); border-radius: 10px; padding: 7px 10px;
}
.check-item .box {
  width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--primary);
  flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: .75rem; transition: background .15s;
}
.check-item.done .box { background: var(--success); border-color: var(--success); }
.check-item.done .txt { text-decoration: line-through; color: var(--text-2); }
.check-item .txt { flex: 1; font-size: .9rem; }
.list-add { display: flex; gap: 8px; }
.list-add input {
  flex: 1; padding: 9px 12px; border: 1px solid var(--border); border-radius: 10px; outline: none;
}
.list-add input:focus { border-color: var(--primary); }
.list-note { font-size: .74rem; color: var(--text-2); margin-top: 8px; }

/* ---------- 时光机 ---------- */
.tm-photo {
  display: block; max-width: 100%; max-height: 480px; margin: 0 auto;
  object-fit: contain; border-radius: 12px; background: var(--bg);
}
.tm-empty {
  border: 2px dashed var(--border); border-radius: 14px; padding: 26px 10px;
  text-align: center; color: var(--text-2); font-size: .85rem;
}

/* ---------- 快捷入口 ---------- */
.links-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px; }
.link-btn { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.link-btn .ico {
  width: 44px; height: 44px; border-radius: 13px; color: #fff; font-weight: 700;
  display: flex; align-items: center; justify-content: center; font-size: .95rem;
  box-shadow: var(--shadow); transition: transform .15s;
}
.link-btn:hover .ico { transform: translateY(-3px); }
.link-btn .nm { font-size: .78rem; color: var(--text); }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(61,61,61,.35); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 16px;
  animation: fadeIn .2s ease;
}
.modal {
  background: var(--card); border-radius: 20px; padding: 24px; width: 100%;
  max-width: 480px; max-height: 86vh; overflow-y: auto; box-shadow: var(--shadow-hover);
}
.modal.wide { max-width: 640px; }
.modal h3 { font-size: 1.05rem; margin-bottom: 16px; }
.form-row { margin-bottom: 12px; }
.form-row label { display: block; font-size: .82rem; color: var(--text-2); margin-bottom: 5px; }
.form-row input, .form-row select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px;
  background: #fff; outline: none;
}
.form-row input:focus, .form-row select:focus { border-color: var(--primary); }
.form-inline { display: flex; gap: 10px; }
.form-inline .form-row { flex: 1; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

/* ---------- 设置中心 ---------- */
.settings-section { margin-bottom: 26px; }
.settings-section > h4 {
  font-size: .95rem; margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--border);
}
.settings-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.settings-head h4 { margin: 0; padding: 0; border: 0; }
.photo-preview { margin-top: 12px; text-align: center; }
.photo-preview-tip { font-size: .72rem; color: var(--text-2); margin-top: 6px; }
.manage-row {
  display: flex; align-items: center; gap: 8px; background: #fff;
  border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; margin-bottom: 6px;
  font-size: .88rem;
}
.manage-row .grow { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.manage-row .sub { color: var(--text-2); font-size: .78rem; }
.order-btns { display: flex; flex-direction: row; gap: 6px; flex-shrink: 0; }
.order-btns button {
  font-size: .7rem; color: var(--text-2); line-height: 1;
  padding: 5px 9px; border: 1px solid var(--border); border-radius: 7px;
  background: #fff; cursor: pointer; transition: all .12s;
}
.order-btns button:hover:not(:disabled) { color: var(--primary); border-color: var(--primary); }
.order-btns button:disabled { opacity: .3; cursor: default; }

/* 可拖拽排序行（模块排序设置页） */
.drag-row { cursor: grab; user-select: none; transition: box-shadow .12s, opacity .12s, border-color .12s; }
.drag-row:active { cursor: grabbing; }
.drag-handle { color: #b0b8c0; font-size: 1rem; line-height: 1; padding: 0 2px; cursor: grab; flex-shrink: 0; }
.drag-row:hover .drag-handle { color: var(--primary); }
.drag-row.dragging { opacity: .4; }
.drag-row.drag-over { border-color: var(--primary); box-shadow: 0 -2px 0 0 var(--primary); }

/* 设置中心：清单条目管理 */
.list-manage { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; }
.list-manage-header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.list-manage-items { display: flex; flex-direction: column; gap: 4px; margin-bottom: 6px; }
.list-manage-item { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; background: var(--bg); }
.list-manage-item .box.small { width: 18px; height: 18px; border-radius: 5px; font-size: .7rem; flex-shrink: 0; }
.list-manage-item .txt { flex: 1; font-size: .84rem; }
.list-manage-item .txt.done { text-decoration: line-through; color: var(--text-2); }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 8px; margin-top: 10px; }
.photo-cell { position: relative; }
.photo-cell img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; }
.photo-cell .del {
  position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%;
  background: rgba(61,61,61,.55); color: #fff; font-size: .7rem;
  display: flex; align-items: center; justify-content: center;
}

/* ---------- 照片上传队列 ---------- */
#ph-queue:empty { display: none; }
/* 照片管理分页栏 */
.pq-pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 12px; }
.pg-info { font-size: .78rem; color: var(--text-2); white-space: nowrap; }
#ph-queue {
  margin-top: 10px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--bg); padding: 10px 12px;
}
.pq-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: .82rem; font-weight: 600; }
.pq-actions { display: flex; gap: 6px; font-weight: 400; }
.pq-bar { height: 6px; background: #e3e7ec; border-radius: 999px; margin: 8px 0; overflow: hidden; }
.pq-bar-fill { height: 100%; background: var(--primary); border-radius: 999px; transition: width .25s ease; }
.pq-list { max-height: 220px; overflow-y: auto; display: flex; flex-direction: column; gap: 3px; }
.pq-row { display: flex; align-items: center; gap: 7px; font-size: .78rem; padding: 3px 4px; border-radius: 6px; }
.pq-row.run { background: #fff; }
.pq-ico { flex-shrink: 0; width: 18px; text-align: center; }
.pq-name {
  flex: 1; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pq-msg { color: var(--text-2); font-size: .72rem; flex-shrink: 0; max-width: 46%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pq-row.ok .pq-ico, .pq-row.ok .pq-msg { color: var(--success); }
.pq-row.err { background: #fdeeee; }
.pq-row.err .pq-ico, .pq-row.err .pq-msg { color: var(--warn); font-weight: 600; }
.pq-row.err .pq-msg { white-space: normal; max-width: 46%; }

/* ---------- Toast 错误/提示 ---------- */
#toast-wrap {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 999;
  display: flex; flex-direction: column; gap: 8px; width: min(92vw, 420px);
}
.toast {
  background: #fff; border-radius: 12px; padding: 12px 16px; font-size: .86rem;
  box-shadow: var(--shadow-hover); animation: slideDown .25s ease;
  border-left: 4px solid var(--primary); word-break: break-all;
}
.toast.error { border-left-color: var(--warn); }
.toast.success { border-left-color: var(--success); }
.toast .code { color: var(--text-2); font-size: .74rem; margin-top: 2px; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }

/* ---------- 移动端适配（含微信内置浏览器） ---------- */
@media (max-width: 900px) {
  .m-love, .m-year { grid-column: span 6; }   /* 两张矮卡并排，省一整行 */
  .m-poem, .m-timemachine, .m-calendar, .m-weather, .m-jobs, .m-rss, .m-lists, .m-links {
    grid-column: span 12;
  }
  #app-view { padding: 14px 12px 24px; }
  .bento { gap: 10px; }
  .card { padding: 14px; }
  .job-list, .check-list { max-height: 260px; }
  .links-grid { grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 6px; }
}
@media (max-width: 480px) {
  html { font-size: 13.5px; }
  #app-view { padding: 10px 10px 60px; }
  .bento { gap: 8px; }
  .card { padding: 12px 13px; border-radius: 16px; }
  .card h2 { font-size: .95rem; margin-bottom: 8px; }
  .topbar { margin-bottom: 10px; }
  .topbar .brand { font-size: 1.1rem; }
  .topbar .clock { font-size: .8rem; }
  .identity-switch button { padding: 5px 12px; font-size: .8rem; }
  .icon-btn { width: 34px; height: 34px; border-radius: 10px; font-size: .95rem; }

  .love-days { font-size: 1.7rem; }
  .love-days small { font-size: .85rem; }
  .love-detail { font-size: .78rem; }
  .year-ring { width: 88px; height: 88px; }
  .year-ring .pct { font-size: .95rem; }

  .cal-cell { min-height: 34px; padding: 2px 1px; border-radius: 6px; }
  .cal-cell .d { font-size: .86rem; }
  .cal-cell .l { font-size: .6rem; }
  
  .cal-cell .badge { font-size: .5rem; padding: 0 3px; top: 1px; right: 1px; }
  .cal-cell .ann-dot { width: 6px; height: 6px; bottom: 2px; animation: none; }
  .cal-head { padding: 1px 0; font-size: .72rem; }

  /* 天气卡在窄屏两列会挤压"今天|明天"内容导致溢出，单列堆叠 */
  .weather-grid { grid-template-columns: 1fr; gap: 6px; }
  .weather-card { padding: 5px 8px; border-radius: 9px; }
  .weather-card .w-icon { width: 22px; height: 22px; }
  .weather-card .w-icon.small { width: 17px; height: 17px; }
  .weather-card .now-temp { font-size: .94rem; }
  .weather-card .tomo-temp { font-size: .78rem; }
  .weather-card .cond { font-size: .72rem; }
  .weather-card .tomo-cond .cond { font-size: .66rem; }
  .weather-card .wind { font-size: .6rem; }

  .job-item { padding: 8px 10px; }
  .job-item .title { font-size: .88rem; }
  .job-item .row2 { font-size: .74rem; gap: 6px; margin-top: 5px; }
  .job-item .main-ops .btn { min-width: 48px; padding: 4px 9px; font-size: .76rem; }
  .icon-action { width: 22px; height: 22px; font-size: .75rem; }
  /* 招聘卡子栏：待处理/已办 + 加号同一行，抓取时间挪到第二行右侧 */
  .job-subbar .tabs { order: 1; }
  .job-subbar .icon-add { order: 2; margin-left: auto; }
  .job-subbar .job-upd { order: 3; flex-basis: 100%; font-size: .68rem; text-align: right; margin-right: 0; }

  .check-item { padding: 6px 9px; }
  .check-item .txt { font-size: .85rem; }
  .list-add input { padding: 8px 10px; }

  .links-grid { grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); gap: 6px; }
  .link-btn .ico { width: 40px; height: 40px; border-radius: 12px; font-size: .85rem; }
  .link-btn .nm { font-size: .72rem; }

  .modal { padding: 18px; border-radius: 16px; }
  .modal.wide { max-width: 100%; }
  .form-inline { flex-direction: column; gap: 8px; }
  .manage-row { padding: 7px 10px; font-size: .84rem; }
  .photo-grid { grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); }

  #toast-wrap { width: min(94vw, 380px); top: 10px; }
}
