/* ===== 双元教育企业管理系统 - Apple风格UI ===== */
:root {
    --primary: #007AFF;
    --primary-dark: #0062CC;
    --primary-light: #E8F0FE;
    --success: #34C759;
    --warning: #FF9500;
    --danger: #FF3B30;
    --bg: #F5F5F7;
    --card: #FFFFFF;
    --text: #1D1D1F;
    --text-secondary: #86868B;
    --text-light: #A1A1A6;
    --border: #D2D2D7;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.06);
    --shadow-lg: 0 8px 40px rgba(0,0,0,0.08);
    --radius: 12px;
    --radius-sm: 8px;
    --nav-height: 52px;
    --transition: all 0.25s cubic-bezier(0.25, 0.1, 0.25, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
                 "Helvetica Neue", "Microsoft YaHei", sans-serif;
    background: var(--bg); color: var(--text);
    line-height: 1.6; -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

/* ===== 导航栏 ===== */
.navbar {
    background: #FFFFFF;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    padding: 0 20px; height: var(--nav-height);
    display: flex; align-items: center;
    position: sticky; top: 0; z-index: 100;
}
.nav-brand { display: flex; align-items: center; gap: 8px; margin-right: 24px; flex-shrink: 0; }
.brand-icon { font-size: 20px; display: flex; align-items: center; }
.brand-icon img { height: 28px; width: auto; border-radius: 6px; }
.brand-text { font-weight: 700; font-size: 15px; color: var(--text); letter-spacing: -0.3px; }
.nav-menu { display: flex; gap: 2px; flex: 1; scrollbar-width: none; }
.nav-menu::-webkit-scrollbar { display: none; }

/* ===== 下拉菜单 ===== */
.dropdown { position: relative; display: inline-block; }
.dropbtn {
    padding: 6px 12px; text-decoration: none; color: var(--text-secondary);
    border-radius: 6px; font-size: 13px; font-weight: 500; cursor: pointer;
    transition: var(--transition); background: none; border: none;
    font-family: inherit; white-space: nowrap; display: flex; align-items: center; gap: 4px;
}
.dropdown:hover .dropbtn { background: var(--primary-light); color: var(--primary); }
.dropdown-content {
    display: none; position: absolute; top: 100%; left: 0;
    padding-top: 6px; margin-top: 0;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    min-width: 180px; box-shadow: var(--shadow-lg);
    border-radius: var(--radius-sm); padding: 6px; z-index: 200;
    border: 1px solid rgba(0,0,0,0.06);
}
.dropdown-content a {
    display: block; padding: 8px 14px; text-decoration: none;
    color: var(--text); font-size: 13px; border-radius: 4px;
    font-weight: 450; transition: var(--transition);
}
.dropdown-content a:hover { background: var(--primary-light); color: var(--primary); }
.dropdown:hover .dropdown-content { display: block; }

/* ===== 导航链接 ===== */
.nav-link {
    padding: 6px 12px; text-decoration: none; color: var(--text-secondary);
    border-radius: 6px; font-size: 13px; font-weight: 500; white-space: nowrap;
    transition: var(--transition); display: flex; align-items: center; gap: 4px;
}
.nav-link:hover { background: var(--primary-light); color: var(--primary); text-decoration: none; }
.nav-user { display: flex; align-items: center; gap: 8px; flex-shrink: 0; margin-left: auto; }
.user-badge { font-weight: 600; font-size: 13px; color: var(--text); }
.role-badge {
    background: var(--primary-light); color: var(--primary);
    padding: 2px 10px; border-radius: 20px; font-size: 11px; font-weight: 500;
}

/* ===== 容器 ===== */
.container { max-width: 1200px; margin: 0 auto; padding: 28px 24px; }

/* ===== 卡片 ===== */
.page-card, .section {
    background: var(--card); border-radius: var(--radius);
    box-shadow: var(--shadow-sm); padding: 24px; margin-bottom: 20px;
    border: 1px solid rgba(0,0,0,0.04);
    transition: box-shadow 0.3s ease;
}
.page-card:hover, .section:hover { box-shadow: var(--shadow-md); }
.page-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 20px; gap: 12px; flex-wrap: wrap;
}
h2 {
    font-size: 22px; font-weight: 700; letter-spacing: -0.5px;
    color: var(--text); margin-bottom: 20px;
}
h3 {
    font-size: 15px; font-weight: 600; color: var(--text);
    margin-bottom: 12px; padding-bottom: 10px;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    display: flex; align-items: center; gap: 6px;
}
h3 small { font-weight: 400; font-size: 12px; color: var(--text-light); }

/* ===== 统计卡片 ===== */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
    background: var(--card); border-radius: var(--radius);
    box-shadow: var(--shadow-sm); padding: 20px; text-align: center;
    border: 1px solid rgba(0,0,0,0.04); transition: var(--transition);
}
.stat-icon { font-size: 24px; margin-bottom: 8px; color: var(--primary); }
.stat-value { font-size: 28px; font-weight: 700; color: var(--text); letter-spacing: -0.5px; }
.stat-label { font-size: 12px; color: var(--text-light); margin-top: 4px; font-weight: 450; }
.stat-link {
    text-decoration: none; display: block; cursor: pointer;
    transition: var(--transition);
}
.stat-link:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

/* ===== 表格 ===== */
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.table th {
    background: var(--bg); text-align: left; padding: 10px 12px;
    font-weight: 600; font-size: 12px; color: var(--text-light);
    border-bottom: 1px solid var(--border); text-transform: uppercase;
    letter-spacing: 0.5px; position: sticky; top: var(--nav-height); z-index: 10;
}
.table td { padding: 10px 12px; border-bottom: 1px solid rgba(0,0,0,0.04); }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--bg); }
.table .btn-sm { padding: 4px 10px; font-size: 12px; }
.table td .cell-truncate { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }

/* ===== 标签 ===== */
.status-badge {
    display: inline-block; padding: 2px 10px; border-radius: 20px;
    font-size: 11px; font-weight: 500;
}
.status-active, .status-进行中 { background: #E8F8E6; color: #1A8A1A; }
.status-已完成 { background: var(--primary-light); color: var(--primary); }
.status-已暂停 { background: #FFF3E0; color: #C77600; }
.status-已取消 { background: #FFEBEE; color: #C62828; }
.role-tag {
    display: inline-block; padding: 2px 10px; border-radius: 4px;
    font-size: 11px; background: var(--bg); color: var(--text);
}

/* ===== 表单 ===== */
.form { max-width: 600px; }
.form-group { margin-bottom: 18px; }
.form-group label {
    display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px;
    color: var(--text);
}
.form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: 10px 14px; border: 1px solid var(--border);
    border-radius: var(--radius-sm); font-size: 14px; font-family: inherit;
    background: var(--bg); transition: var(--transition);
    color: var(--text);
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none; border-color: var(--primary);
    background: var(--card); box-shadow: 0 0 0 4px rgba(0,122,255,0.08);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ===== 按钮 ===== */
.btn {
    display: inline-block; padding: 8px 20px; border: none; border-radius: 8px;
    font-size: 13px; font-weight: 500; cursor: pointer; text-decoration: none;
    transition: var(--transition); text-align: center; line-height: 1.4;
    letter-spacing: -0.1px;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn-secondary { background: var(--bg); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: #E8E8ED; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #D62820; }
.btn-sm { padding: 4px 12px; font-size: 12px; border-radius: 6px; }
.btn-full { width: 100%; padding: 12px; font-size: 15px; border-radius: var(--radius-sm); }

/* ===== 登录页（极简白方案） ===== */
.login-page {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #F5F5F7 0%, #E8E8ED 100%);
    padding: 20px;
}
.login-card {
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(40px); -webkit-backdrop-filter: blur(40px);
    border-radius: 20px; padding: 40px 36px;
    width: 380px; max-width: 100%;
    box-shadow: 0 8px 40px rgba(0,0,0,0.08);
    border: 1px solid rgba(255,255,255,0.6);
    text-align: center;
}
.login-logo { margin-bottom: 20px; }
.login-logo img { height: 56px; width: auto; border-radius: 14px; }
.login-header h1 { font-size: 20px; font-weight: 700; margin-bottom: 4px; color: var(--text); }
.login-subtitle { color: var(--text-secondary); font-size: 13px; margin-bottom: 28px; }

/* ===== 错误/提示消息 ===== */
.error-msg {
    background: #FFEBEE; color: #C62828;
    padding: 10px 14px; border-radius: var(--radius-sm);
    font-size: 13px; margin-bottom: 16px;
}
.info-msg {
    background: var(--primary-light); color: var(--primary);
    padding: 10px 14px; border-radius: var(--radius-sm);
    font-size: 13px; margin-bottom: 16px;
}

/* ===== 详情页 ===== */
.detail-header { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.detail-row { display: flex; padding: 10px 0; border-bottom: 1px solid rgba(0,0,0,0.04); }
.detail-row label { width: 120px; font-weight: 500; color: var(--text-secondary); flex-shrink: 0; font-size: 13px; }
.detail-row.full { display: block; }
.detail-row.full label { width: 100%; margin-bottom: 4px; }
.detail-row.full p { white-space: pre-wrap; line-height: 1.8; font-size: 14px; }

/* ===== 进度条 ===== */
.progress-bar {
    width: 120px; height: 6px; background: var(--border); border-radius: 3px;
    position: relative; overflow: hidden;
}
.progress-fill {
    height: 100%; background: var(--primary);
    border-radius: 3px; transition: width 0.5s ease;
}

/* ===== 优先级 ===== */
.priority-high { color: var(--danger); font-weight: 600; }
.priority-mid { color: var(--warning); font-weight: 600; }
.priority-low { color: var(--success); font-weight: 600; }

/* ===== 空状态 ===== */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-light); }
.empty-state p { margin-bottom: 16px; font-size: 15px; }
.empty-state svg { margin-bottom: 16px; }

/* ===== 日历视图 ===== */
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; max-width: 350px; }
.cal-day { text-align: center; padding: 6px 4px; border-radius: 6px; font-size: 12px; border: 1px solid var(--border); }
.cal-done { background: #E8F8E6; border-color: #A5D6A7; }
.cal-miss { background: #FFEBEE; border-color: #EF9A9A; }
.cal-future { background: var(--bg); color: var(--text-light); }
.daily-date { font-size: 14px; color: var(--text-secondary); margin-bottom: 16px; }

/* ===== 子任务汇总行 ===== */
.subtask-summary-row td { background: var(--bg) !important; border-bottom: none !important; padding: 4px 12px 8px !important; }

/* ===== 简单动画 ===== */
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.page-card, .section, .stat-card, .alert-grid > div { animation: fadeIn 0.4s ease-out both; }
.page-card:nth-child(2), .section:nth-child(2) { animation-delay: 0.05s; }
.page-card:nth-child(3), .section:nth-child(3) { animation-delay: 0.1s; }
.page-card:nth-child(4), .section:nth-child(4) { animation-delay: 0.15s; }

/* ===== 滚动条美化 ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.15); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.25); }

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .navbar { padding: 0 12px; height: 48px; }
    .nav-menu { gap: 0; overflow: visible; }
    .dropbtn, .nav-link { padding: 6px 8px; font-size: 12px; }
    .nav-user { gap: 4px; }
    .user-badge { font-size: 12px; }
    .role-badge { font-size: 10px; padding: 1px 8px; }
    .container { padding: 16px; }
    .page-card, .section { padding: 16px; border-radius: var(--radius-sm); }
    .form-row { grid-template-columns: 1fr; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .stat-card { padding: 14px; }
    .stat-value { font-size: 22px; }
    h2 { font-size: 18px; }
    .table { font-size: 12px; }
    .table th, .table td { padding: 6px 8px; }
    .login-card { padding: 32px 24px 28px; }
    .daily-layout { grid-template-columns: 1fr !important; }
    .alert-grid { grid-template-columns: 1fr !important; }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .container { padding: 20px; }
    .stat-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ===== Mobile Responsive ===== */
.mobile-nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 22px;
    color: #1d1d1f;
    cursor: pointer;
    padding: 4px 8px;
    z-index: 101;
    line-height: 1;
}
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.table-responsive table {
    min-width: 600px;
}
@media (max-width: 768px) {
    .mobile-nav-toggle { display: block; }
    .nav-menu {
        display: none;
        position: fixed;
        top: var(--nav-height);
        left: 0;
        right: 0;
        background: #fff;
        flex-direction: column;
        padding: 8px 0;
        box-shadow: 0 4px 20px rgba(0,0,0,0.1);
        z-index: 99;
        max-height: 80vh;
        overflow-y: auto;
    }
    .nav-menu.open { display: flex; }
    .nav-menu .dropdown { width: 100%; }
    .nav-menu .dropbtn {
        width: 100%;
        justify-content: space-between;
        padding: 10px 16px;
        font-size: 14px;
    }
    .nav-menu .dropdown-content {
        position: static;
        box-shadow: none;
        border: none;
        background: #f5f5f7;
        margin: 0 8px;
        border-radius: 8px;
    }
    .nav-menu .dropdown-content a {
        padding: 10px 16px;
        font-size: 14px;
    }
    .nav-user { margin-left: auto; }
    .alert-grid { grid-template-columns: 1fr !important; }
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    .login-card {
        margin: 20px 16px;
        padding: 24px 20px !important;
    }
    .page-card, .section { padding: 14px !important; }
    .detail-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }
    .detail-row label { width: 100%; }
    .status-flow { flex-wrap: wrap; gap: 2px; }
    .status-flow .step { font-size: 10px; padding: 2px 6px; }
    .status-flow .arrow { font-size: 10px; }
    .empty-state { padding: 40px 16px !important; }
    .form-group input, .form-group select, .form-group textarea {
        font-size: 16px !important;
    }
    [style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }
}
@media (max-width: 480px) {
    h2 { font-size: 16px !important; }
    .brand-text { font-size: 13px; }
    .user-badge { font-size: 11px; }
    .stat-grid { grid-template-columns: repeat(2,1fr) !important; }
}
