/* ══════════════════════════════════════════════════
   VARIABLES & RESET
══════════════════════════════════════════════════ */
:root {
  --green:        #07C160;
  --green-bright: #0adb6e;
  --green-deep:   #059952;
  --white:        #ffffff;
  --ink:          #16191f;
  --ink-mid:      #363d48;
  --ink-light:    #8492a6;
  --border:       rgba(255,255,255,0.75);
  --border-dark:  rgba(0,0,0,0.07);
  --glass:        rgba(255,255,255,0.75);
  --glass-strong: rgba(255,255,255,0.93);
  --bg-base:      #eef2ee;
  --shadow-sm:    0 2px 14px rgba(0,0,0,0.05);
  --shadow-md:    0 6px 32px rgba(0,0,0,0.08);
  --shadow-lg:    0 20px 60px rgba(0,0,0,0.12);
  --shadow-green: 0 8px 32px rgba(7,193,96,0.22);
  --serif-display: 'DM Serif Display', 'Noto Serif SC', serif;
  --serif:         'Noto Serif SC', serif;
  --sans:          'DM Sans', 'Noto Sans SC', sans-serif;
  --radius:        16px;
  --ease-spring:   cubic-bezier(0.34,1.56,0.64,1);
  --ease-smooth:   cubic-bezier(0.4,0,0.2,1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
/* overflow-x 同锁 html 层：移动端浏览器仅在 body 设 hidden 时仍可拖动页面（经典失效场景），双层才能彻底禁止横向滑动 */
html { scroll-behavior: smooth; overflow-x: hidden; }
canvas { max-width: 100%; }
body { font-family: var(--sans); background: var(--bg-base); color: var(--ink); min-height: 100vh; overflow-x: hidden; -webkit-font-smoothing: antialiased; font-size: 15px; line-height: 1.6; position: relative; }

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(7,193,96,0.3); border-radius: 3px; }

/* ══════════════════════════════════════════════════
   BACKGROUND CANVAS
══════════════════════════════════════════════════ */
.bg-orbs { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.orb { position: absolute; border-radius: 50%; filter: blur(100px); opacity: 0.35; animation: orbFloat 18s ease-in-out infinite; }
.orb-1 { width: 520px; height: 520px; background: radial-gradient(circle, rgba(7,193,96,0.35) 0%, transparent 70%); top: -160px; left: -120px; animation-delay: 0s; }
.orb-2 { width: 400px; height: 400px; background: radial-gradient(circle, rgba(7,193,96,0.20) 0%, transparent 70%); bottom: 10%; right: -100px; animation-delay: -7s; }
.orb-3 { width: 300px; height: 300px; background: radial-gradient(circle, rgba(10,219,110,0.15) 0%, transparent 70%); top: 45%; left: 40%; animation-delay: -13s; }
@keyframes orbFloat { 0%, 100% { transform: translate(0, 0) scale(1); } 33% { transform: translate(30px, -40px) scale(1.05); } 66% { transform: translate(-20px, 30px) scale(0.96); } }

/* ══════════════════════════════════════════════════
   HEADER
══════════════════════════════════════════════════ */
.header { position: sticky; top: 0; z-index: 200; background: rgba(240,244,240,0.80); backdrop-filter: blur(28px) saturate(1.6); -webkit-backdrop-filter: blur(28px) saturate(1.6); border-bottom: 1px solid rgba(7,193,96,0.10); }
@keyframes headerIn { from { transform: translateY(-100%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.header-inner { max-width: 1200px; margin: 0 auto; padding: 0 48px; height: 76px; display: flex; align-items: center; justify-content: space-between; }
.logo { display: flex; align-items: center; gap: 16px; cursor: pointer; }
.logo-avatar-wrap { position: relative; width: 44px; height: 44px; flex-shrink: 0; }
.logo-avatar { width: 44px; height: 44px; border-radius: 12px; object-fit: cover; display: block; transition: transform 0.3s var(--ease-spring); box-shadow: 0 4px 14px rgba(7,193,96,0.25); }
.logo-avatar-wrap:hover .logo-avatar { transform: scale(1.06) rotate(-2deg); }
.logo-avatar-default { width: 44px; height: 44px; border-radius: 12px; background: linear-gradient(135deg, var(--green) 0%, var(--green-deep) 100%); display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-green); transition: transform 0.3s var(--ease-spring); }
.logo-avatar-wrap:hover .logo-avatar-default { transform: scale(1.06) rotate(-2deg); }
.logo-avatar-default img { width: 100%; height: 100%; border-radius: 12px; object-fit: cover; display: block; user-select: none; -webkit-user-drag: none; }
.upload-hint { position: absolute; inset: 0; border-radius: 12px; background: rgba(0,0,0,0.45); display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity 0.2s; font-size: 10px; color: white; font-family: var(--sans); letter-spacing: 0.03em; cursor: pointer; }
.logo-avatar-wrap:hover .upload-hint { opacity: 1; }
#avatarInput { display: none; }
.logo-text { display: flex; flex-direction: column; gap: 1px; }
.logo-name { font-family: var(--serif-display); font-size: 21px; font-weight: 400; color: var(--ink); letter-spacing: 0.01em; line-height: 1.2; }
.logo-tagline { font-size: 12px; color: var(--ink-light); letter-spacing: 0.06em; font-weight: 400; margin-top: 3px; }
.header-actions { display: flex; gap: 10px; align-items: center; }

/* ── BUTTONS ── */
.btn { display: inline-flex; align-items: center; gap: 7px; padding: 10px 22px; border-radius: 50px; font-family: var(--sans); font-size: 14px; font-weight: 500; cursor: pointer; border: none; transition: all 0.22s var(--ease-smooth); white-space: nowrap; }
.btn-ghost { background: var(--glass-strong); color: var(--ink-mid); border: 1px solid var(--border-dark); backdrop-filter: blur(8px); }
.btn-ghost:hover { background: white; color: var(--green); border-color: rgba(7,193,96,0.3); box-shadow: 0 4px 16px rgba(7,193,96,0.15); transform: translateY(-1px); }
.btn-primary { background: linear-gradient(135deg, var(--green) 0%, var(--green-deep) 100%); color: white; box-shadow: var(--shadow-green); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 32px rgba(7,193,96,0.35); background: linear-gradient(135deg, var(--green-bright) 0%, var(--green) 100%); }

/* ══════════════════════════════════════════════════
   PAGE LAYOUT
══════════════════════════════════════════════════ */
.page { position: relative; z-index: 1; max-width: 1200px; margin: 0 auto; padding: 48px 48px 100px; }
.tabs-wrap { display: flex; gap: 4px; margin-bottom: 44px; background: var(--glass); backdrop-filter: blur(20px); border: 1px solid var(--border); border-radius: 50px; padding: 5px; width: fit-content; box-shadow: var(--shadow-sm); animation: fadeUp 0.5s 0.2s var(--ease-smooth) both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
.tab { padding: 11px 32px; border-radius: 50px; font-size: 15px; font-family: var(--sans); font-weight: 400; color: var(--ink-light); cursor: pointer; background: transparent; border: none; transition: all 0.25s var(--ease-smooth); position: relative; }
.tab:hover { color: var(--ink-mid); }
.tab.active { background: white; color: var(--green-deep); font-weight: 500; box-shadow: 0 2px 12px rgba(0,0,0,0.07); }
.panel { display: none; }
.panel.active { display: block; animation: panelIn 0.38s var(--ease-smooth) both; }
@keyframes panelIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ══════════════════════════════════════════════════
   STATS & CARDS
══════════════════════════════════════════════════ */
.stats-hero { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 16px; margin-bottom: 24px; }
.stat-hero-card { background: var(--glass-strong); backdrop-filter: blur(28px); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-md); padding: 36px 32px; transition: transform 0.28s, box-shadow 0.28s; animation: statCardIn 0.5s var(--ease-smooth) both; position: relative; overflow: hidden; }
.stat-hero-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.stat-hero-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: linear-gradient(90deg, transparent, rgba(7,193,96,0.5), transparent); opacity: 0; transition: opacity 0.3s; }
.stat-hero-card:hover::before { opacity: 1; }
.stat-hero-card:nth-child(1) { animation-delay: 0.1s; } .stat-hero-card:nth-child(2) { animation-delay: 0.18s; } .stat-hero-card:nth-child(3) { animation-delay: 0.26s; } .stat-hero-card:nth-child(4) { animation-delay: 0.34s; }
@keyframes statCardIn { from { opacity: 0; transform: translateY(24px) scale(0.97); } to { opacity: 1; transform: translateY(0) scale(1); } }
.stat-hero-card.accent { background: linear-gradient(140deg, var(--green) 0%, var(--green-deep) 100%); border-color: rgba(255,255,255,0.25); box-shadow: var(--shadow-green); }
.stat-hero-card.accent:hover { box-shadow: 0 24px 64px rgba(7,193,96,0.40); }
.stat-hero-card.accent::before { background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent); }
.stat-label { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-light); font-weight: 500; margin-bottom: 16px; }
.stat-hero-card.accent .stat-label { color: rgba(255,255,255,0.70); }
.stat-value { font-family: var(--serif-display); font-size: 54px; font-weight: 400; color: var(--ink); line-height: 1; transition: transform 0.3s; }
.stat-hero-card.accent .stat-value { color: white; }
.stat-hero-card:hover .stat-value { transform: scale(1.04); }
.stat-sub { font-size: 13px; color: var(--ink-light); margin-top: 14px; }
.stat-hero-card.accent .stat-sub { color: rgba(255,255,255,0.60); }

.layout-cols { display: grid; grid-template-columns: 1fr 320px; gap: 20px; align-items: start; }
.chart-card { background: var(--glass-strong); backdrop-filter: blur(28px); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-md); padding: 32px 36px; margin-bottom: 20px; transition: transform 0.25s, box-shadow 0.25s; }
.chart-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.chart-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 28px; }
.chart-title { font-family: var(--serif-display); font-size: 22px; font-weight: 400; color: var(--ink); }
.chart-meta { font-size: 13px; color: var(--ink-light); }
.chart-wrap { position: relative; height: 230px; }

.side-card { background: var(--glass-strong); backdrop-filter: blur(28px); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-md); padding: 28px; margin-bottom: 16px; transition: transform 0.25s, box-shadow 0.25s; }
.side-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.side-title { font-family: var(--serif-display); font-size: 19px; font-weight: 400; color: var(--ink); margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid rgba(0,0,0,0.06); }

.type-row { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.type-name { font-size: 13px; color: var(--ink-mid); min-width: 40px; }
.type-track { flex: 1; height: 4px; background: rgba(0,0,0,0.07); border-radius: 2px; overflow: hidden; }
.type-fill { height: 100%; border-radius: 2px; transition: width 0.8s; }
.type-count { font-size: 13px; font-weight: 500; color: var(--ink); min-width: 24px; text-align: right; }

.export-card { background: var(--ink); border-radius: var(--radius); padding: 28px; position: relative; overflow: hidden; }
.export-card::before { content: ''; position: absolute; top: -60px; right: -60px; width: 180px; height: 180px; border-radius: 50%; background: radial-gradient(circle, rgba(7,193,96,0.25) 0%, transparent 70%); }
.export-title { font-family: var(--serif-display); font-size: 17px; color: white; margin-bottom: 8px; }
.export-desc { font-size: 12px; color: rgba(255,255,255,0.4); line-height: 1.6; margin-bottom: 20px; }
.export-btns { display: flex; flex-direction: column; gap: 10px; }
.btn-export, .btn-export-ghost { width: 100%; padding: 12px; border-radius: 50px; font-family: var(--sans); font-size: 13.5px; cursor: pointer; transition: all 0.22s; display: flex; align-items: center; justify-content: center; gap: 7px; }
.btn-export { background: linear-gradient(135deg, var(--green) 0%, var(--green-deep) 100%); color: white; border: none; font-weight: 500; box-shadow: 0 4px 16px rgba(7,193,96,0.3); }
.btn-export:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(7,193,96,0.45); }
.btn-export-ghost { background: transparent; color: rgba(255,255,255,0.65); border: 1px solid rgba(255,255,255,0.18); font-weight: 400; padding: 11px; }
.btn-export-ghost:hover { background: rgba(255,255,255,0.08); color: white; border-color: rgba(255,255,255,0.35); transform: translateY(-1px); }

/* ══════════════════════════════════════════════════
   ARTICLE TABLE & BACK TO TOP
══════════════════════════════════════════════════ */
.article-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; gap: 16px; }
.filter-pills { display: flex; gap: 6px; background: var(--glass); backdrop-filter: blur(16px); border: 1px solid var(--border); border-radius: 50px; padding: 4px; }
.filter-pill { padding: 7px 18px; font-size: 13px; border-radius: 50px; border: none; background: transparent; color: var(--ink-light); cursor: pointer; transition: all 0.2s; }
.filter-pill:hover { color: var(--ink-mid); }
.filter-pill.active { background: white; color: var(--green); font-weight: 500; box-shadow: 0 2px 10px rgba(0,0,0,0.08); }

.article-table-wrap { background: var(--glass-strong); backdrop-filter: blur(28px); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-md); }
.table-head { display: grid; grid-template-columns: 2fr 78px 64px 78px 90px 140px 120px; padding: 15px 28px; background: rgba(245,247,250,0.92); backdrop-filter: blur(16px); border-bottom: 1px solid rgba(0,0,0,0.06); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-light); position: sticky; top: 76px; z-index: 100; border-top-left-radius: var(--radius); border-top-right-radius: var(--radius); }
.article-row { display: grid; grid-template-columns: 2fr 78px 64px 78px 90px 140px 120px; padding: 22px 28px; border-bottom: 1px solid rgba(0,0,0,0.04); align-items: center; transition: background 0.18s; animation: rowIn 0.35s var(--ease-smooth) both; }
@keyframes rowIn { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: translateX(0); } }
.article-row:last-child { border-bottom: none; border-bottom-left-radius: var(--radius); border-bottom-right-radius: var(--radius); }
.article-row:hover { background: rgba(7,193,96,0.04); }

.art-title { font-size: 15px; font-weight: 400; color: var(--ink); line-height: 1.45; }
.art-type-badge { display: inline-flex; align-items: center; padding: 5px 13px; border-radius: 50px; font-size: 13px; letter-spacing: 0.03em; font-weight: 500; }
.badge-article { background: #e4f5ec; color: #1a6038; } .badge-imgtext { background: #e3edf6; color: #1a4a6e; } .badge-video { background: #f8e8e3; color: #9a3418; } .badge-audio { background: #ede8f8; color: #52368a; }

.badge-original { display: inline-flex; padding: 4px 12px; border-radius: 50px; font-size: 12px; font-weight: 500; background: linear-gradient(135deg, rgba(7,193,96,0.12) 0%, rgba(7,193,96,0.06) 100%); color: var(--green-deep); border: 1px solid rgba(7,193,96,0.22); }
.badge-repost { display: inline-flex; padding: 4px 12px; border-radius: 50px; font-size: 12px; font-weight: 400; background: rgba(0,0,0,0.03); color: var(--ink-light); border: 1px solid rgba(0,0,0,0.07); }

/* AI 标签 */
.badge-ai { display: inline-flex; padding: 4px 12px; border-radius: 50px; font-size: 12px; font-weight: 500; letter-spacing: 0.03em; }
.badge-ai-0 { background: #e8f5e9; color: #2e7d32; border: 1px solid rgba(76,175,80,0.2); } /* 淡绿色 */
.badge-ai-1 { background: #fff3e0; color: #e65100; border: 1px solid rgba(255,152,0,0.2); } /* 橘黄色 */
.badge-ai-2 { background: #ffebee; color: #c62828; border: 1px solid rgba(244,67,54,0.2); } /* 红色 */

.art-date { font-size: 14px; color: var(--ink-light); }
.art-actions { display: flex; gap: 8px; }
.del-btn, .edit-btn { background: none; border: 1px solid rgba(0,0,0,0.08); cursor: pointer; font-size: 12px; padding: 5px 12px; border-radius: 50px; transition: all 0.18s; white-space: nowrap; color: var(--ink-light); }
.del-btn:hover { background: #fef0f0; color: #c0392b; border-color: rgba(192,57,43,0.2); }
.edit-btn:hover { background: rgba(7,193,96,0.07); color: var(--green-deep); border-color: rgba(7,193,96,0.25); }

.empty-tip { padding: 72px; text-align: center; color: var(--ink-light); font-size: 15px; line-height: 2.2; }
.empty-tip strong { display: block; font-family: var(--serif-display); font-size: 22px; color: var(--ink-mid); font-weight: 400; margin-bottom: 8px; }

/* 悬浮返回顶部按钮 */
.btn-back-to-top {
  position: fixed; bottom: 40px; right: 40px; width: 50px; height: 50px; border-radius: 50%;
  background: var(--glass-strong); border: 1px solid var(--border); box-shadow: var(--shadow-md);
  display: flex; align-items: center; justify-content: center; color: var(--green-deep);
  cursor: pointer; opacity: 0; pointer-events: none; transform: translateY(20px);
  transition: all 0.3s var(--ease-spring); z-index: 999; backdrop-filter: blur(8px);
}
.btn-back-to-top.show { opacity: 1; pointer-events: auto; transform: translateY(0); }
.btn-back-to-top:hover { background: white; color: var(--green); box-shadow: 0 8px 24px rgba(7,193,96,0.25); transform: translateY(-3px); }

/* ══════════════════════════════════════════════════
   WEEK CARDS & TREND PANEL
══════════════════════════════════════════════════ */
.week-section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; }
.section-title { font-family: var(--serif-display); font-size: 24px; font-weight: 400; color: var(--ink); }
.week-card { background: var(--glass-strong); backdrop-filter: blur(28px); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-md); margin-bottom: 14px; overflow: hidden; transition: box-shadow 0.25s; animation: weekCardIn 0.4s var(--ease-smooth) both; }
@keyframes weekCardIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
.week-card:hover { box-shadow: 0 12px 40px rgba(7,193,96,0.12); }
.week-head { display: flex; align-items: center; padding: 24px 32px; cursor: pointer; gap: 20px; transition: background 0.18s; }
.week-head:hover { background: rgba(7,193,96,0.03); }
.week-num { font-family: var(--serif-display); font-size: 15px; font-weight: 400; color: var(--ink-light); min-width: 56px; font-style: italic; }
.week-info { flex: 1; }
.week-name { font-family: var(--serif-display); font-size: 20px; font-weight: 400; color: var(--ink); }
.week-range { font-size: 14px; color: var(--ink-light); margin-top: 4px; }
.week-pills { display: flex; gap: 32px; }
.pill-item { text-align: right; }
.pill-val { font-family: var(--serif-display); font-size: 28px; font-weight: 400; color: var(--ink); line-height: 1; }
.pill-lbl { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-light); margin-top: 5px; }
.expand-btn { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: rgba(0,0,0,0.05); transition: all 0.25s; flex-shrink: 0; color: var(--ink-light); }
.week-card.open .expand-btn { transform: rotate(180deg); background: var(--green-pale); color: var(--green); }
.week-body { display: none; border-top: 1px solid rgba(0,0,0,0.07); padding: 32px; }
.week-card.open .week-body { display: block; }
.body-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 36px; margin-bottom: 28px; }
.col-label { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-light); margin-bottom: 18px; }
.ct-list { display: flex; flex-direction: column; gap: 14px; }
.ct-row { display: grid; grid-template-columns: 52px 1fr 36px; align-items: center; gap: 12px; }
.ct-name { font-size: 15px; color: var(--ink-mid); }
.ct-track { height: 6px; background: rgba(0,0,0,0.06); border-radius: 3px; overflow: hidden; }
.ct-fill { height: 100%; border-radius: 3px; transition: width 0.8s; }
.ct-num { font-size: 15px; font-weight: 500; color: var(--ink); text-align: right; }
.source-layout { display: grid; grid-template-columns: 150px 1fr; gap: 20px; align-items: center; }
.donut-wrap { position: relative; height: 150px; width: 150px; }
.src-legend { display: flex; flex-direction: column; gap: 11px; }
.src-row { display: flex; align-items: center; gap: 9px; font-size: 14px; color: var(--ink-mid); }
.src-bar { width: 14px; height: 4px; border-radius: 2px; flex-shrink: 0; }
.src-val { margin-left: auto; font-weight: 500; color: var(--ink); font-size: 15px; }
.journal-section { padding-top: 24px; border-top: 1px solid rgba(0,0,0,0.06); grid-column: 1 / -1; }
.journal-text { font-family: var(--serif); font-size: 16px; font-weight: 300; color: var(--ink-mid); line-height: 2; padding-left: 22px; border-left: 3px solid var(--green); }
.journal-empty { font-size: 15px; color: var(--ink-light); padding-left: 22px; border-left: 2px solid rgba(0,0,0,0.07); }
.week-card-actions { display: flex; gap: 8px; margin-left: 12px; }

/* TREND PANEL */
.trend-panel { background: var(--glass-strong); backdrop-filter: blur(28px); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-md); margin-bottom: 20px; overflow: hidden; animation: panelIn 0.38s var(--ease-smooth) both; }
.trend-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; padding: 28px 32px 22px; border-bottom: 1px solid rgba(0,0,0,0.05); }
.trend-title { font-family: var(--serif-display); font-size: 22px; font-weight: 400; color: var(--ink); }
.trend-controls { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ctrl-group { display: flex; background: rgba(0,0,0,0.04); border-radius: 10px; padding: 3px; gap: 2px; }
.ctrl-btn { padding: 6px 16px; border: none; border-radius: 8px; font-size: 13px; font-family: var(--sans); cursor: pointer; background: transparent; color: var(--ink-light); transition: all 0.18s; white-space: nowrap; }
.ctrl-btn:hover { color: var(--ink-mid); }
.ctrl-btn.active { background: white; color: var(--green-deep); font-weight: 500; box-shadow: 0 1px 6px rgba(0,0,0,0.10); }
.ctrl-divider { width: 1px; background: rgba(0,0,0,0.08); margin: 4px 2px; border-radius: 1px; }
.trend-custom-range { display: none; padding: 14px 32px 18px; background: rgba(7,193,96,0.03); border-bottom: 1px solid rgba(7,193,96,0.08); gap: 14px; align-items: center; flex-wrap: wrap; }
.trend-custom-range.show { display: flex; }
.trend-custom-range label { font-size: 13px; color: var(--ink-light); white-space: nowrap; }
.trend-custom-range input[type="date"] { border: 1.5px solid rgba(0,0,0,0.09); border-radius: 8px; padding: 7px 12px; font-family: var(--sans); font-size: 14px; color: var(--ink); background: white; outline: none; }
.trend-custom-range input[type="date"]:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(7,193,96,0.08); }
.trend-body { padding: 24px 32px 28px; }
.trend-chart-wrap { position: relative; height: 260px; }
.trend-empty { height: 260px; display: flex; align-items: center; justify-content: center; font-family: var(--serif-display); font-size: 18px; color: var(--ink-light); font-weight: 400; font-style: italic; }

/* MODALS */
.overlay { display: none; position: fixed; inset: 0; background: rgba(14,16,20,0.4); backdrop-filter: blur(8px); z-index: 500; align-items: center; justify-content: center; }
.overlay.show { display: flex; }
.modal { background: rgba(255,255,255,0.92); backdrop-filter: blur(40px) saturate(2); border: 1px solid rgba(255,255,255,0.8); border-radius: 20px; box-shadow: 0 32px 80px rgba(0,0,0,0.18), 0 0 0 1px rgba(255,255,255,0.5) inset; width: 560px; max-width: 96vw; max-height: 90vh; overflow-y: auto; padding: 40px 44px; animation: modalIn 0.3s var(--ease-spring) both; }
@keyframes modalIn { from { opacity: 0; transform: scale(0.93) translateY(20px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.modal-title { font-family: var(--serif-display); font-size: 26px; font-weight: 400; color: var(--ink); margin-bottom: 30px; padding-bottom: 20px; border-bottom: 1px solid rgba(0,0,0,0.07); }
.form-group { margin-bottom: 22px; }
.form-label { display: block; font-size: 11px; letter-spacing: 0.09em; text-transform: uppercase; color: var(--ink-light); margin-bottom: 9px; font-weight: 600; }
.form-input, .form-textarea, .form-select { width: 100%; border: 1.5px solid rgba(0,0,0,0.09); border-radius: 10px; padding: 13px 16px; font-family: var(--sans); font-size: 14.5px; outline: none; background: rgba(255,255,255,0.75); transition: all 0.2s; }
.form-input:focus, .form-textarea:focus, .form-select:focus { border-color: var(--green); background: white; box-shadow: 0 0 0 4px rgba(7,193,96,0.09); }
.form-textarea { resize: vertical; min-height: 96px; line-height: 1.7; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-divider { font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--green); font-weight: 500; margin: 28px 0 18px; padding-bottom: 11px; border-bottom: 1px solid rgba(7,193,96,0.2); }
.modal-footer { display: flex; gap: 10px; margin-top: 30px; padding-top: 22px; border-top: 1px solid rgba(0,0,0,0.07); }
.btn-cancel { padding: 11px 22px; border: 1.5px solid rgba(0,0,0,0.1); background: none; border-radius: 50px; font-family: var(--sans); font-size: 14px; color: var(--ink-mid); cursor: pointer; transition: all 0.18s; }
.btn-cancel:hover { border-color: var(--ink-mid); background: rgba(0,0,0,0.03); }
.btn-save { flex: 1; padding: 12px; background: linear-gradient(135deg, var(--green) 0%, var(--green-deep) 100%); color: white; border: none; border-radius: 50px; font-family: var(--sans); font-size: 15px; font-weight: 500; cursor: pointer; box-shadow: var(--shadow-green); transition: all 0.22s; }
.btn-save:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(7,193,96,0.38); }

/* 数据导出卡片预览 Modal 样式优化 - 彻底解决超出截断问题 */
.card-preview-overlay { display: none; position: fixed; inset: 0; background: rgba(14,16,20,0.7); backdrop-filter: blur(12px); z-index: 600; align-items: center; justify-content: center; }
.card-preview-overlay.show { display: flex; }
.card-preview-modal { background: rgba(255,255,255,0.96); border-radius: 20px; box-shadow: 0 40px 100px rgba(0,0,0,0.25); padding: 24px; display: flex; flex-direction: column; align-items: center; gap: 20px; animation: modalIn 0.3s both; width: 90vw; max-width: 800px; max-height: 90vh; box-sizing: border-box; }
.card-preview-title { font-family: var(--serif-display); font-size: 20px; font-weight: 500; color: var(--ink); align-self: flex-start; margin-left: 10px; }
#cardCanvas { 
  border-radius: 12px; 
  box-shadow: 0 12px 32px rgba(0,0,0,0.12); 
  max-width: 100%; 
  height: auto; 
  max-height: 55vh; /* 严格限制高度，绝不把底部按钮挤出屏幕 */
  object-fit: contain; 
  background: white; 
}
.card-preview-actions { display: flex; gap: 12px; width: 100%; flex-shrink: 0; margin-top: auto; }

@media (max-width: 960px) {
  .page { padding: 32px 24px 80px; }
  .stats-hero { grid-template-columns: 1fr 1fr; }
  .layout-cols { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .stats-hero { grid-template-columns: 1fr; }
  .table-head, .article-row { grid-template-columns: 1fr 110px; gap: 8px; }
  .table-head > div:not(:first-child):not(:last-child),
  .article-row > div:not(:first-child):not(:last-child) { display: none; }
}

/* ════════════════════════════════════════════════════
   v3.0 新增 · 系统字体本地化（移除 Google Fonts 依赖）
════════════════════════════════════════════════════ */
:root {
  --serif-display: 'Palatino', 'Palatino Linotype', Georgia, 'Songti SC', 'STSong', 'SimSun', serif;
  --serif: 'Songti SC', 'STSong', 'Noto Serif CJK SC', 'SimSun', serif;
  --sans: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Segoe UI', Roboto, sans-serif;
}

/* ════════════════════════════════════════════════════
   v3.0 新增 · 访问口令门（云端模式）
════════════════════════════════════════════════════ */
.gate-overlay { z-index: 900; background: rgba(238,242,238,0.72); backdrop-filter: blur(28px) saturate(1.4); -webkit-backdrop-filter: blur(28px) saturate(1.4); }
.gate-card { width: min(400px, 92vw); background: rgba(255,255,255,0.9); backdrop-filter: blur(30px); border: 1px solid rgba(255,255,255,0.85); border-radius: 22px; box-shadow: 0 32px 80px rgba(0,0,0,0.14), 0 0 0 1px rgba(255,255,255,0.5) inset; padding: 44px 38px 34px; text-align: center; animation: modalIn 0.35s var(--ease-spring) both; }
.gate-lock { width: 64px; height: 64px; margin: 0 auto 20px; border-radius: 20px; background: linear-gradient(135deg, var(--green) 0%, var(--green-deep) 100%); display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-green); }
.gate-lock svg { width: 30px; height: 30px; stroke: white; fill: none; stroke-width: 2; }
.gate-title { font-family: var(--serif-display); font-size: 24px; color: var(--ink); margin-bottom: 8px; }
.gate-sub { font-size: 13.5px; color: var(--ink-light); margin-bottom: 26px; line-height: 1.6; }
.gate-input { width: 100%; height: 50px; border: 1.5px solid rgba(0,0,0,0.10); border-radius: 14px; padding: 0 18px; font-family: var(--sans); font-size: 16px; letter-spacing: 0.06em; text-align: center; outline: none; background: rgba(255,255,255,0.85); transition: all 0.2s; margin-bottom: 14px; }
.gate-input:focus { border-color: var(--green); box-shadow: 0 0 0 4px rgba(7,193,96,0.10); background: white; }
.gate-btn { width: 100%; height: 50px; border: none; border-radius: 14px; background: linear-gradient(135deg, var(--green) 0%, var(--green-deep) 100%); color: white; font-family: var(--sans); font-size: 15.5px; font-weight: 500; cursor: pointer; box-shadow: var(--shadow-green); transition: all 0.22s; }
.gate-btn:hover { transform: translateY(-1px); box-shadow: 0 10px 28px rgba(7,193,96,0.36); }
.gate-btn:disabled { opacity: 0.65; cursor: wait; transform: none; }
.gate-error { min-height: 20px; font-size: 13px; color: #c0392b; margin-top: 12px; line-height: 1.5; }
.gate-offline { display: inline-block; font-size: 13px; color: var(--green-deep); text-decoration: none; border-bottom: 1px dashed rgba(7,193,96,0.4); padding-bottom: 1px; margin-top: 4px; }
.gate-offline:hover { color: var(--green); }
.gate-hint { font-size: 11px; color: var(--ink-light); margin-top: 18px; line-height: 1.7; opacity: 0.85; }

/* ════════════════════════════════════════════════════
   v3.0 新增 · 同步状态徽标
════════════════════════════════════════════════════ */
.sync-badge { display: none; align-items: center; gap: 7px; padding: 7px 14px; border-radius: 50px; background: var(--glass-strong); border: 1px solid var(--border-dark); font-size: 12px; color: var(--ink-mid); font-family: var(--sans); white-space: nowrap; backdrop-filter: blur(8px); }
.sync-badge.show { display: inline-flex; }
.sync-dot { width: 8px; height: 8px; border-radius: 50%; background: #a0aab8; flex-shrink: 0; }
.sync-badge[data-state="ok"] .sync-dot { background: var(--green); box-shadow: 0 0 0 3px rgba(7,193,96,0.15); }
.sync-badge[data-state="busy"] .sync-dot { background: #e8a838; animation: pulse 1.1s ease-in-out infinite; }
.sync-badge[data-state="err"] .sync-dot { background: #e05252; box-shadow: 0 0 0 3px rgba(224,82,82,0.14); }
.sync-badge[data-state="backup"] .sync-dot { background: #5b9bd5; box-shadow: 0 0 0 3px rgba(91,155,213,0.16); }
.sync-badge[data-state="local"] .sync-dot { background: #a0aab8; }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.45; transform: scale(0.8); } }

/* ════════════════════════════════════════════════════
   v3.0 新增 · 轻提示 Toast
════════════════════════════════════════════════════ */
.toast-wrap { position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%); z-index: 1200; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; width: max-content; max-width: 90vw; }
.toast { background: rgba(28,33,40,0.92); color: white; font-size: 13.5px; font-family: var(--sans); padding: 11px 20px; border-radius: 50px; box-shadow: 0 10px 32px rgba(0,0,0,0.22); animation: toastIn 0.3s var(--ease-spring) both; backdrop-filter: blur(12px); max-width: 100%; text-align: center; }
.toast-ok { background: rgba(6,150,78,0.94); }
.toast-err { background: rgba(192,57,43,0.94); }
.toast.out { animation: toastOut 0.32s ease both; }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px) scale(0.94); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(10px) scale(0.96); } }

/* ════════════════════════════════════════════════════
   v3.0 新增 · 文章搜索筛选栏
════════════════════════════════════════════════════ */
.article-searchbar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; background: var(--glass-strong); backdrop-filter: blur(20px); border: 1px solid var(--border); border-radius: 14px; padding: 12px 16px; margin-bottom: 12px; box-shadow: var(--shadow-sm); }
.search-input { flex: 1 1 200px; min-width: 170px; height: 42px; border: 1.5px solid rgba(0,0,0,0.08); border-radius: 10px; padding: 0 14px 0 38px; font-family: var(--sans); font-size: 14px; outline: none; background: rgba(255,255,255,0.8) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 24 24' fill='none' stroke='%238492a6' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") 13px center no-repeat; transition: all 0.2s; }
.search-input:focus { border-color: var(--green); box-shadow: 0 0 0 4px rgba(7,193,96,0.09); background-color: white; }
.search-date { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-light); }
.search-date input { height: 42px; border: 1.5px solid rgba(0,0,0,0.08); border-radius: 10px; padding: 0 10px; font-family: var(--sans); font-size: 13px; outline: none; background: rgba(255,255,255,0.8); color: var(--ink-mid); transition: all 0.2s; }
.search-date input:focus { border-color: var(--green); background: white; }
.search-sort { height: 42px; border: 1.5px solid rgba(0,0,0,0.08); border-radius: 10px; padding: 0 10px; font-family: var(--sans); font-size: 13px; outline: none; background: rgba(255,255,255,0.8); color: var(--ink-mid); cursor: pointer; transition: all 0.2s; }
.search-sort:focus { border-color: var(--green); }
.search-clear { height: 42px; padding: 0 16px; border: 1.5px solid rgba(0,0,0,0.08); border-radius: 10px; background: transparent; font-family: var(--sans); font-size: 13px; color: var(--ink-light); cursor: pointer; transition: all 0.18s; }
.search-clear:hover { color: var(--green-deep); border-color: rgba(7,193,96,0.3); background: rgba(7,193,96,0.05); }
.result-chip { font-size: 12.5px; color: var(--ink-light); margin: 0 4px 14px; min-height: 18px; }
.result-chip b { color: var(--green-deep); font-weight: 600; }

/* ════════════════════════════════════════════════════
   v3.0 新增 · 月度 / 年度汇总
════════════════════════════════════════════════════ */
.month-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px; margin-bottom: 20px; }
.month-toolbar .section-title { font-size: 24px; }
.year-chips { display: flex; gap: 8px; flex-wrap: wrap; background: var(--glass); backdrop-filter: blur(16px); border: 1px solid var(--border); border-radius: 50px; padding: 4px; }
.year-chip { padding: 8px 20px; font-size: 13.5px; font-family: var(--sans); border-radius: 50px; border: none; background: transparent; color: var(--ink-light); cursor: pointer; transition: all 0.2s; }
.year-chip:hover { color: var(--ink-mid); }
.year-chip.active { background: white; color: var(--green-deep); font-weight: 600; box-shadow: 0 2px 10px rgba(0,0,0,0.08); }
.monthly-hero { grid-template-columns: repeat(4, 1fr); }
.chart-wrap-tall { height: 300px; }
.month-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.month-card { background: var(--glass-strong); backdrop-filter: blur(28px); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 22px 24px; transition: transform 0.25s, box-shadow 0.25s; animation: statCardIn 0.45s var(--ease-smooth) both; }
.month-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.month-card-empty { opacity: 0.55; }
.month-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid rgba(0,0,0,0.06); }
.month-name { font-family: var(--serif-display); font-size: 19px; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.month-now { font-size: 10.5px; font-family: var(--sans); color: var(--green-deep); background: rgba(7,193,96,0.10); border: 1px solid rgba(7,193,96,0.22); padding: 2px 9px; border-radius: 50px; font-weight: 500; }
.month-delta { font-size: 12px; font-family: var(--sans); color: var(--ink-light); font-weight: 500; }
.month-delta.up { color: var(--green-deep); }
.month-delta.down { color: #c0392b; }
.month-rows { display: flex; flex-direction: column; gap: 9px; }
.mrow { display: flex; align-items: center; justify-content: space-between; font-size: 13.5px; color: var(--ink-mid); font-family: var(--sans); }
.mrow b { font-size: 14.5px; color: var(--ink); font-weight: 600; }
.mrow b.pos { color: var(--green-deep); }
.mrow b.neg { color: #c0392b; }
.month-none { font-size: 13px; color: var(--ink-light); }

/* ════════════════════════════════════════════════════
   v3.0 · 数据管理新增按钮
════════════════════════════════════════════════════ */
.btn-export-danger { background: transparent !important; color: rgba(255,150,150,0.75) !important; border: 1px solid rgba(224,82,82,0.28) !important; }
.btn-export-danger:hover { background: rgba(224,82,82,0.12) !important; color: #ffb3b3 !important; border-color: rgba(224,82,82,0.5) !important; }

/* ════════════════════════════════════════════════════
   v3.0 新增 · 手机端适配（≤ 820px）
════════════════════════════════════════════════════ */
@media (max-width: 820px) {
  /* ── 头部 ── */
  /* v3.11 修复小屏横向溢出：flex 子项默认 min-width:auto（收缩下限=内容宽），
     同步徽标 + 「记录文章」按钮 + 标题在 ≤380px 屏总宽挤爆 header，右侧按钮被裁且页面可左右滑动；
     全链路放开 min-width:0，空间不足时按比例收缩徽标与标题（ellipsis 兜底），按钮永不裁切 */
  .header-inner { padding: 0 14px; height: 62px; gap: 8px; }
  .logo { gap: 10px; min-width: 0; }
  .logo-avatar-wrap, .logo-avatar, .logo-avatar-default { width: 38px; height: 38px; }
  .logo-avatar-default img { border-radius: 10px; }
  .logo-tagline { display: none; }
  .logo-name { font-size: 16px; white-space: nowrap; max-width: 34vw; overflow: hidden; text-overflow: ellipsis; }
  .logo-text { min-width: 0; }
  .header-actions { gap: 6px; min-width: 0; }
  .header-actions .btn-ghost { display: none; }          /* 小屏收纳：周报面板内仍有入口 */
  .header-actions .btn { padding: 9px 14px; font-size: 13px; flex-shrink: 0; }
  .sync-badge { padding: 6px 10px; font-size: 11px; max-width: 40vw; overflow: hidden; min-width: 0; flex-shrink: 1; }
  .sync-badge .sync-text { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
  /* ≤420px：同步徽标隐去时间只留状态词，360px 主流宽度下 logo 全名 + 徽标 + 按钮三者完整共存 */
  @media (max-width: 420px) {
    .sync-badge { padding: 6px 9px; }
    .sync-badge .sync-time { display: none; }
  }

  /* ── 页面容器 & Tabs ── */
  .page { padding: 18px 14px 96px; }
  .tabs-wrap { width: 100%; overflow-x: auto; border-radius: 16px; margin-bottom: 22px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .tabs-wrap::-webkit-scrollbar { display: none; }
  /* 4 个标签均分一屏放下，不再横向裁切；极窄屏（<330px）回退为可滑动（见文件末尾媒体查询） */
  .tab { flex: 1 1 0; min-width: 0; padding: 10px 6px; font-size: 13.5px; text-align: center; white-space: nowrap; }

  /* ── 总览 ── */
  .stats-hero { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-hero-card { padding: 20px 18px; }
  .stat-value { font-size: 32px; }
  .stat-label { margin-bottom: 10px; font-size: 10px; }
  .stat-sub { margin-top: 8px; font-size: 12px; }
  .layout-cols { grid-template-columns: 1fr; }
  /* 关键：grid 子项默认 min-width:auto 不可收缩，图表 canvas 会撑破窄屏导致右侧被裁 */
  .layout-cols > *, .chart-card, .side-card, .chart-wrap, .chart-head { min-width: 0; max-width: 100%; }
  .chart-wrap canvas { max-width: 100% !important; }
  .chart-card, .side-card { padding: 20px 16px; }
  .chart-head { flex-wrap: wrap; gap: 10px; align-items: center; }
  .chart-title { font-size: 18px; }
  .chart-wrap { height: 220px; }
  .chart-wrap-tall { height: 240px; }

  /* ── 数据管理 ── */
  .export-card { padding: 22px 18px; }

  /* ── 文章记录：表格卡片化 ── */
  .article-toolbar { flex-direction: column; align-items: stretch; gap: 12px; }
  .filter-pills { overflow-x: auto; scrollbar-width: none; justify-content: flex-start; }
  .filter-pills::-webkit-scrollbar { display: none; }
  .filter-pill { flex: 1 0 auto; padding: 9px 16px; text-align: center; }
  .article-searchbar { padding: 10px 12px; gap: 8px; }
  .search-date { flex: 1 1 100%; justify-content: flex-start; }
  .search-date input { flex: 1; min-width: 0; }
  .table-head { display: none; }
  .article-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 8px; padding: 16px 16px; }
  .article-row .art-title { width: 100%; font-size: 15.5px; font-weight: 500; line-height: 1.5; }
  .article-row .art-date { font-size: 12px; margin-right: auto; }
  .article-row .art-actions { margin-left: auto; }
  .empty-tip { padding: 48px 20px; font-size: 14px; }

  /* ── 周报告 ── */
  .week-section-head { flex-direction: column; align-items: stretch; gap: 12px; }
  .section-title { font-size: 20px; }
  .week-section-head .btn { width: 100%; justify-content: center; }
  .week-head { flex-wrap: wrap; padding: 18px 16px; gap: 10px 12px; }
  .week-num { font-size: 13px; min-width: 0; }
  .week-info { flex: 1 1 160px; min-width: 0; }
  .week-name { font-size: 15px; }
  .week-range { font-size: 12px; }
  .week-card-actions { order: 3; margin-left: 0; }
  .expand-btn { display: none; }
  .week-pills { order: 4; width: 100%; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .pill-item { text-align: center; }
  .pill-val { font-size: 18px; }
  .pill-lbl { font-size: 10px; margin-top: 3px; }
  .week-body { padding: 18px 16px; }
  .body-grid { grid-template-columns: 1fr; gap: 26px; }
  .source-layout { grid-template-columns: 116px 1fr; gap: 14px; }
  .donut-wrap { width: 116px; height: 116px; }
  .src-legend { gap: 8px; }
  .src-row { font-size: 13px; }
  .src-val { font-size: 13.5px; }
  .journal-text { font-size: 14.5px; line-height: 1.9; }
  .trend-header { padding: 18px 16px; flex-direction: column; align-items: stretch; }
  .trend-title { font-size: 18px; }
  .trend-controls { flex-direction: column; align-items: stretch; gap: 8px; }
  .ctrl-divider { display: none; }
  .ctrl-group { overflow-x: auto; scrollbar-width: none; }
  .ctrl-group::-webkit-scrollbar { display: none; }
  .ctrl-btn { padding: 9px 14px; flex: 1 0 auto; text-align: center; }
  .trend-custom-range { margin: 0 16px; flex-wrap: wrap; }
  .trend-chart-wrap { padding: 14px; height: 240px; }

  /* ── 月度年度 ── */
  .month-toolbar { flex-direction: column; align-items: stretch; }
  .year-chips { overflow-x: auto; scrollbar-width: none; }
  .year-chip { flex: 1 0 auto; text-align: center; }
  .monthly-hero { grid-template-columns: 1fr 1fr; }
  .month-grid { grid-template-columns: 1fr; gap: 12px; }
  .month-card { padding: 18px 18px; }

  /* ── 弹窗 → 底部抽屉 ── */
  .overlay { align-items: flex-end; padding: 0; }
  .modal { width: 100%; max-width: 100%; max-height: 92vh; border-radius: 22px 22px 0 0; border-bottom: none; padding: 26px 20px calc(22px + env(safe-area-inset-bottom)); animation: sheetUp 0.34s var(--ease-smooth) both; }
  .modal-title { font-size: 21px; margin-bottom: 22px; padding-bottom: 16px; }
  .form-grid { gap: 12px; }
  .form-group { margin-bottom: 16px; }
  .form-input, .form-textarea, .form-select { font-size: 16px; padding: 12px 14px; }   /* 16px 防 iOS 聚焦缩放 */
  .form-divider { margin: 22px 0 14px; }
  .modal-footer { margin-top: 24px; padding-top: 18px; padding-bottom: env(safe-area-inset-bottom); }
  .btn-cancel { min-height: 46px; }
  .btn-save { min-height: 46px; font-size: 15px; }
  .card-preview-modal { max-height: 94vh; padding: 18px; }

  /* ── 其他 ── */
  .btn-back-to-top { right: 16px; bottom: 90px; width: 42px; height: 42px; }
  .gate-card { padding: 36px 24px 28px; }
  .toast-wrap { bottom: calc(20px + env(safe-area-inset-bottom)); width: 100%; max-width: 100%; padding: 0 16px; box-sizing: border-box; }
}

@keyframes sheetUp { from { opacity: 0.6; transform: translateY(48px); } to { opacity: 1; transform: translateY(0); } }

/* 超小屏微调 */
@media (max-width: 360px) {
  .stats-hero { grid-template-columns: 1fr 1fr; }
  .stat-value { font-size: 26px; }
  .week-pills { grid-template-columns: repeat(2, 1fr); gap: 8px; }
}

/* ═══════════════════════════════════════════════════════
   本地模式 UX 增强（js/ux.js）
   A. 首次访问引导卡  B. 备份提醒条
   ═══════════════════════════════════════════════════════ */
.ux-overlay { position: fixed; inset: 0; z-index: 1100; background: rgba(16,22,20,0.46); backdrop-filter: blur(10px) saturate(1.3); -webkit-backdrop-filter: blur(10px) saturate(1.3); display: flex; align-items: center; justify-content: center; padding: 20px; animation: uxFade .35s ease both; }
.ux-overlay.out { animation: uxFadeOut .3s ease both; }
.ux-card { width: min(400px, 100%); max-height: min(86vh, 720px); overflow-y: auto; background: rgba(255,255,255,0.92); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); border: 1px solid rgba(7,193,96,0.14); border-radius: 26px; padding: 34px 30px 24px; text-align: center; box-shadow: 0 24px 80px rgba(10,40,24,0.28); animation: uxPop .45s cubic-bezier(.22,1.4,.36,1) both; font-family: var(--sans); box-sizing: border-box; }
.ux-logo { width: 62px; height: 62px; border-radius: 18px; box-shadow: 0 8px 24px rgba(7,193,96,0.28); margin-bottom: 14px; }
.ux-title { font-size: 19px; font-weight: 800; color: var(--ink); letter-spacing: .02em; }
.ux-sub { font-size: 13px; color: var(--ink-light); line-height: 1.75; margin: 10px 0 18px; }
.ux-sub b { color: #0a9647; }
.ux-point { display: flex; gap: 12px; text-align: left; padding: 11px 12px; border-radius: 14px; background: rgba(7,193,96,0.06); margin-bottom: 8px; }
.ux-n { flex: 0 0 22px; height: 22px; border-radius: 50%; background: linear-gradient(135deg,#07c160,#059a4c); color: #fff; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; margin-top: 2px; }
.ux-point b { display: block; font-size: 13.5px; color: var(--ink); margin-bottom: 2px; }
.ux-point i { font-style: normal; font-size: 12px; color: var(--ink-light); line-height: 1.6; display: block; }
.ux-btn { width: 100%; height: 46px; margin-top: 14px; border: none; border-radius: 14px; background: linear-gradient(135deg,#07c160,#059a4c); color: #fff; font-size: 15px; font-weight: 700; font-family: var(--sans); cursor: pointer; box-shadow: 0 10px 26px rgba(7,193,96,0.35); transition: transform .2s ease, box-shadow .2s ease; }
.ux-btn:active { transform: scale(.97); }
.ux-foot { font-size: 11px; color: var(--ink-light); opacity: .7; margin-top: 12px; }

.ux-banner { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 850; width: min(560px, calc(100vw - 24px)); display: flex; align-items: center; gap: 12px; background: rgba(255,251,240,0.96); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border: 1px solid rgba(180,83,9,0.18); border-radius: 18px; padding: 13px 14px 13px 16px; box-shadow: 0 14px 44px rgba(120,60,10,0.18); animation: uxSlideUp .45s cubic-bezier(.22,1.4,.36,1) both; font-family: var(--sans); box-sizing: border-box; }
.ux-banner.out { animation: uxSlideDown .3s ease both; }
.ux-ico { flex: 0 0 30px; height: 30px; border-radius: 50%; background: rgba(217,119,6,.14); color: #b45309; font-weight: 800; font-size: 17px; display: flex; align-items: center; justify-content: center; }
.ux-banner-txt { flex: 1; font-size: 12.5px; line-height: 1.6; color: #7c4a12; text-align: left; }
.ux-banner-txt b { display: block; font-size: 13.5px; color: #92400e; margin-bottom: 1px; }
.ux-banner-btn { flex-shrink: 0; height: 36px; padding: 0 16px; border: none; border-radius: 11px; background: #b45309; color: #fff; font-size: 13px; font-weight: 600; font-family: var(--sans); cursor: pointer; transition: transform .2s ease; }
.ux-banner-btn:active { transform: scale(.95); }
.ux-banner-x { flex-shrink: 0; width: 30px; height: 30px; border: none; background: transparent; color: #b45309; font-size: 19px; cursor: pointer; opacity: .55; line-height: 1; }
@keyframes uxFade { from { opacity: 0; } }
@keyframes uxFadeOut { to { opacity: 0; } }
@keyframes uxPop { from { opacity: 0; transform: translateY(26px) scale(.94); } }
@keyframes uxSlideUp { from { opacity: 0; transform: translate(-50%, 30px); } }
@keyframes uxSlideDown { to { opacity: 0; transform: translate(-50%, 30px); } }
@media (max-width: 820px) {
  .ux-card { padding: 28px 20px 20px; }
  .ux-banner { flex-wrap: wrap; gap: 10px; }
  .ux-banner-txt { flex: 1 1 calc(100% - 90px); }
}

/* 极窄屏（<330px，如 iPhone SE 1st gen）：tab 回退为可横向滑动 */
@media (max-width: 329px) {
  .tab { flex: 1 0 auto; padding: 10px 14px; font-size: 13px; }
}

/* ══════════════════════════════════════════════════
   v3.3 · 公众号运营指导入口卡（总览页底部）
══════════════════════════════════════════════════ */
.guide-card { margin-top: 20px; background: var(--glass-strong); backdrop-filter: blur(28px); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-md); padding: 24px 28px; display: flex; align-items: center; gap: 18px; cursor: pointer; transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s; position: relative; overflow: hidden; outline: none; }
.guide-card::after { content: ''; position: absolute; right: -40px; top: -40px; width: 150px; height: 150px; border-radius: 50%; background: radial-gradient(circle, rgba(7,193,96,0.13) 0%, transparent 70%); pointer-events: none; }
.guide-card:hover, .guide-card:focus-visible { transform: translateY(-3px); box-shadow: 0 18px 44px rgba(0,0,0,0.10); border-color: rgba(7,193,96,0.38); }
.guide-ico { width: 46px; height: 46px; flex-shrink: 0; border-radius: 13px; background: linear-gradient(135deg, var(--green) 0%, var(--green-deep) 100%); display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 14px rgba(7,193,96,0.28); }
.guide-ico svg { width: 23px; height: 23px; display: block; }
.guide-txt { flex: 1; min-width: 0; }
.guide-txt b { display: block; font-family: var(--serif-display); font-size: 17px; font-weight: 500; color: var(--ink); letter-spacing: 0.02em; }
.guide-txt i { display: block; font-style: normal; font-size: 12.5px; color: var(--ink-light); margin-top: 4px; }
.guide-arrow { font-size: 20px; color: var(--green); flex-shrink: 0; transition: transform 0.25s; line-height: 1; }
.guide-card:hover .guide-arrow { transform: translateX(4px); }

/* ══════════════════════════════════════════════════
   v3.3 · 云端数据说明弹窗
══════════════════════════════════════════════════ */
.ci-block { margin-bottom: 20px; }
.ci-h { font-size: 15px; font-weight: 600; color: var(--ink); margin-bottom: 10px; }
.ci-p { font-size: 13.5px; line-height: 1.8; color: var(--ink-mid); margin: 0 0 8px; }
.ci-row { display: flex; gap: 12px; padding: 9px 0; border-bottom: 1px dashed rgba(0,0,0,0.07); font-size: 13px; align-items: baseline; }
.ci-row:last-of-type { border-bottom: none; }
.ci-row b { flex-shrink: 0; color: var(--green-deep); min-width: 82px; font-weight: 600; }
.ci-row span { color: var(--ink-mid); line-height: 1.65; }
.ci-copy { width: 100%; margin-top: 12px; padding: 11px; border-radius: 50px; border: 1px dashed rgba(7,193,96,0.5); background: rgba(7,193,96,0.06); color: var(--green-deep); font-size: 13px; cursor: pointer; transition: all 0.2s; }
.ci-copy:hover { background: rgba(7,193,96,0.13); }
.ci-foot { font-size: 11.5px; color: var(--ink-light); text-align: center; margin-top: 2px; }

@media (max-width: 820px) {
  .guide-card { padding: 18px 20px; gap: 14px; border-radius: 16px; }
  .guide-ico { width: 40px; height: 40px; border-radius: 11px; }
  .guide-ico svg { width: 20px; height: 20px; }
  .guide-txt b { font-size: 15.5px; }
  .guide-txt i { font-size: 12px; }
  .ci-row { flex-direction: column; gap: 2px; }
  .ci-row b { min-width: 0; }
}

/* ══════════════════════════════════════════════════
   v3.8 · 统计洞察页
══════════════════════════════════════════════════ */
.insights-sub { font-family: var(--serif-display); font-size: 19px; font-weight: 400; color: var(--ink); margin: 8px 0 14px; display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.insights-note { font-family: var(--sans); font-size: 12px; color: var(--ink-light); letter-spacing: 0.02em; }
.ins-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 26px; }
.stat-hero-card.sm { padding: 22px 20px; }
.ins-grid .stat-hero-card .stat-value { font-size: 27px; }
.ins-grid .stat-hero-card .stat-sub { font-size: 11.5px; }
.ins-grid .stat-hero-card:nth-child(5) { animation-delay: 0.42s; }
.ins-grid .stat-hero-card:nth-child(6) { animation-delay: 0.50s; }
.ins-grid .stat-hero-card:nth-child(7) { animation-delay: 0.58s; }
.ins-grid .stat-hero-card:nth-child(8) { animation-delay: 0.66s; }
.stat-title-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.cols-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; margin-bottom: 4px; }
.cols-2 .chart-card { margin-bottom: 20px; }
.ins-foot { font-size: 11.5px; color: var(--ink-light); line-height: 1.7; margin-top: 2px; padding: 0 4px; }

/* 单篇 TOP10 榜单 */
.rk-row { display: flex; align-items: center; gap: 14px; padding: 13px 4px; border-bottom: 1px dashed rgba(0,0,0,0.07); }
.rk-row:last-child { border-bottom: none; }
.rk-rank { flex: 0 0 30px; height: 30px; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; background: rgba(0,0,0,0.05); color: var(--ink-mid); font-family: var(--sans); }
.rk-rank.rk-1 { background: linear-gradient(135deg, #ffb74d, #f59e0b); color: #fff; box-shadow: 0 3px 10px rgba(245,158,11,0.35); }
.rk-rank.rk-2 { background: linear-gradient(135deg, #b0bec5, #78909c); color: #fff; }
.rk-rank.rk-3 { background: linear-gradient(135deg, #e0a678, #bc8a5f); color: #fff; }
.rk-main { flex: 1; min-width: 0; }
.rk-title { font-size: 14px; font-weight: 500; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rk-date { font-size: 11.5px; color: var(--ink-light); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rk-right { flex: 0 0 128px; text-align: right; }
.rk-val { font-family: var(--serif-display); font-size: 19px; color: var(--green-deep); }
.rk-bar { height: 4px; background: rgba(0,0,0,0.06); border-radius: 2px; margin-top: 5px; overflow: hidden; }
.rk-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--green), var(--green-deep)); border-radius: 2px; }

/* 快速补录弹窗 */
.qf-tip { font-size: 13px; color: var(--ink-light); margin-bottom: 10px; line-height: 1.7; }
.qf-tip b { color: var(--green-deep); font-weight: 600; }
.qf-progress { height: 6px; background: rgba(0,0,0,0.06); border-radius: 3px; overflow: hidden; margin-bottom: 14px; }
.qf-progress-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--green), var(--green-deep)); border-radius: 3px; transition: width 0.3s; }
.qf-list { max-height: 52vh; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; padding-right: 2px; }
.qf-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid rgba(0,0,0,0.05); border-radius: 12px; background: rgba(255,255,255,0.6); }
.qf-info { flex: 1; min-width: 0; }
.qf-title { font-size: 13.5px; color: var(--ink); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qf-date { font-size: 11.5px; color: var(--ink-light); margin-top: 2px; }
.qf-input { width: 110px; flex-shrink: 0; height: 38px; border: 1.5px solid rgba(0,0,0,0.08); border-radius: 9px; padding: 0 10px; font-family: var(--sans); font-size: 14px; color: var(--ink-mid); outline: none; background: white; transition: border-color 0.2s; }
.qf-input:focus { border-color: var(--green); }
.qf-input::placeholder { color: rgba(132,146,166,0.55); }

/* 文章表格阅读量列 */
.art-reads { font-family: var(--serif-display); font-size: 15.5px; color: var(--ink-mid); }

@media (max-width: 1100px) {
  .cols-2 { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .ins-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-hero-card.sm { padding: 18px 16px; }
  .ins-grid .stat-hero-card .stat-value { font-size: 24px; }
  .rk-right { flex: 0 0 92px; }
  .rk-val { font-size: 17px; }
  .qf-list { max-height: 46vh; }
}
@media (max-width: 640px) {
  .ins-grid { grid-template-columns: 1fr 1fr; }
}
