/**
 * ICP申请平台 - 主样式表
 * 商务简洁风格
 */

/* ============ CSS变量 ============ */
:root {
    --primary-color: #1a56db;      /* 主色 - 深蓝 */
    --primary-light: #3b82f6;       /* 浅蓝 */
    --primary-dark: #1e40af;        /* 深蓝 */
    --secondary-color: #0e9f6e;     /* 辅助色 - 绿色 */
    --accent-color: #f59e0b;        /* 强调色 - 橙色 */
    --danger-color: #dc2626;        /* 危险色 */
    
    --text-primary: #1f2937;        /* 主文本 */
    --text-secondary: #6b7280;      /* 次要文本 */
    --text-light: #9ca3af;          /* 浅色文本 */
    
    --bg-white: #ffffff;
    --bg-gray: #f9fafb;
    --bg-light: #f3f4f6;
    --border-color: #e5e7eb;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    
    --radius-sm: 4px;
    --radius: 8px;
    --radius-lg: 12px;
    
    --transition: all 0.3s ease;
}

/* ============ 基础样式 ============ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-gray);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

img {
    max-width: 100%;
    height: auto;
}

/* ============ 容器 ============ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.container-fluid {
    width: 100%;
}

/* ============ 头部导航 ============ */
.header {
    background: var(--bg-white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
    padding: 0 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    display: flex;
    align-items: center;
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-color);
}

.logo img {
    height: 40px;
    margin-right: 10px;
}

.nav {
    display: flex;
    align-items: center;
    gap: 30px;
}

.nav-link {
    color: var(--text-primary);
    font-weight: 500;
    padding: 8px 0;
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: var(--transition);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* ============ 按钮 ============ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 500;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

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

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

.btn-outline {
    background: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
}

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

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

.btn-sm {
    padding: 6px 16px;
    font-size: 13px;
}

.btn-lg {
    padding: 14px 32px;
    font-size: 16px;
}

/* ============ 卡片 ============ */
.card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
}

.card-body {
    padding: 20px;
}

.card-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-gray);
}

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

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
}

.form-label.required::after {
    content: '*';
    color: var(--danger-color);
    margin-left: 4px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    font-size: 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    transition: var(--transition);
    background: var(--bg-white);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(26, 86, 219, 0.1);
}

.form-control::placeholder {
    color: var(--text-light);
}

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

.form-select {
    width: 100%;
    padding: 10px 14px;
    font-size: 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-white);
    cursor: pointer;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-check input {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* ============ Banner轮播 ============ */
.banner {
    position: relative;
    height: 500px;
    overflow: hidden;
}

.banner-slides {
    display: flex;
    height: 100%;
    transition: transform 0.5s ease;
}

.banner-slide {
    min-width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.banner-slide::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(26, 86, 219, 0.9) 0%, rgba(14, 159, 110, 0.7) 100%);
}

.banner-content {
    position: relative;
    z-index: 1;
    text-align: center;
    color: white;
    max-width: 600px;
    padding: 0 20px;
}

.banner-title {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 20px;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.8s ease forwards;
}

.banner-subtitle {
    font-size: 20px;
    margin-bottom: 30px;
    opacity: 0.9;
}

.banner-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.8s ease 0.3s forwards;
}

.banner-dots {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 2;
}

.banner-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: var(--transition);
}

.banner-dot.active {
    background: white;
    width: 30px;
    border-radius: 6px;
}

/* ============ 统计区块 ============ */
.stats-section {
    background: var(--bg-white);
    padding: 60px 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
}

.stat-item {
    text-align: center;
    padding: 20px;
}

.stat-number {
    font-size: 48px;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1;
    margin-bottom: 10px;
}

.stat-label {
    font-size: 16px;
    color: var(--text-secondary);
}

/* ============ 课程卡片 ============ */
.course-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.course-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.course-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.course-cover {
    height: 180px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.course-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 12px;
    background: var(--accent-color);
    color: white;
    font-size: 12px;
    border-radius: 20px;
}

.course-badge.free {
    background: var(--secondary-color);
}

.course-info {
    padding: 16px;
}

.course-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.course-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-secondary);
}

.course-price {
    color: var(--danger-color);
    font-weight: 600;
}

.course-price.free {
    color: var(--secondary-color);
}

/* ============ 资料卡片 ============ */
.material-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.material-card {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.material-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.material-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 15px;
    background: var(--bg-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--primary-color);
}

.material-title {
    font-weight: 600;
    margin-bottom: 8px;
}

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

/* ============ 商家卡片 ============ */
.partner-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.partner-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 30px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.partner-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.partner-logo {
    width: 80px;
    height: 80px;
    margin: 0 auto 15px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--bg-light);
}

.partner-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.partner-name {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.partner-category {
    font-size: 12px;
    color: var(--primary-color);
    margin-bottom: 12px;
}

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

/* ============ 步骤条 ============ */
.steps {
    display: flex;
    justify-content: center;
    margin-bottom: 40px;
}

.step {
    display: flex;
    align-items: center;
}

.step-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-light);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.step.active .step-circle {
    background: var(--primary-color);
    color: white;
}

.step.completed .step-circle {
    background: var(--secondary-color);
    color: white;
}

.step-label {
    margin-left: 10px;
    font-weight: 500;
    color: var(--text-secondary);
}

.step.active .step-label,
.step.completed .step-label {
    color: var(--text-primary);
}

.step-line {
    width: 80px;
    height: 2px;
    background: var(--border-color);
    margin: 0 20px;
}

.step.completed + .step-line,
.step.completed ~ .step-line {
    background: var(--secondary-color);
}

/* ============ 表格 ============ */
.table-wrapper {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    background: var(--bg-gray);
    font-weight: 600;
    color: var(--text-primary);
}

.table tbody tr:hover {
    background: var(--bg-gray);
}

.table tbody tr:nth-child(even) {
    background: var(--bg-gray);
}

/* ============ 状态标签 ============ */
.badge {
    display: inline-block;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 20px;
}

.badge-primary { background: #dbeafe; color: var(--primary-color); }
.badge-success { background: #d1fae5; color: var(--secondary-color); }
.badge-warning { background: #fef3c7; color: var(--accent-color); }
.badge-danger { background: #fee2e2; color: var(--danger-color); }
.badge-gray { background: var(--bg-light); color: var(--text-secondary); }

/* ============ 分页 ============ */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 30px;
}

.pagination a,
.pagination span {
    padding: 8px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 14px;
    color: var(--text-primary);
    transition: var(--transition);
}

.pagination a:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.pagination .active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* ============ 页面标题 ============ */
.page-header {
    padding: 40px 0;
    text-align: center;
}

.page-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.page-subtitle {
    font-size: 16px;
    color: var(--text-secondary);
}

/* ============ 区块标题 ============ */
.section {
    padding: 80px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 50px;
}

.section-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 15px;
}

.section-subtitle {
    font-size: 16px;
    color: var(--text-secondary);
}

/* ============ 底部 ============ */
.footer {
    background: var(--text-primary);
    color: white;
    padding: 60px 0 30px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-brand h3 {
    font-size: 20px;
    margin-bottom: 15px;
}

.footer-brand p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    line-height: 1.8;
}

.footer-title {
    font-size: 16px;
    margin-bottom: 20px;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
}

.footer-links a:hover {
    color: white;
}

.footer-bottom {
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
}

/* ============ 动画 ============ */
@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeInUp 0.6s ease forwards;
}

/* ============ 响应式 ============ */
@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .course-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .partner-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .header-inner {
        flex-wrap: wrap;
    }
    
    .nav {
        order: 3;
        width: 100%;
        justify-content: center;
        gap: 20px;
        padding-top: 15px;
    }
    
    .stats-grid,
    .course-grid,
    .partner-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
    }
    
    .banner-title {
        font-size: 32px;
    }
    
    .banner-subtitle {
        font-size: 16px;
    }
}

/* ============ 辅助类 ============ */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-primary { color: var(--primary-color); }
.text-success { color: var(--secondary-color); }
.text-danger { color: var(--danger-color); }
.text-muted { color: var(--text-secondary); }

.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mt-3 { margin-top: 30px; }
.mt-4 { margin-top: 40px; }
.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.mb-3 { margin-bottom: 30px; }
.mb-4 { margin-bottom: 40px; }

.d-flex { display: flex; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }
.gap-1 { gap: 10px; }
.gap-2 { gap: 20px; }

.hidden { display: none; }
.visible { visibility: visible; }

/* ===== 列表页通用布局（课程/资料/商家） ===== */
.course-page { background: var(--bg-gray, #f5f7fa); padding-bottom: 40px; min-height: 100vh; }
.course-list-container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.filter-bar { background: #fff; padding: 20px; border-radius: 12px; margin: -30px auto 30px; max-width: 1200px; box-shadow: 0 6px 24px rgba(0,0,0,.08); position: relative; z-index: 2; }
.filter-tabs { display: flex; gap: 15px; flex-wrap: wrap; }
.filter-tab { padding: 10px 20px; border: 1px solid #e5e7eb; border-radius: 20px; cursor: pointer; transition: all .2s ease; color: #374151; text-decoration: none; display: inline-block; }
.filter-tab:hover, .filter-tab.active { background: var(--primary-color, #2563eb); color: #fff; border-color: var(--primary-color, #2563eb); text-decoration: none; }

/* 无封面图时的渐变占位 */
.course-cover { background: linear-gradient(135deg, #2563eb, #1d4ed8); background-size: cover; background-position: center; }
.detail-cover { background: linear-gradient(135deg, #2563eb, #1d4ed8); }

/* 图片缺失兜底 */
.partner-logo { position: relative; }
.partner-logo::before { content: '🏢'; font-size: 34px; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.partner-logo img { position: relative; z-index: 1; }
