/* ============================================
   极方优秀学员展示系统 - 主样式表
   style.css
   ============================================ */

/* ----- CSS 变量（设计令牌）----- */
:root {
    --primary: #1565C0;
    --primary-light: #1E88E5;
    --primary-dark: #0D47A1;
    --primary-bg: #E3F2FD;
    --accent: #FF6F00;
    --accent-light: #FFA000;
    --bg: #f5f7fa;
    --bg-white: #ffffff;
    --text: #333333;
    --text-light: #666666;
    --text-muted: #999999;
    --border: #e0e0e0;
    --border-light: #f0f0f0;
    --success: #2e7d32;
    --success-bg: #e8f5e9;
    --warning: #f57f17;
    --warning-bg: #fff8e1;
    --danger: #c62828;
    --danger-bg: #ffebee;
    --info: #0277bd;
    --info-bg: #e1f5fe;
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.12);
    --shadow-hover: 0 12px 40px rgba(0, 0, 0, 0.15);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-xs: 4px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font: 'Microsoft YaHei', 'PingFang SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ----- 基础重置 ----- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

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

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

ul, ol { list-style: none; }

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

/* ----- 导航栏 ----- */
.navbar {
    background: var(--bg-white);
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.06);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 0 20px;
}

.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.navbar-brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.navbar-brand span {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

.navbar-nav a {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    color: var(--text-light);
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
}

.navbar-nav a:hover {
    color: var(--primary);
    background: var(--primary-bg);
}

.navbar-nav a.active {
    color: var(--primary);
    background: var(--primary-bg);
}

/* 移动端菜单按钮 */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text);
    padding: 8px;
}

/* ----- Hero 区域 ----- */
.hero {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
    color: #fff;
    padding: 80px 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 50%, rgba(255,255,255,0.08) 0%, transparent 50%);
    animation: heroFloat 20s ease-in-out infinite;
}

@keyframes heroFloat {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(30px, -30px); }
}

.hero h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 16px;
    position: relative;
    z-index: 1;
}

.hero p {
    font-size: 1.15rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* ----- 筛选栏 ----- */
.filter-bar {
    background: var(--bg-white);
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin: -30px auto 30px;
    position: relative;
    z-index: 10;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-bar .search-input {
    flex: 1;
    min-width: 200px;
}

.filter-bar select {
    min-width: 150px;
}

/* ----- 表单元素 ----- */
input[type="text"],
input[type="password"],
input[type="number"],
input[type="search"],
input[type="email"],
textarea,
select {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-family: var(--font);
    color: var(--text);
    background: var(--bg-white);
    transition: var(--transition);
    outline: none;
}

input:focus, textarea:focus, select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(21, 101, 192, 0.1);
}

input::placeholder, textarea::placeholder {
    color: var(--text-muted);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}

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

.form-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ----- 按钮 ----- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 22px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    line-height: 1.4;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff;
    box-shadow: 0 4px 15px rgba(21, 101, 192, 0.3);
}
.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(21, 101, 192, 0.4);
    color: #fff;
}

.btn-success {
    background: linear-gradient(135deg, var(--success), #43a047);
    color: #fff;
    box-shadow: 0 4px 15px rgba(46, 125, 50, 0.3);
}
.btn-success:hover { color: #fff; }

.btn-danger {
    background: linear-gradient(135deg, var(--danger), #e53935);
    color: #fff;
    box-shadow: 0 4px 15px rgba(198, 40, 40, 0.3);
}
.btn-danger:hover { color: #fff; }

.btn-warning {
    background: linear-gradient(135deg, var(--warning), var(--accent-light));
    color: #fff;
    box-shadow: 0 4px 15px rgba(245, 127, 23, 0.3);
}
.btn-warning:hover { color: #fff; }

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--border);
    color: var(--text-light);
}
.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-bg);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.8rem;
}

.btn-block {
    width: 100%;
}

.btn-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ----- 卡片网格 ----- */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    padding: 10px 0;
}

/* ----- 学员卡片 ----- */
.card {
    background: var(--bg-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: var(--transition);
    animation: fadeInUp 0.5s ease-out both;
}

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

.card-image {
    width: 100%;
    height: 240px;
    overflow: hidden;
    position: relative;
    background: var(--primary-bg);
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.card:hover .card-image img {
    transform: scale(1.05);
}

.card-body {
    padding: 20px;
}

.card-name {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}

.card-message {
    font-size: 0.9rem;
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: 14px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-style: italic;
    border-left: 3px solid var(--primary-bg);
    padding-left: 12px;
}

.card-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--text-light);
}

.card-info-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.card-info-item .info-label {
    color: var(--text-muted);
    min-width: 65px;
}

.card-info-item .info-value {
    color: var(--text);
    font-weight: 500;
}

.card-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--border-light);
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* 卡片动画 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card:nth-child(1) { animation-delay: 0.05s; }
.card:nth-child(2) { animation-delay: 0.1s; }
.card:nth-child(3) { animation-delay: 0.15s; }
.card:nth-child(4) { animation-delay: 0.2s; }
.card:nth-child(5) { animation-delay: 0.25s; }
.card:nth-child(6) { animation-delay: 0.3s; }
.card:nth-child(7) { animation-delay: 0.35s; }
.card:nth-child(8) { animation-delay: 0.4s; }
.card:nth-child(9) { animation-delay: 0.45s; }
.card:nth-child(10) { animation-delay: 0.5s; }
.card:nth-child(11) { animation-delay: 0.55s; }
.card:nth-child(12) { animation-delay: 0.6s; }

/* ----- 分页 ----- */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin: 40px 0;
    flex-wrap: wrap;
}

.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 12px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-light);
    background: var(--bg-white);
    border: 1px solid var(--border);
    transition: var(--transition);
    cursor: pointer;
}

.page-link:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: var(--primary-bg);
}

.page-link.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(21, 101, 192, 0.3);
}

.page-link.disabled {
    color: var(--text-muted);
    cursor: not-allowed;
    opacity: 0.5;
}

.page-dots {
    color: var(--text-muted);
    padding: 0 4px;
}

/* ----- 提示消息 ----- */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.alert-success { background: var(--success-bg); color: var(--success); border-left: 4px solid var(--success); }
.alert-error { background: var(--danger-bg); color: var(--danger); border-left: 4px solid var(--danger); }
.alert-warning { background: var(--warning-bg); color: var(--warning); border-left: 4px solid var(--warning); }
.alert-info { background: var(--info-bg); color: var(--info); border-left: 4px solid var(--info); }

.alert-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0.6;
    color: inherit;
    padding: 0 4px;
}
.alert-close:hover { opacity: 1; }

/* ----- 徽章 ----- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.4;
}

.badge-pending { background: var(--warning-bg); color: var(--warning); }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-gray { background: #f5f5f5; color: var(--text-muted); }

/* ----- 登录页面 ----- */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    padding: 20px;
}

.login-card {
    background: var(--bg-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 40px;
    width: 100%;
    max-width: 420px;
    animation: fadeInUp 0.5s ease-out;
}

.login-card h2 {
    text-align: center;
    color: var(--primary);
    margin-bottom: 8px;
    font-size: 1.5rem;
}

.login-card .subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 30px;
    font-size: 0.9rem;
}

.login-card .login-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ----- 学生提交页 ----- */
.dashboard-header {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-light);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.dashboard-header .user-info {
    font-size: 0.9rem;
    color: var(--text-light);
}

.dashboard-header .user-info strong {
    color: var(--primary);
}

.dashboard-content {
    max-width: 800px;
    margin: 30px auto;
    padding: 0 20px;
}

.dashboard-card {
    background: var(--bg-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 30px;
    margin-bottom: 24px;
}

.dashboard-card h3 {
    font-size: 1.15rem;
    color: var(--text);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--primary-bg);
}

/* 上传区域 */
.upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: var(--bg);
    position: relative;
}

.upload-area:hover,
.upload-area.drag-over {
    border-color: var(--primary);
    background: var(--primary-bg);
}

.upload-area .upload-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
    color: var(--text-muted);
}

.upload-area p {
    color: var(--text-light);
    font-size: 0.9rem;
}

.upload-area .upload-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 8px;
}

.upload-preview {
    max-width: 200px;
    border-radius: var(--radius-sm);
    margin-top: 12px;
    display: inline-block;
}

/* 进度条 */
.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--border-light);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 12px;
    display: none;
}

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

/* ----- 空状态 ----- */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state .empty-icon {
    font-size: 4rem;
    margin-bottom: 16px;
    opacity: 0.4;
}

.empty-state h3 {
    font-size: 1.2rem;
    color: var(--text-light);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 0.9rem;
}

/* ----- 页脚 ----- */
.footer {
    background: var(--bg-white);
    border-top: 1px solid var(--border-light);
    padding: 30px 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 60px;
}

.footer a { color: var(--primary); }

/* ----- 状态提示区 ----- */
.status-card {
    padding: 16px 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.status-card.status-pending {
    background: var(--warning-bg);
    border: 1px solid #ffe082;
}

.status-card.status-approved {
    background: var(--success-bg);
    border: 1px solid #a5d6a7;
}

.status-card.status-rejected {
    background: var(--danger-bg);
    border: 1px solid #ef9a9a;
}

/* ----- 图片骨架屏 ----- */
.img-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ----- 响应式布局 ----- */
@media (max-width: 768px) {
    .hero { padding: 50px 16px; }
    .hero h1 { font-size: 1.75rem; }
    .hero p { font-size: 1rem; }

    .filter-bar {
        flex-direction: column;
        margin: -20px 12px 20px;
    }

    .filter-bar select { min-width: 100%; }

    .card-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .card-image { height: 200px; }

    .navbar .container { padding: 0 12px; }

    .navbar-nav {
        display: none;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: var(--bg-white);
        box-shadow: var(--shadow);
        flex-direction: column;
        padding: 12px;
        gap: 4px;
    }

    .navbar-nav.active { display: flex; }

    .navbar-nav a {
        width: 100%;
        padding: 12px 16px;
    }

    .menu-toggle { display: block; }

    .login-card { padding: 30px 24px; }

    .dashboard-card { padding: 20px; }

    .dashboard-header {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }

    .pagination { gap: 4px; }
    .page-link { min-width: 34px; height: 34px; font-size: 0.8rem; }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .card-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1025px) {
    .card-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ----- 辅助类 ----- */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }

/* 图片懒加载占位 */
img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.4s ease;
}
img[loading="lazy"].loaded,
img.loaded {
    opacity: 1;
}

/* 两栏表单布局 */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 600px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* 字数统计 */
.char-counter {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: right;
    margin-top: 4px;
}

.char-counter.over-limit {
    color: var(--danger);
}
