/* main.css - 扁平化设计样式 */

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

:root {
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --primary-light: #dbeafe;
    --secondary: #64748b;
    --dark: #1e293b;
    --light: #f8fafc;
    --gray: #e2e8f0;
    --gray-dark: #94a3b8;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
}

body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    color: var(--dark);
    background-color: var(--light);
}

/* 容器 */
.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* 实用类 */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* 卡片样式 - 扁平化 */
.card {
    background: white;
    border: 1px solid var(--gray);
    border-radius: 0.75rem;
    transition: all 0.2s ease;
}

.card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

/* 按钮样式 - 扁平化 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.2s ease;
    border: 2px solid transparent;
    cursor: pointer;
}

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

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

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

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

/* 代码块 */
.code-block {
    background: var(--dark);
    color: #e2e8f0;
    border-radius: 0.5rem;
    padding: 1.25rem;
    margin: 1rem 0;
    font-family: 'Roboto Mono', monospace;
    font-size: 0.875rem;
    overflow-x: auto;
}

.code-block .comment { color: var(--gray-dark); }
.code-block .keyword { color: #60a5fa; }
.code-block .string { color: #34d399; }
.code-block .function { color: #fbbf24; }
.code-block .variable { color: #c084fc; }

/* 分隔线 */
.divider {
    height: 1px;
    background: linear-gradient(to right, transparent, var(--gray), transparent);
    margin: 2rem 0;
}

/* 标签 */
.tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

.tag-primary {
    background-color: var(--primary-light);
    color: var(--primary);
}

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

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

/* 工具提示 */
.tooltip {
    position: relative;
}

.tooltip-text {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--dark);
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease;
    z-index: 10;
}

.tooltip:hover .tooltip-text {
    opacity: 1;
    visibility: visible;
}

/* 加载动画 */
.spinner {
    display: inline-block;
    width: 1.5rem;
    height: 1.5rem;
    border: 2px solid rgba(37, 99, 235, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: spin 1s linear infinite;
}

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

/* 进度条 */
.progress-bar {
    width: 100%;
    height: 0.5rem;
    background-color: var(--gray);
    border-radius: 9999px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background-color: var(--primary);
    border-radius: 9999px;
    transition: width 0.3s ease;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }
    
    .card {
        border-radius: 0.5rem;
    }
}

@media (max-width: 640px) {
    .hide-mobile {
        display: none !important;
    }
    
    .stack-mobile {
        flex-direction: column !important;
    }
}

/* 打印样式 */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        color: black;
        background: white;
    }
    
    .card {
        border: 1px solid #ddd;
        box-shadow: none;
    }
}