/* ============ 前台样式 —— 个人导航页 ============ */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --primary: #2563eb;
    --bg: #ffffff;
    --panel: #f8fafc;
    --text-1: #1e293b;
    --text-2: #475569;
    --text-3: #94a3b8;
    --border: #e2e8f0;
    --hover: #f1f5f9;
    --tag-bg: #e2e8f0;
    --shadow: 0 1px 3px rgba(15, 23, 42, .08);
}

html[data-theme="dark"] {
    --primary: #60a5fa;
    --bg: #0f172a;
    --panel: #1e293b;
    --text-1: #f1f5f9;
    --text-2: #cbd5e1;
    --text-3: #64748b;
    --border: #334155;
    --hover: #273449;
    --tag-bg: #334155;
    --shadow: 0 1px 3px rgba(0, 0, 0, .4);
}

html { scroll-behavior: smooth; }

body {
    font-family: "Inter", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text-1);
    transition: background .25s, color .25s;
}

.layout { display: flex; min-height: 100vh; }

/* ---------- 左侧边栏 ---------- */
.sidebar {
    width: 240px;
    flex-shrink: 0;
    background: var(--panel);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 22px 16px;
}

.logo-row { display: flex; align-items: center; gap: 10px; padding: 0 8px 20px; }

.logo-badge {
    width: 38px; height: 38px;
    border-radius: 10px;
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    font-size: 15px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    letter-spacing: .5px;
}

.logo-title { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.logo-title strong { font-size: 17px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.logo-title small { font-size: 12px; color: var(--text-3); }

.side-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }

.nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--text-2);
    text-decoration: none;
    font-size: 14px;
    transition: background .15s, color .15s;
}
.nav-item:hover { background: var(--hover); }
.nav-item.active { background: color-mix(in srgb, var(--primary) 12%, transparent); color: var(--primary); font-weight: 600; }
.nav-item .emoji-icon { width: 18px; text-align: center; line-height: 1; }
.nav-brand-icon {
    width: 20px; height: 20px;
    border-radius: 6px;
    background: #64748b;
    padding: 3px;
    flex-shrink: 0;
}

.side-footer { padding: 16px 8px 0; border-top: 1px solid var(--border); }
.slogan { font-size: 12px; color: var(--text-3); margin-bottom: 12px; }
.side-icons { display: flex; gap: 10px; }

.icon-btn {
    width: 34px; height: 34px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text-2);
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer;
    text-decoration: none;
    transition: border-color .15s, color .15s, transform .15s;
}
.icon-btn:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-1px); }

/* ---------- 右侧内容 ---------- */
.content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.content.fade-in { animation: content-fade .3s ease; }
@keyframes content-fade {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: none; }
}

/* ---------- Hero ---------- */
.hero {
    position: relative;
    min-height: 220px;
    padding: 34px 34px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    background-size: cover;
    background-position: center;
    border-bottom: 1px solid var(--border);
    overflow: hidden;
}

/* 默认背景：黄昏湖面风格的渐变 */
.hero-default {
    background:
        radial-gradient(ellipse 90% 60% at 78% 22%, rgba(255, 214, 140, .55), transparent 60%),
        radial-gradient(ellipse 70% 55% at 90% 70%, rgba(255, 158, 110, .38), transparent 65%),
        linear-gradient(160deg, #dbeafe 0%, #e0f2fe 30%, #fde8cf 62%, #fbcfa3 82%, #93c5dd 100%);
}
html[data-theme="dark"] .hero-default {
    background:
        radial-gradient(ellipse 90% 60% at 78% 22%, rgba(96, 165, 250, .18), transparent 60%),
        linear-gradient(160deg, #101c33 0%, #16233d 45%, #1e2c48 75%, #101a2e 100%);
}

.hero-left { display: flex; align-items: center; gap: 20px; position: relative; z-index: 2; }

.avatar {
    width: 96px; height: 96px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: #fff;
    border: 3px solid rgba(255, 255, 255, .85);
    box-shadow: var(--shadow);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-3);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

.hero-info { display: flex; flex-direction: column; gap: 8px; max-width: 560px; }
.hero-info h1 { font-size: 24px; font-weight: 700; color: var(--text-1); }
.hero-desc { font-size: 14px; color: var(--text-2); line-height: 1.7; }

.hero-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.tag {
    background: var(--tag-bg);
    color: var(--text-2);
    font-size: 12px;
    padding: 6px 12px;
    border-radius: 8px;
}

.hero-right { display: flex; align-items: center; gap: 12px; position: relative; z-index: 2; }

.search-box {
    display: flex; align-items: center; gap: 8px;
    background: var(--hover);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0 12px;
    height: 36px;
    width: 208px;
    color: var(--text-3);
    transition: border-color .15s;
}
.search-box:focus-within { border-color: var(--primary); }
.search-box input {
    border: none; outline: none; background: transparent;
    font-size: 13px; color: var(--text-1); width: 100%;
    font-family: inherit;
}
.search-box input::placeholder { color: var(--text-3); }

.handwrite {
    position: absolute;
    right: 30px; bottom: 16px;
    font-family: "Segoe Script", "Bradley Hand", "Comic Sans MS", cursive;
    font-size: 26px;
    color: rgba(100, 116, 139, .32);
    pointer-events: none;
    user-select: none;
    z-index: 1;
    transform: rotate(-4deg);
}
html[data-theme="dark"] .handwrite { color: rgba(148, 163, 184, .22); }

/* ---------- 主内容 ---------- */
.main { flex: 1; padding: 30px 34px 20px; background: var(--bg); }

.block { margin-bottom: 40px; }

.block-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.block-header h2 { font-size: 18px; font-weight: 700; color: var(--text-1); display: flex; align-items: center; gap: 6px; }
.block-icon { font-size: 17px; display: inline-flex; align-items: center; color: var(--primary); }
.block-icon svg { display: block; }

.more-link { font-size: 14px; color: var(--primary); text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.more-link:hover { text-decoration: underline; }

/* 卡片网格 */
.card-grid { display: grid; gap: 16px; }
.card-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.card-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.card-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.card-grid.cols-6 { grid-template-columns: repeat(6, 1fr); }

.link-card {
    display: flex; align-items: center; gap: 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 13px 14px;
    text-decoration: none;
    transition: background .15s, border-color .15s, transform .15s, box-shadow .15s;
    min-width: 0;
}
.link-card:hover {
    background: var(--hover);
    border-color: color-mix(in srgb, var(--primary) 45%, transparent);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.link-icon {
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    color: #fff;
    overflow: hidden;
    line-height: 1;
}
.link-icon img { width: 100%; height: 100%; object-fit: cover; display: block; }

.link-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.link-name { font-size: 14px; font-weight: 600; color: var(--text-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.link-desc { font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.link-arrow { color: var(--text-3); flex-shrink: 0; transition: color .15s, transform .15s; }
.link-card:hover .link-arrow { color: var(--primary); transform: translateX(2px); }

/* 心情卡片 */
.mood-card {
    display: flex; align-items: center; gap: 24px;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 22px 26px;
    background: var(--panel);
    flex-wrap: wrap;
}
.mood-img { width: 150px; height: 100px; object-fit: cover; border-radius: 8px; flex-shrink: 0; }
.mood-text { flex: 1; min-width: 240px; }
.mood-text p { font-size: 15px; color: var(--text-2); line-height: 1.8; }
.mood-author { display: inline-block; margin-top: 8px; font-size: 13px; color: var(--text-3); }
.mood-btn {
    background: var(--primary);
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    padding: 9px 20px;
    border-radius: 8px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: opacity .15s, transform .15s;
}
.mood-btn:hover { opacity: .9; transform: translateY(-1px); }
html[data-theme="dark"] .mood-btn { color: #0f172a; font-weight: 600; }

/* ---------- 独立文档页 ---------- */
.doc-content { background: var(--bg); }
.doc-main {
    flex: 1;
    width: 100%;
    max-width: 860px;
    margin: 0 auto;
    padding: 36px 40px 30px;
}

.doc-back { margin-bottom: 18px; }
.doc-back a {
    display: inline-flex; align-items: center; gap: 2px;
    font-size: 13px; color: var(--text-3); text-decoration: none;
}
.doc-back a:hover { color: var(--primary); }
.doc-back a svg { margin-left: -4px; }

.doc-head { border-bottom: 1px solid var(--border); padding-bottom: 20px; margin-bottom: 28px; }
.doc-head h1 {
    font-size: 26px; font-weight: 700; color: var(--text-1);
    display: flex; align-items: center; gap: 10px; line-height: 1.35;
}
.doc-head-icon { display: inline-flex; color: var(--primary); }
.doc-head-icon img { width: 26px; height: 26px; border-radius: 8px; background: #64748b; padding: 4px; box-sizing: border-box; }
.doc-meta { margin-top: 8px; font-size: 13px; color: var(--text-3); }

.doc-body { display: flex; flex-direction: column; gap: 22px; }

.doc-block-text {
    font-size: 15px;
    line-height: 1.95;
    color: var(--text-2);
}

.doc-block-image { margin: 0; }
.doc-block-image img {
    display: block;
    width: 100%;
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}
.doc-block-image figcaption {
    margin-top: 10px;
    text-align: center;
    font-size: 13px;
    color: var(--text-3);
}

.doc-empty, .doc-404 {
    border: 1px dashed var(--border);
    border-radius: 12px;
    padding: 56px 24px;
    text-align: center;
    color: var(--text-3);
    font-size: 14px;
}
.doc-404 p { margin-bottom: 18px; }
.doc-btn {
    display: inline-flex; align-items: center; gap: 5px;
    background: var(--primary);
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    padding: 9px 20px;
    border-radius: 8px;
}
html[data-theme="dark"] .doc-btn { color: #0f172a; font-weight: 600; }
.doc-btn:hover { opacity: .9; }

/* ---------- 侧边栏音乐播放器 ---------- */
.player {
    margin-top: auto;
    display: flex; flex-direction: column; gap: 10px;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px 14px 12px;
    background: var(--hover);
}
.player-top { display: flex; align-items: center; gap: 11px; min-width: 0; }
.player-disc {
    width: 44px; height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    border: 3px solid var(--bg);
    box-shadow: var(--shadow);
    animation: disc-spin 8s linear infinite;
    animation-play-state: paused;
    flex-shrink: 0;
}
.player.playing .player-disc { animation-play-state: running; }
@keyframes disc-spin { to { transform: rotate(360deg); } }

/* 长波浪均衡器（显示在歌名右侧，播放时起伏） */
.player-title-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.eq {
    display: none; align-items: center; gap: 3px;
    height: 16px; flex-shrink: 0;
}
.player.playing .eq { display: inline-flex; }
.eq i {
    width: 3px; height: 8px;
    background: var(--primary);
    border-radius: 2px;
    transform-origin: center;
    animation: eq-wave 1.1s ease-in-out infinite;
}
.eq i:nth-child(1) { height: 6px;  animation-delay: 0s; }
.eq i:nth-child(2) { height: 11px; animation-delay: .12s; }
.eq i:nth-child(3) { height: 16px; animation-delay: .24s; }
.eq i:nth-child(4) { height: 11px; animation-delay: .36s; }
.eq i:nth-child(5) { height: 6px;  animation-delay: .48s; }
@keyframes eq-wave {
    0%, 100% { transform: scaleY(.35); opacity: .65; }
    50%      { transform: scaleY(1);   opacity: 1; }
}

.player-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.player-title { font-size: 13px; font-weight: 600; color: var(--text-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-artist { font-size: 11px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-height: 13px; }

.player-progress { height: 4px; border-radius: 2px; background: var(--border); cursor: pointer; }
.player-progress-bar { height: 100%; width: 0%; border-radius: 2px; background: var(--primary); }

.player-bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.player-time { font-size: 11px; color: var(--text-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.player-controls { display: flex; gap: 4px; align-items: center; }
.pl-btn {
    width: 26px; height: 26px;
    border: none; background: transparent;
    color: var(--text-2);
    border-radius: 7px;
    cursor: pointer; padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
    transition: color .15s, background .15s;
}
.pl-btn:hover { color: var(--primary); background: color-mix(in srgb, var(--primary) 10%, transparent); }
.pl-btn svg { display: block; }
.pl-play { background: var(--primary); color: #fff; width: 32px; height: 32px; border-radius: 50%; }
.pl-play:hover { background: var(--primary); color: #fff; opacity: .88; }
html[data-theme="dark"] .pl-play { color: #0f172a; font-weight: 600; }

/* ---------- 首页公告弹窗 ---------- */
.notice-mask {
    position: fixed; inset: 0; z-index: 1000;
    background: rgba(15, 23, 42, .5);
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
    opacity: 0; visibility: hidden;
    transition: opacity .25s, visibility .25s;
}
.notice-mask.show { opacity: 1; visibility: visible; }
.notice-card {
    width: 360px; max-width: 100%;
    background: var(--bg);
    border-radius: 16px;
    padding: 28px 26px 24px;
    text-align: center;
    box-shadow: 0 24px 60px rgba(15, 23, 42, .3);
    transform: translateY(14px) scale(.97);
    transition: transform .25s;
}
.notice-mask.show .notice-card { transform: none; }
.notice-icon {
    width: 52px; height: 52px;
    margin: 0 auto 14px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--primary) 12%, transparent);
    color: var(--primary);
    display: flex; align-items: center; justify-content: center;
}
.notice-card h3 { font-size: 17px; color: var(--text-1); margin-bottom: 10px; }
.notice-text { font-size: 14px; color: var(--text-2); line-height: 1.8; }
.notice-btns { display: flex; gap: 10px; margin-top: 20px; }
.notice-btn {
    flex: 1;
    display: inline-flex; align-items: center; justify-content: center; gap: 5px;
    padding: 10px 12px;
    border-radius: 9px;
    font-size: 14px; font-family: inherit;
    border: none; cursor: pointer;
    transition: opacity .15s, transform .15s;
}
.notice-btn:hover { opacity: .9; }
.notice-btn:active { transform: translateY(1px); }
.notice-btn-primary { background: var(--primary); color: #fff; }
html[data-theme="dark"] .notice-btn-primary { color: #0f172a; font-weight: 600; }
.notice-btn-ghost { background: var(--hover); color: var(--text-2); border: 1px solid var(--border); }

/* ---------- 页脚 ---------- */
.page-footer {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 34px;
    border-top: 1px solid var(--border);
    font-size: 13px;
    color: var(--text-3);
}
.page-footer a { color: var(--text-3); text-decoration: none; }
.page-footer a:hover { color: var(--primary); }

/* ---------- 搜索筛选 ---------- */
.js-hidden { display: none !important; }
.no-result {
    text-align: center;
    color: var(--text-3);
    font-size: 14px;
    padding: 40px 0;
    display: none;
}

/* ---------- 响应式 ---------- */
@media (max-width: 1200px) {
    .card-grid.cols-6 { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 1000px) {
    .sidebar { display: none; }
    .card-grid.cols-4, .card-grid.cols-6 { grid-template-columns: repeat(2, 1fr); }
    .card-grid.cols-3 { grid-template-columns: repeat(2, 1fr); }
    .hero { padding: 26px 22px; }
    .main { padding: 24px 22px 12px; }
    .page-footer { padding: 16px 22px; }
    .handwrite { display: none; }
    .doc-main { padding: 24px 20px 20px; }
}

@media (max-width: 560px) {
    .card-grid.cols-2, .card-grid.cols-3, .card-grid.cols-4, .card-grid.cols-6 { grid-template-columns: 1fr; }
    .hero-left { flex-direction: column; align-items: flex-start; }
    .avatar { width: 72px; height: 72px; }
    .hero-right { width: 100%; }
    .search-box { flex: 1; width: auto; }
}
