/* ===== 在线提词器（独立全屏页，无顶部菜单） ===== */
:root {
    --green: #07c160;
    --green-dark: #06ad56;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
    color: #1a1a1a;
    background: #0d0f12;
    overflow: hidden;
}

/* ===== 舞台：占满整个视口 ===== */
.tp {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    display: flex; flex-direction: column;
}

.stage {
    position: relative; flex: 1; overflow: hidden;
    background: #000; color: #fff;
    cursor: text;
    transition: background .25s, color .25s;
}
.stage.light { background: #fff; color: #111; }

/* 上下渐变遮罩 */
.stage::before, .stage::after {
    content: ""; position: absolute; left: 0; right: 0; height: 90px; z-index: 3; pointer-events: none;
}
.stage::before { top: 0; background: linear-gradient(to bottom, rgba(0,0,0,.55), transparent); }
.stage::after { bottom: 0; background: linear-gradient(to top, rgba(0,0,0,.55), transparent); }
.stage.light::before { background: linear-gradient(to bottom, rgba(255,255,255,.7), transparent); }
.stage.light::after { background: linear-gradient(to top, rgba(255,255,255,.7), transparent); }

/* 镜像 / 倒置 */
.canvas-wrap { position: absolute; inset: 0; overflow: hidden; transition: transform .3s; }
.canvas-wrap.mirror { transform: scaleX(-1); }
.canvas-wrap.flip { transform: scaleY(-1); }
.canvas-wrap.mirror.flip { transform: scale(-1, -1); }

.canvas {
    position: absolute; top: 0; left: 0; right: 0;
    padding: 50vh 8vw;
    will-change: transform;
}

.text {
    font-size: 44px; line-height: 1.75; font-weight: 600;
    letter-spacing: .5px; white-space: pre-wrap; word-break: break-word;
    outline: none; min-height: 60vh;
    text-shadow: 0 2px 14px rgba(0, 0, 0, .35);
}
.stage.light .text { text-shadow: none; }
.text:empty::before { content: "在此粘贴或输入提词内容…"; color: rgba(255, 255, 255, .35); }
.stage.light .text:empty::before { color: rgba(0, 0, 0, .3); }

/* 中心指示线 */
.guide {
    position: absolute; left: 0; right: 0; top: 50%; height: 0; z-index: 4;
    border-top: 1px dashed rgba(7, 193, 96, .45); pointer-events: none; opacity: 0;
    transition: opacity .2s;
}
.stage.show-guide .guide { opacity: 1; }

/* 进度条 */
.progress { position: absolute; top: 0; left: 0; right: 0; height: 3px; z-index: 6; background: rgba(255,255,255,.12); }
.progress i { display: block; height: 100%; width: 0; background: var(--green); transition: width .1s linear; }

/* 状态角标 */
.state-badge {
    position: absolute; top: 16px; right: 18px; z-index: 6;
    padding: 5px 14px; border-radius: 999px; font-size: 12.5px; font-weight: 700;
    background: rgba(0, 0, 0, .45); color: #fff;
    border: 1px solid rgba(255, 255, 255, .18);
}
.state-badge.on { background: var(--green); border-color: transparent; }

/* ===== 控制栏 ===== */
.bar {
    flex-shrink: 0; background: #16191d; border-top: 1px solid #262b31;
    padding: 12px 20px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}

.back-btn {
    height: 34px; padding: 0 16px; border-radius: 8px; border: 1px solid #2c3138;
    color: #9aa4ae; font-size: 13.5px; font-weight: 600;
    display: inline-flex; align-items: center; transition: .15s;
}
.back-btn:hover { border-color: var(--green); color: var(--green); }

.ctrl-group {
    display: flex; align-items: center; gap: 4px;
    background: #1f2329; border: 1px solid #2c3138; border-radius: 10px; padding: 4px;
}
.ctrl-group .cg-label { font-size: 12.5px; color: #8b939c; padding: 0 8px 0 6px; white-space: nowrap; user-select: none; }

.btn-i {
    min-width: 34px; height: 30px; padding: 0 9px; border: none; border-radius: 7px;
    background: transparent; color: #d5dadf; font-size: 14px; font-weight: 700;
    cursor: pointer; transition: .15s; display: inline-flex; align-items: center; justify-content: center;
}
.btn-i:hover { background: #2c3138; color: #fff; }
.btn-i.on { background: var(--green); color: #fff; }

.val {
    min-width: 62px; text-align: center; font-size: 13px; font-weight: 700;
    color: #fff; font-variant-numeric: tabular-nums; user-select: none;
}
.val.small { min-width: 52px; font-size: 12.5px; color: #8b939c; font-weight: 600; }

input[type=range] {
    -webkit-appearance: none; appearance: none; width: 92px; height: 4px;
    background: #39404a; border-radius: 4px; outline: none; cursor: pointer;
}
input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%;
    background: var(--green); cursor: pointer; border: 2px solid #16191d;
}
input[type=range]::-moz-range-thumb {
    width: 14px; height: 14px; border-radius: 50%; background: var(--green);
    cursor: pointer; border: 2px solid #16191d;
}

.play-btn {
    height: 38px; padding: 0 22px; border-radius: 999px; border: none;
    background: var(--green); color: #fff; font-size: 14.5px; font-weight: 700;
    cursor: pointer; display: inline-flex; align-items: center; gap: 7px; transition: .18s;
}
.play-btn:hover { background: var(--green-dark); transform: translateY(-1px); }
.play-btn.playing { background: #e8453c; }
.play-btn.playing:hover { background: #d13b33; }

.spacer { flex: 1; }

.tip-btn {
    height: 34px; padding: 0 14px; border-radius: 8px; border: 1px solid #2c3138;
    background: transparent; color: #9aa4ae; font-size: 13px; cursor: pointer; transition: .15s;
}
.tip-btn:hover { border-color: var(--green); color: var(--green); }

/* 复位按钮：有滚动进度时高亮为绿色 */
.tip-btn.has-progress {
    background: var(--green); border-color: transparent; color: #fff;
}
.tip-btn.has-progress:hover { background: var(--green-dark); color: #fff; }

/* ===== 快捷键说明弹窗 ===== */
.mask {
    position: fixed; inset: 0; z-index: 200; background: rgba(0, 0, 0, .6);
    backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
    opacity: 0; visibility: hidden; transition: .25s;
}
.mask.show { opacity: 1; visibility: visible; }

.shortcuts {
    position: fixed; z-index: 201; left: 50%; top: 50%;
    transform: translate(-50%, -50%) scale(.94);
    width: min(400px, calc(100vw - 32px));
    background: #191d22; border: 1px solid #2c3138; border-radius: 16px;
    padding: 22px 24px 20px; color: #d5dadf;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .6);
    opacity: 0; visibility: hidden; transition: .25s;
}
.shortcuts.show { opacity: 1; visibility: visible; transform: translate(-50%, -50%) scale(1); }

.shortcuts h4 {
    font-size: 16px; color: #fff; margin-bottom: 14px;
    display: flex; justify-content: space-between; align-items: center;
}
.shortcuts h4 button {
    background: none; border: none; color: #7d868f; cursor: pointer; font-size: 20px; line-height: 1;
}
.shortcuts h4 button:hover { color: #fff; }

.shortcuts ul { list-style: none; }
.shortcuts li {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 13.5px; padding: 7px 0; border-bottom: 1px dashed #262b31;
}
.shortcuts li:last-child { border-bottom: none; }
.shortcuts kbd {
    background: #2c3138; border: 1px solid #39404a; border-bottom-width: 2px;
    border-radius: 5px; padding: 2px 8px; font-size: 11.5px; font-family: inherit;
    color: #fff; font-weight: 600;
}
.shortcuts .hint { font-size: 12.5px; color: #7d868f; margin-top: 14px; line-height: 1.7; }

.no-more {
    display: flex; align-items: center; gap: 7px; margin-top: 14px;
    font-size: 12.5px; color: #8b939c; cursor: pointer; user-select: none;
}
.no-more input { accent-color: var(--green); cursor: pointer; width: 14px; height: 14px; }

.ok-btn {
    width: 100%; margin-top: 16px; height: 42px; border: none; border-radius: 10px;
    background: var(--green); color: #fff; font-size: 15px; font-weight: 700; cursor: pointer; transition: .18s;
}
.ok-btn:hover { background: var(--green-dark); }

@media (max-width: 860px) {
    .bar { padding: 10px 12px; gap: 8px; }
    input[type=range] { width: 66px; }
    .cg-label { display: none; }
}
@media (max-width: 560px) {
    .val.small { display: none; }
    .tip-btn { padding: 0 10px; }
    .back-btn { padding: 0 12px; }
}
