/* 全局重置 */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #f5f6fa;
    color: #333;
    line-height: 1.6;
}
a { text-decoration: none; color: #1890ff; }
a:hover { color: #40a9ff; }

/* 布局 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}
.header {
    background: #fff;
    border-bottom: 1px solid #e8e8e8;
    padding: 15px 0;
    margin-bottom: 20px;
}
.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}
.logo { font-size: 20px; font-weight: bold; color: #333; }
.nav a { margin-left: 20px; color: #555; }
.nav a:hover { color: #1890ff; }

/* 卡片 */
.card {
    background: #fff;
    border-radius: 6px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.card-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f0f0;
}

/* 按钮 */
.btn {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 4px;
    border: 1px solid #d9d9d9;
    background: #fff;
    cursor: pointer;
    font-size: 14px;
    color: #555;
}
.btn-primary {
    background: #1890ff;
    color: #fff;
    border-color: #1890ff;
}
.btn-primary:hover { background: #40a9ff; border-color: #40a9ff; color: #fff; }
.btn-success {
    background: #52c41a;
    color: #fff;
    border-color: #52c41a;
}
.btn-success:hover { background: #73d13d; border-color: #73d13d; color: #fff; }
.btn-danger {
    background: #ff4d4f;
    color: #fff;
    border-color: #ff4d4f;
}
.btn-sm { padding: 4px 12px; font-size: 13px; }

/* 表单 */
.form-group { margin-bottom: 16px; }
.form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #555;
}
.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
}
.form-control:focus {
    outline: none;
    border-color: #1890ff;
    box-shadow: 0 0 0 2px rgba(24,144,255,0.15);
}
textarea.form-control { min-height: 100px; resize: vertical; }
select.form-control { height: 36px; }

/* 表格 */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.data-table th, .data-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
}
.data-table th {
    background: #fafafa;
    font-weight: 600;
    color: #555;
}
.data-table tr:hover { background: #fafafa; }

/* 消息 */
.alert {
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 16px;
    font-size: 14px;
}
.alert-success {
    background: #f6ffed;
    border: 1px solid #b7eb8f;
    color: #389e0d;
}
.alert-error {
    background: #fff2f0;
    border: 1px solid #ffccc7;
    color: #cf1322;
}

/* 登录页 */
.login-box {
    max-width: 400px;
    margin: 80px auto;
}

/* 后台侧边栏 */
.admin-layout {
    display: flex;
    min-height: 100vh;
}
.admin-sidebar {
    width: 220px;
    background: #001529;
    color: #fff;
    flex-shrink: 0;
}
.admin-sidebar .logo {
    padding: 20px;
    font-size: 16px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    color: #fff;
}
.admin-sidebar .menu a {
    display: block;
    padding: 14px 20px;
    color: rgba(255,255,255,0.7);
    border-left: 3px solid transparent;
}
.admin-sidebar .menu a:hover,
.admin-sidebar .menu a.active {
    background: #1890ff;
    color: #fff;
    border-left-color: #fff;
}
.admin-main {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

/* 题目卡片 */
.question-card {
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 20px;
    background: #fff;
}
.question-title {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 12px;
    color: #222;
}
.question-content {
    color: #555;
    margin-bottom: 16px;
    line-height: 1.8;
}
.question-content p { margin-bottom: 8px; }

/* 子问题 */
.part-box {
    background: #fafafa;
    border-left: 3px solid #1890ff;
    padding: 16px;
    margin-bottom: 16px;
}
.part-title { font-weight: 600; margin-bottom: 8px; }
.part-answer { margin-top: 12px; padding-top: 12px; border-top: 1px dashed #ddd; }
.answer-label { color: #52c41a; font-weight: 600; }

/* 练习布局 */
.practice-layout {
    display: flex;
    gap: 20px;
}
.practice-nav {
    width: 240px;
    flex-shrink: 0;
}
.practice-main {
    flex: 1;
}
.practice-side {
    width: 380px;
    flex-shrink: 0;
}
.nav-item {
    display: block;
    padding: 10px 14px;
    border-radius: 4px;
    margin-bottom: 6px;
    background: #fff;
    color: #555;
    font-size: 14px;
}
.nav-item:hover { background: #e6f7ff; color: #1890ff; }
.nav-item.active { background: #1890ff; color: #fff; }
.nav-item.done { border-left: 3px solid #52c41a; }

/* 评分自评 */
.score-point {
    display: flex;
    align-items: flex-start;
    margin-bottom: 10px;
    padding: 10px;
    background: #f6ffed;
    border-radius: 4px;
}
.score-point input[type="checkbox"] {
    margin-right: 10px;
    margin-top: 3px;
}
.score-input {
    width: 80px;
    text-align: center;
}

/* 状态标签 */
.tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
}
.tag-green { background: #f6ffed; color: #389e0d; border: 1px solid #b7eb8f; }
.tag-red { background: #fff2f0; color: #cf1322; border: 1px solid #ffccc7; }
.tag-blue { background: #e6f7ff; color: #096dd9; border: 1px solid #91d5ff; }
.tag-orange { background: #fff7e6; color: #d46b08; border: 1px solid #ffd591; }

/* 分页 */
.pagination { margin-top: 20px; text-align: center; }
.pagination a, .pagination span {
    display: inline-block;
    padding: 6px 12px;
    margin: 0 3px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    background: #fff;
    color: #555;
}
.pagination a:hover { border-color: #1890ff; color: #1890ff; }
.pagination .current { background: #1890ff; color: #fff; border-color: #1890ff; }

/* 答题卡 */
.answer-card-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}
.answer-card-item {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    border: 1px solid #d9d9d9;
    background: #fff;
    color: #555;
    font-size: 13px;
    cursor: pointer;
    text-decoration: none;
}
.answer-card-item:hover {
    border-color: #1890ff;
    color: #1890ff;
}
.answer-card-item.done {
    background: #52c41a;
    color: #fff;
    border-color: #52c41a;
}
.answer-card-item.active {
    box-shadow: 0 0 0 2px #1890ff;
}

/* 计时器 */
.exam-timer {
    text-align: center;
    padding: 16px;
    background: #fff;
    border-radius: 6px;
    margin-bottom: 16px;
    border: 1px solid #e8e8e8;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.exam-timer .timer-label {
    font-size: 12px;
    color: #999;
    margin-bottom: 4px;
}
.exam-timer .timer-display {
    font-size: 28px;
    font-weight: bold;
    color: #333;
    font-family: 'Courier New', monospace;
    letter-spacing: 2px;
}

/* 210分钟倒计时 */
.countdown-box {
    text-align: center;
    padding: 20px 16px;
    background: #fff;
    border-radius: 6px;
    margin-bottom: 16px;
    border: 1px solid #e8e8e8;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.countdown-box .countdown-label {
    font-size: 13px;
    color: #999;
    margin-bottom: 6px;
}
.countdown-box .countdown-display {
    font-size: 36px;
    font-weight: bold;
    color: #333;
    font-family: 'Courier New', monospace;
    letter-spacing: 2px;
}

/* 吸底答案区 */
.answer-sticky-box {
    background: #fff;
    border-top: 3px solid #1890ff;
    padding: 16px 24px 20px;
    margin: 0 -24px;
    box-shadow: 0 -4px 12px rgba(0,0,0,0.08);
    flex-shrink: 0;
}

/* 登录选项卡 */
.login-tab {
    flex: 1;
    text-align: center;
    padding: 10px 0;
    color: #666;
    border-bottom: 2px solid transparent;
    font-size: 14px;
}
.login-tab.active {
    color: #1890ff;
    border-bottom-color: #1890ff;
    font-weight: 600;
}

/* 高级计算器 */
.calc-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
    cursor: pointer;
    user-select: none;
    font-size: 14px;
}
.calc-display {
    background: #f5f5f5;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    padding: 8px 10px;
    margin: 10px 0;
    font-size: 16px;
    text-align: right;
    min-height: 32px;
    word-break: break-all;
    font-family: 'Courier New', monospace;
    color: #333;
}
.calc-keys {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 5px;
}
.calc-btn {
    padding: 6px 0;
    border: 1px solid #d9d9d9;
    background: #fff;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    text-align: center;
    color: #333;
    line-height: 1.4;
}
.calc-btn:hover { background: #e6f7ff; border-color: #1890ff; }
.calc-btn.calc-func { background: #e6f7ff; color: #096dd9; border-color: #91d5ff; }
.calc-btn.calc-func:hover { background: #bae7ff; }
.calc-btn.calc-op { background: #fff7e6; color: #d46b08; border-color: #ffd591; }
.calc-btn.calc-op:hover { background: #ffe7ba; }
.calc-btn.calc-mem { background: #f6ffed; color: #389e0d; border-color: #b7eb8f; }
.calc-btn.calc-mem:hover { background: #d9f7be; }

/* 小屏适配 */
@media (max-width: 960px) {
    .practice-layout { flex-direction: column; }
    .practice-nav, .practice-side { width: 100%; }
    .admin-layout { flex-direction: column; }
    .admin-sidebar { width: 100%; }
    .answer-sticky-box {
        margin: 0 -16px;
        padding: 12px 16px 16px;
    }
}
