/* 提词器系统样式 */
:root {
    --bg: #f4f6f9;
    --card: #ffffff;
    --text: #1f2937;
    --muted: #6b7280;
    --border: #e5e7eb;
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --danger: #dc2626;
    --danger-hover: #b91c1c;
    --success: #16a34a;
    --radius: 12px;
    --shadow: 0 4px 12px rgba(0,0,0,0.06);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

/* 后台通用 */
.container { max-width: 1100px; margin: 0 auto; padding: 24px; }
.page-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 24px; flex-wrap: wrap; gap: 12px;
}
.page-header h1 { margin: 0; font-size: 28px; letter-spacing: -0.5px; }
.page-header nav { display: flex; gap: 16px; }
.page-header nav a {
    color: var(--muted); text-decoration: none; font-weight: 500;
    padding: 6px 0; border-bottom: 2px solid transparent;
}
.page-header nav a:hover, .page-header nav a.active { color: var(--primary); border-color: var(--primary); }

.card {
    background: var(--card); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 20px; margin-bottom: 20px;
}

.btn {
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--border); background: #fff; color: var(--text);
    border-radius: 8px; padding: 8px 16px; font-size: 14px; cursor: pointer;
    text-decoration: none; transition: all .15s;
}
.btn:hover { background: #f9fafb; border-color: #d1d5db; }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-danger { color: var(--danger); border-color: #fecaca; background: #fef2f2; }
.btn-danger:hover { background: #fee2e2; }

/* 设备档案提示条 */
.calib-device {
    margin: 10px 0 12px; padding: 9px 12px; border-radius: 8px;
    background: #f1f5f9; border: 1px solid #e2e8f0;
    font-size: 13px; color: #334155; line-height: 1.6;
}
.calib-device b { color: #0f172a; }
.ok-tag, .warn-tag {
    display: inline-block; padding: 1px 8px; border-radius: 999px;
    font-size: 12px; font-weight: 600; margin-left: 4px;
}
.ok-tag { background: #dcfce7; color: #15803d; }
.warn-tag { background: #fef3c7; color: #b45309; }
.warn-inline { color: #b45309; }
.calib-foot { margin-top: 10px; text-align: right; }
.btn-sm { padding: 5px 10px; font-size: 13px; }

.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; }
.alert-info { background: #eff6ff; color: #1e40af; border: 1px solid #dbeafe; }

.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 12px; text-align: left; border-bottom: 1px solid var(--border); }
.table th { color: var(--muted); font-weight: 600; font-size: 13px; text-transform: uppercase; }
.table tr:hover { background: #f9fafb; }
.table .empty { color: var(--muted); text-align: center; padding: 40px; }

.inline-form { display: inline-flex; align-items: center; gap: 6px; }
.inline-form input[type="text"] { padding: 6px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 14px; }
.inline-form button { background: transparent; border: none; color: var(--danger); cursor: pointer; font-size: 18px; line-height: 1; padding: 0 4px; }

.toolbar .filter-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.filter-form input[type="text"], .filter-form select {
    padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; min-width: 180px;
}

.category-list { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
    display: inline-flex; align-items: center; gap: 4px;
    background: #eef2ff; color: #3730a3; padding: 4px 10px; border-radius: 20px; font-size: 13px;
}

.edit-form .form-row, .settings-form .form-row { margin-bottom: 18px; }
.edit-form label, .settings-form label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 14px; }
.edit-form input[type="text"], .edit-form select, .edit-form textarea,
.settings-form input[type="text"], .settings-form select {
    width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 15px;
}
.edit-form textarea { resize: vertical; min-height: 320px; font-family: inherit; line-height: 1.6; }
.form-actions { display: flex; gap: 10px; align-items: center; }

.settings-form .form-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.settings-form label { margin-bottom: 0; min-width: 180px; }
.settings-form input[type="range"] { flex: 1; min-width: 200px; }
.settings-form input[type="color"] { width: 48px; height: 36px; border: none; background: none; cursor: pointer; }
.settings-form input[type="checkbox"] { width: 20px; height: 20px; cursor: pointer; }
.range-value { min-width: 48px; font-variant-numeric: tabular-nums; color: var(--muted); }
.hint { color: var(--muted); font-size: 13px; margin-top: -8px; margin-bottom: 18px; }

/* 遥控测试 */
.remote-log {
    max-height: 360px; overflow-y: auto; border: 1px solid var(--border); border-radius: 8px;
    background: #f8fafc; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px;
}
.log-row { display: grid; grid-template-columns: 90px 90px 120px 1fr 70px; gap: 8px; padding: 8px 12px; border-bottom: 1px solid #e2e8f0; }
.log-row.head { background: #e2e8f0; font-weight: 600; position: sticky; top: 0; }

/* 播放器 */
.player-body { overflow: hidden; background: #000; }
.player-app {
    position: fixed; inset: 0; display: flex; flex-direction: column;
    background: #000; color: #fff; overflow: hidden;
}
.prompter {
    flex: 1; overflow: hidden; position: relative; cursor: grab;
    -webkit-overflow-scrolling: auto;
}
.prompter:active { cursor: grabbing; }
.prompter-text {
    padding: 35vh 8vw 120vh; font-weight: 500;
    will-change: transform, scroll-top;
    user-select: none; -webkit-user-select: none;
}

.topbar {
    position: absolute; top: 0; left: 0; right: 0; z-index: 20;
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 18px; background: rgba(0,0,0,0.45);
    backdrop-filter: blur(6px); color: rgba(255,255,255,0.85); font-size: 14px;
    opacity: 1; transition: opacity .4s;
}
.topbar.hidden-bar { opacity: 0; pointer-events: none; }

.controls {
    position: absolute; bottom: 0; left: 0; right: 0; z-index: 20;
    background: rgba(0,0,0,0.75); backdrop-filter: blur(10px);
    padding: 14px 18px; display: flex; flex-wrap: wrap; gap: 14px 24px;
    align-items: center; justify-content: center;
    opacity: 1; transition: opacity .4s; border-top: 1px solid rgba(255,255,255,0.08);
}
.controls.hidden-bar { opacity: 0; pointer-events: none; }
.control-group { display: flex; align-items: center; gap: 8px; }
.control-group label { color: rgba(255,255,255,0.8); font-size: 13px; white-space: nowrap; }
.control-group input[type="range"] { width: 110px; }
.control-group input[type="color"] { width: 32px; height: 28px; border: none; background: none; cursor: pointer; }
.control-group select { background: #111; color: #fff; border: 1px solid #444; border-radius: 6px; padding: 4px 6px; font-size: 13px; }
.control-group.compact label { display: inline-flex; align-items: center; gap: 4px; }
.control-group input[type="checkbox"] { accent-color: var(--primary); }
.control-group.help { color: rgba(255,255,255,0.5); font-size: 12px; }

.countdown {
    position: absolute; inset: 0; z-index: 50;
    display: flex; align-items: center; justify-content: center;
    font-size: 25vh; font-weight: 800; color: rgba(255,255,255,0.95);
    background: rgba(0,0,0,0.4); pointer-events: none;
}
.countdown.hidden { display: none; }

.remote-debug {
    position: absolute; top: 50%; right: 12px; z-index: 30;
    background: rgba(0,0,0,0.65); color: #0f0; padding: 8px 12px; border-radius: 8px;
    font-family: ui-monospace, monospace; font-size: 12px;
}
.remote-debug.hidden { display: none; }

/* 全屏时的隐藏优化 */
:fullscreen .topbar, :fullscreen .controls { background: rgba(0,0,0,0.55); }

/* ===================== 控制台 / 首页 ===================== */
.topnav {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px; margin-bottom: 26px; flex-wrap: wrap; gap: 12px;
    background: #fff; border: 1px solid var(--border);
    border-radius: 18px; box-shadow: var(--shadow);
    position: sticky; top: 14px; z-index: 60;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
    display: grid; place-items: center;
}
.brand-logo { height: 26px; width: auto; max-width: 170px; display: block; object-fit: contain; }
.brand-name { font-size: 19px; font-weight: 800; letter-spacing: -0.3px; }
.brand-sep { margin: 0 9px; color: var(--muted); font-weight: 700; font-size: 18px; }
.topnav-links { display: flex; gap: 4px; }
.topnav-links a {
    text-decoration: none; color: var(--muted); font-weight: 600; font-size: 14px;
    padding: 9px 16px; border-radius: 11px; transition: all .15s;
}
.topnav-links a:hover { color: var(--primary); background: #f1f5f9; }
.topnav-links a.active {
    color: #fff; background: linear-gradient(135deg, #6366f1, #4f46e5);
    box-shadow: 0 6px 16px rgba(79,70,229,0.32);
}

/* 英雄区 */
.hero {
    display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 38px; align-items: center;
    background:
        radial-gradient(900px 380px at 88% -20%, rgba(6,182,212,0.40), transparent 60%),
        linear-gradient(135deg, #4338ca 0%, #4f46e5 46%, #0ea5e9 100%);
    border-radius: 26px; padding: 52px 48px; color: #fff; overflow: hidden;
    box-shadow: 0 24px 60px rgba(67,56,202,0.32); margin-bottom: 28px; position: relative;
}
.hero::after {
    content: ''; position: absolute; left: -90px; bottom: -90px; width: 300px; height: 300px;
    background: radial-gradient(circle, rgba(255,255,255,0.18), transparent 70%); border-radius: 50%;
}
.hero-tag {
    display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: 1.5px;
    background: rgba(255,255,255,0.16); padding: 6px 14px; border-radius: 999px; margin-bottom: 18px;
    backdrop-filter: blur(4px);
}
.hero-text h1 { margin: 0 0 16px; font-size: 42px; line-height: 1.18; font-weight: 800; letter-spacing: -1px; }
.hero-text p { margin: 0 0 24px; font-size: 15px; line-height: 1.8; color: rgba(255,255,255,0.9); max-width: 470px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.btn-lg { padding: 13px 28px; font-size: 15px; font-weight: 700; }
.btn-ghost { background: rgba(255,255,255,0.14); color: #fff; border: 1px solid rgba(255,255,255,0.4); }
.btn-ghost:hover { background: rgba(255,255,255,0.26); }

/* 仿真提词屏 */
.hero-screen {
    background: #0b0f1a; border-radius: 16px; padding: 18px; box-shadow: 0 18px 40px rgba(0,0,0,0.4);
    border: 1px solid rgba(255,255,255,0.12);
}
.hero-screen-inner { height: 220px; overflow: hidden; position: relative; border-radius: 10px; background: #000; }
.hero-screen-inner .marquee {
    position: absolute; bottom: 30%; left: 0; right: 0; padding: 0 22px; text-align: center;
    color: #fff; font-size: 17px; line-height: 1.9; font-weight: 500;
    animation: heroScroll 9s linear infinite;
}
.hero-screen-inner .marquee p { margin: 0 0 6px; }
@keyframes heroScroll { from { transform: translateY(40px); } to { transform: translateY(-160px); } }
.hero-progress { position: absolute; left: 0; bottom: 0; height: 4px; width: 100%; background: rgba(255,255,255,0.12); }
.hero-progress span { display: block; height: 100%; width: 60%; background: linear-gradient(90deg,#06b6d4,#4f46e5); animation: heroProg 9s ease-in-out infinite; }
@keyframes heroProg { from { width: 8%; } to { width: 96%; } }

/* 数据概览 */
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 28px; }
.stat-card {
    background: #fff; border-radius: 16px; padding: 22px 20px; box-shadow: var(--shadow);
    border: 1px solid var(--border); transition: transform .18s, box-shadow .18s, border-color .18s;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(0,0,0,0.1); border-color: #c7d2fe; }
.stat-num { font-size: 32px; font-weight: 800; letter-spacing: -1px; color: var(--text); font-variant-numeric: tabular-nums; }
.stat-label { color: var(--muted); font-size: 13px; margin-top: 6px; }
.stat-card.accent {
    background: linear-gradient(135deg, #6366f1, #0ea5e9); color: #fff; border: none;
}
.stat-card.accent .stat-num, .stat-card.accent .stat-label { color: #fff; }

/* 布局 */
.layout { display: grid; grid-template-columns: 1fr 340px; gap: 22px; align-items: start; }
.section-title { display: flex; align-items: center; justify-content: space-between; margin: 6px 0 14px; }
.section-title h2 { font-size: 20px; margin: 0; letter-spacing: -0.3px; }

/* 稿件卡片 */
.script-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.script-card {
    background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
    padding: 18px; box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s; display: flex; flex-direction: column;
}
.script-card:hover { transform: translateY(-3px); box-shadow: 0 12px 26px rgba(0,0,0,0.1); }
.script-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.script-cat { background: #eef2ff; color: #4338ca; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.script-meta { color: var(--muted); font-size: 12px; }
.script-title { margin: 0 0 8px; font-size: 17px; font-weight: 700; }
.script-excerpt { color: #475569; font-size: 13px; line-height: 1.6; margin: 0 0 14px; flex: 1; }
.script-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.script-time { color: var(--muted); font-size: 12px; }
.script-ops { display: flex; gap: 6px; }

.empty-state { text-align: center; padding: 50px 20px; }
.empty-emoji { font-size: 42px; margin-bottom: 12px; }
.empty-state p { color: var(--muted); margin: 0 0 18px; }

/* 侧栏 */
.side-col { display: flex; flex-direction: column; gap: 18px; }
.side-card h3 { margin: 0 0 12px; font-size: 16px; }
.side-card .hint { margin-bottom: 12px; }
.btn-block { display: block; width: 100%; }
.tip-list { margin: 0; padding-left: 18px; color: #475569; font-size: 13px; line-height: 1.9; }
.tip-list b { color: var(--text); }
.side-card.tip { background: linear-gradient(135deg,#fffbeb,#fef3c7); border-color: #fde68a; }

.site-footer {
    margin-top: 44px;
    padding: 26px 24px 28px;
    text-align: center;
    color: var(--muted);
    font-size: 13px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--shadow);
}
.footer-beian {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 18px;
    font-size: 13px;
}
.footer-beian a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #475569;
    text-decoration: none;
    transition: color .15s ease;
}
.footer-beian a:hover { color: var(--primary); }
.beian-icon { width: 16px; height: 16px; object-fit: contain; vertical-align: middle; }
.beian-sep { display: none; }
.footer-copyright {
    margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--border);
    font-size: 12px; color: #94a3b8; letter-spacing: .3px;
}

/* ===================== 蓝牙手柄状态 ===================== */
.gp-status {
    display: inline-flex; align-items: center; gap: 6px; padding: 3px 12px; border-radius: 999px;
    font-size: 12px; font-weight: 700; white-space: nowrap;
}
.gp-status::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.gp-off { background: #f1f5f9; color: #64748b; border: 1px solid #e2e8f0; }
.gp-on { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.gp-card .gp-status-row { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.gp-detail { color: var(--muted); font-size: 13px; }

/* 实时输入与按键矩阵 */
.live-input {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 15px;
    background: #0b0f1a; color: #4ade80; padding: 14px 16px; border-radius: 10px; min-height: 52px;
    display: flex; align-items: center; border: 1px solid #1e293b;
}
.live-input.flash { animation: liveFlash .4s ease; }
@keyframes liveFlash { from { background: #14532d; } to { background: #0b0f1a; } }

.pad-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 8px; margin-top: 12px; }
.pad-cell {
    aspect-ratio: 1 / 1; display: grid; place-items: center; border-radius: 10px; font-weight: 700;
    background: #f1f5f9; color: #64748b; border: 1px solid #e2e8f0; transition: all .12s; font-size: 14px;
}
.pad-cell.hit { background: #4ade80; color: #052e16; border-color: #22c55e; transform: scale(1.08); box-shadow: 0 0 0 4px rgba(74,222,128,0.3); }

/* 校准表 */
.calibrate-table .bind-cell { font-family: ui-monospace, monospace; color: var(--primary); font-weight: 600; }

.save-msg { margin-top: 12px; font-size: 13px; font-weight: 600; min-height: 18px; }
.save-msg.ok { color: var(--success); }
.save-msg.err { color: var(--danger); }

.code-block {
    background: #0b0f1a; color: #e2e8f0; padding: 16px; border-radius: 10px; font-size: 13px;
    overflow-x: auto; max-height: 280px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* ===================== 可视化手柄图（MOCUTE-052F） ===================== */
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 4px; }

.gamepad-wrap { display: flex; justify-content: center; padding: 18px 0 6px; }
.gamepad {
    position: relative; width: 100%; max-width: 260px; aspect-ratio: 1 / 2.05;
    filter: drop-shadow(0 14px 28px rgba(0,0,0,.22));
}
.gp-case {
    position: absolute; inset: 0;
    background: linear-gradient(180deg, #2a303c 0%, #111827 60%, #0b0f19 100%);
    border-radius: 44px;
    box-shadow: inset 0 0 0 2px #475569, inset 0 2px 4px rgba(255,255,255,.08);
}
.gp-case::before {
    content: ''; position: absolute; top: 18px; left: 50%; transform: translateX(-50%);
    width: 56px; height: 5px; background: #1f2937; border-radius: 3px;
    box-shadow: inset 0 1px 2px rgba(0,0,0,.5);
}
.gp-mode {
    position: absolute; top: 5.5%; left: 8%;
    font-size: 10px; font-weight: 700; color: #94a3b8; letter-spacing: .5px;
    background: rgba(0,0,0,.35); padding: 3px 7px; border-radius: 10px;
    border: 1px solid #334155;
}
.gp-mode::before {
    content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%;
    background: #ef4444; margin-right: 4px; vertical-align: middle;
}

/* 通用按键 */
.gp-btn {
    position: absolute; transform: translate(-50%, -50%);
    width: 15%; height: 7.3%; border-radius: 50%;
    background: #e2e8f0; color: #1f2937; cursor: pointer;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    box-shadow: 0 4px 0 #94a3b8, inset 0 1px 2px #fff;
    transition: transform .1s, box-shadow .1s, background .1s; user-select: none; border: 1px solid #cbd5e1;
}
.gp-btn:hover { transform: translate(-50%, -50%) scale(1.08); }
.gp-btn .gp-tag { font-size: 13px; font-weight: 800; line-height: 1; }
.gp-btn .gp-idx { font-size: 9px; color: #64748b; line-height: 1; margin-top: 1px; }
.gp-btn .gp-act {
    position: absolute; bottom: -18px; left: 50%; transform: translateX(-50%);
    font-size: 9px; line-height: 1; color: #94a3b8; text-align: center; white-space: nowrap;
    padding: 1px 5px; background: rgba(15,23,42,.85); border-radius: 6px;
}
.gp-btn .gp-act.bound { color: #fbbf24; font-weight: 700; }
.gp-btn.hit { background: #4ade80; color: #052e16; box-shadow: 0 0 0 5px rgba(74,222,128,.35), 0 4px 0 #16a34a; transform: translate(-50%, -50%) scale(1.12); }
.gp-btn.hit .gp-act { color: #14532d; background: rgba(255,255,255,.85); }

/* OK 键（蓝色，大一点，在右上方） */
.gp-btn.ok {
    width: 17%; height: 8.3%; background: #3b82f6; color: #fff;
    box-shadow: 0 4px 0 #1d4ed8, inset 0 1px 2px rgba(255,255,255,.3);
    border-color: #2563eb;
}
.gp-btn.ok .gp-idx { color: rgba(255,255,255,.8); }
.gp-btn.ok .gp-tag { font-size: 11px; }
.gp-btn.ok.hit { background: #60a5fa; box-shadow: 0 0 0 5px rgba(96,165,250,.4), 0 4px 0 #1e40af; }

/* 摇杆 */
.gp-stick {
    position: absolute; left: 50%; top: 33%; transform: translate(-50%, -50%);
    width: 36%; height: 17.5%; border-radius: 50%; cursor: pointer;
    background: linear-gradient(180deg, #374151, #111827);
    box-shadow: inset 0 0 0 2px #4b5563, 0 4px 10px rgba(0,0,0,.35);
    display: flex; align-items: center; justify-content: center;
}
.gp-stick-ring {
    position: absolute; inset: 10%;
    border: 2px dashed #4b5563; border-radius: 50%;
}
.gp-stick-knob {
    position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
    width: 52%; height: 52%; border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #6b7280, #1f2937 60%);
    box-shadow: 0 3px 8px rgba(0,0,0,.45), inset 0 1px 2px rgba(255,255,255,.15);
    transition: transform .05s linear;
    z-index: 2;
}
.gp-stick-label {
    position: absolute; bottom: -22px; left: 50%; transform: translateX(-50%);
    font-size: 10px; color: #94a3b8; white-space: nowrap;
    padding: 2px 7px; background: rgba(15,23,42,.85); border-radius: 6px;
}
.gp-stick.hit { box-shadow: inset 0 0 0 2px #4ade80, 0 0 0 6px rgba(74,222,128,.35); }
.gp-stick.hit .gp-stick-knob { background: radial-gradient(circle at 35% 35%, #86efac, #15803d 60%); }
.gp-stick.hit .gp-stick-label { color: #fbbf24; }

.press-tip {
    margin-top: 22px; text-align: center; font-family: ui-monospace, monospace; font-size: 14px;
    color: var(--muted); background: #f8fafc; border: 1px solid var(--border); border-radius: 10px; padding: 12px;
}
.learn-tip {
    margin-top: 10px; text-align: center; font-size: 14px;
    color: #92400e; background: #fffbeb; border: 1px solid #fcd34d; border-radius: 10px; padding: 12px;
    animation: pulse 1.2s ease-in-out infinite;
}
.learn-tip.hidden { display: none; }
@keyframes pulse { 0%,100%{box-shadow:0 0 0 0 rgba(251,191,36,.35);} 50%{box-shadow:0 0 0 6px rgba(251,191,36,0);} }

/* 动作选择浮层 */
.picker { position: fixed; z-index: 999; width: 240px; background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 12px; box-shadow: 0 16px 40px rgba(0,0,0,.18); }
.picker.hidden { display: none; }
.picker-title { font-size: 13px; margin-bottom: 10px; color: var(--text); }
.picker-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.picker-action { font-size: 12px; padding: 8px 6px; border: 1px solid var(--border); background: #fff; border-radius: 8px; cursor: pointer; }
.picker-action:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.picker-clear { margin-top: 10px; width: 100%; font-size: 12px; padding: 8px; border: 1px solid #fecaca; background: #fef2f2; color: #b91c1c; border-radius: 8px; cursor: pointer; }
.picker-clear:hover { background: #fee2e2; }

/* 播放页本机遥控校准面板 */
.calib-panel {
    position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%);
    z-index: 1200; width: min(680px, 94vw); max-height: 72vh; overflow: auto;
    background: #fff; border: 1px solid var(--border); border-radius: 14px;
    padding: 16px 18px; box-shadow: 0 18px 50px rgba(0,0,0,.28);
}
.calib-panel.hidden { display: none; }
.calib-panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.calib-panel .hint { font-size: 12.5px; line-height: 1.6; color: var(--muted); margin: 0 0 12px; }
.calib-panel .calibrate-table th, .calib-panel .calibrate-table td { padding: 8px 10px; font-size: 13px; }
.calib-panel .calibrate-table .calib-cur { font-family: ui-monospace, monospace; color: var(--primary); font-weight: 600; }
.calib-panel .calib-learn { white-space: nowrap; }
.calib-panel .save-msg { margin-top: 6px; }

/* 响应式 */
@media (max-width: 900px) {
    .hero { grid-template-columns: 1fr; padding: 32px 24px; }
    .hero-screen { display: none; }
    .stat-row { grid-template-columns: repeat(2, 1fr); }
    .layout { grid-template-columns: 1fr; }
    .script-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
    .topnav-links a { padding: 8px 10px; font-size: 13px; }
    .hero-text h1 { font-size: 30px; }
    .pad-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ===================== 播放页 · 手机版全新设计 ===================== */
/* 仅移动端显示的按钮，桌面隐藏 */
.mobile-only { display: none; }
/* 高级设置容器：桌面端始终展开 */
.adv-controls { display: contents; }

body.is-mobile .mobile-only { display: inline-flex; }

body.is-mobile .player-app { touch-action: manipulation; }

/* 顶栏：紧凑单行，弱化次要信息 */
body.is-mobile .topbar {
    padding: 8px 12px; gap: 8px; font-size: 12.5px;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
body.is-mobile .topbar::-webkit-scrollbar { display: none; }
body.is-mobile .topbar #title {
    max-width: 32vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    font-weight: 600;
}
body.is-mobile .topbar .gp-status { font-size: 11px; padding: 3px 8px; white-space: nowrap; }
body.is-mobile .topbar .btn { padding: 5px 10px; font-size: 12px; white-space: nowrap; }

/* 正文留白收窄，起始位置上移，适配小屏 */
body.is-mobile .prompter-text { padding: 22vh 5vw 110vh; }

/* 底部控制条：主操作大按钮一行 + 设置抽屉 */
body.is-mobile .controls {
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    gap: 10px; flex-direction: column; align-items: stretch;
}
body.is-mobile .control-group.main-actions {
    display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr 1fr; gap: 8px;
}
body.is-mobile .control-group.main-actions .btn {
    padding: 12px 4px; font-size: 14px; font-weight: 600; border-radius: 12px;
    justify-content: center; text-align: center;
}
body.is-mobile #btn-play { font-size: 16px; }
body.is-mobile #btn-settings.active { background: var(--primary); color: #fff; }

/* 高级设置：手机上默认收起，点「设置」展开为抽屉 */
body.is-mobile .adv-controls {
    display: none; flex-direction: column; gap: 12px;
    max-height: 46vh; overflow-y: auto; -webkit-overflow-scrolling: touch;
    padding-top: 10px; border-top: 1px solid rgba(255,255,255,0.1);
}
body.is-mobile .adv-controls.open { display: flex; }
body.is-mobile .adv-controls .control-group { justify-content: space-between; }
body.is-mobile .adv-controls input[type="range"] { width: 52vw; height: 28px; }
body.is-mobile .adv-controls .control-group.compact { flex-wrap: wrap; gap: 10px; justify-content: flex-start; }
body.is-mobile .adv-controls .control-group.help { display: none; }

/* 横屏播放态：进一步压缩上下栏高度，给文字让位 */
@media (orientation: landscape) {
    body.is-mobile .topbar { padding: 5px 12px; }
    body.is-mobile .prompter-text { padding: 18vh 6vw 110vh; }
    body.is-mobile .controls { padding: 6px 12px calc(6px + env(safe-area-inset-bottom)); }
    body.is-mobile .control-group.main-actions .btn { padding: 8px 4px; }
    body.is-mobile .adv-controls { max-height: 60vh; }
}

/* 校准面板在手机上占满宽度 */
body.is-mobile .calib-panel {
    width: calc(100vw - 16px); bottom: 8px; max-height: 78vh;
    padding: 12px;
}
body.is-mobile .calib-panel .calibrate-table th,
body.is-mobile .calib-panel .calibrate-table td { padding: 6px 6px; font-size: 12px; }

/* 手机上的遥控诊断行移到底部居中，避免遮挡文字 */
body.is-mobile .remote-debug {
    top: auto; bottom: 30vh; right: 50%; transform: translateX(50%);
    font-size: 11px; white-space: nowrap; max-width: 94vw; overflow: hidden; text-overflow: ellipsis;
}

/* ===================== 遥控方案库 ===================== */
.profile-toolbar {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    margin: 18px 0 14px;
}
.dev-now { margin-left: auto; font-size: 13px; color: var(--muted); }
.dev-now code {
    background: #eef2ff; color: #4338ca; padding: 2px 7px;
    border-radius: 5px; font-size: 12px;
}

.profile-list {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px; margin-top: 8px;
}
.profile-card {
    background: var(--card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 16px 18px;
    box-shadow: var(--shadow); position: relative;
    transition: border-color .15s, transform .15s;
}
.profile-card:hover { border-color: #c7d2fe; transform: translateY(-2px); }
.profile-card.is-default { border-color: var(--primary); }
.pc-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.pc-name { font-size: 16px; font-weight: 700; letter-spacing: -0.2px; }
.pc-badge {
    background: var(--primary); color: #fff; font-size: 11px; font-weight: 700;
    padding: 2px 8px; border-radius: 999px;
}
.pc-note { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.pc-fps { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.pc-meta { font-size: 12px; color: var(--muted); margin-bottom: 12px; }
.pc-meta b { color: var(--text); }
.pc-ops { display: flex; flex-wrap: wrap; gap: 6px; }

.fp-chip {
    display: inline-flex; align-items: center; gap: 4px;
    background: #eef2ff; color: #4338ca; border: 1px solid #e0e7ff;
    font-size: 12px; padding: 3px 9px; border-radius: 999px;
}
.fp-chip.removable .fp-x {
    cursor: pointer; color: #94a3b8; font-weight: 700; padding-left: 2px;
}
.fp-chip.removable .fp-x:hover { color: var(--danger); }
.fp-none { font-size: 12px; color: #94a3b8; }
.fp-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 28px; }

/* 方案编辑面板 */
.edit-box { max-width: 720px; }
.edit-body { padding: 4px 2px; max-height: 62vh; overflow-y: auto; }
.edit-row {
    display: grid; grid-template-columns: 110px 1fr;
    gap: 12px; align-items: center; margin-bottom: 12px;
}
.edit-row > label { font-size: 13px; font-weight: 600; color: #374151; }
.lbl-sub { display: block; font-size: 11px; font-weight: 400; color: #9ca3af; }
.input {
    width: 100%; padding: 9px 12px; border: 1px solid var(--border);
    border-radius: 8px; font-size: 14px; font-family: inherit; background: #fff;
}
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.edit-sep {
    display: flex; align-items: center; justify-content: space-between;
    margin: 18px 0 10px; padding-top: 14px; border-top: 1px dashed var(--border);
}
.edit-sep > span { font-size: 14px; font-weight: 700; }
.gp-detail.ok { color: var(--success); }

/* 播放页方案选择条 */
.calib-pick {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px solid rgba(255,255,255,.12);
}
.calib-pick label { font-size: 13px; font-weight: 600; opacity: .85; }
.calib-pick select {
    flex: 1; min-width: 140px; padding: 6px 10px; border-radius: 7px;
    border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.1);
    color: inherit; font-size: 13px; font-family: inherit;
}
.calib-pick select option { color: #1f2937; }

/* ===================== 配置向导 ===================== */
.tpw-mask {
    position: fixed; inset: 0; z-index: 9999;
    background: rgba(15,23,42,.6);
    display: flex; align-items: center; justify-content: center; padding: 20px;
}
.tpw-mask.hidden { display: none; }
.tpw-box {
    background: var(--card); color: var(--text);
    border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,.3);
    width: 100%; max-width: 460px; padding: 20px 22px;
    animation: tpwIn .18s ease-out;
}
@keyframes tpwIn { from { opacity: 0; transform: translateY(12px) scale(.98); } }
.tpw-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--border);
}
.tpw-head strong { font-size: 16px; }
.tpw-dots { display: flex; gap: 6px; justify-content: center; margin-bottom: 16px; }
.tpw-dot {
    width: 8px; height: 8px; border-radius: 50%; background: var(--border);
    transition: all .2s;
}
.tpw-dot.done { background: var(--success); }
.tpw-dot.cur { background: var(--primary); transform: scale(1.5); }
.tpw-stage {
    text-align: center; padding: 22px 10px 18px;
    background: #f8fafc; border-radius: 12px; margin-bottom: 14px;
    min-height: 176px;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.tpw-step { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.tpw-ask { font-size: 14px; color: #475569; }
.tpw-act {
    font-size: 24px; font-weight: 800; color: var(--primary);
    letter-spacing: -0.5px; margin: 6px 0;
}
.tpw-hint { font-size: 12px; color: #94a3b8; margin-top: 6px; }
.tpw-cur { font-size: 13px; color: var(--muted); margin-top: 12px; }
.tpw-ok { font-size: 26px; font-weight: 800; color: var(--success); margin-bottom: 4px; }
.tpw-warn { font-size: 12px; color: #b45309; margin-top: 8px; }
.tpw-wave {
    width: 44px; height: 44px; margin-top: 14px; border-radius: 50%;
    border: 3px solid var(--primary); opacity: .35;
    animation: tpwPulse 1.4s ease-out infinite;
}
@keyframes tpwPulse {
    0%   { transform: scale(.7);  opacity: .6; }
    100% { transform: scale(1.25); opacity: 0; }
}
.tpw-list {
    max-height: 130px; overflow-y: auto; margin-bottom: 14px;
    border: 1px solid var(--border); border-radius: 10px; padding: 6px 10px;
}
.tpw-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 5px 0; font-size: 13px; border-bottom: 1px dashed #f1f5f9;
}
.tpw-row:last-child { border-bottom: none; }
.tpw-row-act { color: #475569; }
.tpw-row-key { font-weight: 700; color: var(--primary); }
.tpw-empty { font-size: 12px; color: #94a3b8; text-align: center; padding: 12px 0; }
.tpw-foot { display: flex; gap: 8px; justify-content: flex-end; }
.tpw-foot .btn:first-child { margin-right: auto; }

@media (max-width: 560px) {
    .profile-list { grid-template-columns: 1fr; }
    .dev-now { margin-left: 0; width: 100%; }
    .edit-row { grid-template-columns: 1fr; gap: 4px; }
    .tpw-box { max-width: 100%; padding: 16px; }
    .tpw-stage { min-height: 150px; padding: 16px 8px; }
    .tpw-act { font-size: 20px; }
}

