/* ============ 轻记账 · 样式（粉色系） ============ */
:root {
  --bg: #fdf3f7;
  --card: #ffffff;
  --border: #f6dde8;
  --text-1: #3d2833;
  --text-2: #8c6c7d;
  --text-3: #bda6b3;
  --primary: #ec6a9c;
  --primary-dark: #dd5389;
  --primary-soft: #fde8f0;
  --income: #1fa96e;
  --expense: #e05275;
  --radius: 14px;
  --shadow: 0 2px 12px rgba(220, 120, 160, .10);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text-1);
  font-size: 14px;
  line-height: 1.5;
}
button { font-family: inherit; cursor: pointer; }
input, select { font-family: inherit; }

.c-income { color: var(--income); }
.c-expense { color: var(--expense); }

/* ---------- 左右两栏布局 ---------- */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: 232px;
  flex-shrink: 0;
  background: var(--card);
  border-right: 1px solid var(--border);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; }
.brand-icon { font-size: 30px; }
.brand-name { font-size: 17px; font-weight: 700; }
.brand-sub { font-size: 12px; color: var(--text-3); }

.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-group {
  font-size: 11px; color: var(--text-3); font-weight: 600;
  padding: 10px 12px 2px; letter-spacing: 1px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--text-2);
  text-decoration: none;
  font-size: 14px;
  transition: background .15s, color .15s;
}
.nav-item:hover { background: var(--primary-soft); }
.nav-item.active { background: linear-gradient(120deg, #f083ae, var(--primary)); color: #fff; font-weight: 600; }
.nav-icon { font-size: 17px; }

.side-summary {
  background: var(--primary-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
}
.side-sum-title { font-size: 12px; color: var(--text-3); margin-bottom: 8px; }
.side-sum-row { display: flex; justify-content: space-between; font-size: 13px; padding: 3px 0; color: var(--text-2); }
.side-sum-bal { border-top: 1px dashed var(--border); margin-top: 6px; padding-top: 8px; }

.side-foot { margin-top: auto; text-align: center; font-size: 11px; color: var(--text-3); }
.sidebar-mask { display: none; }

/* ---------- 主区 ---------- */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  padding: 14px 24px;
  background: rgba(253, 243, 247, .92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
}
.topbar-title { font-size: 18px; flex: 1; }
.menu-toggle { display: none; background: none; border: none; font-size: 20px; }

.page { padding: 20px 24px 48px; max-width: 1080px; width: 100%; margin: 0 auto; }

/* ---------- 通用组件 ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px;
  margin-bottom: 16px;
}
.card-title { font-size: 14px; font-weight: 600; margin-bottom: 12px; }

.btn {
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text-1);
  border-radius: 10px;
  padding: 8px 16px;
  font-size: 13px;
  transition: filter .15s, background .15s;
}
.btn:hover { background: var(--primary-soft); }
.btn-primary { background: linear-gradient(120deg, #f083ae, var(--primary)); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-danger { color: var(--expense); border-color: #f4c4d2; }
.btn-danger:hover { background: #fdeef3; }
.mini-btn {
  border: none; background: none; font-size: 14px;
  padding: 4px 6px; border-radius: 8px; color: var(--text-2);
}
.mini-btn:hover { background: var(--primary-soft); }

.input {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 13px;
  background: var(--card);
  color: var(--text-1);
  outline: none;
}
.input:focus { border-color: var(--primary); }
.input-lg { font-size: 20px; font-weight: 600; padding: 10px 14px; width: 100%; }

.empty { text-align: center; color: var(--text-3); padding: 48px 0; font-size: 14px; }
.empty span { font-size: 12px; }

/* ---------- 记账板块内部页签 ---------- */
.sub-tabs {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-bottom: 16px;
}
.sub-tab {
  padding: 7px 16px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--border);
  color: var(--text-2); text-decoration: none; font-size: 13px;
  transition: background .15s, color .15s;
}
.sub-tab:hover { background: var(--primary-soft); }
.sub-tab.active { background: linear-gradient(120deg, #f083ae, var(--primary)); border-color: var(--primary); color: #fff; font-weight: 600; }

/* ---------- 筛选栏 / 板块 chips ---------- */
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.flt-kw { flex: 1; min-width: 140px; }
.chip-group { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  border: 1px solid var(--border); background: var(--card);
  border-radius: 999px; padding: 6px 13px; font-size: 13px; color: var(--text-2);
  transition: background .15s, color .15s;
}
.chip:hover { background: var(--primary-soft); }
.chip.active { background: linear-gradient(120deg, #f083ae, var(--primary)); border-color: var(--primary); color: #fff; font-weight: 600; }

/* ---------- 统计卡片 ---------- */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px;
}
.stat-label { font-size: 12px; color: var(--text-3); margin-bottom: 4px; }
.stat-num { font-size: 20px; font-weight: 700; }

/* ---------- 记录列表 ---------- */
.record-list { padding: 6px 18px; }
.day-group { padding: 8px 0; }
.day-group + .day-group { border-top: 1px solid var(--border); }
.day-head {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--text-3);
  padding: 6px 0;
}
.day-date { flex-shrink: 0; }
.day-chips { flex: 1; display: flex; flex-wrap: wrap; gap: 4px; }
.day-chip { border-radius: 999px; padding: 1px 8px; font-size: 11px; font-weight: 600; }
.day-sum { flex-shrink: 0; font-weight: 600; color: var(--text-2); }
.record-row {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 0;
}
.rec-icon {
  width: 38px; height: 38px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 12px; font-size: 18px;
}
.rec-main { flex: 1; min-width: 0; }
.rec-cat { font-size: 14px; font-weight: 500; }
.rec-note { font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rec-amount { font-size: 15px; font-weight: 700; }
.rec-ops { display: flex; opacity: 0; transition: opacity .15s; }
.record-row:hover .rec-ops { opacity: 1; }

/* ---------- 今日速览 ---------- */
.today-card {
  display: flex; align-items: center; gap: 24px;
  background: linear-gradient(120deg, #f78bb3, #ec6a9c 55%, #e35d92);
  color: #fff;
  border-radius: var(--radius);
  box-shadow: 0 6px 18px rgba(236, 106, 156, .3);
  padding: 20px 24px;
  margin-bottom: 16px;
}
.today-main { flex-shrink: 0; }
.today-label { font-size: 12px; opacity: .85; margin-bottom: 4px; }
.today-num { font-size: 30px; font-weight: 800; letter-spacing: .5px; }
.today-income { font-size: 12px; margin-top: 4px; opacity: .9; }
.today-secs { flex: 1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.today-sec {
  background: rgba(255, 255, 255, .16);
  border-radius: 12px;
  padding: 10px 12px;
  text-align: center;
  backdrop-filter: blur(2px);
}
.today-sec-icon { font-size: 20px; }
.today-sec-label { font-size: 12px; opacity: .85; margin: 2px 0; }
.today-sec-num { font-size: 15px; font-weight: 700; }

/* ---------- 每月消费汇报 ---------- */
.report-title { font-size: 15px; font-weight: 700; color: var(--primary); }
.report-summary { font-size: 14px; color: var(--text-2); line-height: 1.8; }
.report-summary b { color: var(--text-1); }

.sec-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }
.sec-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-top: 3px solid var(--sec);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px;
}
.sec-head { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.sec-icon { font-size: 17px; }
.sec-name { font-size: 13px; font-weight: 600; flex: 1; }
.sec-count { font-size: 11px; color: var(--text-3); }
.sec-num { font-size: 21px; font-weight: 800; margin-bottom: 8px; }
.sec-foot { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-3); margin-top: 8px; }
.sec-foot em { font-style: normal; color: var(--text-3); }

.stats-grid { display: grid; grid-template-columns: 1fr 1.3fr; gap: 16px; }
.cv-donut { width: 100%; height: 220px; display: block; }
.cv-trend { width: 100%; height: 220px; display: block; }
.donut-legend { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 10px; justify-content: center; }
.legend-item { font-size: 12px; color: var(--text-2); display: inline-flex; align-items: center; gap: 5px; }
.legend-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; }

.rank-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; }
.rank-main { flex: 1; min-width: 0; }
.rank-head { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 5px; }
.rank-bar { height: 6px; background: #f9e7ef; border-radius: 3px; overflow: hidden; }
.rank-bar i { display: block; height: 100%; border-radius: 3px; }
.rank-pct { font-size: 12px; color: var(--text-3); width: 46px; text-align: right; }

/* ---------- 收支切换 ---------- */
.type-switch {
  display: flex; gap: 6px;
  background: #f9e7ef; border-radius: 12px; padding: 4px;
  margin-bottom: 16px;
}
.type-switch.small { margin-bottom: 0; }
.type-btn {
  flex: 1; border: none; background: none;
  padding: 8px 18px; border-radius: 9px;
  font-size: 14px; color: var(--text-2);
}
.type-switch.small .type-btn { padding: 6px 16px; font-size: 13px; }
.type-btn.active { background: #fff; font-weight: 600; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.type-btn.active.expense { color: var(--expense); }
.type-btn.active.income { color: var(--income); }

/* ---------- 表单 / 分类选择 ---------- */
.form-row { margin-bottom: 14px; }
.form-row label { display: block; font-size: 12px; color: var(--text-2); margin-bottom: 6px; }
.form-row .input { width: 100%; }
.cat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.cat-grid.cols-5 { grid-template-columns: repeat(5, 1fr); }
.cat-item {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  border: 1px solid var(--border); background: var(--card);
  border-radius: 10px; padding: 8px 2px; font-size: 12px; color: var(--text-2);
}
.cat-item:hover { border-color: var(--primary); }
.cat-item.active { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.cat-icon { font-size: 18px; }

/* ---------- 家常菜板块 ---------- */
.cook-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  background: linear-gradient(120deg, #f78bb3, #ec6a9c 55%, #e35d92);
  color: #fff; border-radius: var(--radius);
  box-shadow: 0 6px 18px rgba(236, 106, 156, .3);
  padding: 18px 22px; margin-bottom: 16px;
}
.cook-banner-title { font-size: 19px; font-weight: 800; }
.cook-banner-sub { font-size: 12px; opacity: .88; margin-top: 4px; }
.cook-shuffle { border: none; background: rgba(255, 255, 255, .22); color: #fff; flex-shrink: 0; }
.cook-shuffle:hover { background: rgba(255, 255, 255, .34); }

/* 菜谱模式切换：家常 / 减脂餐 / 特殊人群 */
.mode-chips { margin-bottom: 14px; }
.mode-chips .chip { font-size: 13.5px; padding: 7px 15px; }

/* 特殊人群饮食要点 */
.mode-tips { border-left: 4px solid var(--sec, var(--primary)); margin-bottom: 16px; }
.tips-list { margin: 4px 0 0; padding-left: 20px; font-size: 13px; color: var(--text-2); line-height: 1.9; }
.tips-list li::marker { color: var(--sec, var(--primary)); }

.dish-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px; margin-bottom: 16px;
}
.dish-card {
  position: relative;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 14px 16px;
  display: flex; flex-direction: column; gap: 8px;
}
.dish-badge {
  position: absolute; top: -8px; right: 10px;
  font-size: 11px; background: var(--primary-soft); color: var(--primary);
  border: 1px solid var(--border); border-radius: 999px; padding: 2px 9px; font-weight: 600;
}
.dish-top { display: flex; align-items: center; gap: 10px; }
.dish-emoji { font-size: 30px; }
.dish-name { font-size: 15px; font-weight: 700; }
.dish-meta { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--text-3); margin-top: 2px; }
.dish-tag { border-radius: 999px; padding: 1px 8px; font-weight: 600; }
.dish-ings {
  font-size: 12px; color: var(--text-2);
  background: var(--bg); border-radius: 8px; padding: 6px 10px;
}
.dish-btn { width: 100%; font-size: 12px; padding: 6px 0; }

.recipe-meta { display: flex; flex-wrap: wrap; gap: 8px; font-size: 12px; color: var(--text-2); margin-bottom: 12px; align-items: center; }
.recipe-sec-title { font-size: 13px; font-weight: 700; color: var(--text-1); margin: 12px 0 8px; }
.recipe-mats { display: flex; flex-wrap: wrap; gap: 6px; }
.mat-chip {
  font-size: 12px; color: var(--text-2); background: var(--primary-soft);
  border-radius: 999px; padding: 4px 10px;
}
.recipe-steps { padding-left: 20px; display: flex; flex-direction: column; gap: 8px; color: var(--text-1); font-size: 13px; padding-bottom: 6px; line-height: 1.7; }
.recipe-steps li::marker { color: var(--primary); font-weight: 700; }
.recipe-tip {
  margin-top: 10px; padding: 10px 12px; border-radius: 10px;
  background: #fdf6e8; color: #8a6a35; font-size: 12.5px; line-height: 1.7;
}
.flavor-chips .chip { font-size: 13px; padding: 6px 14px; }
.flavor-overlay {
  margin-top: 8px; padding: 12px 14px; border-radius: 12px;
  background: var(--primary-soft); border: 1px solid var(--primary-soft);
}
.flavor-intro { font-size: 13px; font-weight: 700; color: var(--text-1); margin-bottom: 6px; }
.flavor-guide { font-size: 12.5px; color: var(--text-2); line-height: 1.7; }

.pair-card { padding-bottom: 20px; }
.pair-bar { display: flex; gap: 10px; margin-bottom: 10px; }
.pair-tips { font-size: 12px; color: var(--text-3); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.pair-tips .chip { padding: 3px 10px; font-size: 12px; }
.pair-summary { font-size: 13px; color: var(--text-2); margin: 10px 0 12px; }
.pair-summary b { color: var(--primary); }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(70, 30, 50, .4);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal {
  background: var(--card);
  border-radius: 16px;
  width: 100%; max-width: 440px;
  max-height: 86vh; overflow: auto;
  animation: pop .18s ease;
}
@keyframes pop { from { transform: scale(.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
  font-weight: 600; font-size: 15px;
}
.modal-body { padding: 16px 18px; }
.modal-foot {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 12px 18px; border-top: 1px solid var(--border);
}

/* ---------- Toast ---------- */
#toastRoot { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 200; }
.toast {
  background: rgba(60, 30, 45, .9); color: #fff;
  padding: 9px 20px; border-radius: 999px; font-size: 13px;
  animation: pop .18s ease;
}

/* ---------- 导出页 ---------- */
.export-card .filter-bar { margin-bottom: 10px; }
.export-hint { font-size: 13px; color: var(--text-2); margin-bottom: 12px; }
.export-btns { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- 网购对比 ---------- */
.shop-toolbar { display: flex; gap: 10px; margin-bottom: 10px; }
.shop-toolbar .input:first-child { flex: 1; }
.shop-toolbar select.input { width: 170px; flex-shrink: 0; }
.shop-count { font-size: 12px; color: var(--text-3); margin: 12px 2px 10px; }
.shop-count b { color: var(--primary); }
.shop-hint { color: var(--text-3); }
.table-wrap { overflow-x: auto; }
.shop-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 780px; }
.shop-table th {
  text-align: left; font-weight: 600; color: var(--text-2);
  padding: 8px 10px; border-bottom: 2px solid var(--border);
  white-space: nowrap; font-size: 12.5px;
}
.shop-table td { padding: 11px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.shop-table tbody tr:hover { background: var(--primary-soft); }
.cell-name b { font-size: 13.5px; }
.cell-name { min-width: 150px; }
.cell-note { font-size: 12px; color: var(--text-3); margin-top: 3px; }
.cell-shop { font-size: 12px; color: var(--text-3); margin-top: 4px; }
.plat-badge { display: inline-block; color: #fff; font-size: 11.5px; border-radius: 6px; padding: 2px 8px; }
.low-badge {
  display: inline-block; margin-left: 6px; vertical-align: 1px;
  font-size: 11px; color: #fff; font-weight: 600;
  background: linear-gradient(120deg, #f5a623, #f07b3f);
  border-radius: 999px; padding: 2px 8px;
}
.final-price { color: var(--primary); font-size: 15px; }
.orig-price { font-size: 11.5px; color: var(--text-3); text-decoration: line-through; margin-top: 2px; }
.cell-fabric { max-width: 160px; }
.cell-ops { white-space: nowrap; text-align: right; }
.cell-ops .mini-btn { text-decoration: none; }
.form-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }

/* 商品图片：缩略图 / 上传 / 大图预览 */
.cell-img { width: 56px; }
.shop-thumb {
  width: 48px; height: 48px; border-radius: 8px; object-fit: cover;
  border: 1px solid var(--border); cursor: pointer; display: block;
  transition: transform .12s;
}
.shop-thumb:hover { transform: scale(1.06); }
.shop-thumb-empty {
  display: flex; align-items: center; justify-content: center;
  background: var(--primary-soft); color: var(--text-3); font-size: 18px;
}
.img-upload { display: flex; align-items: center; gap: 10px; }
.img-upload-thumb {
  width: 56px; height: 56px; border-radius: 10px; object-fit: cover;
  border: 1px solid var(--border);
}
.img-preview {
  display: block; max-width: 100%; max-height: 46vh; margin: 0 auto;
  border-radius: 12px; border: 1px solid var(--border);
}
.img-preview-meta { text-align: center; margin: 10px 0 4px; font-size: 13px; color: var(--text-2); }
.img-search-box {
  margin-top: 12px; padding: 12px 14px; border-radius: 10px;
  background: var(--primary-soft);
}
.img-search-hint { font-size: 12.5px; color: var(--text-2); margin: 2px 0 10px; line-height: 1.6; }

/* 智能选优弹窗 */
.banner-btns { display: flex; gap: 8px; flex-wrap: wrap; }

/* 添加商品：一键去各平台搜同款 */
.search-same { display: flex; flex-wrap: wrap; gap: 6px; }
.search-chip { cursor: pointer; }
.search-chip:disabled { opacity: .45; cursor: not-allowed; }
.search-cmp { border-color: #f0b46a; background: #fff7ea; color: #8a6a35; font-weight: 600; }
.search-same-hint { font-size: 12px; color: var(--text-3); margin-top: 6px; line-height: 1.6; }

/* 添加商品：选填信息折叠区 */
.more-fields { border: 1px dashed var(--border); border-radius: 10px; padding: 2px 12px 6px; margin: 6px 0 2px; }
.more-fields > summary { cursor: pointer; font-size: 13px; color: var(--text-2); padding: 8px 0; list-style: none; user-select: none; }
.more-fields > summary::-webkit-details-marker { display: none; }
.more-fields > summary::before { content: '▸ '; color: var(--primary); }
.more-fields[open] > summary::before { content: '▾ '; }
.best-hint { font-size: 12.5px; color: var(--text-2); line-height: 1.7; margin-bottom: 12px; }
.best-group { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; }
.best-title { font-size: 14px; font-weight: 700; margin-bottom: 10px; }
.best-sub { font-size: 12px; color: var(--text-3); font-weight: 400; margin-left: 8px; }
.best-pick {
  display: flex; gap: 12px; align-items: center;
  background: linear-gradient(120deg, #fff7ea, #fdeef3);
  border-radius: 10px; padding: 10px 12px; margin-bottom: 10px;
}
.best-crown { font-size: 28px; }
.best-info { font-size: 13px; line-height: 1.7; min-width: 0; }
.best-price { margin: 2px 0; }
.best-reason { font-size: 12.5px; color: #8a6a35; }
.best-rank-row {
  display: flex; align-items: center; gap: 10px;
  font-size: 12.5px; color: var(--text-2);
  padding: 5px 4px; border-bottom: 1px dashed var(--border);
}
.best-rank-row:last-child { border-bottom: none; }
.rank-no { width: 26px; text-align: center; }
.rank-plat { width: 52px; font-weight: 600; color: var(--text-1); }
.rank-price { width: 72px; color: var(--primary); font-weight: 600; }
.rank-rt { width: 52px; }
.rank-sale { flex: 1; }
.rank-fabric { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-score { color: var(--text-3); }

/* 常驻「最合适」卡片：每添加一条自动更新 */
.best-live {
  display: flex; align-items: center; gap: 12px;
  background: linear-gradient(120deg, #fff7ea, #fdeef3);
  border: 1px solid #f5d9a8; border-radius: 12px;
  padding: 12px 16px; margin-bottom: 12px;
}
.best-live-crown { font-size: 26px; }
.best-live-tag { font-size: 12px; color: #b08442; font-weight: 600; margin-bottom: 3px; }
.best-live-main { min-width: 0; }
.best-live-body { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.best-live-fabric { font-size: 12.5px; color: var(--text-2); background: #fff; border-radius: 6px; padding: 2px 8px; border: 1px solid var(--border); }
.best-live-reason { font-size: 12.5px; color: #8a6a35; margin-top: 3px; }
.best-live-mix { font-size: 12px; color: #c0392b; margin-top: 4px; }
.cat-tag { margin-right: 4px; font-size: 14px; }

/* ---------- 吵架记录 ---------- */
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fight-list { display: flex; flex-direction: column; gap: 12px; }
.fight-card { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; background: #fff; }
.fight-cold { background: linear-gradient(120deg, #f2f6fb, #fdf3f6); border-color: #cfdcec; }
.fight-head { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--text-3); }
.fight-cat { background: var(--bg-2); border-radius: 6px; padding: 1px 8px; }
.fight-sev { letter-spacing: -2px; }
.fight-ops { margin-left: auto; display: flex; gap: 4px; }
.fight-topic { font-size: 14.5px; font-weight: 600; margin: 8px 0; }
.fight-foot { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 12.5px; color: var(--text-2); margin-top: 8px; }
.fight-note { color: var(--text-3); }
/* 责任条：他 vs 她 */
.blame-bar { display: flex; height: 22px; border-radius: 11px; overflow: hidden; font-size: 11.5px; color: #fff; }
.blame-him { background: linear-gradient(90deg, #6fa8dc, #4a86c8); display: flex; align-items: center; justify-content: center; min-width: 0; white-space: nowrap; }
.blame-her { background: linear-gradient(90deg, #f49ac1, #ec6f9f); display: flex; align-items: center; justify-content: center; min-width: 0; white-space: nowrap; }
.blame-slider { width: 100%; accent-color: var(--primary); }
.blame-slider-tips { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--text-3); }
/* 谁对谁错分析弹窗 */
.judge-verdict { text-align: center; background: linear-gradient(120deg, #f3ecfd, #fdeef3); border-radius: 12px; padding: 14px; margin-bottom: 12px; }
.judge-title { font-size: 16px; font-weight: 700; }
.judge-sub { font-size: 12.5px; color: var(--text-2); margin-top: 4px; }
.judge-sec { font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.judge-blame { margin-bottom: 12px; }
.judge-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.judge-cell { background: var(--bg-2); border-radius: 10px; padding: 10px 6px; text-align: center; display: flex; flex-direction: column; gap: 4px; }
.judge-cell b { font-size: 15px; }
.judge-cell span { font-size: 11.5px; color: var(--text-3); }
.judge-bad { background: #fdeef0; }
.judge-tip { margin-top: 12px; font-size: 12.5px; color: #8a6a35; background: #fff7ea; border-radius: 10px; padding: 10px 12px; }
.fight-story { resize: vertical; min-height: 84px; font-family: inherit; line-height: 1.6; }
.judge-points { margin: 6px 0 0; padding-left: 20px; font-size: 13px; color: var(--text-2); }
.judge-points li { margin: 3px 0; }
.judge-advice { margin: 6px 0 0; padding-left: 20px; font-size: 13px; line-height: 1.7; }
.judge-advice li { margin: 5px 0; }
.fight-adv { margin-top: 10px; border-top: 1px dashed var(--border); padding-top: 8px; }
.fight-adv > summary { cursor: pointer; font-size: 13px; color: var(--primary); font-weight: 600; list-style: none; }
.fight-adv > summary::-webkit-details-marker { display: none; }
.fight-adv > summary::before { content: '\25b8 '; }
.fight-adv[open] > summary::before { content: '\25be '; }
@media (max-width: 600px) { .judge-grid { grid-template-columns: repeat(2, 1fr); } }

/* ---------- 响应式：手机端左栏改为抽屉 ---------- */
@media (max-width: 860px) {
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 90;
    transform: translateX(-100%);
    transition: transform .22s ease;
    box-shadow: 4px 0 20px rgba(0,0,0,.1);
  }
  body.sidebar-open .sidebar { transform: translateX(0); }
  body.sidebar-open .sidebar-mask {
    display: block; position: fixed; inset: 0; z-index: 80;
    background: rgba(70, 30, 50, .35);
  }
  .menu-toggle { display: block; }
  .topbar { padding: 12px 16px; }
  .page { padding: 16px 14px 40px; }
  .stats-grid { grid-template-columns: 1fr; }
  .sec-cards { grid-template-columns: 1fr; }
  .cat-grid.cols-5 { grid-template-columns: repeat(4, 1fr); }
  .rec-ops { opacity: 1; }
  .today-card { flex-direction: column; align-items: stretch; gap: 14px; text-align: center; }
  .shop-toolbar { flex-direction: column; }
  .shop-toolbar select.input { width: 100%; }
  .form-grid-3 { grid-template-columns: 1fr; }
  .news-item { flex-wrap: wrap; }
  .news-tags { width: 100%; padding-left: 30px; }
}

/* ============ 每日新闻 ============ */
.news-list { list-style: none; margin: 4px 0 0; padding: 0; }
.news-item {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 10px 8px; border-bottom: 1px dashed var(--border, #f3d7e3);
  line-height: 1.65; font-size: 14px;
}
.news-item:last-child { border-bottom: none; }
.news-item.news-hot { background: #fffaf3; border-radius: 8px; }
.news-idx {
  flex: 0 0 22px; height: 22px; margin-top: 1px;
  border-radius: 50%; background: #eef4ff; color: #4a86c8;
  font-size: 12px; font-weight: 700; text-align: center; line-height: 22px;
}
.news-text { flex: 1; }
.news-body { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.news-num { color: #e05a8a; font-weight: 700; }
.news-gloss {
  font-size: 12.5px; color: #8a93a6; line-height: 1.55;
  padding: 4px 8px; background: #f6f8fb; border-radius: 8px;
}
.news-gloss b { color: #4a86c8; }
.news-impact {
  display: block; font-size: 12.5px; color: #b8860b; line-height: 1.55;
  padding: 4px 8px; background: #fff7e0; border-radius: 8px; margin-top: 3px;
}
.chip-easy.active { background: #fff2b8; border-color: #f0d060; color: #8a6d00; }
.news-tags { display: flex; gap: 4px; flex: 0 0 auto; }
.news-tag {
  font-size: 11px; padding: 1px 7px; border-radius: 999px; white-space: nowrap;
}
.tag-pol { background: #eef4ff; color: #4a86c8; }
.tag-chg { background: #fdeef2; color: #ec6f9f; }
.tag-good { background: #e8f8ee; color: #2e9e5b; }
.news-change-box {
  margin: 10px 0 14px; padding: 12px 14px;
  background: linear-gradient(120deg, #fff5f8, #fff9ef);
  border: 1px solid #f8dde7; border-radius: 12px;
}
.news-change-list { margin: 8px 0 0; padding-left: 18px; }
.news-change-list li { margin: 5px 0; line-height: 1.6; font-size: 13.5px; }
.news-tip {
  margin-top: 14px; padding: 10px 14px;
  background: #f6f9ff; border-radius: 10px;
  color: #6b7a99; font-size: 13px; line-height: 1.6;
}
.news-sources {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin-top: 16px; padding-top: 12px; border-top: 1px dashed var(--border, #f3d7e3);
}
.news-src-btn { font-size: 13px; padding: 6px 12px; text-decoration: none; }
