/* --- styles.css --- */

/* 现代化全局变量系统 */
:root {
    /* 主色调 - 科技蓝 */
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #eff6ff;
    
    /* 辅助色 */
    --secondary-color: #475569;
    --accent-color: #8b5cf6; /* 紫色点缀 */
    
    /* 状态色 */
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    
    /* 背景与文字 */
    --bg-body: #f1f5f9;
    --bg-card: #ffffff;
    --text-main: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    
    /* 布局与特效 */
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
    
    /* 头部高度 */
    --header-height: 64px;
}

/* 基础重置 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* --- 导航栏 (响应式) --- */
.navbar {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    height: var(--header-height);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--primary-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-link {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    transition: var(--transition);
    font-size: 0.95rem;
}

.nav-link:hover, .nav-link.active {
    color: var(--primary-color);
}

/* 移动端菜单按钮 */
.menu-toggle {
    display: none;
    font-size: 1.5rem;
    background: none;
    border: none;
    color: var(--text-main);
    cursor: pointer;
}

/* --- 通用容器 --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    width: 100%;
    flex: 1;
}

/* --- 卡片风格 --- */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* --- 按钮 --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    text-decoration: none;
    font-size: 0.95rem;
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-1px); }

.btn-secondary {
    background: var(--primary-light);
    color: var(--primary-color);
}
.btn-secondary:hover { background: #dbeafe; }

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}
.btn-outline:hover { border-color: var(--text-secondary); color: var(--text-main); }

.btn-full { width: 100%; }

/* --- 表单元素 (紧凑优化) --- */
.input-group {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.form-control, .form-select {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    transition: var(--transition);
    background: var(--bg-card);
    width: 100%;
}

.form-control:focus, .form-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* --- 表格 --- */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.table {
    width: 100%;
    border-collapse: collapse;
    white-space: nowrap; /* 防止手机端换行导致难看 */
}

.table th, .table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    background: var(--bg-body);
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.table tr:last-child td { border-bottom: none; }
.table tr:hover { background-color: var(--primary-light); }

/* --- 通知系统 (Toast) --- */
.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: white;
    padding: 1rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 300px;
    animation: slideIn 0.3s ease;
    border-left: 4px solid var(--primary-color);
}
.toast.success { border-left-color: var(--success-color); }
.toast.error { border-left-color: var(--error-color); }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* --- 页脚 --- */
footer {
    background: white;
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: auto;
}

/* --- 移动端适配 --- */
@media (max-width: 768px) {
    .nav-links {
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        padding: 1rem;
        gap: 0.5rem;
        border-bottom: 1px solid var(--border-color);
        box-shadow: var(--shadow-md);
        display: none; /* JS控制显示 */
    }
    
    .nav-links.active { display: flex; }
    
    .menu-toggle { display: block; }
    
    .container { padding: 1.5rem 1rem; }
    
    /* 紧凑表单在手机端变为堆叠，但保持紧凑 */
    .compact-toolbar {
        flex-direction: column;
        align-items: stretch !important;
    }
    
    .compact-toolbar .input-group {
        width: 100%;
    }
}