/* === 基础变量与重置 === */
:root {
    --primary: #4A90E2;
    --primary-dark: #357ABD;
    --bg-gradient: linear-gradient(135deg, #fdfbfb 0%, #ebedee 100%);
    --card-bg: rgba(255, 255, 255, 0.85);
    --text-main: #333;
    --text-sub: #666;
    --border: #e0e0e0;
    --success: #27AE60;
    --error: #E74C3C;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg-gradient);
    min-height: 100vh;
    color: var(--text-main);
    line-height: 1.6;
}

/* === 布局组件 === */
.container { max-width: 1200px; margin: 0 auto; padding: 20px; animation: fadeIn 0.6s ease; }
.header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.header h1 { font-size: 24px; font-weight: 600; color: var(--text-main); }
.card { background: var(--card-bg); backdrop-filter: blur(10px); border-radius: 16px; padding: 24px; box-shadow: var(--shadow); border: 1px solid rgba(255, 255, 255, 0.8); }

/* === 工具栏 === */
.toolbar { display: flex; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.search-box { flex: 1; min-width: 200px; position: relative; }
.search-input { width: 100%; padding: 10px 16px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; transition: all 0.3s; }
.search-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1); }

/* === 按钮样式 === */
.btn { padding: 10px 20px; border: none; border-radius: 8px; font-size: 14px; font-weight: 500; cursor: pointer; transition: all 0.3s; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn-secondary { background: #f5f5f5; color: var(--text-main); border: 1px solid var(--border); }
.btn-secondary:hover { background: #e8e8e8; }

/* === 表格样式 (核心修改：横版表格) === */
.table-container { width: 100%; overflow-x: auto; margin-top: 16px; border-radius: 8px; border: 1px solid #eee; }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; background: #fff; }
.data-table th, .data-table td { padding: 12px 15px; text-align: left; border-bottom: 1px solid #f0f0f0; white-space: nowrap; }
.data-table th { background: #f8f9fa; font-weight: 600; color: #555; border-bottom: 2px solid #e0e0e0; }
.data-table tbody tr:hover { background-color: rgba(74, 144, 226, 0.05); }
.action-cell { display: flex; gap: 8px; }

/* 表格内的按钮 */
.table-btn { padding: 4px 12px; font-size: 12px; border-radius: 4px; border: 1px solid transparent; cursor: pointer; transition: all 0.2s; background: transparent; }
.table-btn.edit { color: var(--primary); border-color: var(--primary); }
.table-btn.edit:hover { background: var(--primary); color: #fff; }
.table-btn.delete { color: var(--error); border-color: var(--error); }
.table-btn.delete:hover { background: var(--error); color: #fff; }

/* === 分页 === */
.pagination { display: flex; justify-content: center; align-items: center; gap: 12px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border); }
.page-btn { padding: 8px 16px; background: white; border: 1px solid var(--border); border-radius: 6px; cursor: pointer; transition: all 0.3s; }
.page-btn:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.page-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.page-info { color: var(--text-sub); font-size: 14px; }

/* === 弹窗 === */
.modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, 0.4); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; z-index: 1000; animation: fadeIn 0.3s ease; }
.modal-content { background: white; border-radius: 16px; width: 90%; max-width: 500px; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15); animation: slideUp 0.3s ease; }
.modal-header { padding: 20px 24px; border-bottom: 1px solid var(--border); }
.modal-title { font-size: 18px; font-weight: 600; }
.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 12px; }

/* === 输入框 === */
.input-group { margin-bottom: 16px; }
.input-label { display: block; margin-bottom: 6px; font-size: 13px; color: var(--text-sub); font-weight: 500; }
.input-field { width: 100%; padding: 10px 14px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; transition: all 0.3s; }
.input-field:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1); }

/* === 其他组件 === */
.loading-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(255,255,255,0.8); display: flex; align-items: center; justify-content: center; z-index: 2000; }
.loading-spinner { width: 40px; height: 40px; border: 3px solid #f3f3f3; border-top: 3px solid var(--primary); border-radius: 50%; animation: spin 1s linear infinite; }
.toast { position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%); background: #333; color: white; padding: 12px 24px; border-radius: 50px; font-size: 14px; box-shadow: 0 4px 12px rgba(0,0,0,0.15); animation: slideUp 0.3s ease; z-index: 3000; }
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-sub); }

/* === 动画 === */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* === 移动端适配 === */
@media (max-width: 768px) {
    .container { padding: 10px; }
    .header { flex-direction: column; gap: 12px; align-items: flex-start; }
    .data-table th, .data-table td { padding: 8px 10px; font-size: 13px; }
}