/* 全局样式 - 马卡龙色系 + 响应式设计 */
:root {
    --primary-color: #9BB8D3;
    --primary-light: #C5DAE9;
    --secondary-color: #F2D4DC;
    --accent-color: #B5E8C3;
    --accent-purple: #D4C1EC;
    --text-primary: #3D3D3D;
    --text-secondary: #8A8A8A;
    --bg-main: #F8F9FC;
    --bg-card: #FFFFFF;
    --border-color: #EAEEF3;
    --error-color: #E8A0A0;
    --success-color: #A0D8B0;
    --warning-color: #F0D49B;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', sans-serif;
    background: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 14px;
}

/* 按钮样式 */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    min-width: 70px;
    font-weight: 500;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 12px;
    min-width: 50px;
}

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

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(155, 184, 211, 0.4);
}

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

.btn-secondary:hover {
    opacity: 0.9;
}

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

/* 输入框样式 */
input, textarea, select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
    background: white;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(155, 184, 211, 0.15);
}

/* 卡片样式 */
.card {
    background: var(--bg-card);
    border-radius: 14px;
    padding: 20px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    margin-bottom: 16px;
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* 消息提示 */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 14px 20px;
    background: var(--bg-card);
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    z-index: 9999;
    animation: slideIn 0.3s ease;
    max-width: 320px;
    font-size: 14px;
}

@keyframes slideIn {
    from { transform: translateX(400px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.toast.success { border-left: 4px solid var(--success-color); }
.toast.error { border-left: 4px solid var(--error-color); }
.toast.warning { border-left: 4px solid var(--warning-color); }

/* 标签样式 */
.client-tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    margin-right: 5px;
    margin-top: 5px;
    font-weight: 500;
}

.tag-high { background: var(--accent-color); color: #2D6A3F; }
.tag-medium { background: var(--warning-color); color: #6B5520; }
.tag-low { background: var(--secondary-color); color: #7A4A5A; }

/* Tab 样式 */
.detail-tab {
    padding: 10px 16px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}

.detail-tab:hover {
    color: var(--text-primary);
}

.detail-tab.active {
    color: var(--primary-color);
    font-weight: 600;
    border-bottom-color: var(--primary-color);
}

/* 工具类 */
.text-center { text-align: center; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }
.mt-20 { margin-top: 20px; }
.mt-10 { margin-top: 10px; }
.hidden { display: none; }

/* ============================================
   响应式适配
   ============================================ */

/* 汉堡菜单按钮 */
.menu-toggle {
    display: none;
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 1001;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.menu-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text-primary);
    margin: 4px auto;
    border-radius: 2px;
}

/* 遮罩层 */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.3);
    z-index: 999;
}

/* 手机端适配 */
@media (max-width: 768px) {
    body {
        flex-direction: column;
    }

    .menu-toggle {
        display: flex;
    }

    .sidebar {
        position: fixed;
        left: -260px;
        top: 0;
        bottom: 0;
        z-index: 1000;
        transition: left 0.3s ease;
        box-shadow: 4px 0 20px rgba(0,0,0,0.1);
    }

    .sidebar.open {
        left: 0;
    }

    .sidebar-overlay.open {
        display: block;
    }

    .main-content {
        width: 100%;
    }

    .content-header {
        padding: 15px 20px;
        padding-left: 65px;
    }

    .content-body {
        padding: 15px;
    }

    /* 表单两列改单列 */
    .form-row {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    /* 筛选器换行 */
    .filter-bar {
        flex-direction: column;
        gap: 8px !important;
    }

    .filter-bar select,
    .filter-bar input {
        width: 100% !important;
    }

    /* 学员卡片单列 */
    .client-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    /* Dashboard 统计单列 */
    .dashboard-grid {
        grid-template-columns: 1fr !important;
    }

    /* 模态框全屏 */
    .modal-content {
        max-width: 100% !important;
        width: 100% !important;
        height: 100vh !important;
        max-height: 100vh !important;
        border-radius: 0 !important;
        margin: 0;
    }

    /* 全局推课结果 */
    .match-result-card {
        flex-direction: column;
        align-items: flex-start !important;
    }

    /* Toast 位置 */
    .toast {
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

/* 平板适配 */
@media (min-width: 769px) and (max-width: 1024px) {
    .sidebar {
        width: 200px;
    }

    .client-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)) !important;
    }
}
