/* ===== 设计变量：亮色主题（毛玻璃半透明）===== */
:root {
  --bg: #f5f0ff;
  --surface: rgba(255, 255, 255, 0.65);
  --surface-2: rgba(244, 244, 255, 0.45);
  --text: #1a1a2e;
  --text-soft: #5b5b70;
  --text-faint: #9a9ab0;
  --accent: #5b5bd6;
  --accent-soft: rgba(91, 91, 214, 0.12);
  --border: rgba(180, 175, 210, 0.3);
  --radius: 18px;
  --shadow: 0 2px 6px rgba(20,20,50,.04), 0 8px 32px rgba(20,20,50,.06);
  --maxw: 1180px;
  --pre-bg: rgba(26, 26, 46, 0.88);
  --pre-fg: #e4e4f0;
  --quote-border: #5b5bd6;
  --quote-bg: rgba(91, 91, 214, 0.06);
  --glass-blur: 14px;
}

/* 强制 [hidden] 属性始终生效 */
[hidden] { display: none !important; }

/* ===== 暗色主题 ===== */
[data-theme="dark"] {
  --bg: #0d0d18;
  --surface: rgba(26, 26, 46, 0.62);
  --surface-2: rgba(36, 36, 64, 0.42);
  --text: #e4e4f0;
  --text-soft: #a0a0c0;
  --text-faint: #6b6b88;
  --accent: #8f8fff;
  --accent-soft: rgba(143, 143, 255, 0.12);
  --border: rgba(80, 75, 110, 0.3);
  --shadow: 0 2px 6px rgba(0,0,0,.3), 0 8px 32px rgba(0,0,0,.45);
  --pre-bg: rgba(13, 13, 26, 0.9);
  --pre-fg: #d4d4e0;
  --quote-border: #8f8fff;
  --quote-bg: rgba(143, 143, 255, 0.06);
}
}
[data-theme="dark"] .btn-submit, [data-theme="dark"] .btn-publish, [data-theme="dark"] .back-top { color: #fff; }

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

/* 背景渐变（供毛玻璃模糊穿透） */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(ellipse 80% 60% at 20% 20%, rgba(91, 91, 214, 0.08), transparent),
    radial-gradient(ellipse 60% 50% at 80% 80%, rgba(255, 122, 77, 0.06), transparent),
    radial-gradient(ellipse 50% 40% at 60% 30%, rgba(255, 214, 77, 0.05), transparent),
    linear-gradient(180deg, #f8f5ff 0%, #f3f0fb 40%, #f7f4f9 100%);
}
[data-theme="dark"] body::before {
  background:
    radial-gradient(ellipse 80% 60% at 20% 20%, rgba(143, 143, 255, 0.06), transparent),
    radial-gradient(ellipse 60% 50% at 80% 80%, rgba(255, 122, 77, 0.04), transparent),
    radial-gradient(ellipse 50% 40% at 60% 30%, rgba(255, 214, 77, 0.03), transparent),
    linear-gradient(180deg, #0d0d18 0%, #101020 40%, #0e0e1a 100%);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--text); line-height: 1.7;
  -webkit-font-smoothing: antialiased; transition: background .35s ease, color .35s ease;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; border-radius: 10px; display: block; }

/* ===== 毛玻璃通用效果 ===== */
.sidebar, .card, .modal, .lunar-clock, .user-chip, .btn-auth, .chip,
.back-btn, .search-box input, .compose-meta input, .compose-panels textarea,
.compose-preview, .compose-panels input, .perk, .archive-item {
  -webkit-backdrop-filter: blur(var(--glass-blur));
  backdrop-filter: blur(var(--glass-blur));
}

/* ===== 布局 ===== */
.layout { display: grid; grid-template-columns: 280px 1fr; min-height: 100vh; max-width: var(--maxw); margin: 0 auto; }

/* ===== 侧边栏 ===== */
.sidebar { padding: 40px 28px; border-right: 1px solid var(--border); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; transition: transform .3s ease; }
.hamburger { display: none; background: none; border: none; font-size: 24px; cursor: pointer; color: var(--text); margin-left: auto; }
.theme-toggle { background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 6px 10px; cursor: pointer; font-size: 16px; transition: background .15s; }
.theme-toggle:hover { background: var(--accent-soft); }
.sidebar-overlay { display: none; }

.brand { display: flex; align-items: center; gap: 14px; margin-bottom: 40px; }
.avatar { width: 46px; height: 46px; border-radius: 14px; background: linear-gradient(135deg, #5b5bd6, #8a5bff); color: #fff; font-size: 20px; font-weight: 700; display: grid; place-items: center; box-shadow: var(--shadow); }
.brand-text h1 { font-size: 18px; font-weight: 700; }
.brand-text p { font-size: 13px; color: var(--text-faint); }

.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-link { padding: 10px 14px; border-radius: 10px; font-size: 15px; color: var(--text-soft); transition: background .18s, color .18s; }
.nav-link:hover { background: var(--surface-2); color: var(--text); }
.nav-link.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

.sidebar-footer { margin-top: auto; font-size: 12px; color: var(--text-faint); display: flex; align-items: center; gap: 8px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #34c759; box-shadow: 0 0 0 3px rgba(52,199,89,.18); }

/* ===== 主内容 ===== */
.content { padding: 48px 56px; min-width: 0; }
.view { display: none; animation: fade .35s ease; }
.view.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; margin-bottom: 28px; }
.hero-text { max-width: 62%; }
.hero h2 { font-size: 30px; font-weight: 800; letter-spacing: -.5px; }
.hero p { color: var(--text-soft); margin-top: 8px; font-size: 16px; }
.hero-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; text-align: right; }

.lunar-clock {
  display: inline-flex; align-items: baseline; gap: 6px; margin-top: 16px;
  padding: 8px 14px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 999px; font-size: 14px; color: var(--text-soft); box-shadow: var(--shadow);
  font-variant-numeric: tabular-nums;
}
.lunar-clock strong { color: var(--accent); font-weight: 700; }
.lunar-clock .lunar-time { color: var(--text-faint); font-size: 12px; letter-spacing: .5px; }

/* ===== 搜索 ===== */
.search-box { margin-top: 14px; }
.search-box input {
  width: 100%; max-width: 340px; padding: 11px 16px; font-size: 14px;
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); color: var(--text); font-family: inherit;
  transition: border-color .2s, box-shadow .2s;
}
.search-box input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search-box input::placeholder { color: var(--text-faint); }

.write-hint { font-size: 13px; color: var(--text-faint); }

.page-head { margin-bottom: 28px; }
.page-head h2 { font-size: 26px; font-weight: 800; }
.page-head p { color: var(--text-soft); margin-top: 6px; }

/* ===== 卡片网格 ===== */
.card-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; cursor: pointer; display: flex; flex-direction: column;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.card:hover { transform: translateY(-5px); box-shadow: var(--shadow); border-color: transparent; }
.card-cover { height: 168px; background-size: cover; background-position: center; position: relative; }
.card-cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, rgba(0,0,0,.16)); }
.card-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 9px; flex: 1; }
.card-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 12px; color: var(--text-faint); }
.card h3 { font-size: 18px; font-weight: 700; line-height: 1.4; }
.card p { color: var(--text-soft); font-size: 14px; line-height: 1.6; flex: 1; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; font-size: 12px; color: var(--text-faint); }
.card-go { color: var(--accent); font-weight: 600; }
.tag { background: var(--accent-soft); color: var(--accent); padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }

/* ===== 归档 ===== */
.archive-list { display: flex; flex-direction: column; gap: 2px; }
.archive-item { display: flex; align-items: baseline; gap: 18px; padding: 14px 4px; border-bottom: 1px dashed var(--border); cursor: pointer; transition: color .15s; }
.archive-item:hover { color: var(--accent); }
.archive-date { font-size: 13px; color: var(--text-faint); min-width: 84px; font-variant-numeric: tabular-nums; }
.archive-title { font-size: 16px; font-weight: 500; }

/* ===== 文章详情与排版美化 ===== */
.back-btn { background: var(--surface); border: 1px solid var(--border); padding: 8px 16px; border-radius: 10px; cursor: pointer; font-size: 14px; color: var(--text-soft); margin-bottom: 28px; transition: background .15s; }
.back-btn:hover { background: var(--surface-2); }
.post-detail h2 { font-size: 28px; font-weight: 800; letter-spacing: -.5px; margin-bottom: 12px; }
.post-detail .post-meta { margin-bottom: 28px; }

.prose { font-size: 16px; line-height: 1.85; color: var(--text); }
.prose h2 { font-size: 24px; font-weight: 800; margin: 34px 0 14px; letter-spacing: -.3px; }
.prose h3 { font-size: 20px; font-weight: 700; margin: 28px 0 10px; }
.prose p { margin-bottom: 18px; color: var(--text-soft); }
.prose code { background: var(--surface-2); padding: 2px 8px; border-radius: 6px; font-family: "SF Mono", Consolas, "Cascadia Code", monospace; font-size: 14px; color: var(--accent); }
.prose pre { background: var(--pre-bg); color: var(--pre-fg); padding: 20px 22px; border-radius: 12px; overflow-x: auto; margin: 18px 0; font-size: 14px; border: 1px solid var(--border); }
.prose pre code { background: none; color: inherit; padding: 0; border-radius: 0; }
.prose blockquote { margin: 18px 0; padding: 14px 20px; border-left: 4px solid var(--quote-border); background: var(--quote-bg); border-radius: 0 10px 10px 0; color: var(--text-soft); font-style: italic; }
.prose blockquote p { margin-bottom: 6px; }
.prose ul, .prose ol { margin: 0 0 18px 22px; color: var(--text-soft); }
.prose li { margin-bottom: 6px; }
.prose strong { color: var(--text); font-weight: 800; }
.prose img { border-radius: 12px; margin: 16px 0; box-shadow: var(--shadow); }
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.prose a:hover { text-decoration-thickness: 2px; }

/* ===== 轮播 ===== */
.slider { position: relative; margin-bottom: 26px; border-radius: 20px; overflow: hidden; box-shadow: var(--shadow); height: 300px; background: var(--surface-2); }
.slides { position: relative; height: 100%; }
.slide { position: absolute; inset: 0; opacity: 0; pointer-events: none; background-size: cover; background-position: center; transition: opacity .6s ease; display: flex; align-items: flex-end; }
.slide.active { opacity: 1; pointer-events: auto; }
.slide-overlay { width: 100%; padding: 32px 34px; color: #fff; background: linear-gradient(180deg, transparent 28%, rgba(0,0,0,.62)); }
.slide-tag { display: inline-block; background: rgba(255,255,255,.22); color: #fff; padding: 3px 12px; border-radius: 999px; font-size: 12px; font-weight: 600; margin-bottom: 10px; -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.slide-title { font-size: 26px; font-weight: 800; letter-spacing: -.5px; margin-bottom: 8px; text-shadow: 0 2px 14px rgba(0,0,0,.4); }
.slide-summary { font-size: 15px; max-width: 640px; opacity: .92; margin-bottom: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.slide-read { background: #fff; color: var(--text); border: none; cursor: pointer; padding: 9px 18px; border-radius: 999px; font-size: 14px; font-weight: 600; transition: transform .15s; }
.slide-read:hover { transform: translateX(3px); }
.slider-arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border-radius: 50%; border: none; cursor: pointer; background: rgba(255,255,255,.85); color: var(--text); font-size: 22px; line-height: 1; display: grid; place-items: center; box-shadow: var(--shadow); transition: background .15s; }
.slider-arrow:hover { background: #fff; }
.slider-arrow.prev { left: 14px; }
.slider-arrow.next { right: 14px; }
.slider-dots { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; }
.slider-dots .dot { width: 8px; height: 8px; border-radius: 50%; border: none; cursor: pointer; padding: 0; background: rgba(255,255,255,.5); transition: all .2s; }
.slider-dots .dot.active { background: #fff; width: 22px; border-radius: 999px; }

/* ===== 分类筛选 ===== */
.filter-bar { display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 16px; margin-bottom: 6px; scrollbar-width: thin; }
.filter-bar::-webkit-scrollbar { height: 6px; }
.filter-bar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 999px; }
.chip { flex: 0 0 auto; padding: 7px 16px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); font-size: 13px; color: var(--text-soft); cursor: pointer; white-space: nowrap; transition: all .15s; }
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ===== 返回顶部 ===== */
.back-top { position: fixed; right: 24px; bottom: 24px; width: 46px; height: 46px; border-radius: 50%; border: none; cursor: pointer; z-index: 50; background: var(--accent); color: #fff; font-size: 20px; line-height: 1; box-shadow: 0 8px 22px rgba(91,91,214,.36); opacity: 0; pointer-events: none; transform: translateY(10px); transition: opacity .25s, transform .25s; }
.back-top.show { opacity: 1; pointer-events: auto; transform: none; }
.back-top:hover { transform: translateY(-2px); }

/* ===== 认证表单/按钮 ===== */
.btn-auth { display: inline-flex; align-items: center; gap: 6px; background: var(--surface); color: var(--accent); border: 1px solid var(--accent); border-radius: 999px; padding: 11px 20px; font-size: 15px; font-weight: 600; cursor: pointer; transition: background .18s, color .18s, transform .18s; }
.btn-auth:hover { background: var(--accent); color: #fff; transform: translateY(-2px); }
.user-chip { display: inline-flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 6px 14px; font-size: 14px; color: var(--text); }
.user-avatar { width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 13px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.link-btn { background: none; border: none; color: var(--text-faint); cursor: pointer; font-size: 13px; text-decoration: underline; padding: 0; }
.link-btn:hover { color: var(--accent); }

.modal-mask { position: fixed; inset: 0; background: rgba(20,20,35,.5); display: flex; align-items: center; justify-content: center; z-index: 100; backdrop-filter: blur(3px); animation: fadeIn .2s ease; }
.modal-mask[hidden] { display: none; }
@keyframes fadeIn { from{opacity:0} to{opacity:1} }
.modal { position: relative; width: min(420px, 92vw); background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 28px 26px 24px; box-shadow: var(--shadow); animation: popIn .22s ease; }
@keyframes popIn { from{transform:translateY(12px) scale(.98);opacity:0} to{transform:none;opacity:1} }
.modal-close { position: absolute; top: 12px; right: 14px; border: none; background: none; font-size: 24px; line-height: 1; color: var(--text-faint); cursor: pointer; }
.modal-close:hover { color: var(--text); }
.tabs { display: flex; gap: 8px; margin-bottom: 18px; }
.tab { flex: 1; padding: 10px; border: 1px solid var(--border); background: var(--surface-2); border-radius: 10px; cursor: pointer; font-size: 15px; font-weight: 600; color: var(--text-soft); transition: all .18s; }
.tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.auth-form { display: none; flex-direction: column; gap: 14px; }
.auth-form.active { display: flex; }
.auth-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-soft); }
.auth-form input { padding: 11px 13px; border: 1px solid var(--border); border-radius: 10px; font-size: 15px; background: var(--surface-2); color: var(--text); }
.auth-form input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.btn-submit { padding: 12px; border: none; border-radius: 10px; cursor: pointer; background: var(--accent); color: #fff; font-size: 15px; font-weight: 700; transition: filter .18s; }
.btn-submit:hover { filter: brightness(1.06); }
.btn-submit:disabled { opacity: .6; cursor: not-allowed; }
.form-msg { font-size: 13px; color: var(--text-faint); min-height: 16px; margin: 0; }
.form-msg.err { color: #d6453d; }
.form-msg.ok { color: #2d8a4e; }

/* ===== 会员 ===== */
.member-gate { border: 1px dashed var(--border); border-radius: var(--radius); padding: 32px; text-align: center; color: var(--text-soft); }
.member-gate .btn-auth { margin-top: 16px; }
.member-welcome { display: flex; flex-direction: column; gap: 18px; }
.member-card { display: flex; align-items: center; gap: 16px; }
.member-avatar { width: 56px; height: 56px; border-radius: 50%; flex: 0 0 auto; background: var(--accent); color: #fff; font-size: 24px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.member-card h3 { font-size: 20px; }
.member-sub { color: var(--text-faint); font-size: 14px; margin-top: 2px; }
.member-perks { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.perk { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; font-size: 15px; color: var(--text); }
.member-note { color: var(--text-faint); font-size: 14px; }

/* ===== 发布按钮 ===== */
.btn-publish-sm { padding: 5px 14px; border: 1px solid var(--accent); border-radius: 999px; cursor: pointer; font-size: 13px; font-weight: 600; background: var(--accent-soft); color: var(--accent); transition: all .18s; }
.btn-publish-sm:hover { background: var(--accent); color: #fff; }
.btn-publish { align-self: flex-start; padding: 12px 28px; border: none; border-radius: 12px; cursor: pointer; font-size: 16px; font-weight: 700; background: var(--accent); color: #fff; transition: filter .18s; }
.btn-publish:hover { filter: brightness(1.06); }

/* ===== 全屏写作页 ===== */
.view-compose .back-btn { margin-bottom: 18px; }
.compose-full { display: flex; flex-direction: column; gap: 16px; height: calc(100vh - 120px); min-height: 500px; }
.compose-meta { display: flex; flex-direction: column; gap: 10px; flex-shrink: 0; }
.compose-meta input { padding: 11px 14px; border: 1px solid var(--border); border-radius: 10px; font-size: 15px; background: var(--surface-2); color: var(--text); font-family: inherit; transition: border-color .2s; }
.compose-meta input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
#composeTitle { font-size: 20px; font-weight: 700; }
.compose-row { display: flex; gap: 10px; flex-wrap: wrap; }
.compose-row input { flex: 1; min-width: 150px; }
.compose-panels { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; flex: 1; min-height: 0; }
.compose-editor { display: flex; flex-direction: column; }
.editor-toolbar {
  display: flex; gap: 4px; padding: 8px 10px; flex-shrink: 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius) var(--radius) 0 0;
  border-bottom: none; -webkit-backdrop-filter: blur(var(--glass-blur)); backdrop-filter: blur(var(--glass-blur));
}
.editor-toolbar button {
  width: 32px; height: 32px; border: 1px solid transparent; border-radius: 6px;
  cursor: pointer; font-size: 14px; font-weight: 700; display: flex; align-items: center; justify-content: center;
  background: transparent; color: var(--text-soft); transition: all .15s;
}
.editor-toolbar button:hover { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.compose-editor textarea {
  width: 100%; height: 100%; resize: none; padding: 18px 20px;
  border: 1px solid var(--border); border-radius: 0 0 var(--radius) var(--radius);
  font-size: 15px; line-height: 1.8; font-family: inherit;
  background: var(--surface); color: var(--text);
  transition: border-color .2s;
  -webkit-backdrop-filter: blur(var(--glass-blur)); backdrop-filter: blur(var(--glass-blur));
}
.compose-editor textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.compose-preview { overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 24px; }
.compose-actions { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.compose-actions .btn-submit { padding: 12px 32px; }

/* ===== 骨架屏 ===== */
.skeleton { background: linear-gradient(90deg, var(--surface-2) 25%, #eaeaef 37%, var(--surface-2) 63%); background-size: 400% 100%; animation: shimmer 1.3s ease infinite; border-radius: 8px; }
@keyframes shimmer { from{background-position:100% 0} to{background-position:-100% 0} }
.sk-card { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.sk-card .sk-cover { height: 168px; }
.sk-card .sk-line { height: 14px; margin: 14px 20px 0; }
.sk-card .sk-line.short { width: 50%; margin-bottom: 18px; }

/* ===== 响应式增强 ===== */
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; height: 100vh; width: 260px; transform: translateX(-100%); z-index: 90; border-right: 1px solid var(--border); border-bottom: none; flex-direction: column; padding: 24px 20px; overflow-y: auto; }
  .sidebar.open { transform: translateX(0); }
  .hamburger { display: block; }
  .sidebar-overlay { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 89; }
  .sidebar-overlay[hidden] { display: none; }
  .sidebar-footer { margin-top: 20px; }
  .content { padding: 20px 16px; }
  .hero-text { max-width: 100%; }
  .hero { flex-direction: column; align-items: stretch; }
  .hero-actions { align-items: flex-start; text-align: left; }
  .card-grid { grid-template-columns: 1fr; }
  .slider { height: 220px; }
  .slide-title { font-size: 20px; }
  .slide-overlay { padding: 20px 18px; }
  .compose-panels { grid-template-columns: 1fr; }
  .compose-preview { max-height: 300px; }
  .compose-row { flex-direction: column; }
}

/* ===== 卡通角色登录框 ===== */
.modal-auth { width: min(720px, 96vw); padding: 0; overflow: hidden; display: grid; grid-template-columns: 320px 1fr; gap: 0; min-height: 480px; }
[data-theme="dark"] .modal-auth { background: var(--surface); }
.auth-side { background: linear-gradient(160deg, #eceaff 0%, #d8d2ff 100%); padding: 24px; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; }
[data-theme="dark"] .auth-side { background: linear-gradient(160deg, #2a2a50 0%, #1e1e3a 100%); }
.auth-side .modal-close { color: var(--text); z-index: 2; }
.chars-stage { position: relative; width: 100%; height: 280px; flex-shrink: 0; }
.char { position: absolute; transition: transform .35s cubic-bezier(.34,1.56,.64,1); animation: char-breathe 3s ease-in-out infinite; }
.char:hover { animation-play-state: paused; }
@keyframes char-breathe { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(1.02); } }

.char-orange { left: 6px; bottom: 20px; width: 110px; animation-delay: 0s; }
.char-purple { left: 100px; top: 30px; width: 70px; animation-delay: .4s; }
.char-black { left: 160px; bottom: 30px; width: 56px; animation-delay: .8s; }
.char-yellow { right: 16px; bottom: 30px; width: 88px; animation-delay: 1.2s; }

.char-svg { width: 100%; height: auto; display: block; overflow: visible; }
.char .eyes { transition: transform .15s; }
.char .pupil { transition: transform .12s ease-out; }
.char .mouth { transition: d .2s ease, opacity .2s; }
.char .tongue { opacity: 0; transition: opacity .2s, transform .2s; transform: translateY(4px); }
.char .cheek { transition: opacity .2s; opacity: 0; }

/* 自然眨眼 */
.char .eye-bg { transform-origin: center; animation: blink 4.5s ease-in-out infinite; }
@keyframes blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }

/* 状态：idle（默认） */
.char-orange .mouth { d: path("M 38 47 Q 50 56 62 47"); }
.char-purple .mouth { d: path("M 28 62 Q 40 70 52 62"); }
.char-black .mouth { stroke-dasharray: 0; }
.char-yellow .mouth { d: path("M 35 64 Q 50 72 65 64"); }

/* 状态：聚焦用户名/邮箱（伸出舌头、脸红） */
.modal-auth[data-state="email"] .char .tongue { opacity: 1; transform: translateY(0); }
.modal-auth[data-state="email"] .char .cheek { opacity: .85; }
.modal-auth[data-state="email"] .char-orange .mouth { d: path("M 36 48 Q 50 62 64 48"); }
.modal-auth[data-state="email"] .char-orange { transform: translateY(-4px) scaleY(1.03); }
.modal-auth[data-state="email"] .char-purple { transform: rotate(-3deg) translateY(-2px); }
.modal-auth[data-state="email"] .char-yellow { transform: scale(1.05); }

/* 状态：聚焦密码（惊讶，圆眼） */
.modal-auth[data-state="password"] .char .eyes { transform: scale(1.15); }
.modal-auth[data-state="password"] .char-orange .mouth { d: path("M 40 50 Q 50 50 60 50"); }
.modal-auth[data-state="password"] .char-purple .mouth { d: path("M 30 64 Q 40 64 50 64"); }
.modal-auth[data-state="password"] .char-black .mouth { d: path("M 35 70 Q 41 78 47 70"); stroke-width: 3; }
.modal-auth[data-state="password"] .char-yellow .mouth { d: path("M 35 62 Q 50 62 65 62"); }
.modal-auth[data-state="password"] .char-black { transform: scale(1.08); animation-duration: 1.2s; }

/* 状态：登录失败（捂嘴+闭眼） */
.modal-auth[data-state="error"] .char { animation: char-shake .4s ease-in-out 2; }
.modal-auth[data-state="error"] .char .eye-bg { animation: none; transform: scaleY(.1); }
.modal-auth[data-state="error"] .char-orange .mouth { d: path("M 40 48 L 60 48"); }
.modal-auth[data-state="error"] .char-purple .mouth { d: path("M 32 60 L 48 60"); }
.modal-auth[data-state="error"] .char-black .mouth { d: path("M 35 70 L 47 70"); }
.modal-auth[data-state="error"] .char-yellow .mouth { d: path("M 38 60 L 62 60"); }
@keyframes char-shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }

/* 状态：登录成功（兴奋跳跃+眼睁大） */
.modal-auth[data-state="success"] .char { animation: char-jump .6s ease-in-out 2; }
.modal-auth[data-state="success"] .char .eyes { transform: scale(1.3); }
.modal-auth[data-state="success"] .char .cheek { opacity: .9; }
.modal-auth[data-state="success"] .char-orange .mouth { d: path("M 36 46 Q 50 64 64 46"); }
.modal-auth[data-state="success"] .char-purple .mouth { d: path("M 26 60 Q 40 76 54 60"); }
.modal-auth[data-state="success"] .char-black .mouth { d: path("M 33 68 Q 41 82 49 68"); stroke-width: 3; }
.modal-auth[data-state="success"] .char-yellow .mouth { d: path("M 33 62 Q 50 80 67 62"); }
@keyframes char-jump { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }

.chars-quote { margin-top: 18px; font-size: 14px; color: var(--text-soft); text-align: center; transition: opacity .3s; min-height: 20px; font-weight: 500; }

/* 右侧表单 */
.auth-content { padding: 36px 36px 28px; display: flex; flex-direction: column; gap: 14px; }
.auth-title { font-size: 22px; font-weight: 800; letter-spacing: -.3px; }
.auth-subtitle { font-size: 14px; color: var(--text-soft); margin-top: -6px; margin-bottom: 4px; }
.auth-content .tabs { margin-bottom: 4px; }
.auth-form { display: none; flex-direction: column; gap: 12px; }
.auth-form.active { display: flex; }
.auth-form label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--text-soft); font-weight: 500; }
.auth-form input[type="text"], .auth-form input[type="password"], .auth-form input[type="email"] { padding: 11px 13px; border: 1px solid var(--border); border-radius: 10px; font-size: 15px; background: var(--surface-2); color: var(--text); transition: border-color .2s, box-shadow .2s; }
.auth-form input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.auth-row { display: flex; justify-content: space-between; align-items: center; font-size: 13px; }
.remember { flex-direction: row !important; align-items: center; gap: 6px !important; color: var(--text-soft) !important; font-weight: 400 !important; }
.remember input { width: 14px; height: 14px; accent-color: var(--accent); }
.forgot { color: var(--accent); }
.forgot:hover { text-decoration: underline; }
.social-row { margin-top: 6px; font-size: 13px; color: var(--text-soft); display: flex; align-items: center; gap: 10px; }
.social-link { width: 32px; height: 32px; border-radius: 50%; background: var(--surface-2); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; color: var(--text-soft); transition: background .15s, color .15s; }
.social-link:hover { background: var(--accent); color: #fff; }

@media (max-width: 640px) {
  .modal-auth { grid-template-columns: 1fr; min-height: auto; }
  .auth-side { padding: 16px; min-height: 180px; }
  .chars-stage { height: 140px; }
  .char-orange { width: 76px; } .char-purple { width: 50px; top: 12px; left: 76px; } .char-black { width: 42px; left: 120px; } .char-yellow { width: 60px; right: 10px; }
  .chars-quote { display: none; }
  .auth-content { padding: 24px 20px; }
}