/* teleprompter —— 在线提词器业务样式 */

/* ===== 设置卡片：元信息行 ===== */
.tp-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}
.tp-chip {
    font-size: 12px;
    font-weight: 700;
    padding: 3px 12px;
    border-radius: 999px;
    background: var(--c-surface-soft);
    border: 1px solid var(--c-border);
    color: var(--c-text-sub);
    font-variant-numeric: tabular-nums;
}
.tp-save {
    margin-left: auto;
    font-size: 12px;
    color: var(--c-text-muted);
}

/* 滑杆行 */
.tp-range-row {
    display: flex;
    align-items: center;
    gap: 12px;
}
.tp-range-row .ik-range {
    flex: 1 1 auto;
    min-width: 120px;
}
.tp-range-val {
    flex: 0 0 auto;
    min-width: 118px;
    text-align: right;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--c-primary);
    font-variant-numeric: tabular-nums;
}

/* 镜像勾选 */
.tp-check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--c-text);
    cursor: pointer;
    user-select: none;
}
.tp-check input {
    width: 16px;
    height: 16px;
    accent-color: var(--c-primary);
    cursor: pointer;
}

/* 空台词时点开始的抖动提示 */
@keyframes tp-shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}
.tp-shake { animation: tp-shake 0.45s ease; }

/* ===== 右卡：开拍前速览 ===== */
.tp-quick-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}
.tp-quick-head .emoji {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: color-mix(in srgb, var(--c-primary) 12%, transparent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}
.tp-quick-head h3 {
    font-size: 16px;
    font-weight: 800;
    margin: 0;
}
.tp-quick-head p {
    margin: 2px 0 0;
    font-size: 12.5px;
    color: var(--c-text-muted);
}
.tp-keyrow {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 0;
    border-bottom: 1px dashed var(--c-border);
    font-size: 13px;
    color: var(--c-text-sub);
}
.tp-keyrow:last-child { border-bottom: none; }
.tp-keycap {
    flex: 0 0 auto;
    min-width: 76px;
    padding: 3px 8px;
    border-radius: 7px;
    border: 1px solid var(--c-border);
    background: var(--c-surface-soft);
    font-size: 12px;
    font-weight: 700;
    text-align: center;
    color: var(--c-text);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* ===== 全屏提词层（永远黑底白字，不受主题影响） ===== */
.tp-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: #000;
    color: #fff;
    display: flex;
    flex-direction: column;
}
#tpOverlay[hidden] { display: none; }

.tp-bar {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    padding: 10px 18px;
    background: rgba(12, 12, 14, 0.94);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
.tp-bar-group {
    display: flex;
    align-items: center;
    gap: 8px;
}
.tp-bar-sep {
    width: 1px;
    height: 22px;
    background: rgba(255, 255, 255, 0.16);
}
.tp-obtn {
    appearance: none;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    padding: 7px 13px;
    border-radius: 8px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s ease, border-color 0.15s ease;
}
.tp-obtn:hover { background: rgba(255, 255, 255, 0.2); }
.tp-obtn.is-playing { background: #2563eb; border-color: #2563eb; }
.tp-obtn.is-on { background: #0891b2; border-color: #0891b2; }
#tpOExit { border-color: rgba(248, 113, 113, 0.55); color: #fca5a5; }
#tpOExit:hover { background: rgba(248, 113, 113, 0.18); }

.tp-olabel {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.62);
    white-space: nowrap;
}
.tp-orange {
    accent-color: #60a5fa;
    cursor: pointer;
}
#tpOSpeed { width: 110px; }
#tpOFont { width: 110px; }
#tpOProgress { width: 150px; }
.tp-oval {
    font-size: 12px;
    color: #93c5fd;
    min-width: 40px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.tp-opos {
    font-size: 12.5px;
    color: #93c5fd;
    min-width: 52px;
    font-variant-numeric: tabular-nums;
}
.tp-otime {
    font-size: 12.5px;
    color: rgba(255, 255, 255, 0.85);
    min-width: 100px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* 滚动舞台 */
.tp-stage {
    position: relative;
    flex: 1 1 auto;
    overflow-y: auto;
    background: #000;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.28) transparent;
}
.tp-stage::-webkit-scrollbar { width: 8px; }
.tp-stage::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.25);
    border-radius: 4px;
}
/* 水平阅读基准线：第一行正好停在这里 */
.tp-guide {
    position: absolute;
    top: 38vh;
    left: 5%;
    right: 5%;
    border-top: 2px solid rgba(96, 165, 250, 0.35);
    pointer-events: none;
    z-index: 1;
}
.tp-content {
    position: relative;
    z-index: 2;
    max-width: 920px;
    margin: 0 auto;
    padding: 38vh 28px 55vh;
    color: #fff;
    font-size: 48px;
    font-weight: 600;
    line-height: 1.8;
    letter-spacing: 0.02em;
    text-align: center;
    white-space: pre-wrap;
    word-break: break-word;
}
/* 镜像翻转：配合提词玻璃 / 分光镜 */
.tp-overlay.is-mirrored .tp-content {
    transform: scaleX(-1);
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .tp-bar {
        gap: 8px;
        padding: 8px 12px;
    }
    .tp-bar-sep { display: none; }
    .tp-obtn { padding: 6px 10px; font-size: 12px; }
    #tpOSpeed, #tpOFont, #tpOProgress { width: 90px; }
    .tp-otime { min-width: 0; }
    .tp-content { padding-left: 16px; padding-right: 16px; }
    .tp-save { margin-left: 0; width: 100%; }
}
