/**
 * base.css - 基础样式和CSS变量
 * 包含: 重置样式、CSS变量、布局基础、登录页、侧边栏、按钮、表单
 */

/* 重置样式 */
* { margin: 0; padding: 0; box-sizing: border-box; }

/* CSS变量 */
:root {
    --primary: #1a73e8;
    --primary-dark: #1557b0;
    --success: #34a853;
    --warning: #fbbc04;
    --danger: #ea4335;
    --bg: #f8f9fa;
    --card: #ffffff;
    --text: #202124;
    --text-secondary: #5f6368;
    --border: #dadce0;
}

/* 基础样式 */
body {
    font-family: 'Segoe UI', -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

/* 登录页 */
.login-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    z-index: 2000;  /* 高于模态框z-index:1000 */
}
.login-card {
    background: var(--card);
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    width: 400px;
}
.login-card h1 { text-align: center; margin-bottom: 30px; color: var(--primary); }

/* 表单 */
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 8px; font-weight: 500; color: var(--text-secondary); }
.form-group input, .form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
}
.form-group input:focus { outline: none; border-color: var(--primary); }

/* 按钮 */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-success { background: var(--success); color: white; }
.btn-warning { background: var(--warning); color: var(--text); }
.btn-danger { background: var(--danger); color: white; }
.btn-secondary { background: var(--border); color: var(--text); }
.btn-sm { padding: 6px 12px; font-size: 12px; }

/* 布局 */
.app-container { display: flex; min-height: 100vh; }

/* 侧边栏 */
.sidebar {
    width: 240px;
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
    color: white;
    padding: 20px 0;
    position: fixed;
    height: 100vh;
}
.sidebar-header { padding: 0 20px 20px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.sidebar-header h2 { font-size: 18px; }
.sidebar-header p { font-size: 12px; opacity: 0.7; margin-top: 4px; }
.nav-item {
    padding: 12px 20px;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: background 0.2s;
    position: relative;
}
.nav-item:hover { background: rgba(255,255,255,0.1); }
.nav-item.active { background: var(--primary); }
.nav-item i { margin-right: 12px; font-size: 20px; }
.nav-badge {
    margin-left: auto;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    min-width: 20px;
    text-align: center;
    background: rgba(255,255,255,0.2);
    color: white;
}
.nav-badge.badge-warning {
    background: #f59e0b;
    color: white;
}
.nav-badge.badge-danger {
    background: #dc2626;
    color: white;
}

/* 主内容区 */
.main-content { flex: 1; margin-left: 240px; padding: 24px; }
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}
.page-header h1 { font-size: 24px; font-weight: 600; }

/* 统计网格 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}
.stat-card {
    background: var(--card);
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.stat-card .label { font-size: 14px; color: var(--text-secondary); margin-bottom: 8px; }
.stat-card .value { font-size: 28px; font-weight: 600; }
.stat-card .value.primary { color: var(--primary); }
.stat-card .value.success { color: var(--success); }
.stat-card .value.warning { color: var(--warning); }

/* 卡片 */
.card {
    background: var(--card);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow: hidden;
    margin-bottom: 24px;
}
.card-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.card-header h3 { font-size: 16px; font-weight: 600; }
.card-body { padding: 16px 24px; }

/* 表格 */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 14px 24px; text-align: left; border-bottom: 1px solid var(--border); }
th { background: #f8f9fa; font-weight: 600; font-size: 13px; color: var(--text-secondary); }
tr:hover { background: #f8f9fa; }

/* 徽章 */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}
.badge-success { background: #e6f4ea; color: var(--success); }
.badge-warning { background: #fef7e0; color: #b06000; }
.badge-danger { background: #fce8e6; color: var(--danger); }
.badge-secondary { background: #f1f3f4; color: var(--text-secondary); }

/* 通用状态 */
.loading { text-align: center; padding: 40px; color: var(--text-secondary); }
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-secondary); }
.empty-state i { font-size: 48px; margin-bottom: 16px; opacity: 0.5; }
.action-btns { display: flex; gap: 8px; }

/* Tab标签 */
.tabs { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.tab {
    padding: 12px 24px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* 响应式 */
@media (max-width: 1200px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) {
    .task-grid { grid-template-columns: 1fr; padding: 12px; gap: 16px; }
    .task-card { padding: 16px; }
    .task-cover { width: 70px; height: 95px; }
}

/* ============================================================
   新手引导页样式
   ============================================================ */
.guide-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    overflow-y: auto;
    padding: 20px;
}

.guide-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 48px;
    max-width: 680px;
    width: 100%;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.4);
    animation: guideSlideIn 0.5s ease-out;
}

@keyframes guideSlideIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.guide-header {
    text-align: center;
    margin-bottom: 36px;
}

.guide-logo {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.guide-logo i {
    font-size: 40px;
    color: white;
}

.guide-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 8px;
}

.guide-header p {
    color: #666;
    font-size: 15px;
}

/* 步骤指示器 */
.guide-steps-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 40px;
    gap: 0;
}

.step-dot {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    color: #999;
    transition: all 0.3s ease;
}

.step-dot.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.step-dot.done {
    background: #34a853;
    color: white;
}

.step-line {
    width: 60px;
    height: 3px;
    background: #e0e0e0;
    transition: all 0.3s ease;
}

.step-line.active {
    background: linear-gradient(90deg, #34a853, #667eea);
}

/* 步骤内容 */
.guide-content {
    min-height: 320px;
}

.guide-step {
    animation: stepFadeIn 0.4s ease-out;
}

@keyframes stepFadeIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.step-icon {
    width: 72px;
    height: 72px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.step-icon i {
    font-size: 36px;
    color: white;
}

.step-icon.wangpai {
    background: linear-gradient(135deg, #f6d365 0%, #fda085 100%);
    box-shadow: 0 8px 25px rgba(253, 160, 133, 0.4);
}

.step-icon.client {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.step-icon.token {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    box-shadow: 0 8px 25px rgba(56, 239, 125, 0.4);
}

.step-icon.xingtu {
    background: linear-gradient(135deg, #ff416c 0%, #ff4b2b 100%);
    box-shadow: 0 8px 25px rgba(255, 75, 43, 0.4);
}

.guide-step h2 {
    text-align: center;
    font-size: 22px;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 10px;
}

.step-desc {
    text-align: center;
    color: #666;
    font-size: 14px;
    margin-bottom: 28px;
}

.step-detail {
    background: #f8f9fc;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;
}

.detail-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px dashed #e0e0e0;
}

.detail-item:last-child {
    border-bottom: none;
}

.detail-item i {
    color: var(--primary);
    font-size: 20px;
    flex-shrink: 0;
    margin-top: 2px;
}

.detail-item span {
    color: #444;
    font-size: 14px;
    line-height: 1.6;
}

.detail-item a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.detail-item a:hover {
    text-decoration: underline;
}

.detail-item code {
    background: #e8e8e8;
    padding: 2px 8px;
    border-radius: 4px;
    font-family: 'Consolas', monospace;
    font-size: 13px;
    color: #d63384;
}

.step-tip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    background: #fff8e1;
    border-radius: 12px;
    border-left: 4px solid #ffb300;
}

.step-tip i {
    color: #ffb300;
    font-size: 20px;
    flex-shrink: 0;
}

.step-tip span {
    color: #7a5a00;
    font-size: 13px;
}

.step-tip.success {
    background: #e8f5e9;
    border-left-color: #4caf50;
}

.step-tip.success i {
    color: #4caf50;
}

.step-tip.success span {
    color: #2e7d32;
}

/* 操作按钮 */
.guide-actions {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 36px;
}

.guide-actions .btn {
    min-width: 140px;
    padding: 14px 28px;
    font-size: 15px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.guide-actions .btn-success {
    background: linear-gradient(135deg, #34a853 0%, #2e9648 100%);
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(52, 168, 83, 0.4);
}

.guide-actions .btn-success:hover {
    background: linear-gradient(135deg, #2e9648 0%, #278a3e 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 168, 83, 0.5);
}

.guide-actions .btn-secondary {
    background: #f1f3f4;
    color: #5f6368;
    border: none;
}

.guide-actions .btn-secondary:hover {
    background: #e8eaed;
}

/* 跳过链接 */
.guide-skip {
    text-align: center;
    margin-top: 24px;
}

.guide-skip a {
    color: #999;
    font-size: 13px;
    text-decoration: none;
    transition: color 0.2s;
}

.guide-skip a:hover {
    color: #666;
    text-decoration: underline;
}

/* 响应式适配 */
@media (max-width: 600px) {
    .guide-container {
        padding: 32px 24px;
        border-radius: 20px;
    }
    
    .guide-header h1 {
        font-size: 22px;
    }
    
    .step-line {
        width: 30px;
    }
    
    .guide-step h2 {
        font-size: 18px;
    }
    
    .guide-actions {
        flex-direction: column;
    }
    
    .guide-actions .btn {
        width: 100%;
    }
}

