/* ELS 粉丝站 样式 */
:root {
    --bg: #0f1117;
    --bg-soft: #161a23;
    --card: #1b202b;
    --border: #2a3140;
    --text: #e6e9ef;
    --muted: #8b93a3;
    --accent: #ff6699;
    --accent-2: #4a9eff;
    --ok: #46c98a;
    --warn: #e6b34a;
    --danger: #e5605c;
    --radius: 10px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Microsoft YaHei", "Hiragino Sans GB", Roboto, Helvetica, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.65;
}

a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: 1000px; margin: 0 auto; padding: 0 16px; }

h1 { font-size: 24px; margin: 20px 0 12px; }
h2 { font-size: 18px; margin: 0 0 12px; }

small, .small { font-size: 12px; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }

/* 顶部导航 */
.site-header {
    background: rgba(15, 17, 23, 0.92);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(8px);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 58px; gap: 16px; }
.brand { display: flex; align-items: center; color: var(--text); }
.brand:hover { text-decoration: none; opacity: 0.92; }
.brand-logo { display: block; height: 40px; width: auto; }
.nav-links { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.nav-links a { color: var(--muted); font-size: 14px; }
.nav-links a:hover { color: var(--text); text-decoration: none; }
.nav-links a.admin-link { color: var(--warn); }

/* 按钮 */
.btn {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 9px 16px;
    font-size: 14px;
    cursor: pointer;
    line-height: 1.2;
}
.btn:hover { filter: brightness(1.08); text-decoration: none; color: #fff; }
.btn-sm { padding: 5px 10px; font-size: 13px; }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn-ghost:hover { background: var(--bg-soft); }
.btn-danger { background: var(--danger); }
.btn-warn { background: var(--warn); color: #1a1a1a; }

/* 卡片与栅格 */
.main { padding-bottom: 40px; }
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    margin: 16px 0;
}
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 720px) { .grid-2 { grid-template-columns: 1fr; } }

/* 首页 hero（首屏：居中偏上的 logo + 小站名 + 欢迎语 + 按钮） */
.hero {
    padding: 36px 0 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}
.hero-logo { display: block; width: 520px; max-width: 100%; height: auto; }
.hero-title { font-size: 15px; font-weight: 400; letter-spacing: 0.28em; color: var(--muted); margin: 14px 0 0; }
.hero-sub { color: var(--muted); margin: 0 0 16px; }
/* 站点公告：已移出首屏，放在所有模块之后、页脚上方（覆盖 .notice 默认的上边距） */
.notice.home-notice { max-width: 760px; margin: 24px auto 0; }
.notice {
    background: var(--bg-soft);
    border-left: 3px solid var(--accent);
    border-radius: 6px;
    padding: 12px 14px;
    margin: 0 0 16px;
}
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

/* 表格 */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table thead th { color: var(--muted); font-weight: 600; font-size: 13px; }
.table-kv th { width: 120px; color: var(--muted); font-weight: 600; }

/* 列表 */
.list { list-style: none; padding: 0; margin: 0; }
.list li { padding: 8px 0; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.list li:last-child { border-bottom: 0; }

/* 标签与徽章 */
.tag { display: inline-block; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 5px; padding: 1px 6px; font-size: 12px; color: var(--muted); }
.tag-hot { background: rgba(255, 102, 153, 0.15); border-color: var(--accent); color: var(--accent); }
.badge { display: inline-block; border-radius: 5px; padding: 1px 7px; font-size: 12px; background: var(--bg-soft); border: 1px solid var(--border); color: var(--muted); }
.badge-ok { background: rgba(70, 201, 138, 0.15); border-color: var(--ok); color: var(--ok); }
.badge-warn { background: rgba(230, 179, 74, 0.15); border-color: var(--warn); color: var(--warn); }
.badge-admin { background: rgba(74, 158, 255, 0.15); border-color: var(--accent-2); color: var(--accent-2); }

/* 统计 */
.stats { display: flex; gap: 28px; flex-wrap: wrap; }
.stat { display: flex; flex-direction: column; }
.stat strong { font-size: 22px; }
.stat span { color: var(--muted); font-size: 13px; }

/* 表单 */
label { display: block; margin: 12px 0; font-size: 14px; color: var(--muted); }
input[type="text"], input[type="password"], input[type="url"], input[type="number"],
input[type="date"], input[type="time"], select, textarea {
    display: block;
    width: 100%;
    margin-top: 6px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    padding: 9px 11px;
    font-size: 14px;
    font-family: inherit;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent-2); }
textarea { resize: vertical; }
label.checkbox { display: flex; align-items: center; gap: 8px; color: var(--text); }
label.checkbox input { width: auto; margin: 0; }
.form-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 720px) { .form-row { grid-template-columns: 1fr 1fr; } }

/* 提示消息 */
.flash { border-radius: 8px; padding: 10px 14px; margin: 12px 0; font-size: 14px; border: 1px solid var(--border); }
.flash-success { background: rgba(70, 201, 138, 0.12); border-color: var(--ok); color: var(--ok); }
.flash-error { background: rgba(229, 96, 92, 0.12); border-color: var(--danger); color: var(--danger); }
.flash-warning { background: rgba(230, 179, 74, 0.12); border-color: var(--warn); color: var(--warn); }

/* 登录/注册 */
.auth-wrap { display: flex; justify-content: center; padding: 24px 0; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card h1 { margin-top: 0; }

/* 留言 */
.message-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.rich { white-space: normal; line-height: 1.7; word-break: break-word; }
.reply { margin-top: 12px; padding: 10px 12px; background: var(--bg-soft); border-left: 3px solid var(--accent-2); border-radius: 6px; }
.reply > strong { color: var(--accent-2); font-size: 13px; }
.reply-form { margin-top: 12px; }
.action-row { display: flex; gap: 8px; flex-wrap: wrap; }
.inline-form { display: inline; }
.clamp { margin: 0; }
.announcement h1 { margin-top: 0; }

/* 搜索 */
.search-form { display: flex; gap: 8px; }
.search-form input { margin: 0; }

/* 后台 */
.admin-header { border-bottom-color: var(--accent-2); }
.admin-layout { display: grid; grid-template-columns: 190px 1fr; gap: 20px; align-items: start; padding-top: 16px; }
@media (max-width: 720px) { .admin-layout { grid-template-columns: 1fr; } }
.admin-side { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.admin-side a { padding: 11px 16px; color: var(--muted); font-size: 14px; border-bottom: 1px solid var(--border); }
.admin-side a:last-child { border-bottom: 0; }
.admin-side a:hover { background: var(--bg-soft); color: var(--text); text-decoration: none; }
.admin-side a.active { background: var(--bg-soft); color: var(--accent); border-left: 3px solid var(--accent); }
.admin-content h1 { margin-top: 0; }

/* 页脚 */
.site-footer { border-top: 1px solid var(--border); color: var(--muted); font-size: 13px; padding: 20px 0; margin-top: 20px; }

/* ================= 周表海报（参考图左侧样式） ================= */
.wk-poster {
    --wk-coral: #ff6f61;
    --wk-coral-2: #ff8f7d;
    --wk-red: #ff4d4f;
    display: flex;
    gap: 16px;
    background: linear-gradient(160deg, #fff9fa, #ffeef0);
    border-radius: 16px;
    padding: 18px;
    color: #4a2b2b;
    box-shadow: 0 10px 34px rgba(0, 0, 0, 0.28);
}
.wk-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.wk-poster.with-char .wk-main { flex: 0 1 62%; }
.wk-char { position: relative; overflow: hidden; flex: 1 1 38%; display: flex; align-items: flex-end; justify-content: center; min-width: 0; }
.wk-char img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }

.wk-head {
    display: flex; align-items: center; gap: 10px;
    background: linear-gradient(135deg, var(--wk-coral-2), var(--wk-coral));
    color: #fff; border-radius: 10px; padding: 8px 14px; margin-bottom: 12px;
}
.wk-head-icon { display: inline-flex; }
.wk-head-text { font-weight: 800; letter-spacing: 0.5px; font-size: 15px; }
.wk-head-range { margin-left: auto; font-size: 12px; opacity: 0.92; }

.wk-rows { display: flex; flex-direction: column; gap: 8px; }
.wk-row { display: flex; align-items: stretch; gap: 10px; }
.wk-date {
    flex: 0 0 64px; display: flex; flex-direction: column; align-items: center; justify-content: center;
    background: #fff; border: 2px solid #ffd9d3; border-radius: 10px; color: var(--wk-coral);
    line-height: 1.15; padding: 6px 2px;
}
.wk-date b { font-size: 15px; }
.wk-date span { font-size: 11px; color: #c98a84; }
.wk-slot { flex: 1 1 auto; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.wk-item {
    display: flex; align-items: center; gap: 10px;
    background: linear-gradient(135deg, var(--wk-coral-2), var(--wk-coral));
    color: #fff; border-radius: 10px; padding: 9px 14px; font-weight: 700; font-size: 14px;
    min-height: 40px;
}
.wk-item-title { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wk-item-note { font-weight: 400; font-size: 12px; opacity: 0.9; margin-left: auto; white-space: nowrap; }
.wk-item.is-hl { background: linear-gradient(135deg, #ff7a6a, var(--wk-red)); }
.wk-item.is-hl::before {
    content: ''; width: 0; height: 0;
    border-top: 5px solid transparent; border-bottom: 5px solid transparent;
    border-left: 7px solid #fff; margin-right: 2px;
}
.wk-item-empty { background: #f0e7e7; color: #b39a9a; font-weight: 600; justify-content: center; }

/* ================= 后台周视图（飞书式日历） ================= */
.cal-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.cal-toolbar .cal-range { font-weight: 700; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.cal-col { background: var(--bg-soft); border: 1px solid var(--border); border-radius: 10px; min-height: 190px; display: flex; flex-direction: column; }
.cal-col-head { padding: 8px 6px; text-align: center; border-bottom: 1px solid var(--border); }
.cal-col-head .cal-d { font-weight: 700; }
.cal-col-head .cal-w { color: var(--muted); font-size: 12px; }
.cal-col-head.is-today .cal-d { color: var(--accent); }
.cal-col-body { flex: 1 1 auto; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.cal-chip { background: var(--card); border: 1px solid var(--border); border-left: 3px solid var(--accent-2); border-radius: 6px; padding: 6px 8px; font-size: 13px; }
.cal-chip.is-hl { border-left-color: var(--danger); }
.cal-chip .cal-chip-t { color: var(--muted); font-size: 12px; }
.cal-chip .cal-chip-tools { margin-top: 4px; display: flex; gap: 6px; }
.cal-chip .cal-chip-tools a { font-size: 12px; }
.cal-add { margin-top: auto; display: block; text-align: center; padding: 6px; border: 1px dashed var(--border); border-radius: 6px; color: var(--muted); font-size: 13px; }
.cal-add:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
@media (max-width: 900px) { .cal-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* 后台周视图（飞书式网格） */
.sch-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.sch-cal {
    --sch-h: 48px; --sch-g: 60px;
    border: 1px solid var(--border); border-radius: var(--radius);
    background: var(--bg-soft); overflow: hidden; overflow: clip;
}
.sch-head {
    display: grid; grid-template-columns: var(--sch-g) repeat(7, minmax(0, 1fr));
    position: sticky; top: 58px; z-index: 3;
    background: var(--card); border-bottom: 1px solid var(--border);
}
.sch-corner { }
.sch-dayhead { padding: 6px 4px; text-align: center; border-left: 1px solid var(--border); }
.sch-dh-date { display: block; font-weight: 700; font-size: 13px; }
.sch-dh-wd { display: block; font-size: 12px; color: var(--muted); }
.sch-dayhead.is-today .sch-dh-date { color: var(--accent); }
.sch-body { display: grid; grid-template-columns: var(--sch-g) repeat(7, minmax(0, 1fr)); }
.sch-time {
    height: var(--sch-h); font-size: 12px; color: var(--muted);
    text-align: right; padding-right: 8px; border-top: 1px solid var(--border);
}
.sch-time:first-child { border-top: 0; }
.sch-col { position: relative; border-left: 1px solid var(--border); }
.sch-slot { height: calc(var(--sch-h) / 2); border-top: 1px dashed rgba(255, 255, 255, 0.07); cursor: pointer; }
.sch-slot.is-hour { border-top: 1px solid var(--border); }
.sch-slot:first-child { border-top: 0; }
.sch-slot:hover { background: rgba(255, 255, 255, 0.04); }

.sch-event {
    position: absolute; z-index: 5; border-radius: 6px; overflow: visible;
    cursor: grab; touch-action: none; user-select: none;
    background: rgba(74, 158, 255, 0.16); border: 1px solid rgba(74, 158, 255, 0.55);
    border-left: 3px solid var(--accent-2);
}
.sch-event.c1 { background: rgba(255, 102, 153, 0.16); border-color: rgba(255, 102, 153, 0.55); border-left-color: var(--accent); }
.sch-event.c2 { background: rgba(70, 201, 138, 0.16); border-color: rgba(70, 201, 138, 0.55); border-left-color: var(--ok); }
.sch-event.c3 { background: rgba(230, 179, 74, 0.16); border-color: rgba(230, 179, 74, 0.55); border-left-color: var(--warn); }
.sch-event.c4 { background: rgba(229, 96, 92, 0.16); border-color: rgba(229, 96, 92, 0.55); border-left-color: var(--danger); }
.sch-event.is-drag { cursor: grabbing; opacity: 0.92; z-index: 40; box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45); }
.sch-ev-body { padding: 3px 6px; height: 100%; overflow: hidden; }
.sch-ev-title { font-size: 12px; font-weight: 700; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sch-ev-time { font-size: 11px; color: var(--muted); line-height: 1.2; white-space: nowrap; }
.sch-ev-grip { position: absolute; left: 0; right: 0; height: 6px; cursor: ns-resize; }
.sch-ev-grip.top { top: 0; }
.sch-ev-grip.bottom { bottom: 0; }
/* 点击条目后才显示「删除 / 复制」，二者同一行并排、永不重叠（窄格也不会互相盖住） */
.sch-ev-acts {
    display: none;
    position: absolute; left: 0; top: -14px; z-index: 60;
    gap: 4px; white-space: nowrap;
}
.sch-event.is-editing .sch-ev-acts { display: flex; }
.sch-event.acts-below .sch-ev-acts { top: auto; bottom: -14px; }
/* 靠近日历右边界时改为右对齐，避免被容器裁掉 */
.sch-event.acts-flip .sch-ev-acts { left: auto; right: 0; }
.sch-ev-act {
    padding: 0 6px; font-size: 11px; line-height: 17px; white-space: nowrap;
    border: 1px solid var(--border); border-radius: 4px;
    background: var(--card); color: var(--text); cursor: pointer;
}
.sch-ev-act.del:hover { border-color: var(--danger); color: var(--danger); }
.sch-ev-act.cpy:hover { border-color: var(--accent-2); color: var(--accent-2); }
.sch-rename {
    position: absolute; left: 3px; right: 3px; top: 50%; transform: translateY(-50%);
    z-index: 50; padding: 2px 4px; font-size: 12px;
    border: 1px solid var(--accent-2); border-radius: 4px;
    background: var(--bg); color: var(--text);
}
@media (max-width: 760px) {
    .sch-cal { overflow-x: auto; }
    .sch-head, .sch-body { min-width: 720px; }
}
/* 草稿状态提示：有未保存改动时高亮 */
#sch-status.is-dirty { color: var(--warn); }

/* 周表海报容器（前台） */
.poster-wrap { margin: 16px 0; }

/* ================= 主播图库 ================= */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.gallery-card {
    background: var(--bg-soft); border: 1px solid var(--border); border-radius: 10px;
    padding: 10px; display: flex; flex-direction: column; gap: 6px; min-width: 0;
}
.gallery-thumb { width: 100%; height: 130px; object-fit: cover; border-radius: 8px; background: var(--card); display: block; }
.gallery-folder { display: block; font-weight: 700; padding: 6px 2px; word-break: break-all; }
.gallery-name { font-size: 13px; word-break: break-all; }
.gallery-tools { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.gallery-tools .inline-form { display: inline-flex; gap: 6px; align-items: center; }
.gallery-card details summary { cursor: pointer; }
.gallery-card details form { margin-top: 8px; }

/* ================= 封面选择 / 位置调整 ================= */
.cover-pick-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.cover-pick {
    margin: 0; padding: 4px; border: 2px solid var(--border); border-radius: 10px;
    background: var(--bg-soft); line-height: 0;
}
.cover-pick.is-active { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(255, 102, 153, 0.25); }
.cover-pick-btn { padding: 0; border: 0; background: none; cursor: pointer; line-height: 0; border-radius: 7px; overflow: hidden; }
.cover-pick-btn img { width: 120px; height: 150px; object-fit: cover; display: block; }

.cover-editor { display: flex; gap: 18px; flex-wrap: wrap; align-items: flex-start; }
.cover-preview {
    position: relative; overflow: hidden; width: 360px; height: 460px;
    background: linear-gradient(160deg, #fff9fa, #ffeef0); border: 1px solid var(--border);
    border-radius: 12px; cursor: grab;
}
.cover-preview:active { cursor: grabbing; }
.cover-preview img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.cover-editor-side { flex: 1 1 220px; min-width: 200px; }
.cover-editor-side label { margin-top: 0; }
.cover-editor-side input[type="range"] { width: 100%; }

/* 角色图候选卡片下方的说明文字 */
.cover-pick-cap {
    display: block; margin-top: 4px; line-height: 1.4; font-size: 12px;
    color: var(--muted); text-align: center; max-width: 120px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* 导出参数调节区 */
.export-controls { display: flex; flex-wrap: wrap; gap: 18px 28px; align-items: flex-start; }
.export-controls label { margin-top: 0; flex: 1 1 240px; min-width: 220px; }
.export-controls input[type="range"] { width: 100%; }
.export-controls .action-row { flex: 1 1 100%; }

/* 导出预览画布（固定 16:9） */
.export-canvas {
    display: block; width: 100%; max-width: 960px; height: auto;
    border-radius: 12px; background: #fff7f8;
    box-shadow: 0 10px 34px rgba(0, 0, 0, 0.28); cursor: grab; touch-action: none;
}
.export-canvas:active { cursor: grabbing; }

/* ================= 个人主页 ================= */
.profile-head { margin-bottom: 12px; }
.profile-avatar {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    border: 2px solid var(--accent);
    background: var(--bg-soft);
}
.profile-avatar-fallback {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: var(--bg-soft);
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: var(--muted);
}

/* ================= 首页（滚动吸附 + 三栏） ================= */
.hero-welcome { color: var(--muted); margin: 10px 0 22px; }
.hero-welcome a { color: var(--accent-2); text-decoration: underline; }
.hero-welcome a:hover { color: var(--accent); }

/* 首页整体背景底图（淡化铺底，保持深色主题可读性） */
html.home-snap body {
    background-image:
        linear-gradient(rgba(15, 17, 23, 0.6), rgba(15, 17, 23, 0.8)),
        url("../../gallery/web/%E8%83%8C%E6%99%AF.png");
    background-position: center, center;
    background-size: cover, cover;
    background-repeat: no-repeat, no-repeat;
    background-attachment: fixed, fixed;
}

/* 上滑/下滑一次进入下一个模块（滚动吸附） */
html.home-snap { scroll-snap-type: y mandatory; scroll-behavior: smooth; }
html.home-snap .main.wrap { max-width: 1280px; }
html.home-snap .hero,
html.home-snap .home-main > section[id] {
    min-height: calc(100vh - 58px);
    scroll-snap-align: start;
    scroll-snap-stop: always;
    scroll-margin-top: 58px;
}
html.home-snap .hero { display: flex; flex-direction: column; justify-content: center; padding: 0; }
html.home-snap .home-main > section[id] {
    margin: 0;
    padding: 18px 4px;
    overflow-y: auto;
    background: transparent;
    border: 0;
}
html.home-snap .site-footer { scroll-snap-align: end; }

/* 三栏：左侧目录 / 中间主要模块 / 右侧时间表 */
.home-layout { display: grid; grid-template-columns: 224px minmax(0, 1fr) 300px; gap: 24px; align-items: stretch; }

.home-rail-inner { position: sticky; top: 78px; padding-left: 2px; }
.home-rail-inner::before {
    content: '';
    position: absolute;
    left: 9px;
    top: 12px;
    bottom: 12px;
    width: 2px;
    background: var(--border);
}
.home-rail-inner a {
    position: relative;
    display: block;
    padding: 9px 8px 9px 28px;
    color: var(--muted);
    font-size: 16px;
    border-radius: 6px;
}
.home-rail-inner a::before {
    content: '';
    position: absolute;
    left: 5px;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--bg);
    border: 2px solid var(--border);
}
.home-rail-inner a:hover { color: var(--text); text-decoration: none; }
.home-rail-inner a.active { color: var(--accent); font-weight: 700; }
.home-rail-inner a.active::before { border-color: var(--accent); background: var(--accent); }

.home-main { min-width: 0; }

/* 公告板用 transform 放大后会横向溢出所在区块。区块默认是 overflow-y: auto，
   按规范另一轴会算成 auto —— 于是底部冒出横向拖动条，一拖整块公告板（连底图）就跟着位移。
   该区块只有 min-height、不会内部滚动，所以改为不裁切、不产生滚动条即可。 */
html.home-snap .home-main > #sec-announcements { overflow: visible; }

/* 首页 · 公告底图（公告.png 竖版，内容排在底图内部空白区） */
.notice-board {
    --board-pad: calc(100vh - 58px - 36px - 8px);
    position: relative;
    width: calc(var(--board-pad) * 0.8934);
    height: var(--board-pad);
    max-width: 100%;
    margin: 0 auto;
    aspect-ratio: 2104 / 2355;
    /* 整块中心放大 1.04 倍（底图不缩放，外框完整可见）；溢出量 13px 左右 / 15px 上下，落在三栏间隙与区块内边距内 */
    transform: scale(1.04);
    background: url("../../gallery/web/%E5%85%AC%E5%91%8A.png") center / 100% 100% no-repeat;
}
.notice-board-inner {
    /* 一行公告的高度：17px 字号 × 1.65 行高 + 上下内边距 16px + 1px 分隔线 ≈ 45px */
    --row-h: 45px;
    position: absolute;
    /* 左右各内缩 16%：底图内部纯色区为 13.7%~86.7%，此处再留约 15px 保护边；
       内框宽 ≈ 645px × 68% ≈ 438px，17px 字号下 20 个汉字约 340px，加日期与间距仍在框内
       （带「置顶」标签时接近临界，过长的标题会自动折行） */
    left: 16%;
    right: 16%;
    /* 顶部在底图内框上沿（17.5%）基础上再多留 2 行文字高度作为保护 */
    top: calc(17.5% + var(--row-h) * 2);
    /* 底部同样多留保护边（底图内部纯色区下沿为 92.9%） */
    bottom: 12%;
    /* 公告正文：加粗宋体，字号放大到 20px */
    font-family: "SimSun", "Songti SC", "STSong", "Noto Serif CJK SC", serif;
    font-size: 20px;
    font-weight: 700;
    /* 纵向可滚动，横向一律不出滚动条（不能让底部出现拖动条） */
    overflow-y: auto;
    overflow-x: hidden;
    /* 长串英文/数字也允许断行，避免撑出横向滚动 */
    overflow-wrap: anywhere;
    color: #000000;
    /* 文字：白色填充 + 沿用本元素原色描边（不支持描边的浏览器回退为原来的颜色） */
    -webkit-text-fill-color: rgb(255, 255, 255)000;
    -webkit-text-stroke: 0px #ffffff;
}
.notice-board-inner .muted { color: #141414; -webkit-text-stroke-color: rgb(0, 0, 0); }
/* 日期等小字同步放大（原来是 12px） */
.notice-board-inner .small { font-size: 20px; }
.notice-list li { justify-content: space-between; border-bottom: 1px solid rgba(120, 70, 58, 0.28); }
.notice-list a { color: hsl(0, 0%, 0%); font-weight: 700; -webkit-text-stroke-color: #ffffff; }
.notice-list a:hover { color: #ffffff; -webkit-text-stroke-color: #ffffff; }
/* 「置顶」是白底标签，保持原色不加描边 */
.notice-list .tag-hot {
    background: rgba(255, 255, 255, 0.6);
    border-color: #ff6f61;
    color: #d2432f;
    font-size: 13px;
    -webkit-text-fill-color: currentColor;
    -webkit-text-stroke-width: 0;
}
.notice-more { margin: 10px 0 0; }
.notice-more a { color: #8a5a5a; -webkit-text-stroke-color: #8a5a5a; }

/* 首页 · 右侧时间表（日期方块 + 内容方块） */
.side-stick { position: sticky; top: 78px; }
/* 顶部留出「直播中」贴图的高度，避免压到第一条日程 */
.side-schedule { position: relative; margin: 0; padding: 34px 16px 16px; }
.side-schedule h2 { font-size: 16px; margin-bottom: 10px; }
/* 「直播中」贴图：整块贴在卡片框内右上角，比原尺寸放大到 120%（46px → 55px） */
.live-now {
    position: absolute;
    top: 8px;
    right: 8px;
    height: 55px;
    width: auto;
    filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.45));
}
.side-sessions { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.side-session { display: flex; align-items: stretch; gap: 8px; }
.side-date {
    flex: 0 0 52px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #ff85ae, var(--accent));
    border-radius: 8px;
    color: #fff;
    line-height: 1.15;
    padding: 5px 2px;
}
.side-date b { font-size: 14px; }
.side-date span { font-size: 11px; color: rgba(255, 255, 255, 0.85); }
.side-block {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border: 2px solid #ffd9d3;
    border-radius: 8px;
    padding: 6px 10px;
    color: #ff6f61;
}
.side-block.is-hl { background: linear-gradient(135deg, #ff7a6a, var(--danger)); border-color: transparent; color: #fff; }
.side-block em { font-style: normal; font-weight: 700; font-size: 13px; white-space: nowrap; }
.side-block strong { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-more { margin: 10px 0 0; }

.video-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.video-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    color: var(--text);
}
.video-card:hover { border-color: var(--accent); text-decoration: none; }
.video-card img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; background: var(--card); }
.video-card .video-title {
    padding: 8px 10px 0;
    font-size: 14px;
    font-weight: 600;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.video-card .video-meta { padding: 4px 10px 10px; color: var(--muted); font-size: 12px; }

.game-list { display: flex; flex-direction: column; }
.game-item {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}
.game-item:last-child { border-bottom: 0; }
.game-item-main { display: flex; align-items: center; gap: 8px; min-width: 0; }
.game-item-main strong { word-break: break-word; }
.game-votes { color: var(--accent-2); font-size: 14px; margin-left: auto; }
.game-item form { margin: 0; }

@media (max-width: 900px) {
    html.home-snap .main.wrap { max-width: 100%; }
    .home-layout { grid-template-columns: 1fr; gap: 16px; }
    .home-rail { display: none; }
    .side-stick { position: static; }
    .notice-board { width: 100%; height: auto; max-height: none; }
    .video-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
    .brand-logo { height: 32px; }
    .video-grid { grid-template-columns: 1fr; }
}

/* ---------------- 小游戏 ---------------- */
.mini-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.mini-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    color: var(--text);
}
.mini-card:hover { border-color: var(--accent); text-decoration: none; }
.mini-card img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; background: var(--card); }
.mini-card-body { display: flex; flex-direction: column; gap: 4px; padding: 10px; }
.mini-card-body strong { font-size: 15px; }
.mini-card-score { color: var(--muted); font-size: 13px; }
.mini-card-score strong { color: var(--accent); font-size: 15px; }

.mini-player-head {
    display: flex;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}
.mini-player-head h1 { margin: 0; }
.mini-player-meta { display: flex; gap: 12px; flex-wrap: wrap; align-items: baseline; margin-left: auto; }
.mini-frame-wrap {
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    background: #000;
}
.mini-frame { display: block; width: 100%; height: 760px; border: 0; }

@media (max-width: 700px) {
    .mini-frame { height: 620px; }
}

/* 资源库 */
.reslib-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
    gap: 16px;
    margin: 16px 0;
}
.res-card {
    display: flex;
    flex-direction: column;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
}
.res-card:hover { border-color: var(--accent-2); }
.res-card h2 { margin: 0 0 6px; font-size: 18px; }
.res-card h2 a { color: var(--text); }
.res-card h2 a:hover { color: var(--accent-2); text-decoration: none; }
.res-card-sub { margin: 0 0 8px; color: var(--muted); font-size: 13px; }
.res-card-desc { margin: 0 0 12px; }
.res-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: auto;
    flex-wrap: wrap;
}
.res-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.res-meta { color: var(--muted); font-size: 12px; margin: 0; }
.res-back { margin: 16px 0 0; }
.res-hero { margin: 8px 0 0; }
.res-hero h1 { margin: 6px 0; }
.res-sub { margin: 0 0 8px; color: var(--muted); }
.res-section-title { font-size: 16px; margin: 0 0 10px; }
.res-file {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}
.res-file:last-of-type { border-bottom: 0; }
.res-file-main { flex: 1; min-width: 220px; }
.res-file-name { font-weight: 600; word-break: break-all; }
.res-file-note { margin-top: 2px; color: var(--muted); font-size: 13px; word-break: break-all; }
.res-file-size { color: var(--muted); font-size: 13px; white-space: nowrap; }
.res-steps { margin: 0; padding-left: 22px; }
.res-steps li { margin: 6px 0; }
.res-notes { margin: 0; padding-left: 22px; color: var(--muted); }
.res-notes li { margin: 4px 0; }
@media (max-width: 720px) {
    .res-file { align-items: flex-start; }
}
