/* ==========================================================================
   主题系统 + 界面布局优化
   --------------------------------------------------------------------------
   1. 六套主题（绿/粉/夜/蓝/橙/紫），通过 <html data-theme="xxx"> 切换
   2. 表单控件统一样式（此前.form-input 只在 changelog 作用域内定义，
      导致每月安排等页面的输入框显得粗糙不统一）
   3. 卡片/表格/按钮的圆角、阴影、间距、悬停反馈统一
   4. 主题选择器浮层
   所有改动均追加在原样式之后，不覆盖既有规则，可安全回滚。
   ========================================================================== */

/* ---------- 主题变量 ---------- */
:root,
[data-theme="green"] {
    --primary: #10b981;
    --primary-light: #d1fae5;
    --primary-dark: #059669;
    --bg: #f8fafc;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --text: #1e293b;
    --text-secondary: #64748b;
    --border: #e2e8f0;
    --shadow: 0 1px 3px rgba(0,0,0,.08);
    --shadow-md: 0 4px 14px rgba(15,23,42,.08);
    --on-primary: #ffffff;
}

[data-theme="pink"] {
    --primary: #ec4899;
    --primary-light: #fce7f3;
    --primary-dark: #be185d;
    --bg: #fdf2f8;
    --surface: #ffffff;
    --surface-2: #fdf2f8;
    --text: #3f1d32;
    --text-secondary: #9d6b83;
    --border: #fbcfe8;
    --shadow: 0 1px 3px rgba(190,24,93,.10);
    --shadow-md: 0 4px 16px rgba(190,24,93,.12);
    --on-primary: #ffffff;
}

[data-theme="dark"] {
    --primary: #10b981;
    --primary-light: #064e3b;
    --primary-dark: #34d399;
    --bg: #0f172a;
    --surface: #1e293b;
    --surface-2: #172033;
    --text: #e2e8f0;
    --text-secondary: #94a3b8;
    --border: #334155;
    --shadow: 0 1px 3px rgba(0,0,0,.40);
    --shadow-md: 0 4px 16px rgba(0,0,0,.45);
    --on-primary: #0f172a;
    /* 暗色下需要反色处理的固定色块 */
    --force-on-surface: #1e293b;
}

[data-theme="blue"] {
    --primary: #0ea5e9;
    --primary-light: #e0f2fe;
    --primary-dark: #0369a1;
    --bg: #f0f9ff;
    --surface: #ffffff;
    --surface-2: #f0f9ff;
    --text: #0c4a6e;
    --text-secondary: #5b8ba8;
    --border: #bae6fd;
    --shadow: 0 1px 3px rgba(3,105,161,.10);
    --shadow-md: 0 4px 16px rgba(3,105,161,.12);
    --on-primary: #ffffff;
}

[data-theme="orange"] {
    --primary: #f59e0b;
    --primary-light: #fef3c7;
    --primary-dark: #b45309;
    --bg: #fffbeb;
    --surface: #ffffff;
    --surface-2: #fffbeb;
    --text: #78350f;
    --text-secondary: #a17c4a;
    --border: #fde68a;
    --shadow: 0 1px 3px rgba(180,83,9,.10);
    --shadow-md: 0 4px 16px rgba(180,83,9,.12);
    --on-primary: #ffffff;
}

[data-theme="purple"] {
    --primary: #8b5cf6;
    --primary-light: #ede9fe;
    --primary-dark: #6d28d9;
    --bg: #f5f3ff;
    --surface: #ffffff;
    --surface-2: #f5f3ff;
    --text: #3b2472;
    --text-secondary: #7c6ba8;
    --border: #ddd6fe;
    --shadow: 0 1px 3px rgba(109,40,217,.10);
    --shadow-md: 0 4px 16px rgba(109,40,217,.12);
    --on-primary: #ffffff;
}

/* ---------- 首页财务概览卡 ---------- */
.fin-mini-row { display:grid; grid-template-columns:repeat(auto-fit, minmax(96px,1fr));
                gap:10px; }
.fin-mini-row .fm {
    background:var(--surface-2); border-radius:8px;
    padding:10px 12px; display:flex; flex-direction:column; gap:2px;
}
.fin-mini-row .fm-lb { font-size:11.5px; color:var(--text-secondary); }
.fin-mini-row .fm-vl { font-size:15px; font-weight:600; letter-spacing:-.01em; }

/* ---------- 表单控件统一（此前缺失，导致输入框样式粗糙） ---------- */
input[type="text"], input[type="password"], input[type="number"],
input[type="email"], input[type="date"], select, textarea,
.form-input {
    font-family: inherit;
    font-size: 13.5px;
    line-height: 1.5;
    color: var(--text);
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: 8px;
    padding: 8px 11px;
    width: 100%;
    transition: border-color .16s ease, box-shadow .16s ease,
                background .16s ease;
    -webkit-appearance: none;
    appearance: none;
}
select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2394a3b8' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 28px;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent);
}
input::placeholder, textarea::placeholder { color: var(--text-secondary); opacity: .72; }
input:disabled, select:disabled, textarea:disabled {
    background: var(--surface-2); color: var(--text-secondary); cursor: not-allowed;
}
input[type="checkbox"], input[type="radio"] {
    width: auto; margin: 0 5px 0 0; vertical-align: middle;
    accent-color: var(--primary); cursor: pointer;
}

.form-group { margin-bottom: 16px; }
.form-group label {
    display: block; font-size: 12.5px; font-weight: 600;
    margin-bottom: 6px; color: var(--text-secondary);
    letter-spacing: .01em;
}
.form-group textarea { min-height: 64px; }

/* ---------- 卡片 ---------- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px 20px;
    margin-bottom: 16px;
    transition: box-shadow .2s ease;
}
.card:hover { box-shadow: var(--shadow-md); }
.card-title {
    font-size: 15px; font-weight: 600; color: var(--text);
    margin: 0 0 14px; display: flex; align-items: center; gap: 7px;
}

/* ---------- 表格 ---------- */
.table { width: 100%; border-collapse: separate; border-spacing: 0; }
.table thead th {
    background: var(--surface-2);
    color: var(--text-secondary);
    font-size: 12.5px; font-weight: 600;
    text-align: left; padding: 10px 12px;
    border-bottom: 1.5px solid var(--border);
    white-space: nowrap;
}
.table tbody td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    font-size: 13.5px; color: var(--text);
    vertical-align: middle;
}
.table tbody tr:nth-child(even) { background: var(--surface-2); }
.table tbody tr:hover { background: var(--primary-light); }
.table tbody tr:last-child td { border-bottom: none; }

/* ---------- 按钮 ---------- */
.btn-primary, .btn-add, .btn-save, button[type="submit"].btn-primary {
    background: var(--primary);
    color: var(--on-primary);
    border: 1px solid var(--primary);
    border-radius: 8px;
    font-weight: 600; font-size: 13.5px;
    padding: 9px 18px; cursor: pointer;
    transition: filter .16s ease, transform .12s ease, box-shadow .16s ease;
    box-shadow: 0 1px 3px color-mix(in srgb, var(--primary) 30%, transparent);
}
.btn-primary:hover, .btn-add:hover, .btn-save:hover,
button[type="submit"].btn-primary:hover {
    filter: brightness(1.07); transform: translateY(-1px);
    box-shadow: 0 4px 12px color-mix(in srgb, var(--primary) 34%, transparent);
}
.btn-primary:active { transform: translateY(0); }
.btn-secondary {
    background: var(--surface);
    color: var(--text-secondary);
    border: 1.5px solid var(--border);
    border-radius: 8px; padding: 8px 18px; font-size: 13.5px;
    cursor: pointer; text-decoration: none; display: inline-block;
    transition: border-color .16s ease, color .16s ease;
}
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); }
.btn-xs {
    background: transparent; border: 1px solid transparent;
    border-radius: 6px; padding: 3px 7px; cursor: pointer;
    text-decoration: none; font-size: 12.5px;
    transition: background .14s ease;
}
.btn-xs:hover { background: var(--primary-light); }

/* ---------- 侧边栏 ---------- */
.nav-item {
    border-radius: 9px;
    transition: background .15s ease, color .15s ease, transform .15s ease;
}
.nav-item:hover { transform: translateX(2px); }
.nav-item.active { font-weight: 600; }

/* ---------- 日历（跟随主题） ---------- */
.cal-cell { background: var(--surface); border-color: var(--border); }
.cal-dow { color: var(--text-secondary); background: var(--surface-2); }
.cal-item { background: var(--surface-2); color: var(--text); }
.cal-cell.dim { background: var(--surface-2); }

/* ---------- 主题选择器 ---------- */
.theme-switcher { position: relative; margin-top: auto; padding: 12px 14px; }
.theme-btn {
    display: flex; align-items: center; gap: 8px; width: 100%;
    background: var(--surface-2); border: 1px solid var(--border);
    border-radius: 9px; padding: 8px 10px; cursor: pointer;
    font-size: 12.5px; color: var(--text); font-family: inherit;
    transition: border-color .16s ease, background .16s ease;
}
.theme-btn:hover { border-color: var(--primary); background: var(--primary-light); }
.theme-btn .tb-label { flex: 1; text-align: left; font-weight: 500; }
.theme-dots { display: flex; gap: 3px; }
.theme-dots i {
    width: 11px; height: 11px; border-radius: 50%; display: block;
    border: 1.5px solid rgba(255,255,255,.7);
}
.theme-panel {
    position: absolute; bottom: calc(100% + 8px); left: 14px; right: 14px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 12px; box-shadow: var(--shadow-md);
    padding: 10px; display: none; z-index: 60;
}
.theme-panel.open { display: block; }
.theme-panel h5 {
    font-size: 11.5px; color: var(--text-secondary); font-weight: 600;
    margin: 0 0 8px; letter-spacing: .02em;
}
.theme-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.theme-opt {
    border: 2px solid transparent; border-radius: 8px;
    padding: 6px 4px; cursor: pointer; background: var(--surface-2);
    text-align: center; transition: border-color .14s ease, transform .12s ease;
}
.theme-opt:hover { transform: translateY(-1px); }
.theme-opt.active { border-color: var(--primary); }
.theme-opt .sw {
    height: 18px; border-radius: 5px; margin-bottom: 4px;
    display: flex; overflow: hidden;
}
.theme-opt .sw i { flex: 1; display: block; }
.theme-opt .nm { font-size: 10.5px; color: var(--text); line-height: 1.3; }

/* ---------- 暗色主题下的额外修正 ---------- */
[data-theme="dark"] .cal-cell.is-off { background: #2d1a1a; border-color: #4c1d1d; }
[data-theme="dark"] .cal-cell.is-workday { background: #2b2412; border-color: #533b0d; }
[data-theme="dark"] .cal-cell.is-off .dnum-day,
[data-theme="dark"] .cal-cell.is-off .dnum-holiday { color: #f87171; }
[data-theme="dark"] .cal-cell.is-workday .dnum-day,
[data-theme="dark"] .cal-cell.is-workday .dnum-holiday { color: #fbbf24; }
[data-theme="dark"] .cal-cell .dnum-lunar { color: #94a3b8; }
[data-theme="dark"] .cal-cell .dnum-lunar.is-fest { color: #fca5a5; }
[data-theme="dark"] .cal-cell.dim .dnum-lunar { color: #64748b; }
[data-theme="dark"] .cal-cell.today .dnum-lunar { color: #6ee7b7; }
[data-theme="dark"] .cal-item { background: #334155; color: #e2e8f0; }
[data-theme="dark"] .cal-item.c-green  { background:#064e3b; color:#a7f3d0; border-left-color:#34d399; }
[data-theme="dark"] .cal-item.c-blue   { background:#1e3a5f; color:#bfdbfe; border-left-color:#60a5fa; }
[data-theme="dark"] .cal-item.c-orange { background:#4c2a10; color:#fed7aa; border-left-color:#fb923c; }
[data-theme="dark"] .cal-item.c-purple { background:#3b2a5c; color:#ddd6fe; border-left-color:#c084fc; }
[data-theme="dark"] .cal-item.c-gray   { background:#334155; color:#cbd5e1; border-left-color:#94a3b8; }
[data-theme="dark"] .cal-more { color: #94a3b8; }
[data-theme="dark"] .cycle-banner { background: #2b2412; border-color: #533b0d; }
[data-theme="dark"] .cycle-banner .cb-title { color: #fbbf24; }
[data-theme="dark"] .cycle-banner .cb-item.cyc-quarterly { background: #4c2a10; color: #fed7aa; }
[data-theme="dark"] .cycle-banner .cb-item.cyc-annual { background: #4c1d1d; color: #fecaca; }
[data-theme="dark"] .cyc-badge.cyc-monthly   { background:#064e3b; color:#a7f3d0; }
[data-theme="dark"] .cyc-badge.cyc-quarterly { background:#4c2a10; color:#fed7aa; }
[data-theme="dark"] .cyc-badge.cyc-annual    { background:#4c1d1d; color:#fecaca; }
[data-theme="dark"] .ef-current { background: var(--surface-2); border-color: var(--border); }
[data-theme="dark"] .empty-state { color: var(--text-secondary); }
[data-theme="dark"] .flash-message { filter: brightness(.92); }
[data-theme="dark"] .mform-actions .cycle-hint,
[data-theme="dark"] .ef-hint { color: var(--text-secondary); }

/* ---------- 其他深色系的节假日格适配（粉/蓝/橙/紫底色较浅，无需覆盖） ---------- */
[data-theme="pink"] .cal-cell.is-off,
[data-theme="blue"] .cal-cell.is-off,
[data-theme="orange"] .cal-cell.is-off,
[data-theme="purple"] .cal-cell.is-off { border-color: var(--border); }

/* ---------- 无障碍：尊重系统的减少动效设置 ---------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        transition-duration: .01ms !important;
    }
}
/* ==========================================================================
   有趣版：问候语 / 激励语 / 灵魂弹窗 / 幸运签 / 设置页
   ========================================================================== */

/* ---------- 红框1：侧边栏问候语 ---------- */
.greet-card {
    margin: 2px 0 12px;
    padding: 11px 12px;
    border-radius: 11px;
    background: linear-gradient(135deg,
        color-mix(in srgb, var(--primary,#10b981) 12%, transparent),
        color-mix(in srgb, var(--primary,#10b981) 4%, transparent));
    border: 1px solid color-mix(in srgb, var(--primary,#10b981) 26%, transparent);
    position: relative;
    overflow: hidden;
}
.greet-card::after {
    content: '';
    position: absolute; right: -18px; top: -18px;
    width: 58px; height: 58px; border-radius: 50%;
    background: color-mix(in srgb, var(--primary,#10b981) 12%, transparent);
}
.greet-main { display: flex; align-items: center; gap: 7px; position: relative; z-index: 1; flex-wrap: wrap; }
.greet-icon { font-size: 16px; line-height: 1.3; flex: 0 0 auto; }
.greet-main .greet-sub { display: inline; margin: 0 0 0 8px; white-space: nowrap; }
.greet-main .greet-sub.warn { margin: 0 0 0 8px; }
.greet-text {
    font-size: 13px; font-weight: 700; line-height: 1.45;
    color: var(--text-primary, #1f2937);
    word-break: break-word;
}
.greet-sub {
    margin-top: 5px; font-size: 11px; line-height: 1.5;
    color: var(--text-secondary, #6b7280);
    position: relative; z-index: 1;
}
[data-theme="dark"] .greet-text { color: #e5e7eb; }
[data-theme="dark"] .greet-sub  { color: #9ca3af; }

/* ---------- 红框2：顶部随机激励语 ---------- */
.motiv-bar {
    display: inline-flex; align-items: center; gap: 8px;
    margin: 0 0 14px; padding: 9px 12px;
    border-radius: 10px;
    background: linear-gradient(90deg,
        color-mix(in srgb, var(--primary,#10b981) 9%, transparent),
        color-mix(in srgb, #a855f7 7%, transparent));
    border: 1px solid color-mix(in srgb, var(--primary,#10b981) 20%, transparent);
    position: relative; overflow: visible;
}
.motiv-star { font-size: 14px; flex: 0 0 auto; }
.motiv-text {
    flex: 0 0 auto; font-size: 13px; font-weight: 600; line-height: 1.5;
    color: var(--text-primary, #1f2937);
    white-space: nowrap;
    overflow: visible;
}
.motiv-refresh {
    flex: 0 0 auto; border: none; cursor: pointer;
    background: transparent; color: var(--text-secondary, #9ca3af);
    font-size: 14px; line-height: 1; padding: 4px 6px; border-radius: 6px;
    transition: transform .3s ease, color .2s ease, background .2s ease;
}
.motiv-refresh:hover { background: rgba(0,0,0,.06); color: var(--primary,#10b981); }
.motiv-refresh.spin { transform: rotate(360deg); }
[data-theme="dark"] .motiv-text { color: #e5e7eb; }

/* ---------- 今日幸运签 ---------- */
.lucky-chip {
    display: inline-flex; align-items: center; gap: 7px; flex-wrap: wrap;
    margin-bottom: 14px; padding: 7px 12px;
    border-radius: 999px; font-size: 12px;
    background: var(--surface-2, #f8fafc);
    border: 1px solid var(--border, #e2e8f0);
    color: var(--text-secondary, #475569);
}
.lucky-chip .lc-swatch {
    width: 13px; height: 13px; border-radius: 4px; flex: 0 0 auto;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,.12);
}
.lucky-chip .lc-text b { color: var(--text-primary, #1f2937); }
.lucky-chip .lc-sep { opacity: .4; }
.lucky-chip .lc-yi { color: var(--primary,#10b981); font-weight: 600; }

/* ---------- 红框3：灵魂版弹窗 ---------- */
.soul-layer { position: fixed; inset: 0; pointer-events: none; z-index: 9990; }
.soul-modal {
    position: fixed; right: 22px; bottom: 22px;
    display: flex; gap: 14px; align-items: center;
    width: min(400px, calc(100vw - 32px));
    padding: 16px 18px;
    border-radius: 16px;
    background: var(--surface, #fff);
    border: 2px solid color-mix(in srgb, var(--primary,#10b981) 45%, transparent);
    box-shadow: 0 14px 40px rgba(15,23,42,.20);
    pointer-events: auto;
}
.soul-modal[hidden] { display: none !important; }
/*通用：任何带 [hidden] 的自定义组件不被 display 规则覆盖 */
[hidden] { display: none !important; }
.soul-modal.pop { animation: soulIn .38s cubic-bezier(.2,.9,.3,1.2); }
@keyframes soulIn {
    from { opacity: 0; transform: translateY(18px) scale(.94); }
    to   { opacity: 1; transform: none; }
}
.soul-art { flex: 0 0 auto; display: flex; align-items: center; justify-content: center; }
.soul-art svg { display: block; flex: 0 0 auto; }
.soul-art { width: 60px; height: 60px; overflow: visible; }
.soul-body { flex: 1; min-width: 0; }
.soul-time { font-size: 10.5px; color: var(--text-secondary, #9ca3af); font-weight: 600; }
.soul-title {
    margin: 2px 0 3px; font-size: 15px; font-weight: 700;
    color: var(--text-primary, #1f2937);
}
.soul-msg {
    margin: 0 0 11px; font-size: 13px; line-height: 1.55;
    color: var(--text-primary, #374151);
}
.soul-actions { display: flex; gap: 8px; justify-content: flex-end; }
.soul-btn {
    border: none; cursor: pointer; border-radius: 9px;
    padding: 7px 14px; font-size: 12.5px; font-weight: 600;
    transition: transform .15s ease, box-shadow .2s ease, background .2s ease;
}
.soul-btn:active { transform: scale(.96); }
.soul-ok {
    background: var(--primary, #10b981); color: #fff;
    box-shadow: 0 3px 10px color-mix(in srgb, var(--primary,#10b981) 38%, transparent);
}
.soul-ok:hover { filter: brightness(1.06); }
.soul-snooze {
    background: var(--surface-2, #f1f5f9);
    color: var(--text-secondary, #64748b);
}
.soul-snooze:hover { background: var(--border, #e2e8f0); }
.soul-toast {
    position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%);
    background: var(--text-primary, #1f2937); color: #fff;
    padding: 9px 18px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
    z-index: 9995; animation: soulIn .3s ease;
    pointer-events: none;
}

/* ---------- 设置页 ---------- */
.settings-hero {
    display: flex; gap: 14px; align-items: flex-start;
    padding: 16px 18px; margin-bottom: 16px; border-radius: 14px;
    background: linear-gradient(135deg,
        color-mix(in srgb, var(--primary,#10b981) 10%, transparent),
        color-mix(in srgb, #a855f7 6%, transparent));
    border: 1px solid color-mix(in srgb, var(--primary,#10b981) 22%, transparent);
}
.settings-hero .sh-icon { font-size: 30px; line-height: 1; }
.settings-hero h2 { margin: 0 0 4px; font-size: 16px; font-weight: 700;
                    color: var(--text-primary, #1f2937); }
.settings-hero p  { margin: 0; font-size: 12.5px; line-height: 1.6;
                    color: var(--text-secondary, #6b7280); }

.set-card { margin-bottom: 16px; }
.set-badge {
    font-size: 11.5px; font-weight: 600; padding: 3px 10px; border-radius: 999px;
    background: var(--surface-2, #f1f5f9); color: var(--text-secondary, #64748b);
    border: 1px solid var(--border, #e2e8f0);
}
.set-badge.streak { background: #fef3c7; color: #b45309; border-color: #fde68a; }
.set-preview {
    font-size: 12px; color: var(--text-secondary, #9ca3af);
    max-width: 46%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.set-divider { border: none; border-top: 1px solid var(--border, #eef0f3); margin: 14px 0; }
.set-row { display: flex; flex-wrap: wrap; gap: 12px 14px; align-items: flex-end; }
.set-row .chk { align-self: center; min-width: 240px; font-size: 13px; }
.set-row .chk.sub { padding-left: 20px; font-size: 12.5px;
                     color: var(--text-secondary, #6b7280); }
.set-row .form-group.inline { flex: 1 1 220px; margin: 0; }
.set-row .form-group.inline.narrow { flex: 0 0 130px; }
.set-hint {
    flex: 1 0 100%; margin: 2px 0 0;
    font-size: 11.5px; line-height: 1.7; color: var(--text-secondary, #9ca3af);
}
.set-actions {
    display: flex; gap: 10px; align-items: center;
    margin-top: 16px; padding-top: 14px;
    border-top: 1px solid var(--border, #eef0f3);
}

/* 心情打卡 */
.mood-picker { display: flex; flex-wrap: wrap; gap: 9px; }
.mood-btn {
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    min-width: 66px; padding: 9px 8px; cursor: pointer;
    border: 1.5px solid var(--border, #e2e8f0); border-radius: 12px;
    background: var(--surface, #fff);
    transition: transform .15s ease, border-color .2s ease, background .2s ease;
}
.mood-btn:hover { transform: translateY(-2px); border-color: var(--primary, #10b981); }
.mood-btn.active {
    border-color: var(--primary, #10b981);
    background: color-mix(in srgb, var(--primary,#10b981) 10%, transparent);
}
.mood-btn .me { font-size: 22px; line-height: 1.1; }
.mood-btn .ml { font-size: 11.5px; color: var(--text-secondary, #6b7280); }

.mood-strip { display: flex; gap: 3px; margin: 14px 0 8px; flex-wrap: wrap; }
.ms-cell {
    width: 15px; height: 15px; border-radius: 4px;
    background: var(--surface-2, #eef2f7);
    border: 1px solid var(--border, #e2e8f0);
}
.ms-cell.filled { border-color: transparent; }
.mood-legend {
    display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
    font-size: 11px; color: var(--text-secondary, #9ca3af);
}
.mood-legend .mlg-item { display: inline-flex; align-items: center; gap: 3px; }
.mood-legend .mlg-item i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }

/* 提醒预设 */
.preset-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(178px, 1fr));
    gap: 10px; margin-bottom: 8px;
}
.preset-btn {
    display: flex; flex-direction: column; align-items: flex-start; gap: 3px;
    width: 100%; text-align: left; cursor: pointer;
    padding: 11px 12px; border-radius: 11px;
    border: 1.5px solid var(--border, #e2e8f0);
    background: var(--surface, #fff);
    transition: transform .15s ease, border-color .2s ease, box-shadow .2s ease;
}
.preset-btn:hover {
    transform: translateY(-2px);
    border-color: var(--primary, #10b981);
    box-shadow: 0 5px 14px rgba(15,23,42,.07);
}
.preset-btn .pe { font-size: 19px; line-height: 1; }
.preset-btn .pn { font-size: 12.5px; font-weight: 600; line-height: 1.4;
                  color: var(--text-primary, #1f2937); }
.preset-btn .pt { font-size: 10.5px; color: var(--text-secondary, #9ca3af); }

.custom-add { margin: 16px 0 6px; }
.ca-row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.ca-row .form-group { flex: 1 1 180px; margin: 0; }
.ca-row .form-group.wide { flex: 2 1 300px; }

/* 提醒列表 */
.rem-list {
    margin-top: 14px; border-top: 1px solid var(--border, #eef0f3);
    padding-top: 6px;
}
.rem-item {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 4px;
    border-bottom: 1px solid var(--border, #f1f5f9);
}
.rem-item:last-child { border-bottom: none; }
.rem-item.off { opacity: .5; }
.rem-item.off .rem-msg { text-decoration: line-through; }
.rem-icon { font-size: 16px; flex: 0 0 auto; }
.rem-time {
    flex: 0 0 auto; font-variant-numeric: tabular-nums;
    font-size: 12.5px; font-weight: 700; color: var(--primary, #10b981);
    background: var(--surface-2, #f1f5f9); padding: 2px 8px; border-radius: 6px;
}
.rem-msg {
    flex: 1; min-width: 0; font-size: 13px;
    color: var(--text-primary, #374151);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rem-switch { flex: 0 0 auto; cursor: pointer; }
.rem-switch input { width: 34px; height: 18px; cursor: pointer; accent-color: var(--primary,#10b981); }
.rem-del {
    flex: 0 0 auto; border: none; cursor: pointer;
    background: transparent; color: #ef4444; font-size: 13px;
    padding: 4px 7px; border-radius: 6px; line-height: 1;
    transition: background .2s ease;
}
.rem-del:hover { background: rgba(239,68,68,.10); }

/* ---------- 暗色适配 ---------- */
[data-theme="dark"] .soul-modal {
    background: #1e293b;
    border-color: color-mix(in srgb, var(--primary,#10b981) 55%, transparent);
    box-shadow: 0 14px 44px rgba(0,0,0,.55);
}
[data-theme="dark"] .soul-title,
[data-theme="dark"] .soul-msg  { color: #e5e7eb; }
[data-theme="dark"] .soul-snooze { background: #334155; color: #cbd5e1; }
[data-theme="dark"] .mood-btn,
[data-theme="dark"] .preset-btn { background: #1e293b; border-color: #334155; }
[data-theme="dark"] .preset-btn .pn,
[data-theme="dark"] .mood-btn .ml  { color: #e5e7eb; }
[data-theme="dark"] .settings-hero h2 { color: #e5e7eb; }
[data-theme="dark"] .set-badge.streak { background: #422006; color: #fcd34d; border-color: #78350f; }
[data-theme="dark"] .ms-cell { background: #1e293b; border-color: #334155; }
[data-theme="dark"] .soul-toast { background: #e5e7eb; color: #0f172a; }

/* ---------- 窄屏 ---------- */
@media (max-width: 860px) {
    .soul-modal { right: 12px; bottom: 12px; left: 12px; width: auto; }
    .mood-btn { min-width: 56px; padding: 7px 5px; }
    .mood-btn .me { font-size: 19px; }
    .set-preview { display: none; }
}

/* ---------- 番茄专注钟 ---------- */
.pomo-bar {
    display: inline-flex; align-items: center; gap: 9px;
    margin: 0 0 14px; padding: 8px 13px;
    border-radius: 999px;
    background: var(--surface-2, #f8fafc);
    border: 1px solid var(--border, #e2e8f0);
    font-size: 12.5px; color: var(--text-secondary, #64748b);
}
.pomo-icon { font-size: 15px; }
.pomo-time {
    font-variant-numeric: tabular-nums; font-weight: 700; font-size: 14px;
    color: #ef4444; min-width: 46px; text-align: center;
}
.pomo-label { min-width: 34px; }
.pomo-btn {
    border: 1px solid var(--border, #e2e8f0); cursor: pointer;
    background: var(--surface, #fff); color: var(--text-secondary, #475569);
    border-radius: 999px; padding: 4px 11px; font-size: 12px; font-weight: 600;
    transition: transform .15s ease, background .2s ease, border-color .2s ease;
}
.pomo-btn:hover { border-color: #ef4444; color: #ef4444; }
.pomo-btn:active { transform: scale(.95); }
.pomo-btn.ghost { background: transparent; }
.pomo-done { padding-left: 4px; border-left: 1px solid var(--border, #e2e8f0); }
.pomo-done b { color: #ef4444; }
.pomo-bar.done {
    background: color-mix(in srgb, #ef4444 9%, transparent);
    border-color: color-mix(in srgb, #ef4444 40%, transparent);
}
[data-theme="dark"] .pomo-btn { background: #1e293b; border-color: #334155; color: #cbd5e1; }
[data-theme="dark"] .pomo-btn:hover { color: #f87171; border-color: #f87171; }

/* ==========================================================================
   个人设置重构：卡片化布局 + 身份画像 + 模式切换
   ========================================================================== */

.set-card { margin-bottom: 16px; padding: 0; overflow: hidden; }
.set-card.is-muted { opacity: .5; }
.set-card.is-muted .sc-body { pointer-events: none; }

/* ---- 卡片头部 ---- */
.sc-head {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 15px 20px 13px;
    border-bottom: 1px solid var(--border, #eef0f3);
    background: var(--surface-2, #fafbfc);
}
.sc-no {
    flex: 0 0 auto; width: 22px; height: 22px; margin-top: 1px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 7px;
    background: color-mix(in srgb, var(--primary,#10b981) 14%, transparent);
    color: var(--primary, #10b981);
    font-size: 12px; font-weight: 700;
}
.sc-head h2 {
    margin: 0 0 2px; font-size: 14.5px; font-weight: 700;
    color: var(--text-primary, #1f2937);
}
.sc-head p {
    margin: 0; font-size: 11.5px; line-height: 1.6;
    color: var(--text-secondary, #9ca3af);
}
.sc-head .set-badge { margin-left: auto; flex: 0 0 auto; }

/* ---- 卡片主体 ---- */
.sc-body { padding: 16px 20px 18px; }

/* ---- 字段 ---- */
.fld { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.fld-label {
    font-size: 12px; font-weight: 600;
    color: var(--text-secondary, #6b7280);
    letter-spacing: .01em;
}
.fld-hint {
    margin: 10px 0 0; font-size: 11.5px; line-height: 1.7;
    color: var(--text-tertiary, #9ca3af);
}
.fld-hint b { color: var(--primary, #10b981); }

.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px 16px; }
.grid-2 .span-2, .grid-3 .span-2, .grid-3 .span-3 { grid-column: 1 / -1; }
.nmt { margin-top: 16px; }

/* ---- 性别分段选择 ---- */
.seg {
    display: inline-flex; padding: 3px; gap: 3px;
    background: var(--surface-2, #f1f5f9);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 10px;
    align-self: flex-start;
}
.seg-i {
    display: inline-flex; align-items: center; gap: 5px;
    border: none; cursor: pointer; background: transparent;
    padding: 6px 14px; border-radius: 7px;
    font-size: 12.5px; font-weight: 600;
    color: var(--text-secondary, #6b7280);
    transition: background .18s ease, color .18s ease, box-shadow .18s ease;
}
.seg-i:hover { color: var(--text-primary, #1f2937); }
.seg-i.on {
    background: var(--surface, #fff);
    color: var(--primary, #10b981);
    box-shadow: 0 1px 4px rgba(15,23,42,.10);
}
.sg-e { font-size: 14px; }

/* ---- 角色卡片 ---- */
.role-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
    gap: 10px;
}
.role-card {
    display: flex; align-items: center; gap: 9px;
    text-align: left; cursor: pointer;
    padding: 11px 12px; border-radius: 11px;
    border: 1.5px solid var(--border, #e2e8f0);
    background: var(--surface, #fff);
    transition: transform .15s ease, border-color .2s ease,
                box-shadow .2s ease, background .2s ease;
}
.role-card:hover {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--primary,#10b981) 55%, transparent);
    box-shadow: 0 4px 12px rgba(15,23,42,.06);
}
.role-card.on {
    border-color: var(--primary, #10b981);
    background: color-mix(in srgb, var(--primary,#10b981) 8%, transparent);
}
.rc-ic { font-size: 20px; flex: 0 0 auto; line-height: 1; }
.rc-tb { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.rc-tb b {
    font-size: 12.5px; font-weight: 600; line-height: 1.3;
    color: var(--text-primary, #1f2937);
}
.rc-tb i {
    font-size: 10.5px; font-style: normal; line-height: 1.3;
    color: var(--text-tertiary, #9ca3af);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ---- 模式卡片 ---- */
.mode-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 12px;
}
.mode-card {
    display: flex; flex-direction: column; gap: 4px;
    text-align: left; cursor: pointer;
    padding: 14px 15px; border-radius: 13px;
    border: 1.5px solid var(--border, #e2e8f0);
    background: var(--surface, #fff);
    transition: transform .15s ease, border-color .2s ease,
                box-shadow .2s ease, background .2s ease;
}
.mode-card:hover {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--primary,#10b981) 55%, transparent);
    box-shadow: 0 5px 16px rgba(15,23,42,.07);
}
.mode-card.on {
    border-color: var(--primary, #10b981);
    background: color-mix(in srgb, var(--primary,#10b981) 7%, transparent);
}
.mc-ic { font-size: 22px; line-height: 1.1; }
.mc-nm { font-size: 13.5px; font-weight: 700; color: var(--text-primary, #1f2937); }
.mc-ds { font-size: 12px; line-height: 1.55; color: var(--text-secondary, #6b7280); }
.mc-ft {
    margin-top: 4px; font-size: 10.5px; line-height: 1.5;
    color: var(--text-tertiary, #9ca3af);
    border-top: 1px dashed var(--border, #e2e8f0);
    padding-top: 6px;
}

/* ---- 开关 ---- */
.chk {
    display: flex; align-items: center; gap: 7px; cursor: pointer;
    font-size: 12.5px; color: var(--text-primary, #374151);
    padding: 7px 0;
}
.chk input { flex: 0 0 auto; accent-color: var(--primary, #10b981); }
.chk:has(input:disabled) { opacity: .45; cursor: not-allowed; }
.chk i.soul-only {
    display: inline-block; margin-left: 5px; padding: 1px 6px;
    font-size: 9.5px; font-style: normal; border-radius: 5px;
    background: color-mix(in srgb, #8b5cf6 12%, transparent);
    color: #8b5cf6; vertical-align: 1px;
}

.set-actions {
    display: flex; align-items: center; gap: 10px;
    padding: 14px 20px;
    border-top: 1px solid var(--border, #eef0f3);
    background: var(--surface-2, #fafbfc);
}
.sa-note { font-size: 11.5px; color: var(--text-tertiary, #9ca3af); margin-left: auto; }

.ca-row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.ca-row .fld { flex: 1 1 190px; }
.ca-row .fld.wide { flex: 2 1 320px; }

[data-theme="dark"] .sc-head { background: #1a2332; }
[data-theme="dark"] .set-actions { background: #1a2332; }
[data-theme="dark"] .seg { background: #1e293b; }
[data-theme="dark"] .seg-i.on { background: #334155; }
[data-theme="dark"] .role-card,
[data-theme="dark"] .mode-card { background: #1e293b; border-color: #334155; }
[data-theme="dark"] .rc-tb b,
[data-theme="dark"] .mc-nm { color: #e5e7eb; }
[data-theme="dark"] .mc-ft { border-top-color: #334155; }

/* ---------- 问候语补充：签名 / 身份标签 / 超限警告 ---------- */
.greet-sign {
    margin-top: 5px; font-size: 11px; line-height: 1.5;
    color: var(--text-tertiary, #9ca3af);
    position: relative; z-index: 1;
}
.greet-sub.warn {
    color: #d97706; font-weight: 600;
    background: color-mix(in srgb, #f59e0b 10%, transparent);
    padding: 4px 7px; border-radius: 6px; margin-top: 6px;
}
.greet-tag {
    display: inline-block; margin-top: 7px;
    font-size: 10.5px; font-weight: 600;
    padding: 2px 8px; border-radius: 999px;
    background: color-mix(in srgb, var(--primary,#10b981) 12%, transparent);
    color: var(--primary, #10b981);
    position: relative; z-index: 1;
}
.sidebar-header .persona-tag {
    display: inline-flex; align-items: center; gap: 4px;
    margin-top: 10px;
    font-size: 11px; font-weight: 600;
    padding: 3px 10px; border-radius: 999px;
    background: color-mix(in srgb, var(--primary,#10b981) 12%, transparent);
    color: var(--primary, #10b981);
}
[data-theme="dark"] .greet-sign { color: #9ca3af; }
[data-theme="dark"] .greet-sub.warn { background: rgba(245,158,11,.14); color: #fbbf24; }

/* ==========================================================================
   作家模块：写作台/ 码字窗口 / 公开阅读页
   ========================================================================== */

/* ---------- 顶部统计条 ---------- */
.wr-stats {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px; margin-bottom: 16px;
}
.wst {
    background: var(--surface, #fff);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: var(--border-radius-lg, 12px);
    padding: 12px 14px;
    display: flex; flex-direction: column; gap: 3px;
}
.wst.wide { grid-column: span 2; }
.wsl { font-size: 11.5px; color: var(--text-secondary, #9ca3af); }
.wsv {
    font-size: 22px; font-weight: 700; line-height: 1.15;
    color: var(--text-primary, #1f2937);
    font-variant-numeric: tabular-nums;
}
.wsv i { font-size: 12px; font-style: normal; font-weight: 400;
         color: var(--text-tertiary, #9ca3af); margin-left: 2px; }
.wsp { font-size: 11px; color: var(--text-tertiary, #9ca3af); }
.wr-bar {
    height: 8px; border-radius: 999px; margin-top: 7px;
    background: var(--surface-2, #f1f5f9); overflow: hidden;
}
.wr-bar span {
    display: block; height: 100%; border-radius: 999px;
    background: var(--primary, #10b981);
    transition: width .3s ease;
}

/* ---------- 两栏布局 ---------- */
.wr-layout {
    display: grid; grid-template-columns: 280px minmax(0, 1fr);
    gap: 16px; align-items: start; margin-bottom: 16px;
}
@media (max-width: 1020px) { .wr-layout { grid-template-columns: 1fr; } }

/* ---------- 左侧作品/ 章节树 ---------- */
.wr-side { display: flex; flex-direction: column; gap: 12px; }
.wr-book {
    background: var(--surface, #fff);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: var(--border-radius-lg, 12px);
    overflow: hidden;
}
.wr-book.on { border-color: var(--primary, #10b981); }
.wb-head {
    padding: 11px 14px 8px;
    display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
}
.wb-title { font-size: 13.5px; font-weight: 700; color: var(--text-primary, #1f2937); }
.wb-meta { font-size: 11px; color: var(--text-tertiary, #9ca3af); }
.wb-pub {
    display: inline-block; margin: 0 14px 6px;
    font-size: 10px; padding: 2px 7px; border-radius: 5px;
    background: color-mix(in srgb, #10b981 14%, transparent);
    color: #10b981;
}
.wb-chs { border-top: 1px solid var(--border, #eef0f3); }
.wb-ch {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 14px;
    border-bottom: 1px solid var(--border, #f1f5f9);
    transition: background .15s ease;
}
.wb-ch:hover { background: var(--surface-2, #f8fafc); }
.wb-ch.on {
    background: color-mix(in srgb, var(--primary,#10b981) 9%, transparent);
    box-shadow: inset 2px 0 0 var(--primary, #10b981);
}
.wb-ch-l {
    flex: 1; min-width: 0; font-size: 12.5px;
    color: var(--text-primary, #374151);
    text-decoration: none;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.wb-ch-w {
    flex: 0 0 auto; font-size: 11px; color: var(--text-tertiary, #9ca3af);
    font-variant-numeric: tabular-nums;
}
.wb-empty { padding: 12px 14px; font-size: 12px; color: var(--text-tertiary, #9ca3af); }
.wb-acts { padding: 10px 14px 12px; display: flex; flex-direction: column; gap: 8px; }
.wb-acts form { display: flex; gap: 6px; }
.wb-acts .form-input { flex: 1; min-width: 0; font-size: 12px; }
.wb-links { display: flex; gap: 12px; }
.wb-links a {
    font-size: 11px; color: var(--primary, #10b981); text-decoration: none;
}
.wb-links a:hover { text-decoration: underline; }

/* ---------- 码字窗口 ---------- */
.wr-editor {
    background: var(--surface, #fff);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: var(--border-radius-lg, 12px);
    overflow: hidden;
    display: flex; flex-direction: column;
}
.we-head {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 16px;
    border-bottom: 1px solid var(--border, #eef0f3);
    background: var(--surface-2, #fafbfc);
}
.we-title {
    flex: 1; min-width: 0; border: none; background: transparent;
    font-size: 15px; font-weight: 700; color: var(--text-primary, #1f2937);
    outline: none; padding: 3px 0;
    border-bottom: 1px dashed transparent; transition: border-color .18s ease;
}
.we-title:focus { border-bottom-color: var(--primary, #10b981); }
.we-tools { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.we-papers {
    display: inline-flex; gap: 2px; padding: 2px;
    background: var(--surface, #fff);
    border: 1px solid var(--border, #e2e8f0); border-radius: 8px;
}
.we-papers button {
    border: none; cursor: pointer; background: transparent;
    padding: 4px 10px; border-radius: 6px;
    font-size: 11.5px; color: var(--text-secondary, #6b7280);
    transition: background .15s ease, color .15s ease;
}
.we-papers button.on {
    background: color-mix(in srgb, var(--primary,#10b981) 13%, transparent);
    color: var(--primary, #10b981); font-weight: 600;
}

/* 三种稿纸：行高统一 28px，字数统计与视觉行对应 */
.we-area {
    width: 100%; border: none; outline: none; resize: vertical;
    min-height: 420px; padding: 22px 24px;
    font-family: var(--font-mono, ui-monospace, monospace);
    font-size: 15px; line-height: 28px;
    color: var(--text-primary, #1f2937);
    background-color: var(--surface, #fff);
    background-image: none;
    background-attachment: local;
    /* 中文传统排版：段落首行缩进两字；JS 会自动维护全角空格缩进 */
    tab-size: 2;
}
.we-area::placeholder { color: var(--text-tertiary, #cbd5e1); }

/* 方格纸：横向浅线 + 纵向分段 */
.paper-grid .we-area {
    background-image:
        repeating-linear-gradient(to right,
            transparent, transparent 27px,
            color-mix(in srgb, var(--border,#e2e8f0) 55%, transparent) 27px,
            color-mix(in srgb, var(--border,#e2e8f0) 55%, transparent) 28px),
        repeating-linear-gradient(to bottom,
            transparent, transparent 27px,
            color-mix(in srgb, var(--border,#e2e8f0) 70%, transparent) 27px,
            color-mix(in srgb, var(--border,#e2e8f0) 70%, transparent) 28px);
    /* 竖线：background-position-x = padding-left - 27，使竖线与文字左边缘对齐 */
    background-position: -3px 22px, 24px 22px;
    padding-left: 24px; padding-right: 24px;
}
/* 下划线稿纸 */
.paper-line .we-area {
    background-image: repeating-linear-gradient(to bottom,
        transparent, transparent 27px,
        color-mix(in srgb, var(--border,#e2e8f0) 90%, transparent) 27px,
        color-mix(in srgb, var(--border,#e2e8f0) 90%, transparent) 28px);
    background-position: 0 22px;
    padding-left: 24px; padding-right: 24px;
}
/* 空白稿纸 */
.paper-plain .we-area { background-image: none; }

/* 护眼纸 */
.paper-yellow .we-area {
    background-color: #fffbe6;
    background-image: none;
}

/* 羊皮纸 */
.paper-parchment .we-area {
    background-color: #f7f0e0;
    background-image:
        repeating-linear-gradient(to right,
            transparent, transparent 27px,
            rgba(160, 140, 100, 0.08) 27px,
            rgba(160, 140, 100, 0.08) 28px),
        repeating-linear-gradient(to bottom,
            transparent, transparent 27px,
            rgba(160, 140, 100, 0.12) 27px,
            rgba(160, 140, 100, 0.12) 28px);
    background-position: -3px 22px, 24px 22px;
}

/* 点阵纸 */
.paper-dot .we-area {
    background-image: radial-gradient(circle,
        color-mix(in srgb, var(--border,#e2e8f0) 55%, transparent) 1.5px,
        transparent 1.5px);
    background-size: 28px 28px;
    background-position: 24px 22px;
}

.we-foot {
    display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
    padding: 9px 16px;
    border-top: 1px solid var(--border, #eef0f3);
    background: var(--surface-2, #fafbfc);
}
.wf-item {
    font-size: 11.5px; color: var(--text-secondary, #6b7280);
    font-variant-numeric: tabular-nums;
}
.wf-item b { color: var(--text-primary, #1f2937); font-weight: 700; }
.wf-item.saving { color: #f59e0b; }
.wf-item.err { color: #ef4444; }
.wf-acts { margin-left: auto; display: flex; gap: 6px; }
.we-summary { padding: 10px 16px; border-top: 1px solid var(--border, #eef0f3); }

/* ---------- 空状态 ---------- */
.wr-empty {
    background: var(--surface, #fff);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: var(--border-radius-lg, 12px);
    padding: 48px 28px; text-align: center;
}
.wre-ic { font-size: 42px; line-height: 1; margin-bottom: 12px; }
.wre-t { margin: 0 0 6px; font-size: 15px; font-weight: 700;
         color: var(--text-primary, #1f2937); }
.wre-d { margin: 0 0 20px; font-size: 12.5px; line-height: 1.7;
         color: var(--text-secondary, #9ca3af); }
.wre-d a { color: var(--primary, #10b981); }
.wre-form { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap;
            max-width: 520px; margin: 0 auto; }

/* ---------- 作品管理 ---------- */
.wr-mrow {
    padding: 14px 0;
    border-bottom: 1px solid var(--border, #eef0f3);
}
.wr-mrow:last-child { border-bottom: none; }
.wr-mform {
    display: grid; gap: 12px;
    grid-template-columns: 1.1fr 1.6fr 100px;
    align-items: end;
}
.wr-mform .fld.wide { grid-column: span 1; }
.wr-mform .fld.narrow { min-width: 0; }
.wr-mform .fld.checks {
    grid-column: 1 / -1;
    display: flex; flex-direction: row; gap: 18px; align-items: center;
}
.wr-mform .chk { padding: 0; }
.wr-mform button[type=submit] { grid-column: 1 / -1; justify-self: start; }
@media (max-width: 760px) {
    .wr-mform { grid-template-columns: 1fr; }
}
.wr-pubinfo {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    margin-top: 10px; font-size: 11.5px;
}
.wr-pubinfo code {
    background: var(--surface-2, #f1f5f9);
    padding: 3px 8px; border-radius: 6px;
    color: var(--text-secondary, #6b7280);
    font-size: 11px;
}
.pub-ok { color: #10b981; font-weight: 600; }
.pub-no { color: var(--text-tertiary, #9ca3af); }
.wr-pubinfo form { margin-left: auto; }

/* ---------- 按钮补充 ---------- */
.btn-sm { padding: 5px 12px !important; font-size: 12px !important; }
.btn-danger {
    background: #ef4444; color: #fff; border: 1px solid #ef4444;
}
.btn-danger:hover { filter: brightness(1.06); }
.btn-ghost {
    background: transparent; color: var(--text-secondary, #6b7280);
    border: 1px solid var(--border, #e2e8f0);
}
.btn-ghost:hover { border-color: var(--primary, #10b981); color: var(--primary, #10b981); }

/* ==========================================================================
   公开阅读页（独立于后台样式）
   ========================================================================== */
.rd-page {
    margin: 0; padding: 0;
    background: #f7f6f3;
    color: #2b2b28;
    font-family: var(--font-sans, system-ui, sans-serif);
}
.read-wrap { max-width: 760px; margin: 0 auto; padding: 48px 20px 80px; }
.read-head { text-align: center; padding-bottom: 26px;
             border-bottom: 1px solid #e2e0d8; margin-bottom: 26px; }
.read-head h1 {
    margin: 0 0 10px; font-size: 27px; font-weight: 500;
    color: #1f2937; letter-spacing: .01em;
}
.read-intro {
    margin: 0 0 12px; font-size: 13.5px; line-height: 1.8;
    color: #5f5e5a;
}
.read-meta {
    display: flex; gap: 16px; justify-content: center; flex-wrap: wrap;
    font-size: 12px; color: #888780;
}
.read-toc {
    background: #fff; border: 1px solid #e2e0d8; border-radius: 12px;
    padding: 14px 18px; margin-bottom: 32px;
    display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: baseline;
}
.rt-t { font-size: 12px; font-weight: 500; color: #888780; }
.read-toc a {
    font-size: 12.5px; color: #5f5e5a; text-decoration: none;
    padding: 2px 0; border-bottom: 1px solid transparent;
}
.read-toc a:hover { color: #185FA5; border-bottom-color: #b5d4f4; }
.read-toc a.on { color: #185FA5; font-weight: 500; }
.read-ch { margin-bottom: 42px; }
.read-ch h2 {
    margin: 0 0 6px; font-size: 19px; font-weight: 500; color: #1f2937;
}
.read-sum {
    margin: 0 0 14px; font-size: 12.5px; color: #888780;
    padding-left: 11px; border-left: 2px solid #e2e0d8;
}
.read-text { font-size: 1rem; line-height: 2.05; color: #2b2b28; }
.read-text p { margin: 0 0 1.15em; text-indent: 2em; }
.read-text p:first-child { text-indent: 0; }
.read-wc {
    margin: 12px 0 0; font-size: 11.5px; color: #b4b2a9;
    font-variant-numeric: tabular-nums;
}
.read-empty { font-size: 13.5px; color: #b4b2a9; font-style: italic; }
.read-foot {
    margin-top: 56px; padding-top: 22px;
    border-top: 1px solid #e2e0d8; text-align: center;
}
.read-foot p { margin: 0; font-size: 12px; color: #b4b2a9; }
.read-toc-toggle {
    display: none; position: fixed; right: 16px; bottom: 16px;
    width: 44px; height: 44px; border-radius: 50%;
    border: 1px solid #e2e0d8; background: #fff; color: #5f5e5a;
    font-size: 17px; cursor: pointer;
    box-shadow: 0 3px 12px rgba(0,0,0,.09);
}
@media (max-width: 640px) {
    .read-wrap { padding: 26px 16px 60px; }
    .read-head h1 { font-size: 22px; }
    .read-text { font-size: 15px; line-height: 1.95; }
    .read-toc {
        position: fixed; left: 12px; right: 12px; bottom: 12px;
        max-height: 62vh; overflow-y: auto; z-index: 50;
        display: none; box-shadow: 0 8px 28px rgba(0,0,0,.14);
    }
    .read-toc.open { display: flex; }
    .read-toc-toggle { display: block; }
}

/* ---------- 职业身份卡片 ---------- */
.occ-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 10px;
}
.occ-card {
    display: flex; align-items: flex-start; gap: 10px;
    text-align: left; cursor: pointer;
    padding: 12px 13px; border-radius: 12px;
    border: 1.5px solid var(--border, #e2e8f0);
    background: var(--surface, #fff);
    transition: transform .15s ease, border-color .2s ease,
                box-shadow .2s ease, background .2s ease;
}
.occ-card:hover {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--primary,#10b981) 55%, transparent);
    box-shadow: 0 4px 12px rgba(15,23,42,.06);
}
.occ-card.on {
    border-color: var(--primary, #10b981);
    background: color-mix(in srgb, var(--primary,#10b981) 8%, transparent);
}
.oc-ic { font-size: 21px; flex: 0 0 auto; line-height: 1.15; }
.oc-tb { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.oc-tb b { font-size: 13px; font-weight: 600; color: var(--text-primary, #1f2937); }
.oc-tb i {
    font-size: 11px; font-style: normal; line-height: 1.5;
    color: var(--text-tertiary, #9ca3af);
}
.wr-prefs {
    margin-top: 16px; padding: 15px 16px;
    border-radius: 12px;
    background: var(--surface-2, #fafbfc);
    border: 1px solid var(--border, #e2e8f0);
}
.wp-t {
    margin: 0 0 12px; font-size: 13px; font-weight: 700;
    color: var(--text-primary, #1f2937);
}
[data-theme="dark"] .occ-card { background: #1e293b; border-color: #334155; }
[data-theme="dark"] .occ-card.on { background: rgba(16,185,129,.12); }
[data-theme="dark"] .oc-tb b { color: #e5e7eb; }

/* ---------- 首页作家面板 ---------- */
.wp-panel { margin-bottom: 16px; }
.wp-head {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.wp-ic {
    font-size: 26px; line-height: 1; flex: 0 0 auto;
    width: 44px; height: 44px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    background: color-mix(in srgb, var(--primary,#10b981) 11%, transparent);
}
.wp-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.wp-txt b {
    font-size: 15px; font-weight: 700; color: var(--text-primary, #1f2937);
}
.wp-txt i {
    font-size: 11.5px; font-style: normal; color: var(--text-secondary, #6b7280);
}
.wp-bar {
    height: 8px; border-radius: 999px; margin-top: 12px;
    background: var(--surface-2, #f1f5f9); overflow: hidden;
}
.wp-bar span {
    display: block; height: 100%; border-radius: 999px;
    background: var(--primary, #10b981);
    transition: width .3s ease;
}
.wp-meta {
    display: flex; gap: 16px; flex-wrap: wrap; margin-top: 7px;
    font-size: 11.5px; color: var(--text-tertiary, #9ca3af);
}
[data-theme="dark"] .wp-txt b { color: #e5e7eb; }

/* ---------- 番茄钟与按钮：防flex 挤压（文字竖排） ---------- */
/* 症状：容器窄时子项被 flex-shrink 压到最小宽度，中文逐字换行成竖排。
   修法：关键子项设 flex:0 0 auto + white-space:nowrap。 */
.pomo-bar { display: inline-flex; align-items: center; gap: 9px;
            flex-wrap: wrap; max-width: 100%; }
.pomo-bar > * { flex: 0 0 auto; white-space: nowrap; }
.pomo-btn { white-space: nowrap; }
.pomo-done { white-space: nowrap; }

.btn { display: inline-flex; align-items: center; justify-content: center;
       gap: 6px; white-space: nowrap; flex: 0 0 auto; }
.btn-primary { white-space: nowrap; }
.btn-block { white-space: nowrap; }

/* 表单栅格里的字段标签与输入框也要防竖排 */
.fld > label, .fld-label { white-space: normal; }
.fld .form-input { min-width: 0; }
.wr-mform .fld { min-width: 0; }
.wr-mform .fld label { white-space: nowrap; overflow: hidden;
                        text-overflow: ellipsis; }
