/* Agent学习H5 - 公共样式 */
:root {
    --primary: #409e8c;
    --primary-dark: #357a70;
    --secondary: #ffd700;
    --bg: #f5f7fa;
    --card-bg: #fff;
    --text: #333;
    --text-light: #666;
    --border: #e0e4e8;
    --success: #52c41a;
    --warning: #faad14;
    --error: #f5222d;
    --locked: #ccc;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'PingFang SC', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

/* 头部 */
.header {
    background: var(--primary);
    color: #fff;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header h1 {
    font-size: 1.25rem;
    font-weight: 600;
}

.header-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.header-actions button {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    color: #fff;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
}

.header-actions button:hover {
    background: rgba(255,255,255,0.3);
}

/* 主容器 */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 1rem;
}

/* 登录页 */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.login-box {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 360px;
}

.login-box h2 {
    text-align: center;
    color: var(--primary);
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text);
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 1rem;
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: background 0.2s;
}

.btn:hover { background: var(--primary-dark); }
.btn-block { display: block; width: 100%; }

/* 统计卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--card-bg);
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.stat-card .num {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-card .label {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: 0.25rem;
}

/* 知识点卡片 */
.knowledge-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.knowledge-card {
    background: var(--card-bg);
    border-radius: 10px;
    padding: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.knowledge-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.knowledge-card.locked {
    opacity: 0.6;
    cursor: not-allowed;
}

.knowledge-card.locked:hover {
    transform: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.day-num {
    width: 48px;
    height: 48px;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.knowledge-card.locked .day-num {
    background: var(--locked);
}

.knowledge-card.completed .day-num {
    background: var(--success);
}

.knowledge-info {
    flex: 1;
}

.knowledge-info h3 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.knowledge-info .meta {
    font-size: 0.8rem;
    color: var(--text-light);
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.badge {
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 500;
}

.badge-basic { background: #e6f7ff; color: #1890ff; }
.badge-advanced { background: #fff7e6; color: #fa8c16; }
.badge-core { background: #fff1f0; color: #f5222d; }
.badge-project { background: #f6ffed; color: #52c41a; }

.status-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

/* 内容页 */
.content-header {
    background: var(--primary);
    color: #fff;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.back-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
}

.content-body {
    padding: 1.5rem 1rem;
    max-width: 800px;
    margin: 0 auto;
}

.section {
    background: var(--card-bg);
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.section h2 {
    font-size: 1.1rem;
    color: var(--primary);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border);
}

.section h3 {
    font-size: 1rem;
    margin: 1rem 0 0.5rem;
}

.content-text {
    line-height: 1.8;
    color: var(--text);
}

.content-text p {
    margin-bottom: 0.75rem;
}

.content-text ul, .content-text ol {
    margin: 0.75rem 0;
    padding-left: 1.5rem;
}

.content-text li {
    margin-bottom: 0.5rem;
}

.content-text code {
    background: #f0f0f0;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.9em;
    color: #c7254e;
}

.content-text pre {
    background: #2d2d2d;
    color: #f8f8f2;
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1rem 0;
    font-size: 0.85rem;
    line-height: 1.6;
}

.content-text pre code {
    background: none;
    color: inherit;
    padding: 0;
}

.code-block {
    background: #2d2d2d;
    color: #f8f8f2;
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1rem 0;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.85rem;
    line-height: 1.6;
}

/* 练习题 */
.exercise-item {
    background: #fafafa;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.exercise-item .question {
    font-weight: 500;
    margin-bottom: 0.75rem;
}

.exercise-item label {
    display: block;
    padding: 0.5rem;
    margin: 0.25rem 0;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.2s;
}

.exercise-item label:hover {
    background: #e6f7ff;
}

.exercise-item input[type="radio"] {
    margin-right: 0.5rem;
}

/* 底部按钮 */
.footer-actions {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem;
    background: var(--bg);
    border-top: 1px solid var(--border);
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

.footer-actions .btn {
    flex: 1;
    max-width: 200px;
}

.btn-secondary {
    background: #fff;
    color: var(--primary);
    border: 1px solid var(--primary);
}

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

.btn-success {
    background: var(--success);
}

.btn-success:hover {
    background: #3d9c14;
}

/* 结果提示 */
.result-toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    z-index: 1000;
    min-width: 280px;
}

.result-toast .icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.result-toast h3 {
    margin-bottom: 0.5rem;
}

.result-toast p {
    color: var(--text-light);
    margin-bottom: 1rem;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}

/* 进度条 */
.progress-bar {
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.progress-bar .fill {
    height: 100%;
    background: var(--success);
    transition: width 0.3s;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-light);
}

.empty-state .icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

/* 响应式 */
@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }
    
    .stat-card {
        padding: 0.75rem 0.5rem;
    }
    
    .stat-card .num {
        font-size: 1.25rem;
    }
    
    .knowledge-card {
        padding: 0.75rem;
    }
    
    .day-num {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
}
