/* ============================================
   COP 项目后台管理系统 - 样式表
   ============================================ */

:root {
    --primary: #0d9488;
    --primary-dark: #0f766e;
    --primary-light: #f0fdfa;
    --accent: #ea580c;
    --accent-light: #fff7ed;
    --danger: #e74c3c;
    --warning: #f59e0b;
    --success: #22c55e;
    --info: #3b82f6;
    --text: #1a1a1a;
    --text-light: #555;
    --text-muted: #888;
    --bg: #f8faf8;
    --bg-white: #ffffff;
    --border: #e2e8e0;
    --border-light: #f0f2ed;
    --shadow: 0 2px 12px rgba(0,0,0,0.06);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.06);
    --radius: 10px;
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    --sidebar-width: 240px;
}

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

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

/* ============ 登录页 ============ */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #0f766e 0%, #0d9488 50%, #2dd4bf 100%);
    padding: 20px;
}

.login-container {
    background: white;
    border-radius: 16px;
    padding: 48px 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}

.login-header {
    text-align: center;
    margin-bottom: 36px;
}

.login-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 6px;
}

.login-header p {
    font-size: 14px;
    color: var(--text-muted);
}

.login-form .form-group {
    margin-bottom: 18px;
}

.login-form label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}

.login-form input {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: var(--font-sans);
    transition: border-color 0.2s;
}

.login-form input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(13,148,136,0.1);
}

.login-error {
    font-size: 13px;
    color: var(--danger);
    margin-bottom: 16px;
    display: none;
}

.login-error.show {
    display: block;
}

.btn-login {
    width: 100%;
    padding: 12px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    font-family: var(--font-sans);
}

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

.login-hint {
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 20px;
}

/* ============ 侧边栏 ============ */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: white;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform 0.3s;
}

.sidebar.collapsed {
    transform: translateX(-100%);
}

.sidebar-header {
    padding: 20px 20px 16px;
    border-bottom: 1px solid var(--border-light);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text);
    font-weight: 700;
    font-size: 16px;
}

.sidebar-logo-img {
    width: 32px;
    height: 32px;
    border-radius: 6px;
}

.sidebar-subtitle {
    font-size: 11px;
    color: var(--text-muted);
    display: block;
    margin-top: 4px;
    padding-left: 42px;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.nav-section {
    margin-bottom: 16px;
}

.nav-section-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 8px 12px 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text-light);
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.nav-item:hover {
    background: var(--primary-light);
    color: var(--primary-dark);
}

.nav-item.active {
    background: var(--primary-light);
    color: var(--primary-dark);
    font-weight: 600;
}

.nav-icon {
    font-size: 16px;
    width: 22px;
    text-align: center;
}

.nav-badge {
    margin-left: auto;
    background: var(--danger);
    color: white;
    font-size: 11px;
    padding: 2px 7px;
    border-radius: 10px;
    font-weight: 600;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-footer a {
    font-size: 13px;
    color: var(--text-muted);
    text-decoration: none;
    cursor: pointer;
    transition: color 0.2s;
}

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

/* ============ 主内容区 ============ */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: margin-left 0.3s;
}

.main-content.expanded {
    margin-left: 0;
}

/* ============ 顶部栏 ============ */
.topbar {
    background: white;
    padding: 14px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.menu-collapse {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-light);
    padding: 4px;
    line-height: 1;
}

.breadcrumb-admin {
    font-size: 13px;
    color: var(--text-muted);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    font-family: var(--font-sans);
    border: 1.5px solid transparent;
}

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

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

.btn-outline {
    background: transparent;
    border-color: var(--border);
    color: var(--text-light);
}

.btn-outline:hover {
    background: var(--bg);
}

.btn-sm {
    padding: 5px 12px;
    font-size: 12px;
}

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

.btn-danger:hover {
    background: #c0392b;
}

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

.admin-user {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-light);
}

.admin-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
}

/* ============ 页面区域 ============ */
.page-section {
    display: none;
    padding: 28px;
}

.page-section.active {
    display: block;
}

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.page-header h1 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 4px;
}

.page-header p {
    font-size: 13px;
    color: var(--text-muted);
}

/* ============ 统计卡片 ============ */
.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.stat-card {
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    border: 1px solid var(--border-light);
    cursor: pointer;
    transition: all 0.2s;
}

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

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.stat-info h3 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
}

.stat-info p {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.stat-info .stat-meta {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
    display: flex;
    gap: 8px;
}

.stat-card-warning {
    border-left: 3px solid var(--warning);
}

.stat-card-brand {
    border-left: 3px solid var(--primary);
}

/* ============ 卡片 ============ */
.card {
    background: white;
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
    margin-bottom: 20px;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
}

.card-header h3 {
    font-size: 15px;
    font-weight: 600;
}

.card-body {
    padding: 20px;
}

.card-body.no-padding {
    padding: 0;
}

/* ============ 搜索栏 ============ */
.search-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.search-bar input,
.search-bar select {
    padding: 8px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-family: var(--font-sans);
    color: var(--text);
    background: white;
    min-width: 160px;
}

.search-bar input:focus,
.search-bar select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(13,148,136,0.1);
}

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

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

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

th, td {
    padding: 11px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
    font-size: 13px;
}

th {
    font-weight: 600;
    color: var(--text-light);
    background: var(--bg);
    white-space: nowrap;
}

td {
    color: var(--text);
}

.text-center {
    text-align: center;
}

.text-muted {
    color: var(--text-muted);
}

/* ============ 状态标签 ============ */
.status-tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.status-pending {
    background: #fef3c7;
    color: #d97706;
}

.status-approved {
    background: #d1fae5;
    color: #059669;
}

.status-rejected {
    background: #fee2e2;
    color: #dc2626;
}

.status-registered {
    background: #dbeafe;
    color: #2563eb;
}

.status-attended {
    background: #ede9fe;
    color: #7c3aed;
}

.status-graduated {
    background: #fce7f3;
    color: #be185d;
}

/* ============ 分页 ============ */
.pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 16px;
}

.pagination button {
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: white;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font-sans);
}

.pagination button:hover {
    background: var(--primary-light);
    border-color: var(--primary);
}

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

/* ============ 模态框 ============ */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 200;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.show {
    display: flex;
}

.modal {
    background: white;
    border-radius: var(--radius-md);
    width: 100%;
    max-width: 620px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-light);
}

.modal-header h3 {
    font-size: 16px;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px;
    line-height: 1;
}

.modal-body {
    padding: 24px;
}

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

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}

.required {
    color: var(--danger);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-family: var(--font-sans);
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(13,148,136,0.1);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

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

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
}

/* ============ Toast ============ */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 300;
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    color: white;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.success {
    background: var(--success);
}

.toast.error {
    background: var(--danger);
}

.toast.info {
    background: var(--info);
}

/* ============ 工作台快捷操作 ============ */
.shortcuts-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 12px;
}

.shortcuts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}

.shortcut-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 16px;
    background: white;
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    position: relative;
}

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

.shortcut-icon {
    font-size: 24px;
}

.shortcut-label {
    font-size: 12px;
    color: var(--text);
    font-weight: 500;
}

.shortcut-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--danger);
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 8px;
    font-weight: 600;
}

/* ============ 响应式 ============ */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.mobile-open {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
    }
    .stats-row {
        grid-template-columns: repeat(2, 1fr);
    }
    .form-row {
        grid-template-columns: 1fr;
    }
    .search-bar {
        flex-direction: column;
    }
}

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