/* Alexander Console：日间 / 夜间双主题 + 毛玻璃现代 UI
 * 设计语言：半透明、有层次感；1px 细边框；6px 直角；暗红 #b91c1c 系强调；
 * backdrop-filter 毛玻璃卡片；清新不冷峻，动效细腻。
 * 注意：登录页样式在文件后半段原样保留，这里只管登录后的控制台内页。
 */
:root {
  --teal: hsl(0, 62%, 38%);
  --teal-dark: hsl(0, 62%, 28%);
  --teal-light: hsl(0, 55%, 93%);
  --accent: #b91c1c;
  --accent-dark: #991b1b;
  --accent-gradient: linear-gradient(135deg, #dc2626, #b91c1c);
  --accent-gradient-hover: linear-gradient(135deg, #b91c1c, #991b1b);
  --radius: 6px;
}
/* ---------- 日间主题 ---------- */
[data-theme="light"] {
  color-scheme: light;
  --page-bg: #eef2f7;
  --card-bg: rgba(255, 255, 255, .72);
  --card-border: rgba(15, 23, 42, .1);
  --text: #1e293b;
  --text-dim: #64748b;
  --input-bg: rgba(255, 255, 255, .85);
  --veil: rgba(255, 255, 255, .35);
  --topbar-bg: rgba(255, 255, 255, .75);
  --shadow: 0 8px 24px rgba(15, 23, 42, .08);
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, .06);
  --code-bg: rgba(15, 23, 42, .05);
  --mark-bg: rgba(185, 28, 28, .14);
  --heat-empty: #e5e7eb;
}
/* ---------- 夜间主题 ---------- */
[data-theme="dark"] {
  color-scheme: dark;
  --page-bg: #0b0f1a;
  --card-bg: rgba(17, 24, 39, .72);
  --card-border: rgba(255, 255, 255, .12);
  --text: #e5e7eb;
  --text-dim: #9ca3af;
  --input-bg: rgba(255, 255, 255, .06);
  --veil: rgba(10, 12, 20, .55);
  --topbar-bg: rgba(17, 24, 39, .75);
  --shadow: 0 8px 24px rgba(0, 0, 0, .35);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, .25);
  --code-bg: rgba(255, 255, 255, .07);
  --mark-bg: rgba(248, 113, 113, .22);
  --heat-empty: rgba(255, 255, 255, .08);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--text);
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 15px; line-height: 1.6;
  background-color: var(--page-bg);
}
/* 控制台内页背景轮换层（两层交替淡入淡出） */
.bg-layer {
  position: fixed; inset: 0; z-index: 0;
  background-position: center; background-size: cover; background-repeat: no-repeat;
  opacity: 0; transition: opacity 1.2s ease; pointer-events: none;
}
/* 主题纱罩：只在有背景图时显示，保证文字可读 */
body.has-bg:not(.is-login)::before {
  content: ""; position: fixed; inset: 0; z-index: 1;
  background: var(--veil); pointer-events: none;
}
#app { position: relative; z-index: 2; }
.hidden { display: none !important; }

/* ---------- 顶栏（毛玻璃 sticky） ---------- */
.topbar {
  background: var(--topbar-bg);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid var(--card-border);
  position: sticky; top: 0; z-index: 50;
}
.topbar-inner {
  max-width: 1320px; margin: 0 auto; padding: 10px 16px;
  display: flex; align-items: center; gap: 12px;
}
.logo { font-weight: 800; font-size: 18px; color: var(--text); white-space: nowrap; letter-spacing: .5px; }
.logo b { color: var(--accent); font-weight: 800; }
.nav { display: flex; gap: 6px; flex-wrap: nowrap; align-items: center; overflow: visible; }
.nav button { flex: 0 0 auto; min-height: 34px; }
.nav button {
  background: var(--card-bg); border: 1px solid var(--card-border); border-radius: var(--radius);
  padding: 6px 11px; font-weight: 600; font-size: 14px; cursor: pointer; color: var(--text);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.nav button.active, .nav button:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.page-title { flex: 0 1 auto; margin: 0 auto; text-align: center; font-weight: 700; font-size: 15px; color: var(--text); opacity: .55; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; max-width: 200px; }
.user-badge {
  background: var(--card-bg); border: 1px solid var(--card-border); border-radius: 999px;
  padding: 4px 12px; font-size: 13px; font-weight: 600; color: var(--text);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.icon-btn {
  width: 34px; height: 34px; display: grid; place-items: center; cursor: pointer; font-size: 16px;
  background: var(--card-bg); border: 1px solid var(--card-border); border-radius: var(--radius); color: var(--text);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  transition: transform .15s ease, background .15s ease;
}
.icon-btn:hover { transform: translateY(-1px); background: var(--input-bg); }
.menu-btn {
  display: none; background: var(--card-bg); border: 1px solid var(--card-border); border-radius: var(--radius);
  padding: 6px 12px; font-weight: 700; cursor: pointer; color: var(--text); font-size: 14px;
}

/* ---------- 主视图 ---------- */
.view { max-width: 1080px; margin: 0 auto; padding: 20px 16px 60px; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--card-bg); border: 1px solid var(--card-border); border-radius: var(--radius);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
  box-shadow: var(--shadow); padding: 18px; margin-bottom: 16px; color: var(--text);
}
.card h2 { margin: 0 0 12px; font-size: 18px; font-weight: 700; }
.card h3.sub-h { margin: 20px 0 10px; padding-top: 16px; border-top: 1px dashed var(--card-border); font-size: 15px; font-weight: 700; }
.card h3.sub-h .sub { font-size: 12px; color: var(--text-dim); font-weight: 400; margin-left: 8px; }
.card h2 .sub { font-size: 13px; color: var(--text-dim); font-weight: 400; margin-left: 8px; }
.card h3 { margin: 18px 0 4px; font-size: 16px; }

/* ---------- 按钮 ---------- */
.btn {
  background: var(--accent-gradient); color: #fff; border: 1px solid rgba(185, 28, 28, .45); border-radius: var(--radius);
  padding: 8px 18px; font-weight: 700; font-size: 14px; cursor: pointer;
  box-shadow: 0 2px 10px rgba(185, 28, 28, .28);
  transition: filter .15s ease, transform .1s ease, box-shadow .15s ease;
}
.btn:hover { background: var(--accent-gradient-hover); box-shadow: 0 4px 14px rgba(185, 28, 28, .35); }
.btn:active { transform: translateY(1px); }
.btn-small { padding: 5px 12px; font-size: 13px; }
.btn-danger { background: linear-gradient(135deg, #ef4444, #b91c1c); border-color: rgba(185, 28, 28, .5); }
.btn-danger:hover { background: linear-gradient(135deg, #dc2626, #991b1b); }
.btn-ghost { background: var(--card-bg); color: var(--text); border: 1px solid var(--card-border); box-shadow: var(--shadow-sm); }
.btn-ghost:hover { background: var(--input-bg); box-shadow: var(--shadow-sm); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- 表单 ---------- */
.field { margin-bottom: 12px; }
.field label { display: block; font-weight: 600; margin-bottom: 4px; font-size: 14px; }
.field input[type=text], .field input[type=date], .field input[type=datetime-local],
.field textarea, .field select, .modal-card input[type=text] {
  width: 100%; border: 1px solid var(--card-border); border-radius: var(--radius); padding: 8px 12px;
  font-size: 15px; font-family: inherit; background: var(--input-bg); color: var(--text);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field textarea.code, #md-body { font-family: ui-monospace, Menlo, Consolas, monospace; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 640px) { .row2 { grid-template-columns: 1fr; } }
.checkline { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.checkline input { width: 18px; height: 18px; accent-color: var(--accent); }
.field input:focus, .field textarea:focus, .modal-card input[type=text]:focus, .mdbar #f-r2dir:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(185, 28, 28, .15);
}

/* ---------- 列表（紧凑） ---------- */
.list-item {
  display: flex; align-items: center; gap: 10px;
  background: var(--card-bg); border: 1px solid var(--card-border); border-radius: var(--radius);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
  box-shadow: var(--shadow-sm); padding: 8px 14px; margin-bottom: 8px;
  transition: transform .12s ease, box-shadow .12s ease;
}
.list-item:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.list-item .title { font-weight: 600; font-size: 14px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item .date { font-size: 12px; color: var(--text-dim); white-space: nowrap; font-variant-numeric: tabular-nums; }
.list-item .meta { font-size: 11px; color: var(--text-dim); white-space: nowrap; border: 1px solid var(--card-border); border-radius: 4px; padding: 1px 6px; }
.badge-draft { background: #fbbf24; color: #451a03; border-radius: 4px; padding: 0 6px; font-size: 12px; font-weight: 700; }

/* ---------- 编辑器 ---------- */
.editor-wrap { display: grid; grid-template-columns: 1fr; gap: 16px; }
#md-body { min-height: 320px; }
.preview {
  border: 1px dashed var(--card-border); border-radius: var(--radius); padding: 16px;
  background: var(--code-bg); min-height: 120px; color: var(--text);
}
.preview img { max-width: 100%; }
.preview pre { background: var(--code-bg); border: 1px solid var(--card-border); border-radius: var(--radius); padding: 12px; overflow-x: auto; }
.preview code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; }
.preview mark, mark { background: var(--mark-bg); color: inherit; padding: 0 3px; border-radius: 3px; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; }
.toolbar .spacer { flex: 1; }
.hint { font-size: 13px; color: var(--text-dim); }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  background: rgba(17, 24, 39, .92); color: #fff; border: 1px solid rgba(255, 255, 255, .14); border-radius: var(--radius);
  padding: 10px 20px; font-weight: 600; font-size: 14px; z-index: 300;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .3); max-width: 90vw;
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.toast.err { background: rgba(185, 28, 28, .94); }

/* ---------- dashboard 统计 ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stat {
  background: var(--card-bg); border: 1px solid var(--card-border); border-radius: var(--radius);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
  box-shadow: var(--shadow-sm); padding: 14px 16px; cursor: pointer; text-align: left;
  transition: transform .15s ease, box-shadow .15s ease;
}
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.stat .lbl { font-size: 14px; color: var(--text); font-weight: 700; }
.stat .num { margin-left: auto; font-size: 26px; font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums; }
.stat-rows { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; }
.stat-row { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-dim); }
.stat-row b { color: var(--text); font-variant-numeric: tabular-nums; }
.stat-row .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); opacity: .7; flex: 0 0 auto; }


/* ---------- 开关（背景轮换等） ---------- */
.switch-row { display: flex; align-items: center; gap: 10px; margin: 6px 0 12px; font-weight: 600; font-size: 14px; }
.switch { position: relative; width: 44px; height: 24px; flex: none; display: inline-block; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider { position: absolute; inset: 0; background: var(--text-dim); opacity: .45; border-radius: 999px; transition: .2s; cursor: pointer; }
.switch .slider::before { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.switch input:checked + .slider { background: var(--accent); opacity: 1; }
.switch input:checked + .slider::before { transform: translateX(20px); }
.switch input:focus-visible + .slider { box-shadow: 0 0 0 3px rgba(185, 28, 28, .25); }

/* ---------- 弹窗（视频插入等） ---------- */
.modal-mask { position: fixed; inset: 0; z-index: 200; background: rgba(0, 0, 0, .42); display: grid; place-items: center; padding: 16px; -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.modal-card { background: var(--card-bg); border: 1px solid var(--card-border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; width: min(440px, 94vw); color: var(--text); -webkit-backdrop-filter: blur(20px) saturate(140%); backdrop-filter: blur(20px) saturate(140%); animation: modal-in .18s ease-out; }
.modal-card h3 { margin: 0 0 8px; font-size: 16px; }
.modal-ops { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; }
@keyframes modal-in { from { transform: scale(.96) translateY(6px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- CRT 开机动画 ---------- */
.crt-overlay { position: fixed; inset: 0; z-index: 9999; background: #000; pointer-events: none; opacity: 0; }
.crt-overlay::after { content: ""; position: absolute; inset: 0; background: #fff; transform: scaleX(0) scaleY(.002); transform-origin: center; }
.crt-overlay.go { animation: crt-bg .7s ease-out forwards; }
.crt-overlay.go::after { animation: crt-line .7s ease-out forwards; }
@keyframes crt-bg { 0% { opacity: 1; } 55% { opacity: 1; } 100% { opacity: 0; } }
@keyframes crt-line {
  0% { transform: scaleX(0) scaleY(.002); opacity: 1; }
  22% { transform: scaleX(1) scaleY(.002); opacity: 1; }
  52% { transform: scaleX(1) scaleY(1); opacity: 1; filter: brightness(1.7); }
  78%, 100% { transform: scaleX(1) scaleY(1); opacity: 0; filter: brightness(1); }
}

/* ---------- 虫洞路由过渡 ---------- */
#view.view-out { animation: worm-out .18s ease-in forwards; }
#view.view-in { animation: worm-in .22s ease-out; }
@keyframes worm-out { to { transform: scale(.96); filter: blur(6px); opacity: 0; } }
@keyframes worm-in { from { transform: scale(1.04); filter: blur(6px); opacity: 0; } to { transform: scale(1); filter: blur(0); opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  #view.view-out, #view.view-in, .crt-overlay.go, .crt-overlay.go::after, .modal-card { animation: none !important; }
  .bg-layer { transition: none; }
}
/* ---------- 登录页（nekro.top 式毛玻璃） ---------- */
body.is-login { background: #0a1f1d; }
body.is-login .topbar { display: none; }
body.is-login .view { max-width: none; margin: 0; padding: 0; }
.login-stage {
  min-height: 100vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 20px; padding: 36px 20px;
  /* 波奇全屏背景，原图不做任何淡化/遮罩处理 */
  background: url("./login-art.jpg") center / cover no-repeat #0d2b28;
  position: relative; overflow: hidden;
}
/* 玻璃卡片通用 */
.glass-card {
  background: rgba(20, 30, 38, 0.10);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
  backdrop-filter: blur(24px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
  padding: 20px 24px; color: #fff;
}
/* 电子表字体（DSEG 七段数码管） */
@font-face {
  font-family: 'DSEG7';
  src: url('./fonts/DSEG7.woff2') format('woff2');
  font-display: swap;
}
/* 登录页左右分栏（学 nekro.top 首页排版：铺满全屏、左右贴边） */
.login-layout {
  display: flex; gap: 40px; align-items: stretch; justify-content: space-between;
  width: min(1360px, 94vw); position: relative; z-index: 2;
}
.login-left { flex: 0 0 400px; display: flex; flex-direction: column; justify-content: space-between; gap: 22px; min-width: 0; padding: 36px 0; }
.login-id { display: flex; align-items: center; gap: 18px; }
.login-avatar {
  width: 110px; height: 110px; border-radius: 50%; flex: 0 0 auto;
  border: 3px solid rgba(255, 255, 255, 0.75);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  object-fit: cover; background: #fff;
}
.login-left h1 { margin: 0; font-size: 38px; letter-spacing: 1px; color: #fff; text-shadow: 0 2px 12px rgba(0,0,0,.45); white-space: nowrap; }
.login-left h1 .brand { color: #fca5a5; }
.login-desc-card { margin: 14px 0 0; padding: 18px 22px; position: relative; }
.login-desc-card .hello-line { color: #fff; margin: 0; font-size: 17px; font-weight: 700; padding: 0 26px; }
.login-desc-card .hello-sub { color: rgba(255, 255, 255, 0.92); margin: 8px 0 0; font-size: 15px; font-weight: 600; line-height: 1.7; padding: 0 26px; }
.qmark { position: absolute; top: 2px; left: 12px; font-size: 26px; font-weight: 900; color: rgba(255,255,255,0.55); line-height: 1; }
.qmark-r { top: auto; left: auto; bottom: 0; right: 12px; }
.quote-card .quote-text { font-size: 15px; line-height: 1.7; }
.quote-card .quote-from { margin-top: 8px; text-align: right; font-size: 13px; color: rgba(255,255,255,.65); }
.clock-card { text-align: center; }
.clock-date { font-size: 14px; color: rgba(255, 255, 255, .75); }
.clock-time { font-family: 'DSEG7', 'Courier New', monospace; font-size: 36px; letter-spacing: 3px; margin-top: 6px; text-shadow: 0 0 18px rgba(255, 255, 255, .35); }
.clock-lunar { font-size: 14px; color: rgba(255, 255, 255, .75); margin-top: 8px; }
.login-right { flex: 0 1 660px; display: flex; flex-direction: column; gap: 18px; min-width: 0; }
/* 右上：名言 + 时钟并排（学 nekro.top 右上音乐卡 + 时钟卡） */
.login-top-row { display: flex; gap: 18px; }
.login-top-row .quote-card { flex: 1.15; display: flex; flex-direction: column; justify-content: center; }
.login-top-row .clock-card { flex: 1; }
.login-label { color: #fff; font-weight: 700; font-size: 14px; text-shadow: 0 1px 8px rgba(0,0,0,.5); margin: 14px 0 10px; display: flex; align-items: center; gap: 8px; }
.login-label svg { width: 17px; height: 17px; }
.login-label svg .lb-bar { fill: #fff; }
.login-label svg .lb-dot { fill: rgba(30,30,40,0.55); }
/* 网站列表九宫格（学 nekro.top 首页：横卡片，图标左 + 文字右） */
.site-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.site-card {
  display: flex; flex-direction: row; align-items: center; justify-content: center;
  gap: 12px; padding: 24px 18px;
  font-size: 17px; font-weight: 700; color: #fff; text-decoration: none;
  cursor: pointer; font-family: inherit;
  transition: transform .15s ease;
}
.site-card:hover { transform: translateY(-3px); }
.site-card svg { width: 30px; height: 30px; stroke: #fff; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.site-card svg.fill-icon { fill: #fff; stroke: none; }
.site-login { background: rgba(185, 28, 28, 0.18); border-color: rgba(248, 113, 113, 0.4); }
/* 联系方式一排（学 nekro.top 首页左下角） */
.contact-row { display: flex; gap: 12px; }
.contact-row a {
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.2);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  transition: transform .15s ease, background .15s ease;
}
.contact-row a:hover { transform: translateY(-2px); background: rgba(255, 255, 255, 0.2); }
.contact-row svg { width: 20px; height: 20px; stroke: #fff; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.contact-row svg.fill-icon { fill: #fff; stroke: none; }
/* 时钟 + 名言卡片 */
.clock-card { flex: 0 0 auto; min-width: 250px; text-align: center; }
.clock-date { font-size: 14px; color: rgba(255, 255, 255, .75); }
.clock-time { font-size: 38px; font-weight: 800; letter-spacing: 2px; font-variant-numeric: tabular-nums; margin-top: 4px; }
.quote-card { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.quote-text { font-size: 16px; line-height: 1.7; }
.quote-from { margin-top: 8px; text-align: right; font-size: 13px; color: rgba(255, 255, 255, .65); }
/* 漂浮音符：咱们的标识，蔷薇红柔光（浅色壁纸上也看得见） */
.note-particle {
  position: absolute; bottom: -40px; z-index: 1;
  color: rgba(219, 84, 105, .55);
  text-shadow: 0 0 12px rgba(219, 84, 105, .45);
  pointer-events: none; user-select: none;
  animation: note-float linear infinite;
}
@keyframes note-float {
  0% { transform: translateY(0) rotate(-8deg); opacity: 0; }
  10% { opacity: .9; }
  85% { opacity: .7; }
  100% { transform: translateY(-105vh) rotate(10deg); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .note-particle { display: none; }
}
@media (max-width: 760px) {
  .clock-card { min-width: 0; }
  .clock-time { font-size: 30px; }
  .login-top-row { flex-direction: column; }
}
/* 登录页移动端：分栏改上下堆叠（1100px 以下平板也堆叠，避免标题被右侧卡片压住） */
@media (max-width: 1100px) {
  .login-layout { flex-direction: column; }
  .login-left { flex: none; width: 100%; align-items: center; text-align: center; }
  .login-id { flex-direction: column; gap: 10px; }
  .site-grid { grid-template-columns: repeat(2, 1fr); }
}
/* 手机端背景适配（≤743px，仅手机横竖屏；平板/桌面不命中此规则）：
 * 未用手机专用图（已清除手机背景）时，桌面横版图位置往主体方向挪，避免竖屏硬铺裁乱。
 * 用手机专用图时位置/尺寸由 JS 行内样式给出（居中 + 铺满/完整），优先级高于此处。 */
@media (max-width: 743px) {
  .bg-layer { background-position: 50% 30%; }
  .login-stage { background-position: 50% 30%; }
}

/* ============================================================
 * part3：图片 / 音乐管理、编辑器细节、移动端适配（新视觉）
 * ============================================================ */

/* ---------- 图片 / 音乐管理 ---------- */
.img-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin: 12px 0; }
.img-cell {
  background: var(--card-bg); border: 1px solid var(--card-border); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
  -webkit-backdrop-filter: blur(20px) saturate(140%); backdrop-filter: blur(20px) saturate(140%);
  transition: transform .15s ease, box-shadow .15s ease;
}
.img-cell:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.img-cell > img {
  width: 100%; height: 112px; object-fit: cover; display: block;
  background: var(--teal-light); border-bottom: 1px solid var(--card-border);
}
.img-cell .url {
  font-size: 11px; color: var(--text-dim); padding: 6px 8px 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.img-cell .ops { display: flex; gap: 6px; padding: 8px; flex-wrap: wrap; align-items: center; }
/* 已禁用的壁纸：图片置灰 + 斜线角标 */
.img-cell.is-disabled > img { filter: grayscale(.9) brightness(.55); }
.img-cell.is-disabled { position: relative; }
.img-cell.is-disabled::after {
  content: "已禁用"; position: absolute; top: 8px; right: 8px;
  background: rgba(0,0,0,.65); color: #fff; font-size: 11px; font-weight: 700;
  padding: 3px 8px; border-radius: 4px; border: 1px solid rgba(255,255,255,.25);
}
.mini-btn {
  background: var(--card-bg); border: 1px solid var(--card-border); border-radius: 6px;
  padding: 4px 10px; font-size: 12px; font-weight: 700; cursor: pointer; color: var(--text);
  box-shadow: var(--shadow); transition: background .15s ease, transform .1s ease;
}
.mini-btn:hover { background: var(--teal-light); }
.mini-btn:active { transform: scale(.96); }
.mini-btn:disabled { opacity: .45; cursor: default; }
.mini-btn.danger { background: var(--accent); border-color: var(--accent-dark); color: #fff; }
.mini-btn.warn { background: #b45309; border-color: #92400e; color: #fff; }
/* 友链管理 */
.friend-row .friend-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; border: 1px solid var(--card-border); background: var(--card-bg); }
.friend-form { margin: -4px 0 8px; }
/* 视频管理 */
.video-thumb { width: 96px; height: 54px; object-fit: cover; border-radius: 6px; background: #000; flex: 0 0 auto; }
.vpreview { margin: -4px 0 8px; }
/* 简介：头像行 */
.avatar-row { display: flex; gap: 8px; align-items: center; }
.avatar-row input[type=text] { flex: 1; }
.avatar-preview { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; border: 1px solid var(--border, #e5e5e5); }
.mono { font-family: ui-monospace, monospace; font-size: 12px; word-break: break-all; }
/* 通用列表项内部 */
.feed-main { flex: 1; min-width: 0; }
.feed-title { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-ex { display: block; font-size: 12px; color: var(--muted, #888); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* ··· 更多菜单 */
.nav-more-wrap { position: relative; flex: 0 0 auto; display: inline-flex; }
.nav-more-wrap > button { background: var(--card-bg); border: 1px solid var(--card-border); border-radius: var(--radius); padding: 6px 11px; font-weight: 600; font-size: 14px; cursor: pointer; color: var(--text); min-height: 34px; letter-spacing: 2px; }
.nav-more-wrap > button.active { background: #dc2626; border-color: #dc2626; color: #fff; }
.nav-more { position: absolute; top: calc(100% + 6px); right: 0; min-width: 140px; background: var(--card-bg); border: 1px solid var(--card-border); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0,0,0,.18); z-index: 50; padding: 6px; display: flex; flex-direction: column; gap: 4px; }
.nav-more button { background: transparent; border: none; border-radius: 6px; padding: 8px 12px; font-size: 14px; cursor: pointer; color: var(--text); text-align: left; white-space: nowrap; }
.nav-more button:hover { background: rgba(0,0,0,.06); }
.nav-more button.active { background: #dc2626; color: #fff; }
.nav-more-inline { display: none; }
@media (max-width: 1200px) {
  .nav-more-wrap { display: none; }
  .nav-more-inline { display: contents; }
}
.slot-row { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; margin: 12px 0; }
.slot-preview {
  width: 120px; height: 120px; object-fit: cover;
  border: 1px solid var(--card-border); border-radius: 6px;
  box-shadow: var(--shadow); background: var(--teal-light);
}
.slot-preview.round { border-radius: 50%; }
.num-inline { width: 64px; border: 1px solid var(--input-border); border-radius: 6px; padding: 5px 8px; font-weight: 700; background: var(--input-bg); color: var(--text); }
.list-item.song { gap: 10px; }
.song-cover {
  width: 52px; height: 52px; border-radius: 6px; border: 1px solid var(--card-border);
  object-fit: cover; background: var(--teal-light); flex: none;
}
.song-info { flex: 1; min-width: 0; }
.song-info .title { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.song-info .meta { font-size: 12px; color: var(--text-dim); }
.song audio { height: 34px; max-width: 230px; }
.card h3 { margin: 18px 0 4px; font-size: 16px; }

/* ---------- 编辑器（doulor 式分区） ---------- */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field input.big { font-size: 20px; font-weight: 800; padding: 10px 14px; }
.field input[type="datetime-local"] {
  width: 100%; border: 1px solid var(--input-border); border-radius: 6px; padding: 8px 12px;
  font-size: 15px; font-family: inherit; background: var(--input-bg); color: var(--text); box-sizing: border-box;
}
.field input:focus, .field textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(185, 28, 28, .15);
}
.pills { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--card-border); border-radius: 999px; padding: 6px 14px;
  cursor: pointer; background: var(--card-bg); font-weight: 700; font-size: 14px;
  box-shadow: var(--shadow); user-select: none; color: var(--text);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  transition: background .15s ease;
}
.pill.on { background: var(--teal-light); border-color: var(--accent); }
.pill input { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
.mdbar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; align-items: center; }
.mdbar #f-r2dir {
  flex: 1; min-width: 160px; border: 1px solid var(--input-border); border-radius: 6px;
  padding: 6px 10px; font-size: 13px; background: var(--input-bg); color: var(--text);
}
.cover-row { display: flex; gap: 8px; }
.cover-row input { flex: 1; }
.cover-prev { margin-top: 8px; }
.cover-prev img { max-height: 130px; border: 1px solid var(--card-border); border-radius: 6px; box-shadow: var(--shadow); }
.preview mark { background: #fef08a; color: inherit; border-radius: 3px; padding: 0 2px; }
[data-theme="dark"] .preview mark { background: #a16207; color: #fefce8; }

/* ---------- 写作统计图 ---------- */
.chart-card h2 .sub { font-size: 12px; color: var(--text-dim); font-weight: 500; }
.lg-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin: 0 4px 0 10px; vertical-align: baseline; }
.chart-scroll { overflow-x: auto; }
.ch-svg { width: 100%; min-width: 560px; height: auto; display: block; }
.ch-grid { stroke: var(--card-border); stroke-dasharray: 4 4; stroke-width: 1; }
.ch-lbl { font-size: 11px; fill: var(--text-dim); }
.heat-block { margin-bottom: 14px; }
.heat-block:last-child { margin-bottom: 0; }
.heat-title { font-size: 13px; font-weight: 700; margin-bottom: 6px; color: var(--text); }
.heat-title .lg-dot { margin-left: 0; }
.heat-svg { max-width: 100%; height: auto; display: block; }
.heat-cell { transition: transform .1s ease; }
.heat-cell:hover { transform: scale(1.25); }
/* ---------- 手机 / 平板适配 ---------- */
.menu-btn { display: none; }
@media (max-width: 1200px) {
  .topbar-inner { flex-wrap: wrap; gap: 8px; padding: 8px 12px; }
  .menu-btn { display: none; } /* 小屏导航直接展示，不用汉堡菜单 */
  .nav { display: flex; width: 100%; flex-direction: row; flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; order: 3; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav button { flex: 0 0 auto; text-align: center; min-height: 40px; font-size: 14px; justify-content: center; padding: 6px 10px; }
}
@media (max-width: 640px) {
  .grid2 { grid-template-columns: 1fr; }
  .view { padding: 14px 12px 60px; }
  .card { padding: 14px; margin-bottom: 12px; }
  .field input[type=text], .field input[type=datetime-local], .field textarea { font-size: 16px; }
  .mdbar .btn-small { min-height: 40px; }
  #md-body { min-height: 260px; }
  .list-item { flex-wrap: wrap; row-gap: 4px; }
  .list-item .meta { width: 100%; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .toolbar .btn { min-height: 44px; }
  .img-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
  .modal-card { padding: 16px; }
}

/* 列表行：写作时间小字 + 更紧凑 */
.list-item .date { font-size: 12px; color: var(--text-dim); white-space: nowrap; }

/* ---------- 总结报告（小红书周报版式：浅色底、红色点缀） ---------- */
.report-page { background-size: cover; background-position: center; border-radius: 16px; overflow: hidden; border: 1px solid rgba(0, 0, 0, .08); margin-bottom: 12px; }
.report-veil { background: rgba(255, 245, 245, .88); padding: 24px; color: #333; }
.report-demo { background: #fff3cd; border: 1px solid #f0d48a; color: #7a5b00; border-radius: 10px; padding: 8px 12px; font-size: 13px; margin-bottom: 16px; }
.report-backfill { background: #e8f1fd; border: 1px solid #b6d2f5; color: #2b5ea7; border-radius: 10px; padding: 8px 12px; font-size: 13px; margin-bottom: 16px; }
#report-section { scroll-margin-top: 12px; margin-top: 12px; }
.report-title { text-align: center; font-size: 22px; margin: 0 0 4px; color: #333; }
.report-greet { background: #fff; border-radius: 14px; padding: 14px 18px; box-shadow: 0 2px 12px rgba(255, 36, 66, .08); font-size: 15px; line-height: 1.8; margin: 16px 0; }
.report-greet b { color: #ff2442; }
.report-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.report-card { background: #fff; border-radius: 14px; padding: 16px; box-shadow: 0 2px 12px rgba(0, 0, 0, .04); text-align: center; }
.report-num { font-size: 30px; font-weight: 800; color: #ff2442; }
.report-label { font-size: 12px; color: #999; margin-top: 4px; }
.report-section { background: #fff; border-radius: 14px; padding: 18px; margin-bottom: 16px; box-shadow: 0 2px 12px rgba(0, 0, 0, .04); }
.report-section h3 { margin: 0 0 12px; font-size: 16px; color: #333; }
.report-section p { font-size: 14px; line-height: 1.8; margin: 0 0 8px; color: #333; }
.report-section p:last-child { margin-bottom: 0; }
.report-bars { display: flex; align-items: flex-end; gap: 6px; min-height: 110px; }
.report-bar-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; justify-content: flex-end; min-height: 110px; }
.report-bar { width: 100%; max-width: 30px; background: linear-gradient(180deg, #ff6b81, #ff2442); border-radius: 6px 6px 0 0; }
.report-bar-val { font-size: 11px; color: #ff2442; font-weight: 700; min-height: 14px; }
.report-bar-date { font-size: 11px; color: #bbb; }
.report-select { border: 3px solid #000; border-radius: 10px; padding: 6px 10px; background: #fff; font-size: 14px; }
.report-modal { width: min(520px, 94vw); }
.report-popup-row { border: 1px solid var(--card-border); border-radius: 12px; padding: 12px; margin-bottom: 12px; }
.report-popup-row b { font-size: 15px; }
@media (max-width: 640px) {
  .report-cards { grid-template-columns: repeat(2, 1fr); }
  .report-veil { padding: 16px; }
}
/* 拖文件导入：全屏虚线高亮提示（仅视觉，不拦截拖放事件） */
.drop-overlay { position: fixed; inset: 12px; z-index: 150; pointer-events: none; display: grid; place-items: center; border: 3px dashed #b91c1c; border-radius: 16px; background: rgba(255, 245, 245, .82); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
.drop-overlay-inner { font-size: 26px; font-weight: 800; color: #b91c1c; text-align: center; line-height: 1.5; }
.drop-overlay-sub { font-size: 14px; font-weight: 500; color: #666; margin-top: 6px; }
