/* ===== CSS Reset & Base Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #4F46E5;
    --primary-light: #6366F1;
    --primary-dark: #4338CA;
    --success-color: #10B981;
    --danger-color: #EF4444;
    --warning-color: #F59E0B;
    --info-color: #06B6D4;
    
    --bg-color: #F3F4F6;
    --surface-color: #FFFFFF;
    --text-primary: #1F2937;
    --text-secondary: #6B7280;
    --text-light: #9CA3AF;
    
    --border-color: #E5E7EB;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    
    --gold-color: #FFD700;
    --silver-color: #C0C0C0;
    --bronze-color: #CD7F32;
    
    --nav-height: 60px;
    --header-height: 56px;
    --transition: all 0.3s ease;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    padding-bottom: calc(var(--nav-height) + 20px);
}

/* ===== Header ===== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 100;
    box-shadow: var(--shadow-md);
}

.header h1 {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.header-date {
    font-size: 12px;
    opacity: 0.9;
}

/* ===== Main Content ===== */
.main-content {
    padding-top: calc(var(--header-height) + 16px);
    padding-bottom: 20px;
    min-height: calc(100vh - var(--nav-height));
}

.page {
    display: none;
    padding: 0 16px;
    animation: fadeIn 0.3s ease;
}

.page.active {
    display: block;
}

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

.page-header {
    text-align: center;
    margin-bottom: 20px;
}

.page-header h2 {
    font-size: 24px;
    color: var(--text-primary);
    margin-bottom: 4px;
}

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

/* ===== Stats Bar ===== */
.stats-bar {
    display: flex;
    justify-content: space-around;
    background: var(--surface-color);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}

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

.stat-number {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
}

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

/* ===== Podium Section (Top 3) ===== */
.podium-section {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 16px;
    margin-bottom: 24px;
    padding: 20px 0;
}

.podium-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: var(--transition);
}

.podium-item:hover {
    transform: translateY(-4px);
}

.podium-rank {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    padding: 4px 12px;
    border-radius: 20px;
    color: white;
}

.rank-1 .podium-rank {
    background: linear-gradient(135deg, var(--gold-color), #FFA500);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
}

.rank-2 .podium-rank {
    background: linear-gradient(135deg, var(--silver-color), #A0A0A0);
    box-shadow: 0 4px 15px rgba(192, 192, 192, 0.4);
}

.rank-3 .podium-rank {
    background: linear-gradient(135deg, var(--bronze-color), #8B4513);
    box-shadow: 0 4px 15px rgba(205, 127, 50, 0.4);
}

.podium-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    color: white;
    margin-bottom: 8px;
    border: 3px solid white;
    box-shadow: var(--shadow-md);
}

.rank-1 .podium-avatar {
    background: linear-gradient(135deg, var(--gold-color), #FFA500);
    width: 80px;
    height: 80px;
    font-size: 32px;
}

.rank-2 .podium-avatar {
    background: linear-gradient(135deg, var(--silver-color), #A0A0A0);
    width: 70px;
    height: 70px;
    font-size: 28px;
}

.rank-3 .podium-avatar {
    background: linear-gradient(135deg, var(--bronze-color), #8B4513);
    width: 65px;
    height: 65px;
    font-size: 26px;
}

.podium-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    text-align: center;
}

.podium-score {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary-color);
}

/* ===== Leaderboard List ===== */
.leaderboard-list {
    background: var(--surface-color);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.leaderboard-item {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

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

.leaderboard-item:hover {
    background-color: #F9FAFB;
}

.leaderboard-item.top-three {
    background: linear-gradient(90deg, rgba(79, 70, 229, 0.05), transparent);
}

.rank-badge {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    margin-right: 12px;
    background-color: var(--bg-color);
    color: var(--text-secondary);
}

.rank-badge.gold {
    background: linear-gradient(135deg, var(--gold-color), #FFA500);
    color: white;
}

.rank-badge.silver {
    background: linear-gradient(135deg, var(--silver-color), #A0A0A0);
    color: white;
}

.rank-badge.bronze {
    background: linear-gradient(135deg, var(--bronze-color), #8B4513);
    color: white;
}

.student-avatar-small {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin-right: 12px;
}

.student-info {
    flex: 1;
}

.student-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.student-id {
    font-size: 12px;
    color: var(--text-light);
}

.student-score {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-color);
}

.student-score.positive {
    color: var(--success-color);
}

.student-score.negative {
    color: var(--danger-color);
}

/* ===== Search Box ===== */
.search-box {
    background: var(--surface-color);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
}

.input-group {
    margin-bottom: 16px;
}

.input-group:last-child {
    margin-bottom: 0;
}

.input-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.input-group input,
.input-group textarea,
.input-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 15px;
    transition: var(--transition);
    background: var(--surface-color);
}

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

.input-group textarea {
    min-height: 120px;
    resize: vertical;
    font-family: inherit;
}

.input-hint {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 6px;
}

.search-tips {
    background: #FEF3C7;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 20px;
}

.search-tips p {
    font-size: 13px;
    color: #92400E;
}

/* ===== Student Detail ===== */
.student-detail {
    background: var(--surface-color);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.detail-header {
    display: flex;
    align-items: center;
    padding: 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
}

.detail-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    margin-right: 16px;
}

.detail-info {
    flex: 1;
}

.detail-info h3 {
    font-size: 18px;
    margin-bottom: 4px;
}

.detail-info .student-id {
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
}

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

.score-value {
    display: block;
    font-size: 32px;
    font-weight: 700;
}

.score-label {
    font-size: 12px;
    opacity: 0.8;
}

/* 特殊标记显示 */
.flag-display {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    font-size: 13px;
}

.flag-icon {
    font-size: 16px;
}

.flag-text {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===== History Section ===== */
.history-section {
    padding: 20px;
}

.history-section h4 {
    font-size: 15px;
    color: var(--text-primary);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.history-item {
    display: flex;
    align-items: flex-start;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

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

.history-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    font-size: 16px;
}

.history-icon.positive {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.history-icon.negative {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

.history-content {
    flex: 1;
}

.history-reason {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.history-date {
    font-size: 12px;
    color: var(--text-light);
}

.history-delta {
    font-size: 16px;
    font-weight: 700;
}

.history-delta.positive {
    color: var(--success-color);
}

.history-delta.negative {
    color: var(--danger-color);
}

/* ===== Admin Card ===== */
.admin-card {
    background: var(--surface-color);
    border-radius: 12px;
    margin-bottom: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.admin-card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    padding: 16px 20px;
    background: linear-gradient(135deg, #F9FAFB, #F3F4F6);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-header h3 {
    font-size: 16px;
    color: var(--text-primary);
    margin: 0;
}

.card-header .card-icon {
    font-size: 20px;
}

.card-body {
    padding: 20px;
}

.button-group {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.button-group .btn {
    flex: 1;
}

.score-input-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.score-input-wrapper input {
    text-align: center;
    font-size: 20px;
    font-weight: 700;
}

.btn-minus,
.btn-plus {
    width: 50px;
    height: 44px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--surface-color);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

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

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

.import-preview {
    background: #F3F4F6;
    border-radius: 8px;
    padding: 12px;
    margin-top: 12px;
}

.import-preview p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.preview-list {
    max-height: 100px;
    overflow-y: auto;
    font-size: 12px;
    color: var(--text-primary);
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

/* ===== Buttons ===== */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

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

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

.btn-secondary {
    background: var(--bg-color);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

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

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

.btn-success:hover {
    background: #059669;
    transform: translateY(-1px);
}

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

.btn-danger:hover {
    background: #DC2626;
    transform: translateY(-1px);
}

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

.btn-info:hover {
    background: #0891B2;
    transform: translateY(-1px);
}

.btn-outline {
    background: var(--surface-color);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    padding: 10px 16px;
    font-size: 13px;
}

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

.btn-block {
    width: 100%;
}

/* ===== Loading & Empty States ===== */
.loading,
.empty-state,
.not-found {
    text-align: center;
    padding: 40px 20px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

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

.loading p,
.empty-state p,
.not-found p {
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.small {
    font-size: 12px;
    color: var(--text-light) !important;
}

/* ===== Toast ===== */
.toast {
    position: fixed;
    bottom: calc(var(--nav-height) + 20px);
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 1000;
    opacity: 0;
    transition: all 0.3s ease;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

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

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

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

/* ===== Bottom Navigation ===== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: var(--surface-color);
    display: flex;
    border-top: 1px solid var(--border-color);
    z-index: 100;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-light);
}

.nav-item:hover {
    background: #F9FAFB;
}

.nav-item.active {
    color: var(--primary-color);
}

.nav-item.active .nav-icon {
    transform: scale(1.1);
}

.nav-icon {
    font-size: 22px;
    margin-bottom: 2px;
    transition: var(--transition);
}

.nav-label {
    font-size: 11px;
    font-weight: 500;
}

/* ===== Responsive ===== */
@media (max-width: 360px) {
    .header h1 {
        font-size: 16px;
    }
    
    .podium-avatar {
        width: 50px !important;
        height: 50px !important;
        font-size: 20px !important;
    }
    
    .podium-name {
        font-size: 12px;
    }
    
    .podium-score {
        font-size: 14px;
    }
    
    .quick-actions {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 768px) {
    .main-content {
        max-width: 600px;
        margin: 0 auto;
    }
    
    .header {
        max-width: 600px;
        left: 50%;
        transform: translateX(-50%);
        border-radius: 0 0 12px 12px;
    }
    
    .bottom-nav {
        max-width: 600px;
        left: 50%;
        transform: translateX(-50%);
        border-radius: 12px 12px 0 0;
    }
}

/* ===== 滚动排行榜样式 ===== */
.scrollable-leaderboard {
    background: var(--surface-color);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    max-height: 45vh;
    display: flex;
    flex-direction: column;
}

.scroll-header {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: var(--primary-color);
    color: white;
    font-weight: 600;
    font-size: 13px;
    flex-shrink: 0;
}

.scroll-header .col-rank {
    width: 50px;
    text-align: center;
}

.scroll-header .col-name {
    flex: 1;
    padding: 0 12px;
}

.scroll-header .col-score {
    width: 60px;
    text-align: center;
}

.scroll-list {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

/* 自定义滚动条样式 */
.scroll-list::-webkit-scrollbar {
    width: 6px;
}

.scroll-list::-webkit-scrollbar-track {
    background: var(--bg-color);
}

.scroll-list::-webkit-scrollbar-thumb {
    background: var(--primary-light);
    border-radius: 3px;
}

.scroll-list::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

.scroll-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

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

.scroll-item:hover {
    background-color: #F9FAFB;
}

.scroll-item.top-three {
    background: linear-gradient(90deg, rgba(79, 70, 229, 0.05), transparent);
}

.scroll-item .col-rank {
    width: 50px;
    text-align: center;
    font-weight: 600;
    font-size: 14px;
}

.scroll-item .col-name {
    flex: 1;
    padding: 0 12px;
}

.scroll-item .student-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.scroll-item .student-id {
    font-size: 11px;
    color: var(--text-light);
}

.scroll-item .col-score {
    width: 60px;
    text-align: center;
    font-weight: 700;
    font-size: 16px;
    color: var(--primary-color);
}

.scroll-item.top-three .col-rank {
    color: var(--gold-color);
}

.scroll-item.rank-1 .col-rank { color: var(--gold-color); }
.scroll-item.rank-2 .col-rank { color: var(--silver-color); }
.scroll-item.rank-3 .col-rank { color: var(--bronze-color); }

/* 标记徽章 */
.flag-badge {
    font-size: 14px;
    cursor: help;
}

/* ===== 管理员登录页面样式 ===== */
.login-card {
    background: var(--surface-color);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

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

.login-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--danger-color);
    border-radius: 8px;
    padding: 12px;
    margin-top: 16px;
    text-align: center;
}

.login-error p {
    color: var(--danger-color);
    font-size: 13px;
    margin: 0;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
    color: white;
}

.admin-header span {
    font-size: 14px;
    color: white;
}

.admin-header .btn-outline {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    color: white;
    padding: 8px 16px;
}

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

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

/* ===== 文件上传样式 ===== */
.file-upload {
    display: flex;
    align-items: center;
    gap: 12px;
}

.file-upload input[type="file"] {
    display: none;
}

.file-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: var(--bg-color);
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
}

.file-label:hover {
    border-color: var(--primary-color);
    background: rgba(79, 70, 229, 0.05);
}

.file-icon {
    font-size: 18px;
}

.file-text {
    font-size: 14px;
    color: var(--text-secondary);
}

.file-name {
    font-size: 13px;
    color: var(--success-color);
    font-weight: 500;
}

.export-hint {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

/* ===== xlsx预览样式 ===== */
.import-preview {
    background: #F3F4F6;
    border-radius: 8px;
    padding: 12px;
    margin-top: 12px;
}

.import-preview p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.preview-list {
    max-height: 120px;
    overflow-y: auto;
    font-size: 12px;
    color: var(--text-primary);
}

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

.preview-list th,
.preview-list td {
    padding: 6px 8px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.preview-list th {
    background: var(--surface-color);
    font-weight: 600;
}

/* ===== 删除学生功能样式 ===== */
.danger-zone {
    border: 2px solid var(--danger-color);
    background: linear-gradient(135deg, #FEF2F2, #FFF5F5);
}

.danger-zone .card-header {
    background: linear-gradient(135deg, #FEE2E2, #FECACA);
    border-bottom-color: var(--danger-color);
}

.danger-zone .card-header h3 {
    color: var(--danger-color);
}

.danger-zone .card-icon {
    filter: hue-rotate(140deg);
}

.delete-warning {
    background: rgba(239, 68, 68, 0.1);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 16px;
    font-size: 13px;
    color: var(--danger-color);
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.delete-warning .warning-icon {
    font-size: 16px;
    flex-shrink: 0;
}

/* ===== 特殊标记功能样式 ===== */
.flag-section {
    background: linear-gradient(135deg, #EFF6FF, #DBEAFE);
    border: 1px solid #93C5FD;
}

.flag-section .card-header {
    background: linear-gradient(135deg, #DBEAFE, #BFDBFE);
    border-bottom-color: #93C5FD;
}

.flag-section .card-icon {
    filter: hue-rotate(180deg);
}

.flag-list {
    margin-top: 16px;
}

.flag-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: var(--surface-color);
    border-radius: 8px;
    margin-bottom: 8px;
    border: 1px solid var(--border-color);
}

.flag-list-item:last-child {
    margin-bottom: 0;
}

.flag-list-info {
    flex: 1;
}

.flag-list-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.flag-list-id {
    font-size: 12px;
    color: var(--text-light);
    margin-bottom: 4px;
}

.flag-list-remark {
    font-size: 13px;
    color: var(--info-color);
    background: rgba(6, 182, 212, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-block;
}

.flag-list-item .btn-outline {
    border-color: var(--info-color);
    color: var(--info-color);
}

.flag-list-item .btn-outline:hover {
    background: var(--info-color);
    color: white;
}

.flag-empty {
    text-align: center;
    padding: 20px;
    color: var(--text-light);
    font-size: 14px;
}

/* ===== Section Divider ===== */
.section-divider {
    height: 1px;
    background: var(--border-color);
    margin: 24px 0;
    position: relative;
}

.section-divider::after {
    content: attr(data-label);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg-color);
    padding: 0 12px;
    font-size: 12px;
    color: var(--text-light);
}

/* ===== Card Description ===== */
.card-description {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.5;
}

/* ===== Two Column Layout ===== */
.two-column {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* ===== Status Badge ===== */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge.success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.status-badge.warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

.status-badge.danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

/* ===== Animation ===== */
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.pulse {
    animation: pulse 2s infinite;
}

/* ===== Focus States ===== */
.btn:focus,
input:focus,
select:focus,
textarea:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

/* ===== Disabled States ===== */
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===== Modal Styles ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--surface-color);
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    transform: scale(0.9);
    transition: var(--transition);
}

.modal-overlay.active .modal {
    transform: scale(1);
}

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

.modal-header h3 {
    font-size: 16px;
    color: var(--text-primary);
}

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

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}
