/**
 * 骏骏爱编程通行证系统 - 全局样式
 */

/* 基础重置与变量 */
:root {
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --primary-light: #818cf8;
    --secondary: #06b6d4;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    --dark: #1f2937;
    --gray: #6b7280;
    --gray-light: #f3f4f6;
    --gray-medium: #d1d5db;
    --white: #ffffff;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --radius: 8px;
    --radius-lg: 12px;
    --transition: all 0.3s ease;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: var(--gray-light);
    color: var(--dark);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

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

/* 页头 */
.site-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    box-shadow: var(--shadow-lg);
    position: sticky;
    top: 0;
    z-index: 1000;
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--white);
    font-size: 20px;
    font-weight: bold;
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.2);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.main-nav {
    display: flex;
    gap: 5px;
}

.main-nav a {
    color: rgba(255,255,255,0.9);
    padding: 8px 16px;
    border-radius: var(--radius);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.main-nav a:hover,
.main-nav a.active {
    background: rgba(255,255,255,0.15);
    color: var(--white);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-points {
    background: rgba(255,255,255,0.15);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.user-points .points-value {
    font-weight: bold;
    color: #fbbf24;
}

/* 页尾 */
.site-footer {
    background: var(--dark);
    color: rgba(255,255,255,0.6);
    padding: 30px 20px;
    margin-top: auto;
    text-align: center;
    font-size: 13px;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-links {
    margin-bottom: 15px;
    display: flex;
    justify-content: center;
    gap: 20px;
}

.footer-links a {
    color: rgba(255,255,255,0.6);
}

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

/* 主内容区 */
.main-content {
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 30px 20px;
}

/* 卡片 */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 20px;
}

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

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-body {
    padding: 24px;
}

/* 按钮 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    color: var(--white);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

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

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

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

.btn-danger:hover {
    background: #dc2626;
    color: var(--white);
}

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

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

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

.btn-secondary:hover {
    background: var(--gray-medium);
}

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

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

.btn-block {
    width: 100%;
}

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

.form-label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--dark);
}

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

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

.form-control::placeholder {
    color: #9ca3af;
}

.input-group {
    display: flex;
    gap: 10px;
}

.input-group .form-control {
    flex: 1;
}

/* 提示消息 */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

/* 登录/注册页 */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 64px - 120px);
    padding: 40px 20px;
}

.auth-box {
    width: 100%;
    max-width: 420px;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.auth-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    padding: 30px;
    text-align: center;
}

.auth-header h2 {
    font-size: 22px;
    margin-bottom: 5px;
}

.auth-header p {
    opacity: 0.8;
    font-size: 13px;
}

.auth-body {
    padding: 30px;
}

.auth-footer {
    text-align: center;
    padding: 20px;
    border-top: 1px solid var(--gray-light);
    font-size: 13px;
    color: var(--gray);
}

/* 统计卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 16px;
}

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

.stat-icon.blue { background: #dbeafe; color: var(--info); }
.stat-icon.green { background: #d1fae5; color: var(--success); }
.stat-icon.orange { background: #fef3c7; color: #d97706; }
.stat-icon.purple { background: #ede9fe; color: #7c3aed; }
.stat-icon.red { background: #fee2e2; color: var(--danger); }

.stat-info h3 {
    font-size: 28px;
    font-weight: 700;
    color: var(--dark);
    line-height: 1;
}

.stat-info p {
    font-size: 13px;
    color: var(--gray);
    margin-top: 4px;
}

/* 数据表格 */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--gray-light);
    font-size: 14px;
}

.data-table th {
    background: #f9fafb;
    font-weight: 600;
    color: var(--gray);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table tbody tr:hover {
    background: #f9fafb;
}

.data-table .actions {
    display: flex;
    gap: 5px;
}

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

.pagination a,
.pagination span {
    padding: 8px 14px;
    border-radius: var(--radius);
    font-size: 14px;
    min-width: 36px;
    text-align: center;
}

.pagination a {
    background: var(--white);
    border: 1px solid var(--gray-medium);
    color: var(--dark);
}

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

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

.pagination .disabled {
    opacity: 0.5;
    pointer-events: none;
}

/* 任务卡片 */
.task-list {
    display: grid;
    gap: 16px;
}

.task-item {
    background: var(--white);
    border: 1px solid var(--gray-light);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    transition: var(--transition);
}

.task-item:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow);
}

.task-info h4 {
    font-size: 16px;
    margin-bottom: 4px;
}

.task-info p {
    font-size: 13px;
    color: var(--gray);
}

.task-points {
    font-size: 18px;
    font-weight: bold;
    color: var(--warning);
    white-space: nowrap;
}

.task-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.task-status.completed {
    background: #d1fae5;
    color: #065f46;
}

.task-status.pending {
    background: #dbeafe;
    color: #1e40af;
}

/* 打卡区域 */
.checkin-section {
    text-align: center;
    padding: 40px;
}

.checkin-btn {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0 auto 20px;
}

.checkin-btn:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15);
}

.checkin-btn:disabled {
    background: var(--gray-medium);
    cursor: not-allowed;
    transform: none;
}

.checkin-btn .checkin-icon {
    font-size: 40px;
}

.checkin-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 30px;
}

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

.checkin-stat h4 {
    font-size: 32px;
    color: var(--primary);
}

.checkin-stat p {
    font-size: 13px;
    color: var(--gray);
    margin-top: 4px;
}

/* 积分记录 */
.points-log-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    border-bottom: 1px solid var(--gray-light);
}

.points-log-item:last-child {
    border-bottom: none;
}

.log-info h4 {
    font-size: 14px;
    margin-bottom: 2px;
}

.log-info p {
    font-size: 12px;
    color: var(--gray);
}

.log-points {
    font-size: 18px;
    font-weight: bold;
}

.log-points.positive {
    color: var(--success);
}

.log-points.negative {
    color: var(--danger);
}

/* 徽章 */
.badge {
    display: inline-flex;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.badge-success { background: #d1fae5; color: #065f46; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-info { background: #dbeafe; color: #1e40af; }
.badge-secondary { background: var(--gray-light); color: var(--gray); }

/* 两栏布局 */
.two-col {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 24px;
}

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sidebar-menu {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    color: var(--dark);
    font-size: 14px;
    border-left: 3px solid transparent;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    background: #f5f3ff;
    color: var(--primary);
    border-left-color: var(--primary);
}

/* 用户资料卡 */
.profile-card {
    text-align: center;
    padding: 30px 20px;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: bold;
    margin: 0 auto 12px;
}

.profile-name {
    font-size: 18px;
    font-weight: 600;
}

.profile-email {
    font-size: 13px;
    color: var(--gray);
    margin-top: 2px;
}

/* 管理员后台 */
.admin-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
}

.admin-sidebar {
    background: var(--dark);
    color: var(--white);
    padding: 20px 0;
    position: fixed;
    width: 260px;
    height: 100vh;
    overflow-y: auto;
}

.admin-logo {
    padding: 0 20px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: bold;
}

.admin-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    color: rgba(255,255,255,0.7);
    font-size: 14px;
    transition: var(--transition);
}

.admin-nav a:hover,
.admin-nav a.active {
    background: rgba(255,255,255,0.1);
    color: var(--white);
}

.admin-main {
    margin-left: 260px;
    background: var(--gray-light);
    min-height: 100vh;
}

.admin-header {
    background: var(--white);
    padding: 16px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
}

.admin-content {
    padding: 30px;
}

/* 响应式 */
@media (max-width: 768px) {
    .header-container {
        flex-wrap: wrap;
        height: auto;
        padding: 10px;
    }

    .main-nav {
        display: none;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .two-col {
        grid-template-columns: 1fr;
    }

    .admin-layout {
        grid-template-columns: 1fr;
    }

    .admin-sidebar {
        display: none;
    }

    .admin-main {
        margin-left: 0;
    }

    .checkin-stats {
        flex-direction: column;
        gap: 20px;
    }
}

/* 工具类 */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-gray { color: var(--gray); }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mr-1 { margin-right: 8px; }
.mr-2 { margin-right: 16px; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 16px; }
.w-full { width: 100%; }
.hidden { display: none; }
