:root {
    --primary: #00f2fe;
    --secondary: #4facfe;
    --accent: #f093fb;
    --bg: #0b111e;
    --panel-bg: rgba(25, 30, 45, 0.7);
    --text: #ffffff;
    --text-dim: #b8c1ec;
    --correct: #00e676;
    --wrong: #ff5252;
    --transition: 0.3s ease;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Roboto', sans-serif;
    color: var(--text);
    background-color: var(--bg);
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

h1, h2, h3, .subtitle {
    font-family: 'Orbitron', sans-serif;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Background Effects */
.background-effects {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.circle {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: move 20s infinite alternate;
}

.circle-1 {
    width: 400px;
    height: 400px;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    top: -100px;
    right: -100px;
}

.circle-2 {
    width: 500px;
    height: 500px;
    background: linear-gradient(to right, var(--accent), #f5576c);
    bottom: -150px;
    left: -150px;
}

@keyframes move {
    from { transform: translate(0, 0); }
    to { transform: translate(100px, 50px); }
}

/* Layout */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px;
    flex-grow: 1;
}

header {
    text-align: center;
    margin-bottom: 40px;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 5px;
}

h1 span {
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: var(--text-dim);
    font-size: 0.9rem;
}

/* Glass Panel */
.glass-panel {
    background: var(--panel-bg);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    margin-bottom: 30px;
}

/* Setup Screen */
.control-group {
    margin: 20px 0;
}

.range-inputs {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 10px;
}

.quick-ranges {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

.quick-btn {
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.08);
    color: white;
    padding: 7px 12px;
    border-radius: 999px;
    cursor: pointer;
}

.quick-btn:hover {
    border-color: var(--secondary);
    background: rgba(79, 172, 254, 0.18);
}

input[type="number"] {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 10px;
    border-radius: 8px;
    width: 80px;
    font-size: 1rem;
    outline: none;
}

.toggle-group {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Switch Styles */
.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.switch input { opacity: 0; width: 0; height: 0; }

.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #333;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px; width: 26px;
    left: 4px; bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider { background-color: var(--secondary); }
input:checked + .slider:before { transform: translateX(26px); }

/* Buttons */
.primary-btn, .secondary-btn {
    width: 100%;
    padding: 15px;
    border-radius: 12px;
    font-family: 'Orbitron', sans-serif;
    font-weight: bold;
    font-size: 1.1rem;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    margin-top: 20px;
    outline: none;
}

.primary-btn {
    background: linear-gradient(90deg, var(--secondary), var(--primary));
    color: white;
    box-shadow: 0 5px 15px rgba(79, 172, 254, 0.4);
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(79, 172, 254, 0.6);
}

.secondary-btn {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Quiz Screen */
.quiz-header {
    margin-bottom: 20px;
}

.timer-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    position: relative;
}

.timer-container {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    border: 1px solid rgba(79, 172, 254, 0.3);
    box-shadow: 0 0 10px rgba(79, 172, 254, 0.1);
}

.timer-container span {
    font-family: 'Orbitron', sans-serif;
    color: var(--secondary);
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: 1px;
    text-shadow: 0 0 8px rgba(79, 172, 254, 0.3);
}

.timer-container.urgent {
    border-color: #ff4757;
    animation: urgent-pulse 1s infinite alternate;
}

.timer-container.urgent span {
    color: #ff4757;
    text-shadow: 0 0 12px rgba(255, 71, 87, 0.5);
}

@keyframes urgent-pulse {
    from { opacity: 1; transform: scale(1); }
    to { opacity: 0.8; transform: scale(1.05); }
}

.progress-container {
    flex-grow: 1;
    margin-right: 20px;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    margin-bottom: 10px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transition: width 0.5s ease;
}

.quiz-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: var(--text-dim);
}

.question-tags {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.q-tag {
    font-size: 0.72rem;
    padding: 4px 8px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #eaf2ff;
    background: rgba(255, 255, 255, 0.08);
    letter-spacing: 0.4px;
}

.q-tag.multi { background: rgba(103, 58, 183, 0.25); border-color: rgba(179, 136, 255, 0.6); }
.q-tag.three { background: rgba(255, 152, 0, 0.22); border-color: rgba(255, 183, 77, 0.65); }
.q-tag.longe { background: rgba(0, 150, 136, 0.25); border-color: rgba(77, 208, 225, 0.65); }
.q-tag.special { background: rgba(244, 67, 54, 0.22); border-color: rgba(255, 138, 128, 0.65); }

.question-text {
    margin-bottom: 30px;
}

.en-text {
    font-size: 1.25rem;
    line-height: 1.6;
    font-weight: 500;
}

.options-grid {
    display: grid;
    gap: 15px;
}

.option {
    padding: 18px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.option:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary);
}

.option.selected {
    background: rgba(79, 172, 254, 0.2);
    border-color: var(--secondary);
}

.option.correct {
    background: rgba(0, 230, 118, 0.15);
    border-color: var(--correct);
}

.option.wrong {
    background: rgba(255, 82, 82, 0.15);
    border-color: var(--wrong);
}

.option-en { font-weight: 500; }

.feedback-panel {
    margin-top: 20px;
    padding: 16px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.05);
}

.feedback-panel h3 {
    margin-bottom: 10px;
    font-size: 1rem;
    letter-spacing: 0.8px;
}

.feedback-zh {
    margin-bottom: 10px;
    color: #d0f0ff;
    line-height: 1.6;
    white-space: pre-wrap;
}

.feedback-expl {
    color: #ffe5b4;
    line-height: 1.6;
    white-space: pre-wrap;
}



/* Result */
.score-circle {
    width: 150px;
    height: 150px;
    border: 8px solid var(--secondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 30px auto;
    box-shadow: 0 0 30px rgba(79, 172, 254, 0.3);
}

.score-value {
    font-size: 2.5rem;
    font-family: 'Orbitron', sans-serif;
    font-weight: bold;
}

.result-details {
    text-align: center;
    margin-bottom: 30px;
    font-size: 1.2rem;
}

footer {
    text-align: center;
    padding: 20px;
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.8rem;
}

.hidden { display: none; }
