/* 考研英语二阅读刷题 - 手机端样式（iPhone 16 Pro优化） */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --primary: #1a73e8;
    --primary-dark: #1557b0;
    --bg: #f5f6fa;
    --card: #ffffff;
    --text: #1a1a1a;
    --text-secondary: #666;
    --border: #e5e7eb;
    --success: #34a853;
    --error: #ea4335;
    --radius: 14px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Helvetica Neue", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    font-size: 16px;
}

.app-container {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    background: var(--bg);
    display: flex;
    flex-direction: column;
}

/* 顶部栏 */
.app-header {
    background: var(--primary);
    color: white;
    padding: 48px 20px 16px;
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.app-header h1 {
    font-size: 20px;
    font-weight: 600;
    flex: 1;
    text-align: center;
}

.back-btn {
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    padding: 0 10px;
    cursor: pointer;
}

/* 内容区 */
.app-content {
    flex: 1;
    padding: 16px;
    padding-bottom: 80px;
}

/* 底部导航 */
.app-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    background: white;
    border-top: 1px solid var(--border);
    display: flex;
    padding: 8px 0;
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
}

.nav-item {
    flex: 1;
    text-align: center;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 13px;
    padding: 8px;
}

.nav-item:active {
    opacity: 0.6;
}

/* 首页 */
.progress-card {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.progress-label {
    font-size: 14px;
    opacity: 0.9;
}

.progress-value {
    font-size: 28px;
    font-weight: 700;
}

.btn-primary {
    display: block;
    width: 100%;
    background: white;
    color: var(--primary);
    border: none;
    border-radius: 10px;
    padding: 14px;
    font-size: 17px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
}

.btn-secondary {
    display: block;
    width: 100%;
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px;
    font-size: 16px;
    margin-top: 10px;
    cursor: pointer;
}

.section-title {
    font-size: 18px;
    margin: 24px 0 12px;
    font-weight: 600;
}

.article-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.article-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 16px;
    text-decoration: none;
    color: var(--text);
    position: relative;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.article-title {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 4px;
}

.article-meta {
    font-size: 13px;
    color: var(--text-secondary);
}

.badge-done {
    position: absolute;
    top: 16px;
    right: 16px;
    color: var(--success);
    font-size: 13px;
    font-weight: 600;
}

.no-article {
    color: var(--text-secondary);
    text-align: center;
    padding: 20px;
}

/* 答题页 */
.article-section {
    background: var(--card);
    border-radius: var(--radius);
    margin-bottom: 16px;
    overflow: hidden;
}

.section-header {
    padding: 14px 16px;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    cursor: pointer;
    background: #fafafa;
}

.article-content {
    padding: 16px;
    display: block;
}

.article-en {
    font-size: 16px;
    line-height: 1.8;
    color: var(--text);
}

.translation {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px dashed var(--border);
}

.translation summary {
    cursor: pointer;
    color: var(--primary);
    font-weight: 600;
    font-size: 15px;
    padding: 8px 0;
}

.article-cn {
    font-size: 15px;
    line-height: 1.8;
    color: var(--text-secondary);
}

.article-en p, .article-cn p {
    margin: 0 0 0.9em 0;
    text-indent: 1.6em;
}

.article-en .pnum, .article-cn .pnum {
    font-weight: 700;
    color: var(--primary);
    margin-right: 0.3em;
}

/* 题目卡片 */
.question-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.question-header {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
}

.q-num {
    font-weight: 700;
    color: var(--primary);
    font-size: 17px;
    flex-shrink: 0;
}

.q-text {
    flex: 1;
}

.q-en {
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 4px;
}

.q-cn {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.option-btn {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: var(--bg);
    border: 2px solid transparent;
    border-radius: 10px;
    padding: 14px;
    cursor: pointer;
    text-align: left;
    font-size: 16px;
    transition: all 0.2s;
}

.option-btn:active {
    transform: scale(0.98);
}

.opt-label {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 15px;
}

.opt-text {
    flex: 1;
    line-height: 1.5;
}

.option-btn.selected {
    border-color: var(--primary);
    background: #e8f0fe;
}

.option-btn.correct {
    border-color: var(--success);
    background: #e6f4ea;
}

.option-btn.correct .opt-label {
    background: var(--success);
}

.option-btn.wrong {
    border-color: var(--error);
    background: #fce8e6;
}

.option-btn.wrong .opt-label {
    background: var(--error);
}

.btn-submit {
    display: block;
    width: 100%;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    padding: 16px;
    font-size: 18px;
    font-weight: 600;
    margin-top: 8px;
    cursor: pointer;
    position: sticky;
    bottom: 70px;
}

.btn-submit:active {
    background: var(--primary-dark);
}

/* 结果弹窗 */
.result-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 1000;
}

.result-content {
    background: white;
    border-radius: 20px 20px 0 0;
    width: 100%;
    max-width: 480px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 24px;
    padding-bottom: calc(24px + env(safe-area-inset-bottom));
}

.result-score {
    text-align: center;
    font-size: 28px;
    font-weight: 700;
    color: var(--error);
    margin-bottom: 20px;
}

.result-score.perfect {
    color: var(--success);
}

.result-item {
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 10px;
    background: var(--bg);
}

.result-item.correct {
    border-left: 4px solid var(--success);
}

.result-item.wrong {
    border-left: 4px solid var(--error);
}

.result-q {
    font-size: 15px;
    margin-bottom: 6px;
    line-height: 1.5;
}

.result-ans {
    font-size: 14px;
    color: var(--text-secondary);
}

/* 历史记录 */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.history-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.history-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.history-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-time {
    font-size: 13px;
    color: var(--text-secondary);
}

.history-score {
    font-weight: 700;
    color: var(--primary);
}

.history-score.perfect {
    color: var(--success);
}

.empty-tip {
    text-align: center;
    color: var(--text-secondary);
    padding: 40px 20px;
}
