/* ============================================
   JK 幻影夜行 Mini Wiki - 全局样式 v3
   暗色主题 · 咒术回战风
   含：主题变量 / 重置 / 排版 / 组件 / 工具类 / 响应式
   ============================================ */

/* ============================================
   1. CSS 变量
   ============================================ */
:root {
    /* ---- 主色板 ---- */
    --color-bg: #0d0d1a;
    --color-bg-alt: #1a0a2e;
    --color-bg-card: #1e1e32;
    --color-bg-hover: #2a1a3e;
    --color-bg-elevated: #252040;

    /* ---- 文字 ---- */
    --color-text: #e8e0f0;
    --color-text-muted: #9a8ab0;
    --color-text-dim: #6a5a80;
    --color-text-inverse: #0d0d1a;

    /* ---- 强调色 ---- */
    --color-accent: #ff2040;
    --color-accent-glow: #ff3060;
    --color-accent-hover: #ff4060;
    --color-gold: #ffd700;
    --color-purple: #7b2d8e;

    /* ---- 语义色 ---- */
    --color-success: #22c55e;
    --color-warning: #f59e0b;
    --color-error: #ef4444;
    --color-info: #3b82f6;

    /* ---- 稀有度 ---- */
    --rarity-ssr: #ffd700;
    --rarity-ssr-bg: rgba(255, 215, 0, 0.15);
    --rarity-sr: #c084fc;
    --rarity-sr-bg: rgba(192, 132, 252, 0.15);
    --rarity-r: #60a5fa;
    --rarity-r-bg: rgba(96, 165, 250, 0.15);

    /* ---- 属性（来自用户设计图片提取的主色） ---- */
    --attr-gen: #611f23;
    --attr-gen-light: #8a2d33;
    --attr-kage: #35648f;
    --attr-kage-light: #4a84bf;
    --attr-yoru: #247b4e;
    --attr-yoru-light: #30a566;
    --attr-gyou: #785e1e;
    --attr-gyou-light: #9e7d28;

    /* ---- T 度（新: L超模红, S顶级金, A常规紫, B NPC蓝, C路边绿） ---- */
    --tier-l: #ff2040;
    --tier-l-bg: rgba(255, 32, 64, 0.15);
    --tier-s: #ffd700;
    --tier-s-bg: rgba(255, 215, 0, 0.15);
    --tier-a: #a855f7;
    --tier-a-bg: rgba(168, 85, 247, 0.15);
    --tier-b: #3b82f6;
    --tier-b-bg: rgba(59, 130, 246, 0.15);
    --tier-c: #22c55e;
    --tier-c-bg: rgba(34, 197, 94, 0.15);

    /* ---- 布局 ---- */
    --border-radius-sm: 6px;
    --border-radius: 8px;
    --border-radius-lg: 12px;
    --border-radius-xl: 16px;
    --transition-speed: 0.2s;
    --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-elevated: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 20px rgba(255, 32, 64, 0.15);

    /* ---- 字体 ---- */
    --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
    --font-mono: "SF Mono", "Fira Code", "Consolas", "JetBrains Mono", monospace;
}

/* ============================================
   2. 重置 / 基础
   ============================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}
body {
    font-family: var(--font-main);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.5;
    overflow: hidden;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ============================================
   3. VH 分屏布局
   ============================================ */
.app-shell {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* 上半部 — 60% 内容展示区
   首页：左封面 + 右信息栏
   其他页：宽版滚动内容 */
.top-area {
    display: flex;
    flex-direction: column;
    flex: 0 0 auto;
    height: 60vh;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    position: relative;
}
.top-area::-webkit-scrollbar { width: 4px; }
.top-area::-webkit-scrollbar-track { background: transparent; }
.top-area::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 2px; }

/* 首页 80/20 覆盖 */
.home-shell .top-area { height: 80vh; flex: 0 0 80%; }
.home-shell .bottom-nav { height: 20vh; flex: 0 0 20%; }

/* 首页五小只紧凑适配 */
.home-shell .nav-icon-wrap { width: 44%; max-width: 60px; }
.home-shell .nav-label { font-size: 0.68rem; }
.home-shell .nav-entry { gap: 5px; padding: 4px; }

/* 强度榜页 — 五小只 1/3 高度适配 */
.tierlist-shell .bottom-nav { height: 13.5vh; flex: 0 0 13.5%; }
.tierlist-shell .top-area { height: 86.5vh; flex: 0 0 86.5%; }
.tierlist-shell .nav-icon-wrap { width: 36%; max-width: 42px; }
.tierlist-shell .nav-label { font-size: 0.55rem; }
.tierlist-shell .nav-entry { gap: 3px; padding: 2px; }

/* 强度榜 — 全宽 + 下拉不被遮挡 */
.tierlist-shell .page-container { max-width: 100%; width: 100%; padding: 0; flex: 0 1 auto; display: flex; flex-direction: column; min-height: 0; }
.tierlist-shell .page-header { padding: 6px 4px 2px; flex-shrink: 0; }
.tierlist-shell .tier-elem-filter {
    overflow: visible !important;
    flex-wrap: wrap;
    padding: 4px 3px;
    position: relative;
    z-index: 10000;
}
.tierlist-shell .filter-dropdown-menu { z-index: 10001; }

/* 回想强度榜 — 回想图鉴尺寸对齐 */
.tierlist-recalls-shell .tier-grid {
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 4px;
}
.tierlist-recalls-shell .tier-card-body {
    padding: 2px 3px 3px;
}
.tierlist-recalls-shell .tier-card-name {
    font-size: 0.55rem;
}
/* 回想强度榜图片比例与回想图鉴一致 */
.tierlist-recalls-shell .tier-card-img-wrap {
    padding-top: 75%;
}

/* 角色强度榜 — 角色图鉴尺寸对齐（shell级覆盖） */
.tierlist-chars-shell .tier-card-body {
    padding: 2px 3px 3px;
}
.tierlist-chars-shell .tier-card-name {
    font-size: 0.55rem;
}

/* 个人日志 — 五小只 1/3 高度适配 */
.journal-shell .bottom-nav { height: 13.5vh; flex: 0 0 13.5%; }
.journal-shell .top-area { height: 86.5vh; flex: 0 0 86.5%; }
.journal-shell .nav-icon-wrap { width: 36%; max-width: 42px; }
.journal-shell .nav-label { font-size: 0.55rem; }
.journal-shell .nav-entry { gap: 3px; padding: 2px; }

/* 回想页 — 五小只 1/3 高度适配 */
.recalls-shell .bottom-nav { height: 13.5vh; flex: 0 0 13.5%; }
.recalls-shell .top-area { height: 86.5vh; flex: 0 0 86.5%; }
.recalls-shell .nav-icon-wrap { width: 36%; max-width: 42px; }
.recalls-shell .nav-label { font-size: 0.55rem; }
.recalls-shell .nav-entry { gap: 3px; padding: 2px; }

/* 回想页 — 全宽 + 下拉不被遮挡 */
.recalls-shell .page-container { max-width: 100%; padding: 0; flex: 0 1 auto; display: flex; flex-direction: column; min-height: 0; }
.recalls-shell .page-header { padding: 6px 4px 2px; flex-shrink: 0; }
.recalls-shell .recall-grid { padding: 0 3px; gap: 3px; flex: 0 1 auto; min-height: 0; }
.recalls-shell .char-filter-bar {
    overflow: visible !important;
    flex-wrap: wrap;
    padding: 4px 3px;
    position: relative;
    z-index: 10000;
}
.recalls-shell .filter-dropdown-menu { z-index: 10001; }

/* 角色页 — 五小只 1/3 高度适配 */
.characters-shell .bottom-nav { height: 13.5vh; flex: 0 0 13.5%; }
.characters-shell .top-area { height: 86.5vh; flex: 0 0 86.5%; }
.characters-shell .nav-icon-wrap { width: 36%; max-width: 42px; }
.characters-shell .nav-label { font-size: 0.55rem; }
.characters-shell .nav-entry { gap: 3px; padding: 2px; }

/* 角色页 — 全宽 + 下拉不被遮挡 */
.characters-shell .page-container { max-width: 100%; padding: 0; flex: 0 1 auto; display: flex; flex-direction: column; min-height: 0; }
.characters-shell .page-header { padding: 6px 4px 2px; flex-shrink: 0; }
.characters-shell .char-grid { padding: 0 3px; gap: 4px; flex: 0 1 auto; min-height: 0; }
.characters-shell .char-filter-bar {
    overflow: visible !important;
    flex-wrap: wrap;
    padding: 4px 3px;
    position: relative;
    z-index: 10000;
}
.characters-shell .filter-dropdown-menu { z-index: 10001; }
.bottom-nav {
    flex: 0 0 40%;
    height: 40vh;
    display: flex;
    background: linear-gradient(180deg, var(--color-bg-alt) 0%, #0d0d1a 100%);
    border-top: 1px solid rgba(255,255,255,0.06);
}

/* ============================================
   4. 导航入口
   ============================================ */
.nav-entry {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-decoration: none;
    color: var(--color-text-dim);
    position: relative;
    padding: 6px;
    transition: all 0.2s ease;
}
.nav-entry:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 20%;
    height: 60%;
    width: 1px;
    background: rgba(255,255,255,0.05);
}
.nav-entry:hover {
    color: var(--color-text);
    background: rgba(255,255,255,0.02);
}
.nav-entry.active {
    color: var(--color-accent);
    background: rgba(255,32,64,0.03);
}
.nav-entry.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 25%;
    right: 25%;
    height: 2px;
    background: var(--color-accent);
    border-radius: 0 0 2px 2px;
    box-shadow: 0 0 8px var(--color-accent-glow);
}
.nav-icon-wrap {
    width: 55%;
    max-width: 80px;
    aspect-ratio: 1 / 1;
    border-radius: 12px;
    overflow: hidden;
    background: var(--color-bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    border: 1px solid rgba(255,255,255,0.04);
}
.nav-entry.active .nav-icon-wrap {
    border-color: rgba(255,32,64,0.15);
    box-shadow: 0 0 12px rgba(255,32,64,0.06);
}
.nav-icon-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.55);
    transition: filter 0.2s ease;
}
.nav-entry.active .nav-icon-img { filter: brightness(1); }
.nav-entry:hover .nav-icon-img { filter: brightness(0.8); }
.nav-label {
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-align: center;
    line-height: 1.15;
}

/* ============================================
   5. 通用页面容器
   ============================================ */
.main-content {
    flex: 1;
    position: relative;
    display: flex;
    flex-direction: column;
}
.page-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 12px;
}

.page-header { padding: 12px 16px 4px; }
.page-subtitle { font-size: 0.8rem; color: var(--color-text-dim); margin: 2px 0 0; }

.card {
    background: var(--color-bg-card);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: var(--border-radius);
    transition: all var(--transition-smooth);
}
.card-hover:hover {
    background: var(--color-bg-hover);
    border-color: rgba(255,255,255,0.1);
    transform: translateY(-2px);
    box-shadow: var(--shadow-elevated);
}
.fade-in {
    opacity: 0;
    transform: translateY(12px);
    animation: fadeInUp 0.4s ease forwards;
}
@keyframes fadeInUp {
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   6. 角色 / 回想 列表卡片
   ============================================ */
.char-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 5px;
    padding: 0 4px;
}
.char-card {
    display: block;
    text-decoration: none;
    overflow: hidden;
    position: relative;
}
.char-card-img-wrap {
    position: relative;
    width: 100%;
    padding-top: 50%;
    overflow: hidden;
    background: transparent;
}
.char-card-img {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}
.char-card:hover .char-card-img { transform: scale(1.05); }
.char-card-body { padding: 3px 4px 4px; }
.char-card-name { font-size: 0.6rem; font-weight: 600; color: var(--color-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; }
.char-card-tags { display: none; }

/* 角色页 — 缩小卡片（第十四次修改） */
.characters-shell .char-card { border-radius: 4px; }
.characters-shell .char-card-body { padding: 2px 3px 3px; }
.characters-shell .char-card-name { font-size: 0.55rem; line-height: 1.15; }
.characters-shell .char-card-img-wrap { border-radius: 4px 4px 0 0; }

/* 角色页 — 首页图标 */
.page-title-with-home { display: flex; align-items: center; gap: 10px; }
.home-icon-link { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; flex-shrink: 0; }
.home-icon-img { width: 78px; height: 78px; object-fit: contain; opacity: 0.6; transition: opacity 0.2s; }
.home-icon-link:hover .home-icon-img { opacity: 1; }

.recall-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 4px;
    padding: 0 4px;
}
.recall-card { display: block; text-decoration: none; overflow: hidden; position: relative; }
.recall-card-img-wrap {
    position: relative;
    width: 100%;
    padding-top: 75%;
    overflow: hidden;
    background: var(--color-bg-card);
}
.recall-card-img {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}
.recall-card:hover .recall-card-img { transform: scale(1.05); }
.recall-card-body { padding: 2px 3px 3px; }
.recall-card-name { font-size: 0.55rem; font-weight: 600; color: var(--color-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; }
.recall-card-tags { display: none; }

/* 回想页 — 缩小卡片 */
.recalls-shell .recall-card { border-radius: 4px; }
.recalls-shell .recall-card-body { padding: 2px 3px 3px; }
.recalls-shell .recall-card-name { font-size: 0.55rem; line-height: 1.15; }
.recalls-shell .recall-card-img-wrap { border-radius: 4px 4px 0 0; }

/* ---- 标签/徽章 ---- */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.65rem;
    font-weight: 600;
    white-space: nowrap;
}
.badge-ssr { background: var(--rarity-ssr-bg); color: var(--rarity-ssr); }
.badge-sr { background: var(--rarity-sr-bg); color: var(--rarity-sr); }
.badge-r { background: var(--rarity-r-bg); color: var(--rarity-r); }
.badge-tier-l { background: var(--tier-l-bg); color: var(--tier-l); }
.badge-tier-s { background: var(--tier-s-bg); color: var(--tier-s); }
.badge-tier-a { background: var(--tier-a-bg); color: var(--tier-a); }
.badge-tier-b { background: var(--tier-b-bg); color: var(--tier-b); }
.badge-tier-c { background: var(--tier-c-bg); color: var(--tier-c); }
.badge-role { background: rgba(255,255,255,0.06); color: var(--color-text-muted); }
.badge-tag { background: rgba(255,255,255,0.04); color: var(--color-text-dim); }
.badge-element { background: rgba(255,255,255,0.06); color: var(--color-text-muted); }

.rarity-ssr { background: var(--rarity-ssr-bg); color: var(--rarity-ssr); border: 1px solid rgba(255,215,0,0.3); }
.rarity-sr { background: var(--rarity-sr-bg); color: var(--rarity-sr); border: 1px solid rgba(192,132,252,0.3); }
.rarity-r { background: var(--rarity-r-bg); color: var(--rarity-r); border: 1px solid rgba(96,165,250,0.3); }

.type-atk-dot { background: rgba(255,60,60,0.15); color: #ff6b6b; }
.type-sup-dot { background: rgba(60,180,255,0.15); color: #4dc9f6; }

/* ---- 搜索框 ---- */
.search-box {
    position: relative;
    max-width: 320px;
    width: 100%;
}
.search-box .input {
    width: 100%;
    padding: 8px 12px 8px 36px;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--border-radius);
    background: var(--color-bg-alt);
    color: var(--color-text);
    font-size: 0.85rem;
    outline: none;
    transition: border-color var(--transition-speed);
}
.search-box .input:focus { border-color: var(--color-accent); }
.search-box .input::placeholder { color: var(--color-text-dim); }

/* ---- 筛选栏 ---- */
.char-filter-bar, .filter-bar {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 8px 12px;
    flex-wrap: wrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.char-search-row {
    display: flex;
    align-items: center;
    gap: 6px;
}
.char-search-box {
    max-width: 200px;
    width: auto;
    flex: 1;
}
.char-search-box .input {
    height: 32px;
    padding: 4px 10px 4px 32px;
    font-size: 0.78rem;
}

/* ---- 下拉筛选 ---- */
.filter-dropdown {
    position: relative;
    display: inline-block;
}
.filter-dropdown-btn {
    padding: 5px 14px;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--border-radius-sm);
    background: var(--color-bg-alt);
    color: var(--color-text-muted);
    font-size: 0.78rem;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 80px;
    justify-content: space-between;
}
.filter-dropdown-btn:hover { background: var(--color-bg-hover); color: var(--color-text); }
.filter-dropdown-btn.active { border-color: var(--color-accent); color: var(--color-accent); }
.filter-active .filter-dropdown-btn { border-color: var(--color-accent); color: var(--color-accent); background: rgba(255,32,64,0.08); }
.filter-dropdown-arrow { font-size: 0.6rem; transition: transform 0.2s ease; }
.filter-dropdown.open .filter-dropdown-arrow { transform: rotate(180deg); }
.filter-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 100;
    min-width: 100%;
    background: var(--color-bg-elevated);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--border-radius-sm);
    padding: 4px;
    box-shadow: var(--shadow-elevated);
    margin-top: 3px;
}
.filter-dropdown.open .filter-dropdown-menu { display: block; }
.filter-dropdown-item {
    display: block;
    padding: 6px 12px;
    font-size: 0.78rem;
    color: var(--color-text-muted);
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.1s ease;
    white-space: nowrap;
}
.filter-dropdown-item:hover { background: var(--color-bg-hover); color: var(--color-text); }
.filter-dropdown-item.active { background: var(--color-accent); color: #fff; }
.filter-icon { width: 16px; height: 16px; vertical-align: middle; margin-right: 4px; border-radius: 2px; object-fit: contain; }

/* ---- 特性颜色圆点 ---- */
.elem-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    vertical-align: middle;
    margin-right: 2px;
}
.elem-gen { background: #ef4444; }   /* 幻 → 红色 */
.elem-kage { background: #3b82f6; }  /* 影 → 蓝色 */
.elem-yoru { background: #22c55e; }  /* 夜 → 绿色 */
.elem-gyou { background: #eab308; }  /* 行 → 黄色 */
.filter-group-label { font-size: 0.75rem; color: var(--color-text-dim); font-weight: 600; white-space: nowrap; }
.filter-group-btns { display: flex; gap: 4px; flex-wrap: nowrap; }
.filter-btn {
    padding: 4px 10px;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--border-radius-sm);
    background: transparent;
    color: var(--color-text-muted);
    font-size: 0.75rem;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition-speed);
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.filter-btn:hover { background: var(--color-bg-hover); color: var(--color-text); }
.filter-btn.active { background: var(--color-accent); color: #fff; border-color: var(--color-accent); }
.filter-elem-icon { width: 16px; height: 16px; border-radius: 2px; object-fit: cover; }

/* ---- 分页 ---- */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 16px;
}
.pagination-info { font-size: 0.8rem; color: var(--color-text-dim); }
.pager-link, .pager-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border-radius: var(--border-radius-sm);
    font-size: 0.8rem;
    color: var(--color-text-muted);
    text-decoration: none;
    transition: all var(--transition-speed);
}
.pager-link:hover { background: var(--color-bg-hover); color: var(--color-text); }
.pager-item.active { background: var(--color-accent); color: #fff; }

.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.text-center { text-align: center; }

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 20px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition-speed);
}
.btn-primary { background: var(--color-accent); color: #fff; }
.btn-primary:hover { background: var(--color-accent-hover); transform: translateY(-1px); }
.btn-secondary { background: rgba(255,255,255,0.08); color: var(--color-text); }
.btn-secondary:hover { background: rgba(255,255,255,0.12); }
.btn-ghost { background: transparent; color: var(--color-text-muted); border: 1px solid rgba(255,255,255,0.1); }
.btn-ghost:hover { border-color: var(--color-accent); color: var(--color-accent); }
.btn-sm { padding: 4px 10px; font-size: 0.75rem; }
.empty-state { text-align: center; padding: 40px 20px; color: var(--color-text-dim); font-size: 0.9rem; }

/* ============================================
   7. 详情页
   ============================================ */
.char-detail-root { max-width: 1100px; margin: 0 auto; padding: 16px; }
.detail-layout { display: flex; gap: 24px; align-items: flex-start; }
.detail-left { width: 340px; flex-shrink: 0; position: sticky; top: 10px; }
.detail-right { flex: 1; min-width: 0; }
.char-portrait-wrap, .recall-portrait-wrap { position: relative; border-radius: var(--border-radius-lg); overflow: hidden; background: var(--color-bg-alt); }
.char-portrait-img, .recall-portrait-img, .detail-portrait { width: 100%; display: block; aspect-ratio: 1; object-fit: cover; }
.detail-tier-badge { position: absolute; top: 10px; left: 10px; padding: 4px 12px; border-radius: var(--border-radius-sm); font-size: 0.85rem; font-weight: 800; color: #fff; }
.tier-l { background: var(--tier-l); } .tier-s { background: var(--tier-s); }
.tier-a { background: var(--tier-a); } .tier-b { background: var(--tier-b); } .tier-c { background: var(--tier-c); }
.detail-rarity-badge { position: absolute; top: 10px; right: 10px; padding: 3px 10px; border-radius: var(--border-radius-sm); font-size: 0.75rem; font-weight: 700; }
.detail-char-name { font-size: 1.5rem; font-weight: 800; color: var(--color-text); margin: 0; }
.detail-char-fullname { font-size: 0.85rem; color: var(--color-text-muted); margin: 2px 0 0; }
.detail-header { margin-bottom: 12px; }
.detail-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.detail-section-title { font-size: 1rem; font-weight: 700; color: var(--color-text); margin: 0 0 8px; padding-bottom: 6px; border-bottom: 2px solid var(--color-accent); display: inline-block; }
.detail-desc { margin: 12px 0; }
.detail-desc-text { font-size: 0.85rem; color: var(--color-text-muted); line-height: 1.6; }
.detail-stats-panel { padding: 12px; }
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stat-item { padding: 8px; background: rgba(255,255,255,0.03); border-radius: var(--border-radius-sm); }
.stat-label { font-size: 0.7rem; color: var(--color-text-dim); text-transform: uppercase; letter-spacing: 0.5px; }
.stat-bar { height: 4px; background: rgba(255,255,255,0.06); border-radius: 2px; margin-top: 4px; overflow: hidden; }
.stat-bar-fill { height: 100%; border-radius: 2px; transition: width 0.6s ease; }
.stat-hp .stat-bar-fill { background: var(--color-success); }
.stat-atk .stat-bar-fill { background: var(--color-accent); }
.stat-def .stat-bar-fill { background: var(--color-info); }
.stat-spd .stat-bar-fill { background: var(--color-warning); }
.skills-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.skill-item { padding: 10px 12px; background: var(--color-bg-card); border: 1px solid rgba(255,255,255,0.06); border-radius: var(--border-radius); }
.skill-header { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.skill-name { font-weight: 700; font-size: 0.85rem; color: var(--color-text); }
.skill-type-badge { font-size: 0.65rem; padding: 1px 6px; border-radius: 8px; background: rgba(255,255,255,0.06); color: var(--color-text-dim); }
.skill-cooldown { font-size: 0.7rem; color: var(--color-text-dim); margin-left: auto; }
.skill-effect { font-size: 0.8rem; color: var(--color-text-muted); line-height: 1.5; }
.detail-elem-icon { width: 20px; height: 20px; vertical-align: middle; }
.related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; margin-top: 8px; }
.related-card { text-decoration: none; display: block; background: var(--color-bg-card); border-radius: var(--border-radius); overflow: hidden; transition: all var(--transition-speed); }
.related-card:hover { background: var(--color-bg-hover); transform: translateY(-2px); }
.related-img-wrap { position: relative; width: 100%; padding-top: 100%; overflow: hidden; background: var(--color-bg-alt); }
.related-img-wrap img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; }
.related-info { padding: 6px 8px 8px; }
.related-name { font-size: 0.75rem; font-weight: 600; color: var(--color-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.related-tags { display: flex; gap: 3px; margin-top: 3px; flex-wrap: wrap; }
.detail-back { padding: 8px 0; }

/* ---- 回想 ---- */
.recall-detail-type-tag { display: inline-block; padding: 3px 10px; border-radius: 10px; font-size: 0.75rem; font-weight: 600; }
.type-atk { background: rgba(255,60,60,0.15); color: #ff6b6b; }
.type-sup { background: rgba(60,180,255,0.15); color: #4dc9f6; }
.recall-skill-card { padding: 12px; }
.recall-skill-content { font-size: 0.85rem; color: var(--color-text-muted); line-height: 1.6; }
.recall-portrait-tags { margin-top: 8px; text-align: center; }

/* ============================================
   8. 强度榜（导航+标题已迁至上方）
   ============================================ */
.tier-label { font-size: 1.3rem; font-weight: 800; }
.tier-label-l { color: var(--tier-l); } .tier-label-s { color: var(--tier-s); }
.tier-label-a { color: var(--tier-a); } .tier-label-b { color: var(--tier-b); } .tier-label-c { color: var(--tier-c); }
.tier-subtitle { font-size: 0.75rem; color: var(--color-text-dim); }
.tier-count { margin-left: auto; font-size: 0.75rem; color: var(--color-text-dim); }
.tier-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 5px; padding: 0 4px; }
.tier-card { display: block; text-decoration: none; overflow: hidden; position: relative; }
.tier-card:hover { }
.tier-card-img-wrap { position: relative; width: 100%; padding-top: 50%; overflow: hidden; background: var(--color-bg-alt); }
.tier-card-img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s ease; }
.tier-card:hover .tier-card-img { transform: scale(1.05); }
.tier-card-body { padding: 3px 4px 4px; }
.tier-card-name { font-size: 0.6rem; font-weight: 600; color: var(--color-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; }
.tier-card-tags { display: none; }

/* 回想强度榜卡片 — 延续回想图鉴的 4:3 + contain 风格 */
.tier-card-recall .tier-card-img-wrap {
    padding-top: 75%;
    background: var(--color-bg-card);
}
.tier-card-recall .tier-card-img {
    object-fit: contain;
}
.tier-elem-tag { font-size: 0.6rem; padding: 1px 6px; border-radius: 8px; }
.elem-gen { background: var(--attr-gen); color: #fff; }
.elem-kage { background: var(--attr-kage); color: #fff; }
.elem-yoru { background: var(--attr-yoru); color: #fff; }
.elem-gyou { background: var(--attr-gyou); color: #fff; }

/* ---- 强度榜 T度导航（美化） ---- */
.tier-nav {
    display: flex;
    gap: 6px;
    padding: 4px 2px;
    flex-wrap: wrap;
}
.tier-nav-item {
    flex: 1;
    min-width: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 4px;
    border-radius: var(--border-radius);
    text-decoration: none;
    background: var(--color-bg-card);
    border: 1px solid rgba(255,255,255,0.05);
    transition: all 0.2s ease;
    cursor: pointer;
}
.tier-nav-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-elevated);
}
.tier-nav-rank {
    font-size: 0.9rem;
    font-weight: 800;
    letter-spacing: 1px;
}
.tier-nav-count {
    font-size: 0.6rem;
    opacity: 0.7;
}
.tier-nav-item.tier-l .tier-nav-rank { color: var(--tier-l); }
.tier-nav-item.tier-s .tier-nav-rank { color: var(--tier-s); }
.tier-nav-item.tier-a .tier-nav-rank { color: var(--tier-a); }
.tier-nav-item.tier-b .tier-nav-rank { color: var(--tier-b); }
.tier-nav-item.tier-c .tier-nav-rank { color: var(--tier-c); }

/* ---- 强度榜标题栏（美化） ---- */
.tier-section { margin-bottom: 16px; }
.tier-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    padding: 6px 10px;
    border-radius: var(--border-radius);
    position: sticky;
    top: 0;
    z-index: 10;
}
.tier-header-l { background: linear-gradient(135deg, rgba(255,32,64,0.2), rgba(255,32,64,0.05)); border-left: 3px solid var(--tier-l); }
.tier-header-s { background: linear-gradient(135deg, rgba(255,215,0,0.15), rgba(255,215,0,0.03)); border-left: 3px solid var(--tier-s); }
.tier-header-a { background: linear-gradient(135deg, rgba(168,85,247,0.15), rgba(168,85,247,0.03)); border-left: 3px solid var(--tier-a); }
.tier-header-b { background: linear-gradient(135deg, rgba(59,130,246,0.12), rgba(59,130,246,0.03)); border-left: 3px solid var(--tier-b); }
.tier-header-c { background: linear-gradient(135deg, rgba(34,197,94,0.12), rgba(34,197,94,0.03)); border-left: 3px solid var(--tier-c); }
.tier-title {
    font-size: 0.85rem;
    font-weight: 700;
    margin: 0;
}
.tier-title-l { color: var(--tier-l); }
.tier-title-s { color: var(--tier-s); }
.tier-title-a { color: var(--tier-a); }
.tier-title-b { color: var(--tier-b); }
.tier-title-c { color: var(--tier-c); }

/* ---- 强度榜筛选 ---- */
.tier-elem-filter { display: flex; gap: 6px; align-items: center; padding: 8px 12px; overflow-x: auto; -webkit-overflow-scrolling: touch; flex-wrap: nowrap; }
.tier-filter-label { font-size: 0.75rem; color: var(--color-text-dim); font-weight: 600; white-space: nowrap; }
.tier-filter-btn { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border: 1px solid rgba(255,255,255,0.08); border-radius: var(--border-radius-sm); background: transparent; color: var(--color-text-muted); font-size: 0.75rem; cursor: pointer; transition: all var(--transition-speed); white-space: nowrap; }
.tier-filter-btn:hover { background: var(--color-bg-hover); }
.tier-filter-btn.active { background: var(--color-accent); color: #fff; border-color: var(--color-accent); }
.tier-filter-btn img { width: 16px; height: 16px; border-radius: 2px; }
.tier-card.tier-hidden { display: none; }

/* ============================================
   9. 首页 — 封面 + 三小样布局（80% / 五小只20%）
   ============================================ */
.home-shell .top-area { height: 80vh; flex: 0 0 80%; }
.home-shell .bottom-nav { height: 20vh; flex: 0 0 20%; }

/* 首页五小只紧凑适配 */
.home-shell .nav-icon-wrap { width: 44%; max-width: 60px; }
.home-shell .nav-label { font-size: 0.68rem; }
.home-shell .nav-entry { gap: 5px; padding: 4px; }

.home-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* ---- 左侧封面区 (60%) ---- */
.hero-section {
    flex: 0 0 60%;
    position: relative;
    overflow: hidden;
    background: var(--color-bg-alt);
}
.hero-carousel { width: 100%; height: 100%; position: relative; overflow: hidden; }
.carousel-track { display: flex; height: 100%; transition: transform 0.5s cubic-bezier(0.4,0,0.2,1); }
.carousel-slide { flex: 0 0 100%; height: 100%; position: relative; text-decoration: none; display: block; }
.carousel-img-wrapper { width: 100%; height: 100%; position: relative; overflow: hidden; }
.carousel-placeholder { position: absolute; inset: 0; }
.carousel-img { width: 100%; height: 100%; object-fit: cover; transition: opacity 0.5s ease; opacity: 0; }
.carousel-img.loaded { opacity: 1; }
.carousel-img.error { opacity: 0.3; }
.carousel-caption {
    position: absolute; bottom: 0; left: 0; right: 0;
    padding: 40px 16px 12px;
    background: linear-gradient(transparent, rgba(0,0,0,0.85));
    color: #fff;
}
.carousel-title { font-size: 0.9rem; font-weight: 700; text-shadow: 0 2px 6px rgba(0,0,0,0.5); }
.hero-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #1a0a2e, #2a1040); }
.hero-text { text-align: center; }
.hero-text h1 { font-size: 1.5rem; color: var(--color-accent); }
.hero-text p { font-size: 0.85rem; color: var(--color-text-muted); margin-top: 4px; }
.carousel-dots { position: absolute; bottom: 8px; right: 10px; display: flex; gap: 4px; z-index: 5; }
.carousel-dot { width: 5px; height: 5px; border-radius: 50%; background: rgba(255,255,255,0.3); border: none; cursor: pointer; transition: all 0.2s ease; padding: 0; }
.carousel-dot.active { background: var(--color-accent); width: 14px; border-radius: 3px; }
.carousel-arrow {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 26px; height: 26px; border-radius: 50%;
    background: rgba(0,0,0,0.4); border: none; color: #fff;
    cursor: pointer; z-index: 5; display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: opacity 0.2s ease;
}
.hero-carousel:hover .carousel-arrow { opacity: 1; }
.carousel-arrow:hover { background: rgba(0,0,0,0.7); }
.carousel-prev { left: 6px; }
.carousel-next { right: 6px; }

/* ---- 右侧边栏 (40%) — 三小样 ---- */
.home-sidebar {
    flex: 0 0 40%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--color-bg);
}

/* ---- 三小样迷你卡片 ---- */
.mini-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.mini-card:last-child { border-bottom: none; }
.mini-card-header {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    font-size: 0.75rem;
    color: var(--color-text);
    border-bottom: 1px solid rgba(255,255,255,0.03);
    background: rgba(0,0,0,0.08);
}
.mini-card-title { font-size: 0.78rem; font-weight: 700; }
.mini-card-more {
    margin-left: auto;
    font-size: 0.6rem;
    color: var(--color-text-dim);
    text-decoration: none;
    padding: 1px 6px;
    border-radius: 4px;
    transition: all 0.15s ease;
}
.mini-card-more:hover { color: var(--color-accent); background: rgba(255,32,64,0.08); }
.mini-card-body {
    flex: 1;
    overflow-y: auto;
    padding: 5px 12px;
    -webkit-overflow-scrolling: touch;
}
.mini-card-body::-webkit-scrollbar { width: 3px; }
.mini-card-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.06); border-radius: 2px; }
.mini-empty { text-align: center; padding: 10px; color: var(--color-text-dim); font-size: 0.65rem; }

/* ---- 公告 ---- */
.mini-announce-list { list-style: none; margin: 0; padding: 0; }
.mini-announce-item {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 3px 0;
    border-bottom: 1px solid rgba(255,255,255,0.02);
}
.mini-announce-item:last-child { border-bottom: none; }
.mini-badge {
    flex: 0 0 auto;
    font-size: 0.48rem;
    padding: 1px 4px;
    border-radius: 3px;
    background: rgba(255,255,255,0.05);
    color: var(--color-text-dim);
    font-weight: 600;
}
.mini-badge.top { background: var(--color-accent); color: #fff; }
.mini-announce-link {
    flex: 1;
    font-size: 0.7rem;
    color: var(--color-text-muted);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.15s ease;
}
.mini-announce-link:hover { color: var(--color-text); }
.mini-announce-date { flex: 0 0 auto; font-size: 0.5rem; color: var(--color-text-dim); }

/* ---- UP池 — 横向行式（小正方形头像 + 名称，一行排列） ---- */
.mini-gacha-row {
    display: flex;
    flex-direction: row;
    gap: 12px;
    padding: 6px 0;
    justify-content: flex-start;
    align-items: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.mini-gacha-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    flex: 0 0 auto;
    width: 44px;
}
.mini-gacha-avatar {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 6px;
    background: var(--color-bg-alt);
}
.mini-gacha-name {
    font-size: 0.55rem;
    color: var(--color-text-muted);
    text-align: center;
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 44px;
}

/* ---- 活动 ---- */
.mini-event-list { list-style: none; margin: 0; padding: 0; }
.mini-event-item {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 3px 0;
    border-bottom: 1px solid rgba(255,255,255,0.02);
    font-size: 0.7rem;
}
.mini-event-item:last-child { border-bottom: none; }
.mini-event-icon { font-size: 0.7rem; flex: 0 0 auto; }
.mini-event-title {
    flex: 1;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 600;
}
.mini-event-type {
    flex: 0 0 auto;
    font-size: 0.5rem;
    padding: 1px 5px;
    border-radius: 3px;
    background: rgba(255,255,255,0.04);
    color: var(--color-text-dim);
}

/* ============================================
   10. 公告列表页 / 详情
   ============================================ */
.announcement-article { max-width: 800px; margin: 0 auto; padding: 16px; }
.announcement-header h1 { font-size: 1.3rem; margin: 0 0 8px; }
.announcement-content { font-size: 0.9rem; color: var(--color-text); line-height: 1.8; }
.announcement-content p { margin: 8px 0; }
.announcement-pager { display: flex; justify-content: space-between; margin-top: 24px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,0.06); }

/* ============================================
   11. 个人日志
   ============================================ */
.journal-tabs { display: flex; gap: 4px; padding: 12px 16px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.journal-tab { padding: 6px 14px; border-radius: var(--border-radius); font-size: 0.8rem; font-weight: 600; cursor: pointer; white-space: nowrap; color: var(--color-text-dim); background: transparent; border: 1px solid transparent; transition: all 0.2s ease; }
.journal-tab:hover { background: var(--color-bg-hover); color: var(--color-text); }
.journal-tab.active { background: var(--color-accent); color: #fff; }
.journal-content { max-width: 800px; margin: 0 auto; padding: 0 16px; }
.journal-section { display: none; }
.journal-section.active { display: block; }
.journal-entry { background: var(--color-bg-card); border: 1px solid rgba(255,255,255,0.06); border-radius: var(--border-radius); padding: 12px; margin-bottom: 12px; }
.journal-entry-title { font-size: 0.9rem; font-weight: 700; color: var(--color-text); }
.journal-entry-meta { font-size: 0.7rem; color: var(--color-text-dim); margin-top: 4px; }
.journal-entry-tags { display: flex; gap: 4px; margin-top: 6px; flex-wrap: wrap; }

/* ============================================
   日记本 — Markdown 日记
   ============================================ */
.diary-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
    height: 100%;
}
.diary-sidebar {
    flex: 0 0 260px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(255,255,255,0.06);
    background: var(--color-bg-alt);
    overflow: hidden;
}
.diary-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.diary-sidebar-header h3 { margin: 0; font-size: 0.9rem; }
.diary-list {
    flex: 1;
    overflow-y: auto;
    padding: 4px;
}
.diary-sidebar-item {
    padding: 8px 10px;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: background 0.2s;
    margin-bottom: 2px;
}
.diary-sidebar-item:hover { background: var(--color-bg-hover); }
.diary-sidebar-item.active { background: rgba(255,32,64,0.1); border-left: 2px solid var(--color-accent); }
.diary-sidebar-item-date { font-size: 0.6rem; color: var(--color-text-dim); }
.diary-sidebar-item-title { font-size: 0.78rem; font-weight: 600; color: var(--color-text); margin: 1px 0; }
.diary-sidebar-item-preview { font-size: 0.6rem; color: var(--color-text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.diary-empty { text-align: center; padding: 30px 12px; color: var(--color-text-dim); }
.diary-empty-hint { font-size: 0.7rem; margin-top: 4px; opacity: 0.6; }
.diary-sidebar-footer {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-top: 1px solid rgba(255,255,255,0.06);
    font-size: 0.65rem;
}
.diary-total { color: var(--color-text-dim); margin-right: auto; }

/* ---- 编辑器 ---- */
.diary-editor {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.diary-placeholder {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--color-text-dim);
    padding: 40px;
    text-align: center;
}
.diary-placeholder-icon { font-size: 3rem; margin-bottom: 12px; opacity: 0.4; }
.diary-placeholder h3 { font-size: 1rem; margin: 0 0 6px; color: var(--color-text); }
.diary-placeholder p { font-size: 0.8rem; margin: 0 0 4px; }
.diary-placeholder-hint { font-size: 0.7rem; opacity: 0.5; margin-top: 12px !important; }

.diary-editor-active {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.diary-editor-header {
    padding: 10px 14px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.diary-title-input {
    width: 100%;
    border: none;
    background: transparent;
    color: var(--color-text);
    font-size: 1rem;
    font-weight: 700;
    outline: none;
    padding: 4px 0;
}
.diary-title-input::placeholder { color: var(--color-text-dim); opacity: 0.5; }
.diary-editor-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}
.diary-date-input {
    border: none;
    background: transparent;
    color: var(--color-text-dim);
    font-size: 0.7rem;
    outline: none;
    cursor: pointer;
}
.diary-date-input::-webkit-calendar-picker-indicator { filter: invert(0.6); cursor: pointer; }

.diary-editor-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}
.diary-toolbar {
    display: flex;
    gap: 2px;
    padding: 4px 8px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    flex-wrap: wrap;
    background: var(--color-bg-alt);
}
.diary-tb-btn {
    padding: 3px 8px;
    border: 1px solid transparent;
    border-radius: 3px;
    background: transparent;
    color: var(--color-text-muted);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.15s;
    line-height: 1.4;
}
.diary-tb-btn:hover { background: var(--color-bg-hover); color: var(--color-text); border-color: rgba(255,255,255,0.08); }

.diary-textarea {
    flex: 1;
    width: 100%;
    border: none;
    background: transparent;
    color: var(--color-text);
    font-size: 0.85rem;
    line-height: 1.7;
    padding: 12px 14px;
    outline: none;
    resize: none;
    font-family: inherit;
}
.diary-textarea::placeholder { color: var(--color-text-dim); opacity: 0.4; }

.diary-preview {
    flex: 1;
    overflow-y: auto;
    padding: 12px 14px;
    font-size: 0.85rem;
    line-height: 1.7;
    display: none;
}
.diary-preview h1 { font-size: 1.3rem; margin: 16px 0 8px; color: var(--color-text); }
.diary-preview h2 { font-size: 1.1rem; margin: 14px 0 6px; color: var(--color-text); }
.diary-preview h3 { font-size: 0.95rem; margin: 12px 0 4px; color: var(--color-text); }
.diary-preview p { margin: 6px 0; }
.diary-preview ul { margin: 4px 0; padding-left: 20px; }
.diary-preview li { margin: 2px 0; }
.diary-preview code {
    background: rgba(255,255,255,0.06);
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 0.8rem;
}
.diary-preview pre { background: rgba(0,0,0,0.2); padding: 10px; border-radius: var(--border-radius-sm); overflow-x: auto; }
.diary-preview pre code { background: none; padding: 0; }
.diary-preview img { max-width: 100%; border-radius: var(--border-radius-sm); margin: 8px 0; }
.diary-preview a { color: var(--color-accent); }

.diary-editor-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 14px;
    border-top: 1px solid rgba(255,255,255,0.06);
    font-size: 0.65rem;
}
.diary-char-count { color: var(--color-text-dim); }
.diary-save-status { color: var(--color-success); font-weight: 600; }
.diary-btn {
    padding: 4px 10px;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--border-radius-sm);
    background: transparent;
    color: var(--color-text-muted);
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.2s;
}
.diary-btn:hover { background: var(--color-bg-hover); color: var(--color-text); }
.diary-btn-add { border-color: var(--color-accent); color: var(--color-accent); }
.diary-btn-add:hover { background: var(--color-accent); color: #fff; }
.diary-btn-delete { font-size: 0.85rem; padding: 2px 6px; }
.diary-btn-export, .diary-btn-import { font-size: 0.6rem; padding: 2px 6px; }

/* 日记本图片 */
.diary-img { max-width: 100%; border-radius: 4px; }

/* 周刊/旧日志兼容 */
.journal-content { max-width: 800px; margin: 0 auto; padding: 0 16px; }

/* ============================================
   12. 响应式
   ============================================ */
@media (max-width: 768px) {
    .detail-layout { flex-direction: column; }
    .detail-left { width: 100%; position: static; max-width: 340px; margin: 0 auto; }
    .char-grid, .recall-grid { grid-template-columns: repeat(5, 1fr); gap: 4px; padding: 0 4px; }
    .tier-grid { grid-template-columns: repeat(5, 1fr); gap: 4px; }
    .nav-icon-wrap { width: 48%; max-width: 58px; }
    .nav-label { font-size: 0.7rem; }
    .char-filter-bar, .filter-bar, .tier-elem-filter { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; padding: 6px 8px; }
    .detail-char-name { font-size: 1.2rem; }
}
@media (max-width: 480px) {
    .mini-gacha-row { gap: 6px; }
    .mini-gacha-cell { width: 34px; }
    .mini-gacha-avatar { width: 30px; height: 30px; }
    .mini-gacha-name { font-size: 0.4rem; max-width: 34px; }
    .char-grid, .recall-grid { grid-template-columns: repeat(4, 1fr); gap: 3px; padding: 0 3px; }
    .top-area { height: 55vh; }
    .bottom-nav { height: 45vh; }
    .nav-icon-wrap { width: 42%; max-width: 50px; }
    .nav-label { font-size: 0.65rem; }
    .home-layout { flex-direction: column; flex: none; overflow-y: auto; }
    .hero-section { flex: none; height: 30vh; }
    .home-sidebar { flex: none; height: auto; }
    .tier-grid { grid-template-columns: repeat(4, 1fr); gap: 3px; }
    .detail-char-name { font-size: 1.1rem; }
    .stats-grid { grid-template-columns: 1fr; }
}
@media (max-width: 360px) {
    .char-grid, .recall-grid { grid-template-columns: repeat(3, 1fr); gap: 2px; padding: 0 2px; }
    .tier-grid { grid-template-columns: repeat(3, 1fr); gap: 2px; }
}

/* ============================================
   13. 暗色/亮色模式切换
   ============================================ */
body, body * { transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease; }
body.light-mode {
    --color-bg: #f5f0fa;
    --color-bg-alt: #ede4f5;
    --color-bg-card: #ffffff;
    --color-bg-hover: #f0e8f8;
    --color-bg-elevated: #faf5ff;
    --color-text: #1a1a2e;
    --color-text-muted: #6a5a80;
    --color-text-dim: #9a8ab0;
    --color-text-inverse: #f5f0fa;
    --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-elevated: 0 4px 16px rgba(0, 0, 0, 0.12);
    --shadow-glow: 0 0 20px rgba(255, 32, 64, 0.08);
}
.theme-toggle {
    position: fixed; top: 10px; right: 10px; z-index: 9999;
    width: 38px; height: 38px; border: 1px solid rgba(255,255,255,0.15);
    border-radius: 50%; background: var(--color-bg-elevated); color: var(--color-text);
    font-size: 1.2rem; cursor: pointer; display: flex;
    align-items: center; justify-content: center; transition: all 0.3s ease;
    opacity: 0.7; box-shadow: var(--shadow-card);
}
.theme-toggle:hover { opacity: 1; transform: scale(1.1); box-shadow: var(--shadow-glow); }
.light-mode .theme-toggle { border-color: rgba(0,0,0,0.12); }

/* ============================================
   14. 收藏夹
   ============================================ */
.fav-btn {
    position: absolute; top: 6px; right: 6px; z-index: 5;
    width: 30px; height: 30px; border: none; border-radius: 50%;
    background: rgba(0,0,0,0.4); color: #888; font-size: 1rem;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: all 0.2s ease; backdrop-filter: blur(4px);
}
.fav-btn:hover { transform: scale(1.15); background: rgba(0,0,0,0.6); }
.fav-btn.active { color: var(--color-gold); background: rgba(255,215,0,0.2); text-shadow: 0 0 8px rgba(255,215,0,0.5); }
.fav-btn.active:hover { background: rgba(255,215,0,0.35); }
.fav-filter-btn {
    padding: 6px 14px; border: 1px solid rgba(255,255,255,0.15);
    border-radius: var(--border-radius); background: transparent;
    color: var(--color-text-muted); font-size: 0.8rem; cursor: pointer; white-space: nowrap;
}
.fav-filter-btn:hover { background: var(--color-bg-hover); color: var(--color-text); }
.fav-filter-btn.active { background: var(--color-accent); color: #fff; border-color: var(--color-accent); }
.detail-fav-btn {
    display: inline-flex; align-items: center; gap: 5px; padding: 5px 12px;
    border: 1px solid rgba(255,255,255,0.15); border-radius: var(--border-radius);
    background: transparent; color: var(--color-text-muted); font-size: 0.85rem;
    cursor: pointer; transition: all 0.2s ease; margin-left: 8px;
}
.detail-fav-btn:hover { background: var(--color-bg-hover); color: var(--color-text); }
.detail-fav-btn.active { color: var(--color-gold); border-color: rgba(255,215,0,0.4); background: rgba(255,215,0,0.1); }

/* ============================================
   15. 极简日志 — Start / End 模式
   ============================================ */
.journal-page .page-container {
    max-width: 700px;
    margin: 0 auto;
}

.journal-simple {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    padding: 0 16px;
}

.journal-controls {
    display: flex;
    justify-content: center;
    gap: 16px;
    padding: 16px 0;
}

.j-btn {
    padding: 10px 32px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 2px;
}

.j-btn-start {
    background: linear-gradient(135deg, var(--color-accent), #ff4d6a);
    color: #fff;
    box-shadow: 0 4px 16px rgba(255, 32, 64, 0.3);
}
.j-btn-start:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(255, 32, 64, 0.45);
}

.j-btn-end {
    background: rgba(255,255,255,0.08);
    color: var(--color-text-muted);
    border: 1px solid rgba(255,255,255,0.12);
}
.j-btn-end:hover {
    background: rgba(255,255,255,0.14);
    color: var(--color-text);
}

/* 空状态 */
.journal-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--color-text-dim);
    padding: 60px 20px;
    text-align: center;
}
.journal-empty-icon {
    font-size: 3.5rem;
    margin-bottom: 16px;
    opacity: 0.35;
}
.journal-empty p {
    font-size: 0.9rem;
    margin: 4px 0;
}
.journal-empty strong { color: var(--color-text); }
.journal-empty-hint {
    font-size: 0.7rem !important;
    opacity: 0.4;
    margin-top: 12px !important;
}

/* 编辑器 */
.journal-editor {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.journal-editor textarea {
    flex: 1;
    width: 100%;
    border: none;
    background: transparent;
    color: var(--color-text);
    font-size: 0.95rem;
    line-height: 1.8;
    padding: 12px 4px;
    outline: none;
    resize: none;
    font-family: inherit;
    min-height: 200px;
}
.journal-editor textarea::placeholder {
    color: var(--color-text-dim);
    opacity: 0.3;
}

.journal-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 4px;
    border-top: 1px solid rgba(255,255,255,0.06);
    font-size: 0.65rem;
    color: var(--color-text-dim);
    flex-shrink: 0;
}
.journal-meta #j-date {
    font-weight: 600;
    color: var(--color-text-muted);
}
.journal-meta #j-save-status {
    font-weight: 600;
}

/* 响应式 */
@media (max-width: 480px) {
    .journal-simple { padding: 0 10px; }
    .journal-editor textarea { font-size: 0.85rem; padding: 8px 2px; }
}
