/* 个人错题本系统 - 主样式文件 */

/* 全局重置和基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    font-family: 'Microsoft YaHei', 'PingFang SC', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f8fafc;
    color: #333;
    overflow-x: hidden;
}

/* 背景效果 */
.background-stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../images/image.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    opacity: 1.0;
    z-index: 0;
}

/* 导航栏样式 */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    position: sticky;
    top: 0;
    z-index: 1000;
    height: 60px;
}

.nav-container {
    max-width: 1920px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    height: 100%;
}

.nav-logo h2 {
    color: #2d3748;
    font-weight: 600;
    font-size: 24px;
}

.nav-menu {
    display: flex;
    gap: 30px;
}

.nav-item {
    text-decoration: none;
    color: #555;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 20px;
    transition: all 0.3s ease;
    position: relative;
}

.nav-item:hover {
    color: #2b6cb0;
    background: rgba(43, 108, 176, 0.1);
}

.nav-item.active {
    color: #2b6cb0;
    background: rgba(43, 108, 176, 0.15);
}

/* 主容器 */
.main-container {
    max-width: 1920px;
    margin: 0 auto;
    padding: 20px;
    min-height: calc(100vh - 60px);
}

/* 统计面板 */
.stats-panel {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-number {
    font-size: 2.5em;
    font-weight: bold;
    color: #3182ce;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.9em;
    color: #666;
    font-weight: 500;
}

/* 内容区域布局 */
.content-area {
    display: grid;
    grid-template-columns: 300px 1fr 300px;
    gap: 20px;
    height: calc(100vh - 200px);
}

/* 面板卡片通用样式 */
.panel-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin-bottom: 20px;
    height: fit-content;
}

.panel-card h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.2em;
    font-weight: 600;
}

/* 按钮样式 */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, #3182ce, #2c5aa0);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5a67d8, #6b46a2);
    transform: translateY(-2px);
}

.btn-secondary {
    background: #e2e8f0;
    color: #4a5568;
}

.btn-secondary:hover {
    background: #cbd5e0;
}

.btn-tertiary {
    background: transparent;
    color: #3182ce;
    border: 1px solid #3182ce;
}

.btn-tertiary:hover {
    background: #3182ce;
    color: white;
}

.btn-success {
    background: #38a169;
    color: white;
}

.btn-warning {
    background: #d69e2e;
    color: white;
}

.btn-danger {
    background: #e53e3e;
    color: white;
}

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #4a5568;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
    background: rgba(255, 255, 255, 0.9);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: #3182ce;
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

/* 网格布局工具类 */
.grid {
    display: grid;
}

.grid-cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-cols-4 {
    grid-template-columns: repeat(4, 1fr);
}

.gap-4 {
    gap: 1rem;
}

.gap-6 {
    gap: 1.5rem;
}

/* 响应式设计 */
@media (max-width: 1600px) {
    .content-area {
        grid-template-columns: 280px 1fr 280px;
    }
}

@media (max-width: 1200px) {
    .content-area {
        grid-template-columns: 250px 1fr 250px;
    }
    
    .stats-panel {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .content-area {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .stats-panel {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .nav-menu {
        gap: 15px;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3182ce;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 模态框基础样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    margin: 5% auto;
    padding: 20px;
    border-radius: 15px;
    width: 80%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e2e8f0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
}

.modal-close:hover {
    color: #333;
}

/* 工具提示 */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 120px;
    background-color: #555;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 5px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -60px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 12px;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
} 

/* ===============================
   卡通浅蓝主题（全局覆盖与变量）
   说明：不改动HTML结构，通过变量与覆盖增强卡通观感
   - 颜色更柔和、明度提高
   - 圆角更大、边框略粗形成卡通描边
   - 投影更柔，形成轻拟物
   =============================== */
:root {
    /* 基础色板 */
    --ctn-primary: #55a8ff;
    --ctn-primary-dark: #2c7be5;
    --ctn-primary-ink: #1e4fa1; /* 用于描边 */
    --ctn-bg: #eef6ff;
    --ctn-card: #ffffff;
    --ctn-text: #2d3748;
    --ctn-muted: #6b7280;
    --ctn-success: #34d399;
    --ctn-warning: #fbbf24;
    --ctn-danger: #f87171;
    --ctn-pink: #f472b6;
    --ctn-purple: #a78bfa;

    /* 阴影与描边 */
    --ctn-shadow-sm: 0 4px 12px rgba(30, 79, 161, 0.08);
    --ctn-shadow-md: 0 8px 24px rgba(30, 79, 161, 0.12);
    --ctn-shadow-lg: 0 16px 40px rgba(30, 79, 161, 0.16);
    --ctn-outline: 2px solid rgba(30, 79, 161, 0.15);
    --ctn-outline-strong: 2px solid rgba(30, 79, 161, 0.25);
}

html, body {
    background: linear-gradient(180deg, #f5faff 0%, var(--ctn-bg) 100%);
    color: var(--ctn-text);
}

/* 背景保持指定图片，并叠加柔和蓝白遮罩增强可读性 */
.background-stars {
    position: fixed;
}
.background-stars::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(1200px 800px at 20% 10%, rgba(255,255,255,0.45), rgba(255,255,255,0) 60%),
                radial-gradient(1000px 700px at 80% 20%, rgba(85,168,255,0.22), rgba(85,168,255,0) 55%),
                linear-gradient(180deg, rgba(255,255,255,0.35), rgba(255,255,255,0.35));
    pointer-events: none;
}

/* 导航条卡通化 */
.navbar {
    background: rgba(255, 255, 255, 0.92);
    border-bottom: var(--ctn-outline);
}
.nav-logo h2 {
    color: var(--ctn-primary-ink);
    text-shadow: 0 2px 0 rgba(85,168,255,0.15);
}
.nav-item {
    color: #3a4a5e;
    border-radius: 999px;
    border: 1.5px solid transparent;
}
.nav-item:hover {
    color: var(--ctn-primary-dark);
    background: rgba(85, 168, 255, 0.12);
    border-color: rgba(44, 123, 229, 0.25);
}
.nav-item.active {
    color: #fff;
    background: linear-gradient(135deg, var(--ctn-primary), var(--ctn-primary-dark));
    box-shadow: var(--ctn-shadow-sm);
}

/* 卡片与统计卡片卡通化 */
.panel-card, .stat-card {
    background: var(--ctn-card);
    border-radius: 18px;
    border: var(--ctn-outline);
    box-shadow: var(--ctn-shadow-md);
}
.stat-number { color: var(--ctn-primary-dark); }
.stat-label { color: var(--ctn-muted); }

/* 主要内容区栅格间距微调，留白更柔和 */
.content-area {
    gap: 22px;
}

/* 通用按钮卡通化 */
.btn {
    border-radius: 14px;
    box-shadow: 0 4px 0 rgba(30,79,161,0.08);
}
.btn-primary {
    background: linear-gradient(135deg, var(--ctn-primary), var(--ctn-primary-dark));
    border: 2px solid rgba(44, 123, 229, 0.35);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 0 rgba(30,79,161,0.10), var(--ctn-shadow-md);
}
.btn-secondary {
    background: #eaf1fb;
    color: #2b3f5c;
    border: 2px solid rgba(44, 123, 229, 0.20);
}
.btn-secondary:hover {
    background: #e0ebfb;
}
.btn-tertiary {
    color: var(--ctn-primary-dark);
    border: 2px dashed rgba(44, 123, 229, 0.35);
}
.btn-success { background: var(--ctn-success); border: 2px solid rgba(16,185,129,0.35); }
.btn-warning { background: var(--ctn-warning); border: 2px solid rgba(251,191,36,0.35); }
.btn-danger { background: var(--ctn-danger); border: 2px solid rgba(248,113,113,0.35); }

/* 表单控件卡通化 */
.form-input,
.form-select,
.form-textarea {
    background: rgba(255,255,255,0.95);
    border: 2px solid rgba(44, 123, 229, 0.15);
    border-radius: 12px;
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--ctn-primary);
    box-shadow: 0 0 0 4px rgba(85,168,255,0.18);
}

/* 模态卡通化 */
.modal-content {
    border-radius: 18px;
    border: var(--ctn-outline);
    box-shadow: var(--ctn-shadow-lg);
}
.modal-header {
    border-bottom: 2px dashed rgba(44,123,229,0.2);
}
.modal-close { color: #99a7bd; }
.modal-close:hover { color: var(--ctn-primary-dark); }

/* 工具提示卡通化 */
.tooltip .tooltiptext {
    background-color: #2f3d56;
    border: 2px solid rgba(47,61,86,0.5);
}

/* 滚动条柔和蓝 */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}
::-webkit-scrollbar-track {
    background: rgba(238,246,255,0.8);
    border-radius: 8px;
}
::-webkit-scrollbar-thumb {
    background: rgba(85,168,255,0.45);
    border-radius: 8px;
    border: 2px solid rgba(255,255,255,0.6);
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(44,123,229,0.55);
}
