/**
 * 清大AI学 - 家长端样式
 * 移动端优先，清新温暖风格
 */
:root {
    --primary: #4A90D9;
    --primary-light: #6BA3E0;
    --primary-dark: #3A7BC8;
    --secondary: #67C23A;
    --secondary-light: #85CE61;
    --accent: #FF9500;
    --background: #F8FAFC;
    --card-bg: #FFFFFF;
    --text-primary: #303133;
    --text-secondary: #606266;
    --text-muted: #909399;
    --border-color: #EBEEF5;
    --shadow: 0 2px 12px rgba(74, 144, 217, 0.1);
    --shadow-lg: 0 4px 20px rgba(74, 144, 217, 0.15);
    --radius: 12px;
    --radius-sm: 8px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* 登录页样式 */
.login-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    padding: 20px;
}

.login-header {
    text-align: center;
    padding: 40px 0;
    color: white;
}

.login-logo {
    width: 80px;
    height: 80px;
    background: white;
    border-radius: 20px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
}

.login-logo svg {
    width: 50px;
    height: 50px;
    fill: var(--primary);
}

.login-header h1 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
}

.login-header p {
    font-size: 14px;
    opacity: 0.9;
}

.login-form {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 30px 24px;
    box-shadow: var(--shadow-lg);
    flex: 1;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    height: 48px;
    padding: 0 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 16px;
    transition: all 0.3s;
    outline: none;
}

.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.1);
}

.btn {
    width: 100%;
    height: 48px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

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

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

.btn-primary:disabled {
    background: #C0D4E8;
    cursor: not-allowed;
}

.btn-secondary {
    background: var(--secondary);
    color: white;
}

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 主内容区 */
.main-container {
    padding: 16px;
    padding-bottom: calc(70px + var(--safe-bottom));
    max-width: 100%;
    overflow-x: hidden;
}

/* 页面头部 */
.page-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    padding: 20px 16px;
    margin: -16px -16px 16px -16px;
    border-radius: 0 0 24px 24px;
}

.page-header h2 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 4px;
}

.page-header p {
    font-size: 13px;
    opacity: 0.9;
}

/* 卡片 */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-title svg {
    width: 20px;
    height: 20px;
    fill: var(--primary);
}

/* 概览统计 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.stat-item {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    padding: 16px;
    border-radius: var(--radius-sm);
    text-align: center;
}

.stat-item.green {
    background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-light) 100%);
}

.stat-item.orange {
    background: linear-gradient(135deg, var(--accent) 0%, #FFB347 100%);
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 12px;
    opacity: 0.9;
}

/* 科目进度 */
.subject-item {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.subject-item:last-child {
    border-bottom: none;
}

.subject-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--background);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    font-size: 20px;
}

.subject-info {
    flex: 1;
}

.subject-name {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.progress-bar {
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 4px;
    transition: width 0.5s ease;
}

.progress-text {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
    margin-left: 12px;
    min-width: 45px;
    text-align: right;
}

/* 底部导航 */
.tab-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--card-bg);
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    padding-bottom: calc(8px + var(--safe-bottom));
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
    z-index: 100;
}

.tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 4px 16px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 11px;
    transition: all 0.3s;
}

.tab-item svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.tab-item.active {
    color: var(--primary);
}

.tab-item.active svg {
    fill: var(--primary);
}

/* 通知列表 */
.notification-item {
    display: flex;
    padding: 14px 0;
    border-bottom: 1px solid var(--border-color);
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--background);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    flex-shrink: 0;
}

.notification-icon svg {
    width: 20px;
    height: 20px;
    fill: var(--primary);
}

.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-title {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.notification-desc {
    font-size: 13px;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.notification-time {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
}

.notification-badge {
    background: var(--secondary);
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 8px;
}

/* 设置列表 */
.setting-list {
    background: var(--card-bg);
    border-radius: var(--radius);
    overflow: hidden;
}

.setting-item {
    display: flex;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.2s;
}

.setting-item:last-child {
    border-bottom: none;
}

.setting-item:hover {
    background: var(--background);
}

.setting-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
}

.setting-icon svg {
    width: 20px;
    height: 20px;
    fill: white;
}

.setting-icon.blue { background: var(--primary); }
.setting-icon.green { background: var(--secondary); }
.setting-icon.orange { background: var(--accent); }
.setting-icon.red { background: var(--secondary); }

.setting-text {
    flex: 1;
}

.setting-title {
    font-size: 15px;
    color: var(--text-primary);
}

.setting-desc {
    font-size: 12px;
    color: var(--text-muted);
}

.setting-arrow {
    color: var(--text-muted);
    font-size: 12px;
}

/* 报告切换 */
.report-tabs {
    display: flex;
    background: var(--background);
    border-radius: var(--radius-sm);
    padding: 4px;
    margin-bottom: 16px;
}

.report-tab {
    flex: 1;
    padding: 10px;
    text-align: center;
    border-radius: 6px;
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s;
}

.report-tab.active {
    background: white;
    color: var(--primary);
    font-weight: 500;
    box-shadow: var(--shadow);
}

/* 趋势图表区域 */
.trend-chart {
    height: 200px;
    background: var(--background);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    padding: 16px;
    margin-bottom: 12px;
}

.chart-bar {
    width: 30px;
    background: linear-gradient(180deg, var(--primary), var(--primary-light));
    border-radius: 4px 4px 0 0;
    transition: height 0.5s ease;
}

.chart-label {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 8px;
    text-align: center;
}

/* 孩子选择器 */
.child-selector {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 4px 0;
    margin-bottom: 16px;
    -webkit-overflow-scrolling: touch;
}

.child-card {
    min-width: 100px;
    padding: 12px;
    background: var(--card-bg);
    border-radius: var(--radius);
    text-align: center;
    box-shadow: var(--shadow);
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.3s;
}

.child-card.active {
    border-color: var(--primary);
}

.child-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 600;
    margin: 0 auto 8px;
}

.child-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.child-class {
    font-size: 12px;
    color: var(--text-muted);
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 40px 20px;
}

.empty-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 16px;
    background: var(--background);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.empty-icon svg {
    width: 40px;
    height: 40px;
    fill: var(--text-muted);
}

.empty-title {
    font-size: 16px;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.empty-desc {
    font-size: 14px;
    color: var(--text-muted);
}

/* 头部用户信息 */
.user-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.user-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: white;
}

.user-info h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 2px;
}

.user-info p {
    font-size: 13px;
    opacity: 0.8;
}

/* 响应式 */
@media (max-width: 375px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-value {
        font-size: 24px;
    }
}
