/* style.css */
:root {
    --bg-color: #F5F5F7;
    --card-bg: #FFFFFF;
    --text-primary: #1D1D1F;
    --text-secondary: #86868B;
    --accent-color: #0071E3; /* Apple Blue */
    --danger-color: #FF3B30;
    --success-color: #34C759;
    --border-radius: 18px;
    --input-bg: #F5F5F7;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
    --font-stack: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --nav-height: 60px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font-stack);
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 布局容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    width: 100%;
}

/* 导航栏 */
.navbar {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    height: var(--nav-height);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.navbar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.brand {
    font-weight: 700;
    font-size: 20px;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: -0.5px;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    margin-left: 24px;
    font-size: 14px;
    transition: color 0.2s;
}

.nav-links a:hover, .nav-links a.active {
    color: var(--accent-color);
}

/* 卡片风格 */
.card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid rgba(0,0,0,0.02);
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

/* 表单元素 */
.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

input[type="text"],
input[type="password"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid transparent;
    background: var(--input-bg);
    font-size: 16px; /* 防止iOS缩放 */
    font-family: inherit;
    transition: all 0.2s;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    background: #fff;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.1);
}

/* 按钮 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: 99px; /* Pill shape */
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary {
    background: var(--text-primary); /* Apple uses black/dark gray for primary usually */
    color: white;
}

.btn-primary:hover {
    background: #000;
    transform: scale(1.02);
}

.btn-secondary {
    background: var(--input-bg);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: #e5e5ea;
}

.btn-danger {
    background: rgba(255, 59, 48, 0.1);
    color: var(--danger-color);
}

.btn-danger:hover {
    background: rgba(255, 59, 48, 0.2);
}

.btn-block {
    width: 100%;
}

/* 登录/注册页布局 */
.auth-container {
    max-width: 400px;
    margin: 80px auto;
    text-align: center;
}

.auth-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 40px;
    letter-spacing: -1px;
}

/* 仪表盘 Grid */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    margin-top: 30px;
}

/* 考试项目卡片 */
.exam-card {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.exam-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
}

.exam-desc {
    color: var(--text-secondary);
    font-size: 14px;
    flex-grow: 1;
    margin-bottom: 20px;
    line-height: 1.4;
}

/* 标签 Badge */
.badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    background: #eee;
    color: #666;
}

.badge-success { background: #d4f7dc; color: #155724; }
.badge-warning { background: #fff3cd; color: #856404; }

/* 模态框 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: white;
    padding: 30px;
    border-radius: 24px;
    width: 90%;
    max-width: 500px;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.active .modal {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-title {
    font-size: 22px;
    font-weight: 700;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-secondary);
}

/* 图片画廊 */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.gallery-item {
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    aspect-ratio: 1;
    cursor: pointer;
    border: 1px solid #eee;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

/* Toast */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 12px 24px;
    border-radius: 50px;
    font-size: 14px;
    transition: transform 0.3s;
    z-index: 3000;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

/* Mobile 优化 */
@media (max-width: 768px) {
    .grid {
        grid-template-columns: 1fr;
    }
    .container {
        padding: 16px;
    }
    .auth-container {
        margin: 40px auto;
    }
}
