:root {
    --bg: #0b1220;
    --panel: #111a2b;
    --text: #e6eefc;
    --muted: #8aa4c2;
    --primary: #409eff;
    --highlight: #1f3b68;
    --controls-h: 84px;
    --header-h: 56px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: radial-gradient(1200px 800px at 50% -10%, #11233b 0%, #0b1220 60%);
    color: var(--text);
}

.site-header, .site-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: rgba(17, 26, 43, 0.8);
    border-bottom: 1px solid #1d2a46;
}
.site-header { position: fixed; top: 0; left: 0; right: 0; z-index: 40; backdrop-filter: blur(8px); min-height: var(--header-h); box-shadow: 0 6px 18px rgba(0,0,0,0.35); }
.site-footer { border-top: 1px solid #1d2a46; border-bottom: none; }
.site-header h1 { margin: 0; font-size: 18px; }
.header-actions { display: flex; align-items: center; gap: 12px; }
.header-filter { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }

.layout {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 16px;
    padding: 16px;
    padding-top: calc(16px + var(--header-h));
}

.controls {
    background: var(--panel);
    border: 1px solid #1d2a46;
    border-radius: 10px;
    padding: 12px;
}
.btn.ghost { display: none; }
.control-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.control-row label { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.select-input {
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid #2a3c61;
    background: linear-gradient(180deg, rgba(20,32,54,0.9) 0%, rgba(10,18,34,0.95) 100%);
    color: var(--text);
    min-width: 120px;
    height: 34px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04), 0 6px 14px rgba(0,0,0,0.25);
    backdrop-filter: blur(6px);
}

/* 头部两个下拉的最小宽度优化 */
#category-select { min-width: 110px; }
#read-mode-select { min-width: 100px; }

.select-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(64,158,255,0.18);
}
/* 去除数字输入上下箭头 */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"] { -moz-appearance: textfield; }

/* 已移除语速滑条样式 */

.btn {
    background: #1b2a48;
    color: var(--text);
    border: 1px solid #2a3c61;
    padding: 10px 14px;
    border-radius: 8px;
    cursor: pointer;
    min-height: 40px;
}
/* 已移除间隔步进按钮样式 */
.btn.primary { background: var(--primary); border-color: #3077c6; }
.btn:hover { filter: brightness(1.05); }

.word-panel {
    background: var(--panel);
    border: 1px solid #1d2a46;
    border-radius: 10px;
    padding: 12px;
    min-height: 60vh;
    display: flex;
    flex-direction: column;
}
.now-playing { padding: 8px 10px 14px; border-bottom: 1px dashed #2a3c61; margin-bottom: 8px; }
.now-playing {
    position: sticky;
    top: calc(var(--header-h) + 8px);
    z-index: 35;
    background: rgba(17, 26, 43, 0.9);
    backdrop-filter: blur(8px);
    box-shadow: 0 6px 14px rgba(0,0,0,0.25);
    border-radius: 8px;
}
.word { font-size: 28px; font-weight: 700; }
.meaning { font-size: 16px; color: var(--muted); margin-top: 6px; }

.word-list { list-style: decimal inside; margin: 0; padding: 0; overflow: auto; height: 100%; }
.word-item { padding: 8px 10px; border-radius: 8px; display: grid; grid-template-columns: 220px 1fr; gap: 8px; align-items: baseline; }
.word-item .w { font-weight: 600; }
.word-item .m { color: var(--muted); }
.word-item.active { background: var(--highlight); }

@media (max-width: 980px) {
    .layout { grid-template-columns: 1fr; padding: 12px; padding-top: calc(12px + var(--header-h)); padding-bottom: calc(var(--controls-h) + env(safe-area-inset-bottom)); }
    .word-item { grid-template-columns: 1fr; }
    .word { font-size: 34px; }
    .meaning { font-size: 18px; }
    .controls {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 30;
        border-radius: 16px 16px 0 0;
        border-left: none;
        border-right: none;
        border-bottom: none;
        padding: 10px 12px calc(12px + env(safe-area-inset-bottom));
        box-shadow: 0 -8px 20px rgba(0,0,0,0.35);
        backdrop-filter: blur(8px);
        background: linear-gradient(180deg, rgba(17,26,43,0.9) 0%, rgba(17,26,43,0.95) 60%, rgba(17,26,43,1) 100%);
    }
    .controls .control-top { display: none; }
    .controls::before {
        content: "";
        position: absolute;
        left: 0; right: 0; top: -16px; height: 16px;
        background: linear-gradient(180deg, rgba(11,18,32,0) 0%, rgba(11,18,32,0.35) 100%);
        pointer-events: none;
    }
    .control-row { gap: 10px; margin-bottom: 8px; }
    .control-row:last-child { margin-bottom: 0; }
    .btn { flex: 1; min-height: 44px; }
    .control-row label { flex: 1; justify-content: space-between; }
    /* 已移除语速滑条在移动端的样式 */
}

@media (max-width: 520px) {
    .header-actions { gap: 8px; }
    .header-filter { font-size: 13px; }
    #category-select { min-width: 96px; }
    #read-mode-select { min-width: 88px; }
    .select-input { height: 32px; padding: 6px 10px; }
}

.progress { font-size: 14px; color: var(--muted); font-weight: 500; }




