/* iOS-Style Design System */
:root {
    --system-blue: #007AFF;
    --system-red: #FF3B30;
    --system-green: #34C759;
    --system-gray: #8E8E93;
    --system-bg: rgba(255, 255, 255, 0.7);
    --ios-bg: #F2F2F7;
    --card-bg: rgba(255, 255, 255, 0.85);
    --glass-blur: blur(20px);
    --border-radius-lg: 20px;
    --border-radius-md: 12px;
    --shadow-soft: 0 4px 12px rgba(0, 0, 0, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", "Helvetica", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background-color: var(--ios-bg);
    background-image:
        radial-gradient(at 0% 0%, hsla(253, 16%, 7%, 0.03) 0, transparent 50%),
        radial-gradient(at 50% 0%, hsla(225, 39%, 30%, 0.03) 0, transparent 50%),
        radial-gradient(at 100% 0%, hsla(339, 49%, 30%, 0.02) 0, transparent 50%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #000;
}

.app-container {
    width: 100%;
    max-width: 500px;
    height: 100vh;
    max-height: 900px;
    background: var(--ios-bg);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

@media (min-width: 600px) {
    .app-container {
        height: 90vh;
        margin: auto;
        border-radius: 40px;
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
        border: 8px solid #1c1c1e;
    }
}

@media (max-width: 600px) {
    .app-container {
        width: 100%;
        height: 100vh;
        max-height: none;
        border: none;
        border-radius: 0;
    }

    .header h1 {
        font-size: 24px;
    }
}

/* Header */
.header {
    padding: 24px 20px 10px;
    background: transparent;
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header h1 {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.progress-container {
    margin-top: 15px;
    height: 6px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--system-blue);
    width: 0%;
    transition: width 0.4s cubic-bezier(0.1, 0.7, 0.1, 1);
}

/* Question Area */
.main {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.question-card {
    background: var(--card-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-radius: var(--border-radius-lg);
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-soft);
    animation: slideIn 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.question-type {
    display: inline-block;
    padding: 4px 8px;
    background: rgba(0, 122, 255, 0.1);
    color: var(--system-blue);
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 12px;
}

.question-text {
    font-size: 19px;
    font-weight: 600;
    line-height: 1.4;
    color: #1c1c1e;
    margin-bottom: 20px;
}

/* Options */
.options-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.option-btn {
    background: var(--card-bg);
    border: none;
    border-radius: var(--border-radius-md);
    padding: 16px 20px;
    text-align: left;
    font-size: 17px;
    font-weight: 500;
    color: #1c1c1e;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    box-shadow: var(--shadow-soft);
}

.option-btn:active {
    background: #E5E5EA;
    transform: scale(0.98);
}

.option-btn.selected {
    background: var(--system-blue);
    color: #fff;
}

.option-btn.correct {
    background: var(--system-green);
    color: #fff;
}

.option-btn.wrong {
    background: var(--system-red);
    color: #fff;
}

.option-letter {
    font-weight: 700;
    margin-right: 12px;
    opacity: 0.6;
}

.selected .option-letter,
.correct .option-letter,
.wrong .option-letter {
    opacity: 1;
}

/* Footer & Buttons */
.footer {
    padding: 20px;
    background: transparent;
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    display: flex;
    gap: 15px;
}

.primary-btn {
    background: var(--system-blue);
    color: #fff;
    border: none;
    border-radius: var(--border-radius-md);
    padding: 14px 24px;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    width: auto;
    min-width: 160px;
}

.primary-btn:active {
    opacity: 0.8;
    transform: scale(0.97);
}

.footer .primary-btn {
    flex: 1;
}

.primary-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Start/End Screen */
.screen {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 40px 20px;
    height: 100%;
}

.screen.active {
    display: flex;
}

.icon-large {
    font-size: 80px;
    margin-bottom: 20px;
}

.title-large {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 12px;
}

.desc-large {
    font-size: 17px;
    color: var(--system-gray);
    margin-bottom: 40px;
}