* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: #f0f2f5; color: #333; }

/* 登录页 */
.login-page { display: flex; justify-content: center; align-items: center; min-height: 100vh; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.login-box { background: #fff; border-radius: 12px; padding: 40px; width: 400px; box-shadow: 0 20px 60px rgba(0,0,0,0.15); }
.login-box h1 { text-align: center; margin-bottom: 8px; font-size: 24px; color: #1a1a2e; }
.login-box .subtitle { text-align: center; color: #888; margin-bottom: 30px; font-size: 14px; }
.login-box .form-group { margin-bottom: 20px; }
.login-box label { display: block; margin-bottom: 6px; font-size: 14px; color: #555; }
.login-box input { width: 100%; padding: 12px 16px; border: 1px solid #ddd; border-radius: 8px; font-size: 14px; transition: border-color 0.3s; }
.login-box input:focus { outline: none; border-color: #667eea; box-shadow: 0 0 0 3px rgba(102,126,234,0.1); }

/* 按钮 */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 10px 20px; border: none; border-radius: 8px; font-size: 14px; cursor: pointer; transition: all 0.2s; text-decoration: none; }
.btn-primary { background: #667eea; color: #fff; }
.btn-primary:hover { background: #5a6fd6; }
.btn-info { background: #2D9B8A; color: #fff; }
.btn-info:hover { background: #268b7c; }
.btn-success { background: #52c41a; color: #fff; }
.btn-success:hover { background: #49b018; }
.btn-danger { background: #ff4d4f; color: #fff; }
.btn-danger:hover { background: #e04345; }
.btn-warning { background: #faad14; color: #fff; }
.btn-warning:hover { background: #e8a012; }
.btn-outline { background: transparent; border: 1px solid #d9d9d9; color: #555; }
.btn-outline:hover { border-color: #667eea; color: #667eea; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-block { width: 100%; justify-content: center; padding: 12px; }

/* 布局 */
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 240px; background: #001529; color: #fff; display: flex; flex-direction: column; position: fixed; top: 0; left: 0; bottom: 0; z-index: 100; }
.sidebar-header { padding: 20px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.sidebar-header h2 { font-size: 18px; color: #fff; }
.sidebar-header .sub { font-size: 12px; color: rgba(255,255,255,0.45); margin-top: 4px; }
.sidebar-nav { flex: 1; padding: 12px 0; }
.sidebar-nav a { display: flex; align-items: center; gap: 10px; padding: 12px 24px; color: rgba(255,255,255,0.65); text-decoration: none; transition: all 0.2s; font-size: 14px; }
.sidebar-nav a:hover, .sidebar-nav a.active { color: #fff; background: rgba(255,255,255,0.08); }
.sidebar-nav a.active { border-right: 3px solid #667eea; }
.sidebar-footer { padding: 16px 20px; border-top: 1px solid rgba(255,255,255,0.1); font-size: 13px; color: rgba(255,255,255,0.45); }

.main { flex: 1; margin-left: 240px; padding: 24px; }
.main-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.main-header h1 { font-size: 22px; font-weight: 600; }
.user-info { display: flex; align-items: center; gap: 12px; font-size: 14px; color: #666; }

/* 卡片 */
.card { background: #fff; border-radius: 12px; padding: 24px; margin-bottom: 20px; box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; padding-bottom: 16px; border-bottom: 1px solid #f0f0f0; }
.card-header h3 { font-size: 16px; }

/* 统计卡片 */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: #fff; border-radius: 12px; padding: 20px; box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
.stat-card .num { font-size: 28px; font-weight: 700; color: #1a1a2e; }
.stat-card .label { font-size: 14px; color: #888; margin-top: 4px; }
.stat-card .icon { font-size: 32px; float: right; opacity: 0.2; }

/* 表格 */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 16px; text-align: left; border-bottom: 1px solid #f0f0f0; font-size: 14px; }
th { background: #fafafa; font-weight: 600; color: #555; }
tr:hover td { background: #fafafa; }
.actions { display: flex; gap: 8px; }

/* 搜索栏 */
.search-bar { display: flex; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.search-bar input, .search-bar select { padding: 8px 12px; border: 1px solid #d9d9d9; border-radius: 6px; font-size: 14px; }
.search-bar input:focus, .search-bar select:focus { outline: none; border-color: #667eea; }
.search-bar input { flex: 1; min-width: 200px; }

/* 弹窗 */
.modal { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 1000; justify-content: center; align-items: center; }
.modal.show { display: flex; }
.modal-content { background: #fff; border-radius: 12px; width: 90%; max-width: 680px; max-height: 90vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,0.2); }
.modal-header { padding: 20px 24px; border-bottom: 1px solid #f0f0f0; display: flex; justify-content: space-between; align-items: center; }
.modal-header h3 { font-size: 16px; }
.modal-close { background: none; border: none; font-size: 20px; cursor: pointer; color: #999; padding: 4px; line-height: 1; }
.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid #f0f0f0; display: flex; justify-content: flex-end; gap: 12px; }

/* 表单 */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-size: 14px; color: #555; font-weight: 500; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 10px 12px; border: 1px solid #d9d9d9; border-radius: 8px; font-size: 14px; transition: border-color 0.3s; font-family: inherit; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: #667eea; box-shadow: 0 0 0 3px rgba(102,126,234,0.1); }
.form-group textarea { min-height: 100px; resize: vertical; }
.form-group .help { font-size: 12px; color: #999; margin-top: 4px; }
.form-group.full { grid-column: 1 / -1; }

/* 分页 */
.pagination { display: flex; justify-content: center; align-items: center; gap: 8px; margin-top: 20px; }
.pagination button { padding: 6px 14px; border: 1px solid #d9d9d9; border-radius: 6px; background: #fff; cursor: pointer; font-size: 13px; }
.pagination button:hover { border-color: #667eea; color: #667eea; }
.pagination button:disabled { opacity: 0.4; cursor: not-allowed; }
.pagination .page-info { font-size: 13px; color: #666; }

/* Toast */
.toast { position: fixed; top: 20px; right: 20px; padding: 12px 20px; border-radius: 8px; color: #fff; font-size: 14px; z-index: 2000; transform: translateX(120%); transition: transform 0.3s; }
.toast.show { transform: translateX(0); }
.toast.success { background: #52c41a; }
.toast.error { background: #ff4d4f; }
.toast.info { background: #1890ff; }

/* Badge */
.badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 12px; }
.badge-active { background: #f6ffed; color: #52c41a; border: 1px solid #b7eb8f; }
.badge-inactive { background: #fff2f0; color: #ff4d4f; border: 1px solid #ffccc7; }

/* 空状态 */
.empty { text-align: center; padding: 40px; color: #999; }
.empty .icon { font-size: 48px; margin-bottom: 12px; }

/* Markdown 内容预览 */
.markdown-preview { background: #f9f9f9; border-radius: 8px; padding: 16px; max-height: 300px; overflow-y: auto; white-space: pre-wrap; font-size: 13px; line-height: 1.6; color: #555; }
