/* =====================================================================
   牛来短剧提示词平台 - PC 端主样式
   适配：1366x768 ~ 1920x1080 及以上；Chrome/Firefox/Safari/Edge
   ===================================================================== */

:root {
    --brand: #7c3aed;
    --brand-600: #6d28d9;
    --brand-50: #f5f3ff;
    --accent: #f59e0b;
    --ink-900: #111827;
    --ink-700: #374151;
    --ink-500: #6b7280;
    --ink-300: #d1d5db;
    --ink-100: #f3f4f6;
    --bg: #f8f9fc;
    --card: #ffffff;
    --ok: #16a34a;
    --err: #dc2626;
    --radius: 14px;
    --shadow-1: 0 1px 3px rgba(17, 24, 39, .08);
    --shadow-2: 0 6px 20px rgba(17, 24, 39, .10);
    --container: 1240px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    background: var(--bg);
    color: var(--ink-900);
    font-size: 15px;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 24px; }

/* 大屏（>1500px）逐步放大容器与字号，保证 1920+ 不空旷 */
@media (min-width: 1500px) {
    :root { --container: 1380px; }
    body { font-size: 16px; }
}
@media (min-width: 1800px) {
    :root { --container: 1520px; }
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
img { display: block; }

/* ---------------- 顶部导航 ---------------- */
.app-header {
    position: sticky; top: 0; z-index: 50;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--ink-100);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; }
.brand-logo {
    width: 34px; height: 34px; border-radius: 9px;
    background: linear-gradient(135deg, #8b5cf6, #6d28d9);
    color: #fff; display: flex; align-items: center; justify-content: center;
    font-size: 17px; font-weight: 700;
}
.header-nav { display: flex; gap: 6px; }
.nav-link {
    padding: 7px 16px; border-radius: 99px; color: var(--ink-700);
    font-size: 14px; transition: background .2s, color .2s;
}
.nav-link:hover { background: var(--brand-50); color: var(--brand-600); }
.nav-link.active { background: var(--brand-50); color: var(--brand-600); font-weight: 600; }

/* ---------------- 子导航（返回 + 面包屑） ---------------- */
.subnav { display: flex; align-items: center; gap: 16px; padding: 14px 24px 0; }
.btn-back {
    display: inline-flex; align-items: center; gap: 5px;
    border: 1px solid var(--ink-300); background: #fff; color: var(--ink-700);
    padding: 6px 14px; border-radius: 99px; font-size: 13px;
    transition: all .2s;
}
.btn-back:hover { border-color: var(--brand); color: var(--brand-600); }
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-500); flex-wrap: wrap; }
.breadcrumb a { color: var(--ink-500); }
.breadcrumb a:hover { color: var(--brand-600); }
.breadcrumb .sep { color: var(--ink-300); }
.breadcrumb .cur { color: var(--ink-900); font-weight: 600; }

/* ---------------- 页面容器与过渡动画 ---------------- */
.page-host { flex: 1; padding: 20px 24px 48px; min-height: 400px; }
.page { animation: page-in .35s ease both; }
.page.leaving { animation: page-out .18s ease both; }
@keyframes page-in {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes page-out {
    from { opacity: 1; }
    to { opacity: 0; transform: translateY(-8px); }
}

/* 列表项级联入场 */
.stagger > * { animation: item-in .4s ease both; }
.stagger > *:nth-child(1) { animation-delay: .02s; }
.stagger > *:nth-child(2) { animation-delay: .06s; }
.stagger > *:nth-child(3) { animation-delay: .10s; }
.stagger > *:nth-child(4) { animation-delay: .14s; }
.stagger > *:nth-child(5) { animation-delay: .18s; }
.stagger > *:nth-child(6) { animation-delay: .22s; }
.stagger > *:nth-child(7) { animation-delay: .26s; }
.stagger > *:nth-child(8) { animation-delay: .30s; }
@keyframes item-in {
    from { opacity: 0; transform: translateY(10px) scale(.98); }
    to { opacity: 1; transform: none; }
}

/* ---------------- 首页（类型选择） ---------------- */
.hero {
    border-radius: var(--radius);
    background: linear-gradient(120deg, #ede9fe 0%, #fdf4ff 45%, #fff7ed 100%);
    padding: 34px 36px;
    margin-bottom: 24px;
}
.hero h1 { font-size: 26px; letter-spacing: .5px; }
.hero p { color: var(--ink-500); margin-top: 6px; max-width: 640px; }
.hero .search {
    margin-top: 18px; display: flex; max-width: 560px;
    background: #fff; border: 1px solid var(--ink-300); border-radius: 99px;
    padding: 4px 4px 4px 18px; align-items: center;
    box-shadow: var(--shadow-1);
    transition: border .2s;
}
.hero .search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(124, 58, 237, .12); }
.hero .search input {
    flex: 1; border: 0; outline: 0; font-size: 15px; background: transparent; font-family: inherit;
}
.hero .search button {
    border: 0; background: var(--brand); color: #fff; padding: 9px 22px;
    border-radius: 99px; font-size: 14px; font-weight: 600; transition: background .2s;
}
.hero .search button:hover { background: var(--brand-600); }

.sec-title { display: flex; align-items: center; justify-content: space-between; margin: 26px 0 14px; }
.sec-title h2 { font-size: 19px; }
.sec-title .more { font-size: 13px; color: var(--ink-500); }
.sec-title .more:hover { color: var(--brand-600); }

.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.cat-card {
    background: var(--card); border-radius: var(--radius); padding: 20px 18px;
    border: 1px solid var(--ink-100); box-shadow: var(--shadow-1);
    display: flex; align-items: center; gap: 14px;
    transition: transform .22s ease, box-shadow .22s ease, border-color .22s;
    cursor: pointer;
}
.cat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); border-color: #ddd6fe; }
.cat-card .ico {
    width: 46px; height: 46px; border-radius: 12px; font-size: 24px;
    display: flex; align-items: center; justify-content: center;
    background: var(--brand-50); flex-shrink: 0;
}
.cat-card .name { font-weight: 600; font-size: 16px; }
.cat-card .meta { font-size: 12px; color: var(--ink-500); margin-top: 2px; }
.cat-card .hot-tag {
    margin-left: auto; font-size: 11px; color: var(--accent);
    background: #fef3c7; border-radius: 99px; padding: 2px 8px; flex-shrink: 0;
}

/* 二级分类 chips */
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.chip {
    background: #fff; border: 1px solid var(--ink-300); color: var(--ink-700);
    padding: 6px 16px; border-radius: 99px; font-size: 13px;
    transition: all .2s; cursor: pointer;
}
.chip:hover { border-color: var(--brand); color: var(--brand-600); }
.chip.active { background: var(--brand); border-color: var(--brand); color: #fff; }

/* ---------------- 短剧列表 ---------------- */
.list-head {
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 12px; margin-bottom: 16px;
}
.sort-tabs { display: flex; gap: 6px; background: var(--ink-100); padding: 4px; border-radius: 99px; }
.sort-tab {
    border: 0; background: transparent; padding: 7px 18px; border-radius: 99px;
    font-size: 13px; color: var(--ink-500); transition: all .2s;
}
.sort-tab.active { background: #fff; color: var(--ink-900); font-weight: 600; box-shadow: var(--shadow-1); }

.drama-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.drama-card {
    background: var(--card); border-radius: var(--radius); overflow: hidden;
    border: 1px solid var(--ink-100); box-shadow: var(--shadow-1);
    cursor: pointer; transition: transform .22s ease, box-shadow .22s ease;
    display: flex; flex-direction: column;
}
.drama-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-2); }
.drama-cover { position: relative; aspect-ratio: 16 / 9; background: var(--ink-100); overflow: hidden; }
.drama-cover img {
    width: 100%; height: 100%; object-fit: cover;
    opacity: 0; transition: opacity .5s ease;
}
.drama-cover img.loaded { opacity: 1; }
.cover-tag {
    position: absolute; left: 10px; top: 10px; z-index: 2;
    background: rgba(17, 24, 39, .72); color: #fff; font-size: 11px;
    padding: 3px 9px; border-radius: 99px; backdrop-filter: blur(4px);
}
.cover-tag.finished { background: rgba(22, 163, 74, .85); }
.drama-body { padding: 13px 15px 15px; display: flex; flex-direction: column; gap: 7px; flex: 1; }
.drama-title {
    font-size: 16px; font-weight: 600;
    display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
}
.drama-desc {
    font-size: 13px; color: var(--ink-500);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.drama-meta { display: flex; align-items: center; gap: 12px; margin-top: auto; font-size: 12px; color: var(--ink-500); }
.rating { color: var(--accent); font-weight: 700; display: inline-flex; align-items: center; gap: 3px; }
.rating::before { content: "★"; font-size: 13px; }

/* ---------------- 详情页 ---------------- */
.detail-top { display: grid; grid-template-columns: 420px 1fr; gap: 28px; }
@media (max-width: 1100px) { .detail-top { grid-template-columns: 1fr; } }
.detail-cover {
    border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-2);
    aspect-ratio: 16 / 9; background: var(--ink-100);
}
.detail-cover img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .5s; }
.detail-cover img.loaded { opacity: 1; }
.detail-info h1 { font-size: 26px; line-height: 1.3; }
.detail-info .desc { color: var(--ink-700); margin-top: 10px; max-width: 660px; }
.stat-row { display: flex; gap: 30px; margin-top: 16px; flex-wrap: wrap; }
.stat-item b { font-size: 21px; display: block; }
.stat-item span { font-size: 12px; color: var(--ink-500); }
.btn-primary {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--brand); color: #fff; border: 0; border-radius: 12px;
    padding: 12px 30px; font-size: 15px; font-weight: 600;
    transition: background .2s, transform .15s;
}
.btn-primary:hover { background: var(--brand-600); }
.btn-primary:active { transform: scale(.97); }

/* ---------------- 剧集选择 ---------------- */
.ep-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.ep-card {
    background: var(--card); border: 1px solid var(--ink-100); border-radius: var(--radius);
    padding: 18px 16px; cursor: pointer; transition: all .22s;
    display: flex; flex-direction: column; gap: 6px; position: relative;
}
.ep-card:hover { border-color: #ddd6fe; box-shadow: var(--shadow-2); transform: translateY(-3px); }
.ep-no { font-size: 18px; font-weight: 700; }
.ep-title { font-size: 13px; color: var(--ink-500); }
.ep-duration { font-size: 12px; color: var(--ink-300); }
.ep-arrow { position: absolute; right: 14px; top: 18px; color: var(--ink-300); transition: color .2s; }
.ep-card:hover .ep-arrow { color: var(--brand); }

/* ---------------- 视频段时间轴 ---------------- */
.timeline { position: relative; padding-left: 26px; }
.timeline::before {
    content: ""; position: absolute; left: 8px; top: 6px; bottom: 6px;
    width: 2px; background: linear-gradient(#ddd6fe, var(--brand-50)); border-radius: 2px;
}
.seg-item {
    position: relative; background: var(--card); border: 1px solid var(--ink-100);
    border-radius: var(--radius); padding: 14px 16px; margin-bottom: 14px;
    transition: all .22s;
}
.seg-item::before {
    content: ""; position: absolute; left: -24px; top: 26px;
    width: 10px; height: 10px; border-radius: 50%;
    background: #fff; border: 3px solid var(--brand);
}
.seg-item.selected { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(124, 58, 237, .12); }
.seg-main { display: flex; gap: 16px; }
.seg-thumbs { display: flex; gap: 6px; flex-shrink: 0; }
.seg-thumb {
    width: 108px; height: 61px; border-radius: 8px; overflow: hidden;
    background: var(--ink-100); position: relative; cursor: pointer;
}
.seg-thumb img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .4s; }
.seg-thumb img.loaded { opacity: 1; }
.seg-thumb .dur {
    position: absolute; right: 4px; bottom: 4px; z-index: 2;
    background: rgba(17, 24, 39, .75); color: #fff; font-size: 11px;
    padding: 1px 6px; border-radius: 4px;
}
.seg-info { flex: 1; min-width: 0; }
.seg-title { font-weight: 600; font-size: 15px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.badge { font-size: 11px; padding: 2px 8px; border-radius: 99px; font-weight: 500; }
.badge.ok { background: #dcfce7; color: var(--ok); }
.badge.none { background: var(--ink-100); color: var(--ink-500); }
.badge.time { background: var(--brand-50); color: var(--brand-600); font-weight: 600; }
.seg-range { font-size: 12px; color: var(--ink-500); margin-top: 3px; }
.seg-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; align-items: center; }
.btn-sm {
    border: 1px solid var(--ink-300); background: #fff; color: var(--ink-700);
    font-size: 12px; padding: 6px 14px; border-radius: 99px; transition: all .2s;
    display: inline-flex; align-items: center; gap: 4px;
}
.btn-sm:hover { border-color: var(--brand); color: var(--brand-600); }
.btn-sm.solid { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-sm.solid:hover { background: var(--brand-600); }
.btn-sm:disabled { opacity: .45; cursor: not-allowed; }
.seg-check {
    margin-left: auto; display: inline-flex; align-items: center; gap: 5px;
    font-size: 12px; color: var(--ink-500); cursor: pointer; user-select: none;
}

/* 批量操作条 */
.batch-bar {
    position: sticky; bottom: 16px; z-index: 20;
    background: rgba(17, 24, 39, .92); color: #fff; border-radius: 12px;
    display: flex; align-items: center; gap: 14px; padding: 10px 18px;
    backdrop-filter: blur(6px); box-shadow: var(--shadow-2);
}
.batch-bar .count { font-size: 13px; }
.batch-bar select {
    background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.25);
    border-radius: 8px; padding: 5px 10px; font-size: 13px; font-family: inherit;
}
.batch-bar select option { color: var(--ink-900); }

/* ---------------- 提示词页 ---------------- */
.prompt-stage { display: grid; grid-template-columns: 360px 1fr; gap: 22px; }
@media (max-width: 1100px) { .prompt-stage { grid-template-columns: 1fr; } }
.prompt-side {
    background: var(--card); border-radius: var(--radius); border: 1px solid var(--ink-100);
    padding: 18px; position: sticky; top: 84px; height: fit-content;
}
.prompt-side h3 { font-size: 15px; margin-bottom: 10px; }
.side-segments { display: flex; flex-direction: column; gap: 8px; max-height: 60vh; overflow: auto; padding-right: 4px; }
.side-seg {
    text-align: left; border: 1px solid var(--ink-100); background: #fafafa;
    border-radius: 10px; padding: 9px 12px; font-size: 13px; color: var(--ink-700);
    transition: all .2s; display: flex; gap: 10px; align-items: center;
}
.side-seg:hover { border-color: #ddd6fe; }
.side-seg.active { border-color: var(--brand); background: var(--brand-50); color: var(--brand-600); font-weight: 600; }
.side-seg .seq {
    width: 24px; height: 24px; border-radius: 50%; background: var(--ink-100);
    display: flex; align-items: center; justify-content: center; font-size: 12px; flex-shrink: 0;
}
.side-seg.active .seq { background: var(--brand); color: #fff; }

.mode-tabs { display: inline-flex; background: var(--ink-100); padding: 4px; border-radius: 99px; margin-bottom: 14px; }
.mode-tab {
    border: 0; background: transparent; padding: 8px 20px; border-radius: 99px; font-size: 13px;
    color: var(--ink-500); transition: all .2s;
}
.mode-tab.active { background: #fff; font-weight: 600; color: var(--ink-900); box-shadow: var(--shadow-1); }

.prompt-content {
    background: var(--card); border-radius: var(--radius); border: 1px solid var(--ink-100);
    padding: 24px 28px; box-shadow: var(--shadow-1);
}
.prompt-content.fading { animation: prompt-in .3s ease; }
@keyframes prompt-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; } }
.para { margin-bottom: 18px; }
.para:last-child { margin-bottom: 0; }
.para-head {
    display: inline-flex; align-items: center; gap: 8px;
    font-weight: 700; font-size: 14px; color: var(--brand-600);
    background: var(--brand-50); padding: 4px 14px; border-radius: 8px; margin-bottom: 8px;
}
.para-text { font-size: 15px; color: var(--ink-900); line-height: 1.9; white-space: pre-wrap; word-break: break-word; }
.para-copy { font-size: 12px; margin-left: 8px; font-weight: 400; color: var(--ink-500); }
.para-copy:hover { color: var(--brand-600); }
.content-whole { white-space: pre-wrap; line-height: 2.05; font-size: 15.5px; word-break: break-word; }

.prompt-ops { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.btn {
    display: inline-flex; align-items: center; gap: 7px; border-radius: 10px;
    padding: 10px 20px; font-size: 14px; font-weight: 600; border: 0; transition: all .2s;
}
.btn.primary { background: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-600); }
.btn.ghost { background: #fff; color: var(--ink-700); border: 1px solid var(--ink-300); }
.btn.ghost:hover { border-color: var(--brand); color: var(--brand-600); }
.btn.success-flash { animation: flash-ok .5s ease; }
@keyframes flash-ok {
    0% { box-shadow: 0 0 0 0 rgba(22, 163, 74, .5); }
    100% { box-shadow: 0 0 0 12px rgba(22, 163, 74, 0); }
}

/* ---------------- 榜单页 ---------------- */
.rank-table { width: 100%; border-collapse: collapse; background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-1); }
.rank-table th, .rank-table td { text-align: left; padding: 13px 18px; font-size: 14px; border-bottom: 1px solid var(--ink-100); }
.rank-table th { background: var(--ink-100); font-size: 13px; color: var(--ink-500); font-weight: 600; }
.rank-table tr:last-child td { border-bottom: 0; }
.rank-table tbody tr { cursor: pointer; transition: background .15s; }
.rank-table tbody tr:hover { background: var(--brand-50); }
.rank-no { font-weight: 700; color: var(--ink-500); }
.rank-no.top1 { color: #f59e0b; }
.rank-no.top2 { color: #94a3b8; }
.rank-no.top3 { color: #d97706; }

/* ---------------- 骨架屏 ---------------- */
.skeleton {
    border-radius: var(--radius); background: linear-gradient(90deg, #eef0f4 25%, #f8f9fc 50%, #eef0f4 75%);
    background-size: 200% 100%; animation: sk 1.3s infinite;
}
@keyframes sk { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.sk-card { height: 260px; }

/* ---------------- 空态 ---------------- */
.empty { text-align: center; padding: 70px 0; color: var(--ink-500); }
.empty .icon { font-size: 44px; margin-bottom: 10px; }
.empty p { font-size: 14px; }

/* ---------------- 加载更多 / 加载条 ---------------- */
.load-more { text-align: center; padding: 26px 0 6px; }
.load-more button {
    border: 1px solid var(--ink-300); background: #fff; border-radius: 99px;
    padding: 10px 34px; font-size: 14px; color: var(--ink-700); transition: all .2s;
}
.load-more button:hover { border-color: var(--brand); color: var(--brand-600); }

.top-loading { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 99; background: transparent; }
.top-loading-bar {
    height: 100%; width: 0; background: linear-gradient(90deg, #8b5cf6, #ec4899);
    animation: load-bar 1s ease infinite;
}
@keyframes load-bar {
    0% { width: 0; opacity: 1; }
    70% { width: 70%; opacity: 1; }
    100% { width: 96%; opacity: .4; }
}

/* ---------------- Toast ---------------- */
.toast-wrap {
    position: fixed; top: 74px; left: 50%; transform: translateX(-50%);
    z-index: 100; display: flex; flex-direction: column; gap: 10px; align-items: center;
    pointer-events: none;
}
.toast {
    padding: 10px 22px; border-radius: 99px; font-size: 14px; font-weight: 500;
    color: #fff; box-shadow: var(--shadow-2);
    animation: toast-in .3s ease both; max-width: 70vw;
}
.toast.success { background: var(--ok); }
.toast.error { background: var(--err); }
.toast.info { background: var(--ink-900); }
.toast.out { animation: toast-out .3s ease both; }
@keyframes toast-in {
    from { opacity: 0; transform: translateY(-14px) scale(.95); }
    to { opacity: 1; transform: none; }
}
@keyframes toast-out {
    from { opacity: 1; }
    to { opacity: 0; transform: translateY(-10px); }
}

/* ---------------- 页脚 ---------------- */
.app-footer {
    border-top: 1px solid var(--ink-100); padding: 18px 0; margin-top: auto;
    color: var(--ink-300); font-size: 12px; text-align: center;
}

/* 状态反馈（复制成功态） */
.copied-hint { color: var(--ok); font-weight: 600; }
