/* ========== 直播话术台 全局样式（手机端优先） ========== */
:root {
    --bg: #14172b;
    --bg-soft: #1b1f38;
    --card: #20253f;
    --card-hover: #262b49;
    --border: #2e3454;
    --text: #e8eaf6;
    --text-dim: #9aa1c0;
    --primary: #6c7bff;
    --primary-dark: #5563e8;
    --green: #2ecc71;
    --green-dark: #27ae60;
    --red: #ff5c6c;
    --red-dark: #e04a59;
    --orange: #ffa940;
    --blue: #40a9ff;
    --radius: 14px;
    --shadow: 0 6px 24px rgba(0, 0, 0, .28);
    --script-size: 24px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; -webkit-tap-highlight-color: transparent; }
img { -webkit-user-drag: none; }

/* ---------- 顶栏 ---------- */
.topbar {
    background: rgba(20, 23, 43, .94);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 50;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.topbar-inner {
    max-width: 1280px; margin: 0 auto; padding: 0 14px;
    height: 54px; display: flex; align-items: center; gap: 14px;
}
.logo { font-size: 17px; font-weight: 700; color: var(--text); white-space: nowrap; }
.nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a {
    color: var(--text-dim); padding: 7px 14px; border-radius: 8px;
    font-size: 14px; white-space: nowrap;
}
.nav a.active { color: #fff; background: var(--primary); }
.topbar-clock { color: var(--text-dim); font-variant-numeric: tabular-nums; font-size: 13px; }
@media (max-width: 640px) { .topbar-clock { display: none; } }

/* ---------- 容器 ---------- */
.container { max-width: 1280px; margin: 0 auto; padding: 16px 14px calc(40px + var(--safe-bottom)); }

/* ---------- 通用组件 ---------- */
.flash {
    padding: 12px 16px; border-radius: var(--radius); margin-bottom: 14px;
    font-size: 14px; border: 1px solid transparent;
}
.flash-ok    { background: rgba(46, 204, 113, .12); border-color: rgba(46, 204, 113, .4); color: #7ce8a8; }
.flash-error { background: rgba(255, 92, 108, .12); border-color: rgba(255, 92, 108, .4); color: #ff9aa4; }

.page-head {
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 12px; margin-bottom: 16px;
}
.page-head h1 { font-size: 21px; }
.page-head .sub { color: var(--text-dim); font-size: 13px; margin-top: 3px; }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 10px 18px; border-radius: 10px; border: 1px solid transparent;
    font-size: 14px; cursor: pointer; color: #fff; background: var(--primary);
    transition: background .15s, transform .1s;
    font-family: inherit; line-height: 1.4; white-space: nowrap;
    -webkit-tap-highlight-color: transparent; user-select: none;
}
.btn:active { transform: scale(.96); }
.btn-green { background: var(--green); }
.btn-red   { background: var(--red); }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text-dim); }
.btn-sm { padding: 7px 13px; font-size: 13px; border-radius: 8px; }
.btn-lg { padding: 14px 22px; font-size: 16px; border-radius: 12px; }
.btn[disabled] { opacity: .35; cursor: not-allowed; }

.badge {
    display: inline-block; padding: 2px 9px; border-radius: 20px;
    font-size: 12px; line-height: 1.7; white-space: nowrap;
}
.badge-green  { background: rgba(46, 204, 113, .15); color: #6fe3a1; }
.badge-gray   { background: rgba(154, 161, 192, .15); color: var(--text-dim); }
.badge-blue   { background: rgba(64, 169, 255, .15); color: #7cc6ff; }
.badge-orange { background: rgba(255, 169, 64, .15); color: #ffc178; }
.badge-red    { background: rgba(255, 92, 108, .15); color: #ff8f9b; }
.badge-purple { background: rgba(108, 123, 255, .18); color: #a3adff; }

.card {
    background: var(--card); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow);
}

.empty { text-align: center; padding: 60px 20px; color: var(--text-dim); }
.empty .icon { font-size: 44px; margin-bottom: 10px; }

/* ---------- 统计条 ---------- */
.stat-row { display: flex; gap: 10px; margin-bottom: 16px; }
.stat-card {
    flex: 1; background: var(--card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 13px 14px;
}
.stat-card .num { font-size: 24px; font-weight: 700; }
.stat-card .label { color: var(--text-dim); font-size: 12px; }

/* ---------- 筛选栏（美化：搜索框带放大镜、圆角胶囊、focus 发光） ---------- */
.filter-bar {
    display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
    margin-bottom: 16px; padding: 10px; background: var(--card);
    border: 1px solid var(--border); border-radius: 16px;
}
.filter-bar input[type="search"], .filter-bar select {
    background: var(--bg-soft); border: 1px solid var(--border); color: var(--text);
    padding: 10px 14px; border-radius: 999px; font-size: 14px; font-family: inherit;
    flex: 1; min-width: 120px;
    transition: border-color .18s, box-shadow .18s, background .18s;
    appearance: none; -webkit-appearance: none;
}
.filter-bar input[type="search"] {
    padding-left: 38px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238b93b0' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M21 21l-4.3-4.3'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: 13px center;
}
.filter-bar input[type="search"]::-webkit-search-cancel-button { display: none; }
.filter-bar input::placeholder { color: var(--text-dim); opacity: .75; }
.filter-bar select {
    cursor: pointer; padding-right: 34px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238b93b0' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 13px center;
}
.filter-bar input:hover, .filter-bar select:hover { border-color: rgba(108, 123, 255, .45); }
.filter-bar input:focus, .filter-bar select:focus {
    outline: none; border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(108, 123, 255, .18);
    background-color: var(--card);
}

/* ---------- 商品卡片网格 ---------- */
.product-grid {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px;
}
@media (min-width: 640px)  { .product-grid { grid-template-columns: repeat(3, 1fr); gap: 16px; } }
@media (min-width: 1000px) { .product-grid { grid-template-columns: repeat(4, 1fr); } }

.product-card {
    background: var(--card); border: 1px solid var(--border);
    border-radius: var(--radius); overflow: hidden; display: flex;
    flex-direction: column; color: var(--text);
    transition: transform .15s, border-color .15s;
}
a.product-card:hover { text-decoration: none; border-color: var(--primary); }
.product-card .thumb {
    width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block;
    background: var(--bg-soft);
}
.product-card .body { padding: 11px 12px; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.product-card .name {
    font-size: 14px; font-weight: 600; color: var(--text);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.product-card .meta { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.product-card .price { color: var(--orange); font-weight: 700; font-size: 16px; }
.product-card .times { color: var(--text-dim); font-size: 11px; }
.product-card .actions {
    display: flex; gap: 6px; padding: 10px 12px;
    border-top: 1px solid var(--border);
}
.product-card .actions .btn { flex: 1; }
.product-card .actions form { display: contents; }

/* 合集卡片：序号角标 */
.gallery-card { position: relative; }
.gallery-order {
    position: absolute; top: 8px; left: 8px; z-index: 2;
    width: 28px; height: 28px; border-radius: 50%;
    background: rgba(108, 123, 255, .92); color: #fff;
    font-size: 14px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,.4);
}
.gallery-order.done { background: rgba(46, 204, 113, .92); }

/* ---------- 表单 ---------- */
.form-card {
    background: var(--card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 18px; max-width: 860px;
}
@media (min-width: 768px) { .form-card { padding: 26px; } }
.form-row { margin-bottom: 20px; }
.form-row label { display: block; margin-bottom: 7px; font-weight: 600; font-size: 14px; }
.form-row label .req { color: var(--red); margin-left: 3px; }
.form-row .hint { color: var(--text-dim); font-size: 12px; margin-top: 6px; }
.hint-inline { color: var(--text-dim); font-size: 12px; font-weight: 400; }
.form-row input[type="text"], .form-row input[type="number"], .form-row input[type="password"],
.form-row input[type="url"], .form-row input[type="datetime-local"], .form-row textarea, .form-row select,
.cat-row select, #newCatInput {
    width: 100%; background: var(--bg-soft); border: 1px solid var(--border);
    color: var(--text); padding: 11px 13px; border-radius: 10px;
    font-size: 15px; font-family: inherit; line-height: 1.6;
    transition: border-color .18s, box-shadow .18s, background .18s;
}
.form-row input::placeholder, .form-row textarea::placeholder { color: var(--text-dim); opacity: .7; }
.form-row input:hover, .form-row textarea:hover, .form-row select:hover { border-color: rgba(108, 123, 255, .45); }
.form-row input:focus, .form-row textarea:focus, .form-row select:focus,
.cat-row select:focus, #newCatInput:focus {
    outline: none; border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(108, 123, 255, .18);
    background: var(--card);
}
.form-row textarea { resize: vertical; }
.form-grid { display: grid; grid-template-columns: 1fr; gap: 0 20px; }
@media (min-width: 768px) { .form-grid { grid-template-columns: 1fr 1fr; } }

.cat-row { display: flex; gap: 8px; align-items: center; }
.cat-row select { flex: 1; }
.cat-row .btn { flex-shrink: 0; }

.upload-zone {
    border: 2px dashed var(--border); border-radius: var(--radius);
    padding: 22px 16px; text-align: center; color: var(--text-dim);
    cursor: pointer; transition: border-color .15s, background .15s;
}
.upload-zone.dragover { border-color: var(--primary); background: rgba(108, 123, 255, .06); }
.upload-zone input[type="file"] { display: none; }
.upload-zone .preview {
    max-width: 240px; max-height: 180px; border-radius: 10px; margin: 0 auto 10px;
    display: block; object-fit: cover;
}
.upload-zone .big { font-size: 14px; color: var(--text); }

/* 机制信息行 */
.mech-row { display: flex; gap: 8px; margin-bottom: 8px; }
.mech-row input {
    flex: 1; background: var(--bg-soft); border: 1px solid var(--border); color: var(--text);
    padding: 10px 13px; border-radius: 10px; font-size: 15px; font-family: inherit;
}
.mech-row input:focus { outline: none; border-color: var(--primary); }

/* 机制图片列表 */
.mech-img-list { display: flex; gap: 10px; flex-wrap: wrap; margin: 10px 0; }
.mech-img { position: relative; width: 92px; height: 92px; }
.mech-img img {
    width: 100%; height: 100%; object-fit: cover; border-radius: 10px;
    border: 1px solid var(--border); display: block;
}
.mech-img-del {
    position: absolute; top: -7px; right: -7px; width: 24px; height: 24px;
    border-radius: 50%; border: none; background: var(--red); color: #fff;
    font-size: 12px; cursor: pointer; line-height: 1;
}

.tpl-btns { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.tpl-btns button {
    background: var(--bg-soft); border: 1px solid var(--border); color: var(--text-dim);
    padding: 6px 13px; border-radius: 20px; font-size: 12px; cursor: pointer; font-family: inherit;
}
.tpl-btns button:active { border-color: var(--primary); color: var(--text); }

.char-count { color: var(--text-dim); font-size: 12px; text-align: right; margin-top: 4px; }
.form-actions { display: flex; gap: 10px; margin-top: 24px; flex-wrap: wrap; }
.form-actions .btn-lg { flex: 1; min-width: 140px; }

/* ---------- 分页 ---------- */
.pagination { display: flex; gap: 8px; justify-content: center; margin-top: 24px; flex-wrap: wrap; }
.pagination a, .pagination span {
    padding: 7px 14px; border-radius: 9px; border: 1px solid var(--border);
    color: var(--text-dim); background: var(--card); font-size: 14px;
}
.pagination .cur { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ---------- 计划卡片 ---------- */
.plan-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 760px)  { .plan-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .plan-grid { grid-template-columns: repeat(3, 1fr); } }
.plan-card {
    background: var(--card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 11px;
}
.plan-card .title-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.plan-card .title { font-size: 17px; font-weight: 700; }
.plan-card .info { color: var(--text-dim); font-size: 13px; display: flex; flex-direction: column; gap: 4px; }
.plan-card .progress-track { height: 8px; border-radius: 6px; background: var(--bg-soft); overflow: hidden; }
.plan-card .progress-fill { height: 100%; background: linear-gradient(90deg, var(--primary), #9b6cff); border-radius: 6px; }
.plan-card .progress-text { font-size: 12px; color: var(--text-dim); margin-top: 5px; }
.plan-card .actions { display: flex; gap: 6px; flex-wrap: wrap; }
.plan-card .actions form { display: inline; }

/* ---------- 计划详情 / 排序 ---------- */
.detail-layout { display: grid; grid-template-columns: 1fr; gap: 16px; align-items: start; }
@media (min-width: 1000px) { .detail-layout { grid-template-columns: 1fr 340px; } }

.panel {
    background: var(--card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 16px;
}
.panel h2 { font-size: 16px; margin-bottom: 13px; display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }

.item-list { display: flex; flex-direction: column; gap: 9px; }
.item-row {
    display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
    background: var(--bg-soft); border: 1px solid var(--border);
    border-radius: 12px; padding: 10px 12px;
    transition: border-color .15s, opacity .15s;
}
@media (min-width: 768px) { .item-row { flex-wrap: nowrap; } }
.item-row.dragging { opacity: .4; border-color: var(--primary); }
.item-row .drag-handle { color: var(--text-dim); font-size: 17px; cursor: grab; user-select: none; }
.item-row .order-no {
    width: 27px; height: 27px; border-radius: 50%; background: var(--primary);
    color: #fff; font-size: 13px; font-weight: 700; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
}
.item-row .mini-thumb { width: 50px; height: 38px; object-fit: cover; border-radius: 7px; flex-shrink: 0; }
.item-row .info { flex: 1; min-width: 120px; }
.item-row .info .n { font-weight: 600; font-size: 14px; }
.item-row .info .p { color: var(--orange); font-size: 13px; }
.move-btns { display: flex; gap: 4px; }
.item-row .minutes-input {
    width: 62px; background: var(--card); border: 1px solid var(--border); color: var(--text);
    padding: 6px 8px; border-radius: 8px; font-size: 13px; text-align: center; font-family: inherit;
}
.item-row .unit { color: var(--text-dim); font-size: 12px; }

.picker-search {
    width: 100%; margin-bottom: 12px; background: var(--bg-soft);
    border: 1px solid var(--border); color: var(--text);
    padding: 10px 13px; border-radius: 10px; font-size: 14px; font-family: inherit;
}
.picker-search:focus { outline: none; border-color: var(--primary); }
.picker-list { display: flex; flex-direction: column; gap: 8px; max-height: 520px; overflow-y: auto; }
.picker-item {
    display: flex; align-items: center; gap: 10px; padding: 8px 10px;
    border: 1px solid var(--border); border-radius: 10px; background: var(--bg-soft);
}
.picker-item img { width: 46px; height: 36px; object-fit: cover; border-radius: 6px; flex-shrink: 0; }
.picker-item .pi-info { flex: 1; min-width: 0; }
.picker-item .pi-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.picker-item .pi-price { color: var(--orange); font-size: 12px; }

.toast {
    position: fixed; bottom: calc(30px + var(--safe-bottom)); left: 50%; transform: translateX(-50%);
    background: rgba(30, 34, 60, .96); border: 1px solid var(--border);
    color: var(--text); padding: 10px 22px; border-radius: 24px;
    font-size: 14px; z-index: 300; box-shadow: var(--shadow);
    opacity: 0; pointer-events: none; transition: opacity .25s;
}
.toast.show { opacity: 1; }

/* ---------- 商品详情页 ---------- */
.view-wrap { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.view-hero { overflow: hidden; }
.view-hero img { width: 100%; display: block; max-height: 460px; object-fit: cover; }
.view-card { padding: 18px; }
.view-name { font-size: 21px; line-height: 1.4; }
.view-price { color: var(--orange); font-size: 28px; font-weight: 800; margin-top: 6px; }
.view-card .meta { display: flex; gap: 6px; flex-wrap: wrap; }
.view-section { margin-top: 20px; }
.view-section h3 { font-size: 15px; color: var(--text-dim); margin-bottom: 10px; }
.view-script { font-size: 17px; line-height: 1.95; white-space: pre-wrap; word-break: break-word; }
.view-remark { color: var(--text-dim); font-size: 14px; white-space: pre-wrap; }
.view-pagenav { display: flex; justify-content: space-between; gap: 10px; }
.view-pagenav .btn { max-width: 48%; overflow: hidden; text-overflow: ellipsis; }

/* 机制标签 */
.mech-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.mech-tag {
    background: rgba(108, 123, 255, .14); border: 1px solid rgba(108, 123, 255, .4);
    color: #b9c1ff; padding: 6px 14px; border-radius: 10px; font-size: 14px; font-weight: 600;
}

/* 机制图片横向滑动画廊 */
.mech-gallery {
    display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px;
    scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
}
.mech-gallery img {
    height: 150px; border-radius: 12px; border: 1px solid var(--border);
    scroll-snap-align: start; flex-shrink: 0; cursor: zoom-in;
}

/* 手卡图 */
.handcard-img {
    width: 100%; border-radius: 12px; border: 1px solid var(--border);
    display: block; cursor: zoom-in;
}

/* ---------- 直播模式 ---------- */
body.live-mode { background: #0d1020; }
/* 【页面总宽度设置处】三列布局时题词页最大宽度 = 1400px（改这里调整三列整体宽度） */
.live-wrap {
    max-width: 1400px; margin: 0 auto;
    padding: 12px 12px calc(120px + var(--safe-bottom));
}
.live-topbar {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    padding: 11px 14px; background: var(--card); border: 1px solid var(--border);
    border-radius: var(--radius); margin-bottom: 12px;
    position: sticky; top: 8px; z-index: 60;
}
.live-topbar .lt-title { font-size: 16px; font-weight: 700; flex: 1; min-width: 120px; }
.live-topbar .lt-progress { color: var(--text-dim); font-size: 13px; white-space: nowrap; }
.live-topbar .lt-progress b { color: var(--primary); font-size: 17px; }
.live-clock { font-variant-numeric: tabular-nums; color: var(--text-dim); font-size: 13px; }
.lt-tools { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; width: 100%; }
.lt-tools::-webkit-scrollbar { display: none; }
@media (min-width: 900px) { .lt-tools { width: auto; } }
.lt-tools .btn, .lt-tools form { flex-shrink: 0; }

.live-main { display: grid; grid-template-columns: 1fr; gap: 12px; align-items: start; }
@media (min-width: 1100px) { .live-main { grid-template-columns: 300px 1fr 240px; } }

.live-product { padding: 16px; }
.lp-top { display: flex; gap: 14px; }
.lp-img { width: 110px; height: 110px; border-radius: 12px; object-fit: cover; flex-shrink: 0; }
.lp-head { flex: 1; min-width: 0; }
.lp-head h2 { font-size: 18px; line-height: 1.4; }
.lp-price { color: var(--orange); font-size: 24px; font-weight: 800; margin: 4px 0; }
.lp-meta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.live-product h3 { font-size: 13px; color: var(--text-dim); margin: 16px 0 8px; }
.live-product .mech-gallery img { height: 120px; }
.live-product .lp-remark { color: var(--text-dim); font-size: 13px; }
@media (min-width: 1100px) {
    .lp-top { flex-direction: column; }
    .lp-img { width: 100%; height: auto; aspect-ratio: 4/3; }
}

.timer-chip {
    display: inline-flex; align-items: center; gap: 6px;
    background: rgba(255, 92, 108, .12); color: #ff8f9b; border: 1px solid rgba(255, 92, 108, .35);
    padding: 4px 13px; border-radius: 20px; font-size: 13px; font-variant-numeric: tabular-nums;
}

.live-script { padding: 18px 18px 30px; min-height: 320px; }
@media (min-width: 768px) { .live-script { padding: 24px 28px 40px; } }
.live-script .ls-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 14px; gap: 10px; flex-wrap: wrap;
}
.live-script .ls-title { font-size: 13px; color: var(--text-dim); }
.live-script .ls-title b { color: var(--text); }
@media (max-width: 640px) { .ls-keys { display: none; } }

.script-content { font-size: var(--script-size); line-height: 1.6; word-break: break-word; }
.s-line {
    padding: 2px 10px; border-radius: 8px; margin: 0 0 1px;
    transition: background .3s, color .3s, opacity .3s;
}
.s-line.read { opacity: .38; }
.s-line.active {
    background: rgba(108, 123, 255, .2); color: #fff; font-weight: 700;
    box-shadow: inset 3px 0 0 var(--primary);
}
.script-empty { color: var(--text-dim); font-size: 15px; padding: 30px 0; text-align: center; }

.live-side { padding: 14px; }
.live-side h3 { font-size: 13px; color: var(--text-dim); margin-bottom: 10px; }
.side-list { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
.side-list::-webkit-scrollbar { display: none; }
.side-list form { display: block; flex-shrink: 0; }
.side-item {
    display: flex; align-items: center; gap: 8px; text-align: left;
    background: var(--bg-soft); border: 1px solid var(--border); color: var(--text);
    padding: 8px 12px; border-radius: 10px; cursor: pointer; font-family: inherit; font-size: 13px;
    max-width: 200px;
}
.side-item.current { border-color: var(--primary); background: rgba(108, 123, 255, .16); }
.side-item .no {
    width: 22px; height: 22px; border-radius: 50%; background: var(--border);
    color: var(--text); font-size: 11px; font-weight: 700; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
}
.side-item.current .no { background: var(--primary); }
.side-item.done .no { background: var(--green); }
.side-item.skipped .no { background: var(--orange); }
.side-item .si-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-item.done .si-name { color: var(--text-dim); text-decoration: line-through; }
@media (min-width: 1100px) {
    .live-side { max-height: 70vh; overflow-y: auto; position: sticky; top: 86px; }
    .side-list { flex-direction: column; overflow: visible; }
    .side-item { width: 100%; max-width: none; }
}

/* 底部操作栏：手机端固定 */
.live-actions {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 70;
    display: flex; gap: 8px; justify-content: center; align-items: center;
    padding: 10px 12px calc(10px + var(--safe-bottom));
    background: rgba(13, 16, 32, .92); border-top: 1px solid var(--border);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.live-actions form { display: contents; }
.live-actions .btn { flex: 1; max-width: 240px; padding: 13px 10px; font-size: 15px; }

/* 语音跟随悬浮按钮 */
.fab-follow {
    position: fixed; right: 16px; bottom: calc(96px + var(--safe-bottom)); z-index: 80;
    background: var(--primary); color: #fff; border: none; border-radius: 24px;
    padding: 11px 20px; font-size: 14px; font-family: inherit; cursor: pointer;
    box-shadow: 0 6px 20px rgba(108, 123, 255, .5);
    opacity: 0; pointer-events: none; transform: translateY(8px);
    transition: opacity .25s, transform .25s;
}
.fab-follow.show { opacity: 1; pointer-events: auto; transform: translateY(0); }

.live-banner {
    padding: 13px 16px; border-radius: var(--radius); margin-bottom: 12px;
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    border: 1px solid; font-size: 14px;
}
.live-banner.warn { background: rgba(255, 169, 64, .1); border-color: rgba(255, 169, 64, .4); color: #ffc178; }
.live-banner.done { background: rgba(46, 204, 113, .1); border-color: rgba(46, 204, 113, .4); color: #7ce8a8; }

.live-empty { text-align: center; padding: 70px 20px; color: var(--text-dim); }
.live-empty .big { font-size: 40px; margin-bottom: 12px; }

/* ---------- 单商品题词页 ---------- */
.tp-wrap {
    max-width: 860px; margin: 0 auto;
    padding: 12px 12px calc(60px + var(--safe-bottom));
}
.tp-meta {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    padding: 12px 16px; margin-bottom: 12px;
}
.tp-price { color: var(--orange); font-size: 22px; font-weight: 800; }

/* ---------- 参考线（当前句锚定在屏幕上方 30% 处） ---------- */
.ref-line {
    position: fixed; left: 0; right: 0; top: 30%; z-index: 30;
    height: 0; border-top: 2px dashed rgba(255, 92, 108, .4);
    pointer-events: none;
}
.ref-line::before, .ref-line::after {
    content: ''; position: absolute; top: -6px;
    width: 10px; height: 10px; border-radius: 50%;
    background: rgba(255, 92, 108, .55);
}
.ref-line::before { left: 12px; }
.ref-line::after { right: 12px; }

/* 提词器模式 */
body.tele .live-side, body.tele .live-product, body.tele .no-tele { display: none; }
body.tele .live-main { grid-template-columns: 1fr; }
body.tele { --script-size: 36px; background: #000; }
body.tele .live-topbar { background: #111; border-color: #2a2a2a; top: 0; }
body.tele .live-script { background: #000; border-color: #2a2a2a; }
body.tele .script-content { color: #ffe58f; font-weight: 600; }
body.tele .s-line.active { background: rgba(255, 229, 143, .14); box-shadow: inset 3px 0 0 #ffe58f; }
body.tele .s-line.read { opacity: .3; }
body.tele .ref-line { border-top-color: rgba(255, 229, 143, .45); }
body.tele .ref-line::before, body.tele .ref-line::after { background: rgba(255, 229, 143, .5); }
@media (max-width: 640px) { body.tele { --script-size: 30px; } }

/* 结尾占位：让最后一句也能滚动到参考线上方结束 */
.tp-end-spacer { height: 75vh; pointer-events: none; }

/* ========== 图片页内弹窗（lightbox） ========== */
.img-lightbox {
    position: fixed; inset: 0; z-index: 9999;
    background: rgba(0, 0, 0, .88);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none;
    transition: opacity .18s ease;
    padding: 20px;
    box-sizing: border-box;
}
.img-lightbox.show { opacity: 1; pointer-events: auto; }
.img-lightbox img {
    max-width: 94vw; max-height: 88vh;
    border-radius: 10px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, .6);
    object-fit: contain;
}
.img-lightbox .ilb-close {
    position: absolute; top: calc(14px + env(safe-area-inset-top)); right: 16px;
    width: 42px; height: 42px; border-radius: 50%;
    border: none; cursor: pointer;
    background: rgba(255, 255, 255, .14); color: #fff;
    font-size: 20px; line-height: 1;
    display: flex; align-items: center; justify-content: center;
    transition: background .15s;
    z-index: 1;
}
.img-lightbox .ilb-close:hover { background: rgba(255, 255, 255, .28); }
img.zoomable { cursor: zoom-in; }

/* ========== 快递 / 服务 / 附加信息 ========== */
.mech-tag.tag-express { background: rgba(124, 198, 255, .12); color: #7cc6ff; box-shadow: inset 0 0 0 1px rgba(124, 198, 255, .25); }
.mech-tag.tag-service { background: rgba(111, 227, 161, .12); color: #6fe3a1; box-shadow: inset 0 0 0 1px rgba(111, 227, 161, .25); }
.mech-tag.tag-info    { background: rgba(255, 209, 102, .10); color: #ffd166; box-shadow: inset 0 0 0 1px rgba(255, 209, 102, .22); }

.info-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.info-item {
    background: rgba(255, 255, 255, .04);
    border: 1px solid rgba(255, 255, 255, .07);
    border-radius: 10px; padding: 8px 12px;
    display: flex; flex-direction: column; gap: 2px;
}
.info-label { font-size: 12px; color: #8b93b0; }
.info-val   { font-size: 14px; color: #e8eaf2; font-weight: 600; word-break: break-all; }

.link-list { display: flex; flex-direction: column; gap: 8px; }
.link-item {
    display: flex; align-items: center; gap: 8px;
    background: rgba(255, 255, 255, .04);
    border: 1px solid rgba(255, 255, 255, .07);
    border-radius: 10px; padding: 10px 12px;
    color: #7cc6ff; text-decoration: none; font-size: 14px;
}
.link-item span {
    color: #8b93b0; font-size: 12px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.link-item:hover { border-color: rgba(124, 198, 255, .4); }

/* ========== 表单多选框 ========== */
.check-row { display: flex; flex-wrap: wrap; gap: 10px; }
.check-item {
    display: inline-flex; align-items: center; gap: 7px;
    background: rgba(255, 255, 255, .04);
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 10px; padding: 9px 14px;
    cursor: pointer; font-size: 14px; color: #cfd4e4;
    user-select: none; transition: border-color .15s, background .15s;
}
.check-item:hover { border-color: rgba(124, 198, 255, .35); }
.check-item input[type="checkbox"] {
    width: 17px; height: 17px; margin: 0;
    accent-color: #5b8cff; cursor: pointer;
}
.check-item:has(input:checked) {
    background: rgba(91, 140, 255, .14);
    border-color: rgba(91, 140, 255, .5);
    color: #fff;
}

/* ========== 附加信息：一行三项数字输入（带单位） ========== */
.num-line { display: flex; gap: 10px; flex-wrap: wrap; }
.num-field {
    flex: 1; min-width: 150px;
    display: flex; align-items: center; gap: 8px;
    background: rgba(255, 255, 255, .04);
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 10px; padding: 6px 12px;
    transition: border-color .15s;
}
.num-field:focus-within { border-color: rgba(91, 140, 255, .55); }
.num-field .nf-label { font-size: 13px; color: #8b93b0; white-space: nowrap; }
.num-field .nf-unit  { font-size: 13px; color: #6fe3a1; white-space: nowrap; }
.num-field input {
    flex: 1; min-width: 0;
    background: none; border: none; outline: none;
    color: #fff; font-size: 16px; font-weight: 600;
    text-align: center; padding: 6px 0;
}
.num-field input::placeholder { color: #4a5170; font-weight: 400; }
.num-field input::-webkit-outer-spin-button,
.num-field input::-webkit-inner-spin-button { -webkit-appearance: none; }
.num-field input[type="number"] { -moz-appearance: textfield; appearance: textfield; }

/* 佣金自动计算结果 */
.comm-calc {
    display: none; margin-top: 10px;
    background: rgba(111, 227, 161, .10);
    border: 1px solid rgba(111, 227, 161, .3);
    color: #6fe3a1; font-size: 14px; font-weight: 600;
    border-radius: 10px; padding: 10px 14px;
}
.comm-calc.show { display: block; }

/* ========== 商品链接输入框（图标前缀美化） ========== */
.input-icon {
    display: flex; align-items: center; gap: 0;
    background: rgba(255, 255, 255, .04);
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 12px; overflow: hidden;
    transition: border-color .15s, box-shadow .15s;
}
.input-icon:focus-within {
    border-color: rgba(91, 140, 255, .55);
    box-shadow: 0 0 0 3px rgba(91, 140, 255, .12);
}
.input-icon .ii-icon {
    flex: none;
    padding: 0 12px 0 14px;
    font-size: 18px;
    border-right: 1px solid rgba(255, 255, 255, .08);
    height: 46px; display: flex; align-items: center;
    background: rgba(255, 255, 255, .03);
}
.input-icon input {
    flex: 1; min-width: 0;
    background: none; border: none; outline: none;
    color: #e8eaf2; font-size: 14px;
    padding: 12px 14px;
}
.input-icon input::placeholder { color: #4a5170; }

/* ========== 快递区域：其他输入 / 偏远地区 ========== */
.other-input, .remote-row {
    display: flex; align-items: center; gap: 10px;
    margin-top: 10px; flex-wrap: wrap;
}
.oi-label { font-size: 13px; color: #8b93b0; white-space: nowrap; }
.other-input input {
    flex: 1; min-width: 200px;
}

/* 偏远地区标签（橙色警示） */
.mech-tag.tag-remote {
    background: rgba(255, 153, 102, .12); color: #ff9966;
    box-shadow: inset 0 0 0 1px rgba(255, 153, 102, .3);
}

/* 后台模式顶栏区分 */
body.admin-mode .topbar { border-bottom-color: rgba(91, 140, 255, .35); }

/* ========== AI 识别页 ========== */
.ai-loading {
    display: flex; align-items: center; justify-content: center; gap: 14px;
    padding: 26px 0 8px;
}
.ai-spinner {
    width: 34px; height: 34px; border-radius: 50%;
    border: 3px solid rgba(91, 140, 255, .2);
    border-top-color: #5b8cff;
    animation: ai-spin .8s linear infinite;
    flex: none;
}
@keyframes ai-spin { to { transform: rotate(360deg); } }
.ai-loading-text { color: #8b93b0; font-size: 14px; }
.ai-error {
    margin-top: 14px;
    background: rgba(255, 92, 108, .10);
    border: 1px solid rgba(255, 92, 108, .35);
    color: #ff8a95; font-size: 14px;
    border-radius: 10px; padding: 12px 14px;
}

/* ========== 手卡大图管理弹窗 ========== */
.hc-modal {
    position: fixed; inset: 0; z-index: 9999;
    background: rgba(0, 0, 0, .88);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none;
    transition: opacity .18s ease;
    padding: 20px; box-sizing: border-box;
}
.hc-modal.show { opacity: 1; pointer-events: auto; }
.hc-modal-box {
    display: flex; flex-direction: column; align-items: center; gap: 16px;
    max-width: 94vw;
}
.hc-modal-box img {
    max-width: 94vw; max-height: 76vh;
    border-radius: 10px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, .6);
    object-fit: contain;
}
.hc-modal-actions { display: flex; gap: 12px; }
.hc-modal-actions .btn { padding: 10px 22px; font-size: 15px; }
#handcardPreview { cursor: zoom-in; }

/* 划线日常价 */
.daily-price {
    font-size: 14px; color: #8b93b0;
    text-decoration: line-through;
    font-weight: 400; margin-left: 8px;
}
.badge.badge-green { background: rgba(111, 227, 161, .15); color: #6fe3a1; }

/* 后台商品卡片联系人行（仅后台可见） */
.contact-line {
    margin-top: 6px;
    font-size: 12px; color: #8b93b0;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}


/* ========== 题词页：四周固定，仅中间话术区滚动 ========== */
body.live-mode {
    height: 100vh; height: 100dvh;
    overflow: hidden;
    display: flex; flex-direction: column;
}
.live-wrap, .tp-wrap {
    flex: 1; min-height: 0;
    display: flex; flex-direction: column;
    overflow: hidden;
}
.live-wrap { width: 100%; padding-bottom: calc(76px + var(--safe-bottom)); }
.tp-wrap { width: 100%; padding-bottom: calc(24px + var(--safe-bottom)); }
body.tele .live-wrap { padding-bottom: 12px; }

.live-main {
    flex: 1; min-height: 0;
    display: flex; flex-direction: column;
    overflow: hidden; align-items: stretch;
}
.live-script {
    display: flex; flex-direction: column;
    flex: 1; min-height: 0; overflow: hidden;
}
.script-scroll {
    position: relative;
    flex: 1; min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    scrollbar-width: thin;
}

/* 桌面端：左卡、右卡各自内部滚动，话术卡占满高度 */
@media (min-width: 1100px) {
    .live-main { display: grid; grid-template-columns: 300px 1fr 240px; }
    .live-main > .live-left,
    .live-main > .live-side {
        height: 100%; max-height: none;
        overflow-y: auto; position: static;
    }
    .live-main > .live-script { height: 100%; }
}

/* 手机/平板：左卡收起（用右下角悬浮按钮看商品信息），底部商品条固定不滚动 */
@media (max-width: 1099px) {
    .live-main > .live-left { display: none; }
    .live-main > .live-side { flex-shrink: 0; }
}

/* ========== 商品信息悬浮按钮 + 底部弹层 ========== */
.info-fab {
    position: fixed; right: 16px; bottom: calc(84px + var(--safe-bottom)); z-index: 80;
    width: 58px; height: 58px; border-radius: 50%;
    background: var(--card); color: var(--primary);
    border: 1px solid var(--primary);
    font-size: 12px; line-height: 1.25; font-family: inherit; cursor: pointer;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .45);
    transition: transform .2s;
}
.info-fab:active { transform: scale(.92); }
body.tele .info-fab { background: #1a1a1a; border-color: #ffe58f; color: #ffe58f; }

.info-panel {
    position: fixed; inset: 0; z-index: 90;
    background: rgba(0, 0, 0, .55);
    opacity: 0; pointer-events: none;
    transition: opacity .25s;
}
.info-panel.show { opacity: 1; pointer-events: auto; }
.info-panel-box {
    position: absolute; left: 0; right: 0; bottom: 0;
    max-height: 82vh;
    display: flex; flex-direction: column;
    background: var(--bg); border-top: 1px solid var(--border);
    border-radius: 18px 18px 0 0;
    padding-bottom: var(--safe-bottom);
    transform: translateY(102%);
    transition: transform .28s ease;
}
.info-panel.show .info-panel-box { transform: translateY(0); }
.info-panel-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 16px; border-bottom: 1px solid var(--border);
    font-size: 15px; font-weight: 700; flex-shrink: 0;
}
.info-panel-body {
    flex: 1; min-height: 0;
    overflow-y: auto; -webkit-overflow-scrolling: touch;
    margin: 12px;
}
@media (min-width: 768px) {
    .info-panel-box {
        left: 50%; right: auto;
        width: min(560px, 92vw);
        transform: translate(-50%, 102%);
    }
    .info-panel.show .info-panel-box { transform: translate(-50%, 0); }
}


/* ========== 隐藏滚动轨道条（保留滚动功能，鼠标滚轮/触控板正常用） ========== */
.script-scroll,
.live-main > .live-product,
.live-main > .live-side,
.info-panel-body {
    scrollbar-width: none;        /* Firefox */
    -ms-overflow-style: none;     /* IE/旧 Edge */
}
.script-scroll::-webkit-scrollbar,
.live-main > .live-product::-webkit-scrollbar,
.live-main > .live-side::-webkit-scrollbar,
.info-panel-body::-webkit-scrollbar {
    display: none;                /* Chrome / Safari / 新 Edge */
    width: 0; height: 0;
}


/* ========== 左栏拆分卡片（三列叠放 / 五列分栏共用） ========== */
.live-left {
    display: flex; flex-direction: column; gap: 12px;
    min-height: 0;
    scrollbar-width: none;
}
.live-left::-webkit-scrollbar { display: none; }
.live-left > .card { flex-shrink: 0; }
.live-extra, .live-hand { padding: 16px; }
.live-extra h3, .live-hand h3 { font-size: 13px; color: var(--text-dim); margin: 16px 0 8px; }
.live-extra h3:first-child, .live-hand h3:first-child { margin-top: 0; }
.live-hand .handcard-img { width: 100%; border-radius: 10px; }
.live-hand .lp-remark { color: var(--text-dim); font-size: 13px; }

/* 提词模式下隐藏左侧区与手卡列 */
body.tele .live-left, body.tele .live-hand { display: none; }

/* 布局切换按钮：仅桌面端显示 */
@media (max-width: 1099px) { #colsBtn { display: none; } }

/* ========== 五列布局（宽屏生效，提词模式下自动回到单列） ========== */
@media (min-width: 1500px) {
    /* 【页面总宽度设置处】五列布局时题词页最大宽度 = 1960px：
       在三列 1400px 的基础上加宽，容纳新增的两列，中间话术区不被压小（改这里调整五列整体宽度） */
    body.cols5:not(.tele) .live-wrap { max-width: 1960px; }
    /* 列宽比例 1 : 1 : 3 : 1 : 1，中间话术区占 3/7 大尺寸 */
    body.cols5:not(.tele) .live-main {
        grid-template-columns: 1fr 1fr 3fr 1fr 1fr;
        align-items: start; /* 卡片多高由内容决定，下方留白显示背景色 */
    }
    body.cols5:not(.tele) .live-left { display: contents; }
    body.cols5:not(.tele) .live-extra { grid-column: 1; grid-row: 1; }
    body.cols5:not(.tele) .live-product { grid-column: 2; grid-row: 1; }
    body.cols5:not(.tele) .live-script { grid-column: 3; grid-row: 1; }
    body.cols5:not(.tele) .live-side { grid-column: 4; grid-row: 1; }
    body.cols5:not(.tele) .live-hand { grid-column: 5; grid-row: 1; }
    /* 四张侧栏卡：内容到哪就显示到哪；内容超过一屏时卡内滚动，最高不超过一屏 */
    body.cols5:not(.tele) .live-main .live-extra,
    body.cols5:not(.tele) .live-main .live-product,
    body.cols5:not(.tele) .live-main .live-side,
    body.cols5:not(.tele) .live-main .live-hand {
        height: auto; max-height: 100%;
        overflow-y: auto; position: static;
        scrollbar-width: none;
    }
    body.cols5:not(.tele) .live-main .live-extra::-webkit-scrollbar,
    body.cols5:not(.tele) .live-main .live-product::-webkit-scrollbar,
    body.cols5:not(.tele) .live-main .live-side::-webkit-scrollbar,
    body.cols5:not(.tele) .live-main .live-hand::-webkit-scrollbar { display: none; }
}


/* ==========================================================
   联系信息折叠条（品牌方录入/修改商品：默认收起，点「✎ 修改」展开）
   ========================================================== */
.bp-contact-toggle {
    width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px;
    background: var(--bg-soft); border: 1px solid var(--border); border-radius: 12px;
    padding: 12px 16px; font-size: 14px; color: var(--text);
    cursor: pointer; font-family: inherit; text-align: left;
}
.bp-contact-toggle b { color: var(--primary); font-weight: 700; }
.bp-contact-toggle .ct-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bp-contact-toggle .ct-arrow { color: var(--text-dim); font-size: 13px; white-space: nowrap; flex-shrink: 0; }
.bp-contact-box { margin-top: 10px; }
.bp-add-tools { display: flex; justify-content: flex-end; margin: -6px 0 12px; }

/* ==========================================================
   白天 / 黑夜模式一键切换
   白天模式 = 白底黑字（直播时可把屏幕当补光灯用），选择自动记忆
   ========================================================== */
html.light {
    --bg: #ffffff;
    --bg-soft: #f3f5f9;
    --card: #ffffff;
    --card-hover: #f5f6fa;
    --border: #e3e6ef;
    --text: #171a26;
    --text-dim: #5c6376;
    --shadow: 0 4px 18px rgba(30, 36, 64, .08);
}
html.light body, html.light body.live-mode { background: #ffffff; }
html.light .topbar { background: rgba(255, 255, 255, .94); }
/* 提词模式（白天）：白底黑字 */
html.light body.tele { background: #ffffff; }
html.light body.tele .live-topbar { background: #ffffff; border-color: var(--border); }
html.light body.tele .live-script { background: #ffffff; border-color: var(--border); }
html.light body.tele .script-content { color: #14161f; }
html.light body.tele .s-line.active { background: rgba(108, 123, 255, .16); box-shadow: inset 3px 0 0 var(--primary); color: #14161f; }
html.light body.tele .info-fab { background: #ffffff; border-color: var(--primary); color: var(--primary); }
html.light .s-line.active { background: rgba(108, 123, 255, .14); color: #171a26; }
/* 直播页固定件 */
html.light .live-actions { background: rgba(255, 255, 255, .94); }
html.light .live-topbar .lt-progress b { color: var(--primary-dark); }
/* 徽标（白底配深色文字，保证可读） */
html.light .badge-green  { background: rgba(46, 204, 113, .13); color: #148c4b; }
html.light .badge.badge-green { background: rgba(46, 204, 113, .13); color: #148c4b; }
html.light .badge-blue   { background: rgba(64, 169, 255, .13); color: #1773c2; }
html.light .badge-orange { background: rgba(255, 169, 64, .18); color: #ad6800; }
html.light .badge-red    { background: rgba(255, 92, 108, .12); color: #cf3040; }
html.light .badge-purple { background: rgba(108, 123, 255, .13); color: #4753c9; }
html.light .badge-gray   { background: rgba(93, 100, 120, .12); color: #5c6376; }
/* 机制 / 快递 / 服务标签 */
html.light .mech-tag.tag-express { background: rgba(64, 169, 255, .10); color: #1773c2; box-shadow: inset 0 0 0 1px rgba(64, 169, 255, .3); }
html.light .mech-tag.tag-service { background: rgba(46, 204, 113, .10); color: #148c4b; box-shadow: inset 0 0 0 1px rgba(46, 204, 113, .3); }
html.light .mech-tag.tag-info    { background: rgba(255, 169, 64, .12); color: #ad6800; box-shadow: inset 0 0 0 1px rgba(255, 169, 64, .3); }
html.light .mech-tag.tag-remote  { background: rgba(255, 92, 108, .10); color: #cf3040; box-shadow: inset 0 0 0 1px rgba(255, 92, 108, .3); }
/* 表单部件 */
html.light .info-item, html.light .check-item, html.light .num-field,
html.light .input-icon, html.light .link-item { background: #f5f6fa; border-color: #e3e6ef; }
html.light .info-label, html.light .oi-label, html.light .num-field .nf-label { color: #828aa0; }
html.light .info-val { color: #171a26; }
html.light .num-field input { color: #171a26; }
html.light .num-field input::placeholder { color: #aab1c5; }
html.light .num-field .nf-unit { color: #148c4b; }
html.light .input-icon .ii-icon { background: #eef0f6; border-right-color: #e3e6ef; }
html.light .input-icon input { color: #171a26; }
html.light .input-icon input::placeholder { color: #aab1c5; }
html.light .check-item { color: #3c4257; }
html.light .check-item:has(input:checked) { background: rgba(91, 140, 255, .12); border-color: rgba(91, 140, 255, .5); color: #2a3fb0; }
html.light .link-item { color: #1773c2; }
html.light .link-item span { color: #828aa0; }
html.light .comm-calc { background: rgba(46, 204, 113, .08); border-color: rgba(46, 204, 113, .35); color: #148c4b; }
/* 提示 / 计时 / 文本 */
html.light .flash-ok { background: rgba(46, 204, 113, .10); border-color: rgba(46, 204, 113, .4); color: #148c4b; }
html.light .flash-error { background: rgba(255, 92, 108, .08); border-color: rgba(255, 92, 108, .35); color: #cf3040; }
html.light .timer-chip { background: rgba(255, 92, 108, .08); color: #cf3040; }
html.light .daily-price, html.light .contact-line { color: #828aa0; }
html.light .live-banner.warn { background: rgba(255, 169, 64, .10); border-color: rgba(255, 169, 64, .4); color: #ad6800; }
html.light .live-banner.done { background: rgba(46, 204, 113, .10); border-color: rgba(46, 204, 113, .4); color: #148c4b; }
html.light .ai-loading-text { color: #828aa0; }
html.light .ai-error { color: #cf3040; }
html.light .info-fab { background: #ffffff; }
/* 商品清单 */
html.light .side-item { color: #171a26; }
html.light .side-item .no { background: #dfe3ee; color: #3c4257; }
html.light .side-item.current .no { background: var(--primary); color: #fff; }
html.light .side-item.done .si-name { color: #828aa0; }
/* 品牌站 */
html.light body.bp-mode { background: #f6f7fb; }
html.light .bp-topbar { background: rgba(255, 255, 255, .92); }
html.light .bp-hero { background: linear-gradient(160deg, rgba(108, 123, 255, .10), rgba(108, 123, 255, .02)); }
html.light .bp-contact-bar { background: rgba(108, 123, 255, .08); }
html.light .bp-badge-collected { color: #148c4b; }
html.light .bp-badge-wait { color: #ad6800; }
html.light .bp-modal-err, html.light .req { color: #cf3040; }

/* 主题切换按钮（顶栏） */
.theme-btn { flex-shrink: 0; }

/* ==========================================================
   题词页：靠左布局 + 右侧「网页题词」嵌入区
   直播时左边看话术滚动，右边嵌入外部题词网页（iframe），地址自动记忆
   ========================================================== */
body.live-mode { flex-direction: row; }
.live-embed { display: none; }
body.embed-on .live-wrap { margin: 0; flex: 1 1 auto; min-width: 0; }
body.embed-on .live-embed {
    display: flex; flex-direction: column; position: relative;
    flex: 1 1 320px; min-width: 280px; min-height: 0;
    padding: 12px 12px calc(76px + var(--safe-bottom)) 0;
}
/* 题词模式下右侧实时提词区保持显示（用户要求题词时也能看 shishitici） */
.le-bar {
    display: flex; align-items: center; gap: 6px;
    background: var(--card); border: 1px solid var(--border);
    border-radius: var(--radius) var(--radius) 0 0; padding: 8px;
}
.le-title { font-size: 13px; color: var(--text-dim); white-space: nowrap; }
.le-tip {
    flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    font-size: 12px; color: var(--text-dim); opacity: .75;
}
.live-embed iframe {
    flex: 1; min-height: 0; width: 100%;
    border: 1px solid var(--border); border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
    background: #fff;
}
.le-empty {
    position: absolute; inset: 49px 12px calc(76px + var(--safe-bottom)) 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
    text-align: center; color: var(--text-dim); font-size: 14px; line-height: 1.8;
    background: var(--bg); border: 1px dashed var(--border); border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
    padding: 20px; pointer-events: none;
}
.le-empty small { font-size: 12px; opacity: .8; }
/* 手机 / 平板：嵌入区改为全屏浮层，打开后盖在题词页上方 */
@media (max-width: 1099px) {
    body.embed-on .live-embed {
        position: fixed; inset: 0; z-index: 200;
        min-width: 0; padding: 8px 8px calc(8px + var(--safe-bottom));
        background: var(--bg);
    }
    .le-empty { inset: 49px 8px calc(8px + var(--safe-bottom)); }
}

/* ==========================================================
   手机端全站优化：简单、大方、明了
   ========================================================== */
@media (max-width: 640px) {
    body { font-size: 14px; }
    .container { padding: 12px 10px calc(40px + var(--safe-bottom)); }
    .topbar-inner { height: 50px; padding: 0 10px; gap: 8px; }
    .logo { font-size: 15px; }
    .nav a { padding: 6px 10px; font-size: 13px; }
    .page-head h1 { font-size: 19px; }
    .page-head .sub { font-size: 12px; }
    /* 统计卡片 */
    .stat-row { gap: 8px; margin-bottom: 12px; }
    .stat-card { padding: 10px 12px; }
    .stat-card .num { font-size: 20px; }
    /* 筛选栏 */
    .filter-bar { padding: 8px; gap: 6px; margin-bottom: 12px; border-radius: 14px; }
    .filter-bar input[type="search"], .filter-bar select { padding-top: 9px; padding-bottom: 9px; font-size: 14px; }
    /* 商品卡片：紧凑、价格佣金一眼看清 */
    .product-grid { gap: 10px; }
    .product-card .body { padding: 9px 10px; gap: 5px; }
    .product-card .name { font-size: 13px; }
    .product-card .price { font-size: 15px; }
    .product-card .badge { font-size: 11px; padding: 1px 7px; }
    .product-card .actions { padding: 8px 10px; }
    .product-card .actions .btn { font-size: 12px; padding: 7px 6px; }
    /* 表单 */
    .form-card { padding: 14px 12px; }
    /* 卡片与区块 */
    .card { border-radius: 12px; }
    .view-wrap { gap: 10px; }
    /* 题词页 */
    .live-wrap { padding: 8px 8px calc(76px + var(--safe-bottom)); }
    .live-topbar { padding: 8px 10px; gap: 6px; margin-bottom: 8px; top: 6px; }
    .live-topbar .lt-title { font-size: 14px; }
    .lt-tools .btn { font-size: 12px; padding: 6px 10px; }
    .live-script { padding: 14px 14px 24px; min-height: 0; }
    .lp-img { width: 92px; height: 92px; }
    .lp-head h2 { font-size: 16px; }
    .lp-price { font-size: 20px; }
    .info-fab { width: 52px; height: 52px; font-size: 11px; right: 12px; }
    /* 品牌站 */
    .bp-main { padding: 14px 12px 50px; }
    .bp-card { padding: 16px 14px; }
    .bp-hero { padding: 30px 14px 26px; }
    .bp-grid { grid-template-columns: repeat(2, 1fr); }
    .bp-kv-row { padding: 11px 12px; font-size: 13px; }
}

/* ==========================================================
   商品详情页 · 信息网格（两列一行：直播价/日常价/佣金/返点/品牌/分类/日期/保质期/发货）
   ========================================================== */
.view-info-grid {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px;
    margin-top: 14px; padding: 12px;
    background: var(--bg-soft); border: 1px solid var(--border); border-radius: 14px;
}
.vig-item {
    display: flex; align-items: baseline; gap: 8px; min-width: 0;
    padding: 8px 10px; background: var(--card);
    border: 1px solid var(--border); border-radius: 10px;
}
.vig-label { flex-shrink: 0; color: var(--text-dim); font-size: 12px; }
.vig-val {
    color: var(--text); font-size: 14px; font-weight: 600;
    word-break: break-all; line-height: 1.45;
}
.vig-item.vig-price { border-color: rgba(255, 176, 32, .4); }
.vig-item.vig-price .vig-val { color: var(--orange); font-size: 17px; font-weight: 800; }
@media (max-width: 380px) {
    .view-info-grid { gap: 6px; padding: 10px; }
    .vig-item { flex-direction: column; gap: 2px; align-items: flex-start; }
}

/* 商品链接 · 点击复制 */
.link-item.link-copy { cursor: pointer; user-select: none; }
.link-item.link-copy:active { transform: scale(.99); }
.link-item .lc-btn {
    margin-left: auto; flex-shrink: 0;
    font-size: 12px; font-weight: 600; color: var(--text-dim);
    background: var(--bg-soft); border: 1px solid var(--border);
    padding: 4px 10px; border-radius: 8px;
}

/* 复制成功 toast */
.copy-toast {
    position: fixed; left: 50%; bottom: 46px; z-index: 9999;
    transform: translateX(-50%) translateY(16px);
    background: var(--green); color: #052e12;
    font-size: 14px; font-weight: 700;
    padding: 11px 22px; border-radius: 999px;
    box-shadow: 0 8px 26px rgba(0, 0, 0, .35);
    opacity: 0; transition: all .3s ease; pointer-events: none;
    white-space: nowrap;
}
.copy-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* 列表页佣金/返佣行 */
.comm-line { margin-top: 4px; }
html.light .vig-item { background: #fff; }
html.light .vig-item.vig-price { border-color: rgba(217, 142, 0, .45); }
