/* ============================================================
   双布局模式：方案A（底部Tab App化）+ 方案C（封面剧场故事商店）
   暗金视觉 token 沿用 base.css；本文件在 lobby.css 之后加载
   ============================================================ */

.empty-sub { color: var(--faint); font-size: 12.5px; }

/* ============ 方案A：Tab 壳 ============ */
.applayout { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.tabbody { flex: 1; overflow-y: auto; min-height: 0; display: flex; flex-direction: column; }
.tabbody .lobby { padding-bottom: 18px; }

.tabbar {
    display: flex; flex: none; background: var(--panel);
    border-top: 1px solid var(--line);
    padding: 4px 4px calc(4px + env(safe-area-inset-bottom, 0px));
}
.tab {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px;
    background: none; border: none; border-radius: var(--radius-sm);
    padding: 7px 0 5px; color: var(--dim); position: relative;
}
.tab:hover { border-color: transparent; }
.tab.on { color: var(--accent); }
.tab .ticon { font-family: var(--font-story); font-size: 20px; line-height: 1.2; font-weight: 700; }
.tab .tlbl { font-size: 11px; letter-spacing: .5px; }
.tab-badge {
    position: absolute; top: 3px; left: calc(50% + 8px); min-width: 17px; height: 17px; padding: 0 5px;
    border-radius: 999px; background: rgba(150,48,42,.95); border: 1px solid rgba(255,200,170,.5);
    color: #ffe9dd; font-size: 10px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
}

/* 大厅 Tab：题材筛选胶囊行 */
.genre-pills { display: flex; gap: 8px; overflow-x: auto; padding: 2px 18px 6px; }
.genre-pills::-webkit-scrollbar { display: none; }
.pill {
    flex: none; font-size: 12.5px; padding: 6px 14px; border-radius: 999px;
    background: var(--panel); border: 1px solid var(--line); color: var(--dim); white-space: nowrap;
}
.pill.on { background: linear-gradient(180deg, #ecc27f, var(--accent)); color: var(--accent-ink); border-color: transparent; font-weight: 700; }

/* 继续玩 Tab / 详情页存档：纵向列表行 */
.save-list { display: flex; flex-direction: column; }
.save-row {
    display: flex; gap: 12px; align-items: center; padding: 12px 18px;
    border-bottom: 1px solid var(--line); cursor: pointer; text-align: left;
}
.save-row:active { background: rgba(224,180,106,.06); }
.sr-cover { width: 54px; height: 72px; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--line); flex: none; }
.sr-main { flex: 1; min-width: 0; }
.sr-r1 { display: flex; align-items: baseline; gap: 8px; }
.sr-name { font-weight: 700; font-size: 14.5px; font-family: var(--font-story); letter-spacing: .5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-mail {
    flex: none; font-size: 10.5px; padding: 1px 7px; border-radius: 999px;
    background: rgba(120,40,40,.88); border: 1px solid rgba(255,200,170,.55); color: #ffe9dd; font-weight: 700;
}
.sr-when { margin-left: auto; flex: none; color: var(--faint); font-size: 12px; }
.sr-pv { color: var(--dim); font-size: 12.5px; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-meta { color: var(--faint); font-size: 11.5px; margin-top: 3px; }

/* 传讯 Tab / 整页：会话行 */
.dm-list { display: flex; flex-direction: column; }
.dm-row { display: flex; gap: 12px; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--line); cursor: pointer; }
.dm-row:active { background: rgba(224,180,106,.06); }
.dm-av { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; border: 1px solid var(--line); flex: none; background: var(--panel2); }
.dm-main { flex: 1; min-width: 0; }
.dm-r1 { display: flex; align-items: baseline; gap: 8px; }
.dm-npc { font-weight: 700; font-size: 14.5px; }
.dm-when { margin-left: auto; flex: none; color: var(--faint); font-size: 12px; }
.dm-r2 { display: flex; align-items: center; gap: 8px; margin-top: 3px; }
.dm-last { color: var(--dim); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.dm-un {
    flex: none; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
    background: rgba(150,48,42,.95); border: 1px solid rgba(255,200,170,.5);
    color: #ffe9dd; font-size: 10.5px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
}
/* 传讯按存档分组：组头=剧本封面+存档时间+该存档未读合计 */
.dm-group { margin-bottom: 6px; }
.dm-group-head { display: flex; align-items: center; gap: 9px; padding: 12px 18px 6px; cursor: pointer; }
.dm-g-cover { width: 26px; height: 26px; border-radius: 8px; object-fit: cover; border: 1px solid var(--line); flex: none; background: var(--panel2); }
.dm-g-name { font-family: var(--font-story, "Kaiti SC","KaiTi","STKaiti",serif); font-size: 15px; color: var(--accent); letter-spacing: 1px; }
.dm-g-when { color: var(--faint); font-size: 11.5px; }
.dm-group-head .dm-un { margin-left: auto; }
.dm-group .dm-row { padding-left: 26px; }
.dm-group .dm-row:last-child { border-bottom: none; }

/* 我的 Tab */
.me-balance {
    margin: 10px 18px 4px; padding: 18px 20px;
    background: linear-gradient(160deg, rgba(224,180,106,.14), rgba(224,180,106,.04)), var(--panel);
    border: 1px solid rgba(224,180,106,.3); border-radius: var(--radius-lg);
}
.mb-lbl { color: var(--dim); font-size: 12px; letter-spacing: 1px; }
.mb-num { font-size: 34px; font-weight: 800; color: var(--accent); font-family: var(--font-story); line-height: 1.3; }
.mb-unit { font-size: 14px; color: var(--dim); font-weight: 400; }

.style-opts { display: flex; gap: 10px; margin: 0 18px; }
.style-opt {
    flex: 1; display: flex; flex-direction: column; gap: 3px; align-items: center;
    padding: 13px 10px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-md);
}
.style-opt.on { border-color: var(--accent); box-shadow: 0 0 0 1px rgba(224,180,106,.35); }
.so-t { font-size: 14px; font-weight: 700; font-family: var(--font-story); letter-spacing: .5px; }
.style-opt.on .so-t { color: var(--accent); }
.so-s { font-size: 11.5px; color: var(--faint); }

.persona-list { margin: 0 18px; display: flex; flex-direction: column; gap: 8px; }
.persona-row {
    display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
    background: var(--panel2); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 11px 13px;
}
.pr-name { font-weight: 600; font-size: 13.5px; flex: none; }
.pr-sum { margin-left: auto; color: var(--dim); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pr-none { color: var(--faint); }
.me-tip { margin: 8px 18px 0; color: var(--faint); font-size: 12px; }
.me-logout { text-align: center; padding: 26px 0 10px; }

/* ============ 方案C：剧场商店 ============ */
.store { flex: 1; overflow-y: auto; min-height: 0; padding-bottom: 34px; }
.store section { margin-top: 24px; }

.avatar-btn {
    width: 34px; height: 34px; border-radius: 50%; padding: 0; flex: none;
    background: radial-gradient(circle at 35% 30%, #ecc27f, var(--accent) 60%, #8a6527);
    color: var(--accent-ink); font-weight: 800; font-family: var(--font-story); font-size: 15px;
    border: none; display: flex; align-items: center; justify-content: center;
}

/* Hero 轮播大卡 */
.hero { position: relative; margin-top: 8px; }
.hero-slide { position: relative; display: none; height: 400px; overflow: hidden; cursor: default; }
.hero-slide.on { display: block; }
.hero-slide img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-veil { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10,8,5,.18) 0%, transparent 30%, rgba(10,8,5,.55) 62%, rgba(10,8,5,.95)); }
.new-badge {
    position: absolute; top: 14px; left: 16px; padding: 3px 10px; border-radius: 999px;
    background: linear-gradient(180deg, #ecc27f, var(--accent)); color: var(--accent-ink);
    font-size: 11.5px; font-weight: 800; letter-spacing: 1px; box-shadow: 0 2px 10px rgba(0,0,0,.4);
}
.hero-info { position: absolute; left: 20px; right: 20px; bottom: 40px; }
.hero-title { font-family: var(--font-story); font-size: 30px; font-weight: 800; letter-spacing: 1px; text-shadow: 0 2px 12px rgba(0,0,0,.65); }
.hero-hook { color: rgba(242,234,217,.82); font-size: 13px; margin-top: 6px; line-height: 1.5; text-shadow: 0 1px 6px rgba(0,0,0,.6); }
.btn-play {
    margin-top: 14px; padding: 10px 30px; border-radius: 999px; border: none;
    background: linear-gradient(180deg, #ecc27f, var(--accent)); color: var(--accent-ink);
    font-weight: 800; font-size: 15px; font-family: var(--font-story); letter-spacing: 3px;
    box-shadow: 0 6px 18px rgba(224,180,106,.3);
}
.hero-dots { position: absolute; bottom: 14px; left: 0; right: 0; display: flex; gap: 6px; justify-content: center; z-index: 2; }
.dot { width: 6px; height: 6px; border-radius: 999px; background: rgba(242,234,217,.3); cursor: pointer; transition: all .2s ease; }
.dot.on { width: 16px; background: var(--accent); }

/* 题材分区：竖版海报卡（2:3） */
.poster-rail { display: flex; gap: 12px; overflow-x: auto; padding: 2px 18px 8px; }
.poster-rail::-webkit-scrollbar { display: none; }
.poster {
    position: relative; flex: none; width: 122px; aspect-ratio: 2/3;
    border-radius: var(--radius-md); overflow: hidden; cursor: pointer;
    border: 1px solid var(--line); box-shadow: var(--shadow-card);
    transition: transform .15s ease, border-color .15s ease;
}
.poster:hover { transform: translateY(-3px); border-color: rgba(224,180,106,.4); }
.poster img { width: 100%; height: 100%; object-fit: cover; display: block; }
.poster .veil { position: absolute; inset: 0; background: linear-gradient(180deg, transparent 42%, rgba(10,8,5,.5) 68%, rgba(10,8,5,.94)); }
.poster-info { position: absolute; left: 9px; right: 9px; bottom: 8px; }
.p-name { font-family: var(--font-story); font-weight: 700; font-size: 14px; letter-spacing: .5px; text-shadow: 0 2px 8px rgba(0,0,0,.6); }
.p-dif {
    display: inline-block; margin-top: 5px; font-size: 10.5px; padding: 2px 8px; border-radius: 999px;
    background: rgba(20,16,10,.72); border: 1px solid rgba(224,180,106,.35); color: var(--accent);
}

/* 剧本详情页（整页视图） */
.detail { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.detail-scroll { flex: 1; overflow-y: auto; min-height: 0; }
.detail-hero { position: relative; height: 300px; overflow: hidden; }
.detail-hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.detail-back {
    position: absolute; top: 14px; left: 14px; z-index: 2;
    width: 36px; height: 36px; border-radius: 50%; padding: 0;
    background: rgba(20,16,10,.62); border: 1px solid rgba(224,180,106,.3);
    color: var(--text); font-size: 20px; line-height: 1;
    display: flex; align-items: center; justify-content: center;
}
.detail-head { position: absolute; left: 18px; right: 18px; bottom: 16px; }
.d-name { font-family: var(--font-story); font-size: 28px; font-weight: 800; letter-spacing: 1px; text-shadow: 0 2px 12px rgba(0,0,0,.65); }
.d-genre {
    display: inline-block; margin-top: 8px; font-size: 11.5px; padding: 3px 10px; border-radius: 999px;
    background: rgba(20,16,10,.72); border: 1px solid rgba(224,180,106,.4); color: var(--accent);
}
.detail-body { padding-bottom: 12px; }
.d-diffs { display: flex; flex-wrap: wrap; gap: 8px; padding: 16px 18px 2px; }
.diff-btn.on { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 0 1px rgba(224,180,106,.35); }
.d-sec { margin-top: 20px; }
.d-intro {
    margin: 0 18px; color: var(--dim); font-size: 13.5px; line-height: 1.75;
    font-family: var(--font-story);
    white-space: pre-wrap; word-break: break-word;
    max-height: 220px; overflow: hidden;
    -webkit-mask-image: linear-gradient(180deg, #000 78%, transparent);
    mask-image: linear-gradient(180deg, #000 78%, transparent);
}
.d-none { margin: 0 18px; color: var(--faint); font-size: 13px; padding: 14px; border: 1px dashed var(--line); border-radius: var(--radius-md); text-align: center; }
.d-persona {
    margin: 0 18px; display: flex; align-items: center; gap: 10px;
    background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 12px 14px;
}
.dp-sum { flex: 1; min-width: 0; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.detail-cta {
    flex: none; display: flex; gap: 10px;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
    background: var(--panel); border-top: 1px solid var(--line);
}
.detail-cta button { flex: 1; padding: 13px; border-radius: 999px; font-size: 15px; font-weight: 700; font-family: var(--font-story); letter-spacing: 1px; }
.detail-cta .ghost-cta { background: transparent; border: 1px solid rgba(224,180,106,.45); color: var(--accent); }

/* 商店头像菜单（底部 sheet 内） */
.menu-sec-lbl { font-size: 12px; color: var(--dim); margin: 14px 0 8px; }
.menu-row {
    display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
    background: var(--panel2); border: 1px solid var(--line); border-radius: var(--radius-md);
    padding: 12px 14px; margin-top: 10px; font-size: 14px;
}
.menu-row.danger { color: var(--danger); justify-content: center; }
.menu-badge {
    min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
    background: rgba(150,48,42,.95); border: 1px solid rgba(255,200,170,.5);
    color: #ffe9dd; font-size: 10.5px; font-weight: 700;
    display: inline-flex; align-items: center; justify-content: center;
}
.sheet .style-opts { margin: 0; }
.sheet .model-row { margin: 0; }

/* ============ 宽屏桌面（≥900px）============ */
/* 方案A：底 Tab 变左侧竖向导航，内容区居中限宽 720 */
@media (min-width: 900px) {
    .applayout { flex-direction: row; }
    .tabbar {
        order: -1; flex-direction: column; width: 200px; flex: none;
        border-top: none; border-right: 1px solid var(--line);
        padding: 26px 12px; gap: 6px;
    }
    .tab { flex: none; flex-direction: row; justify-content: flex-start; gap: 12px; padding: 12px 16px; border-radius: var(--radius-md); }
    .tab.on { background: rgba(224,180,106,.1); }
    .tab .ticon { font-size: 18px; }
    .tab .tlbl { font-size: 13.5px; }
    .tab-badge { top: 10px; left: auto; right: 12px; }
    .tabbody { max-width: none; }
    .tabbody .lobby-top, .tabbody .lobby-hello, .tabbody .genre-pills,
    .tabbody .lobby section, .tabbody .me-balance, .tabbody .style-opts,
    .tabbody .persona-list, .tabbody .me-tip, .tabbody .model-row,
    .tabbody .save-list, .tabbody .dm-list { max-width: 720px; margin-left: auto; margin-right: auto; }
    .tabbody .model-row { margin-bottom: 6px; }
    .tabbody .section-title { margin-left: auto; margin-right: auto; max-width: 684px; }
    .tabbody .shelf-grid { grid-template-columns: repeat(3, 1fr); max-width: 720px; margin-left: auto; margin-right: auto; }
    .tabbody .rail { padding-left: 24px; padding-right: 24px; }
    .tabbody .save-row, .tabbody .dm-row { padding-left: 0; padding-right: 0; }

    /* 方案C：内容限宽 960 居中，海报行更宽 */
    .store-top { max-width: 960px; margin-left: auto; margin-right: auto; }
    .hero { max-width: 960px; margin: 12px auto 0; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--line); }
    .hero-slide { height: 440px; }
    .store section { max-width: 960px; margin-left: auto; margin-right: auto; }
    .store .rail { padding-left: 24px; padding-right: 24px; }
    .poster { width: 152px; }
    .p-name { font-size: 15px; }
    .detail-scroll { }
    .detail-hero { max-width: 960px; margin: 0 auto; height: 340px; border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
    .detail-body { max-width: 960px; margin: 0 auto; }
    .detail-cta { padding-left: 24px; padding-right: 24px; }
    .detail-cta button { max-width: 300px; }
    .detail-cta { justify-content: center; }
}
