/* ===== 基础重置 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; background: #f5f6f8; color: #333; }

/* ===== 登录页 ===== */
.login-view { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: #1a1a2e; }
.login-box { background: #fff; padding: 40px; border-radius: 12px; box-shadow: 0 4px 24px rgba(0,0,0,.15); width: 360px; }
.login-box h1 { text-align: center; margin-bottom: 30px; font-size: 20px; color: #333; }
.login-box input { width: 100%; padding: 12px 16px; margin-bottom: 16px; border: 1px solid #ddd; border-radius: 8px; font-size: 14px; }
.login-box input:focus { outline: none; border-color: #534AB7; }
.login-box button { width: 100%; padding: 12px; background: #534AB7; color: #fff; border: none; border-radius: 8px; font-size: 14px; cursor: pointer; }
.login-box button:hover { background: #3C3489; }

/* ===== 主布局 ===== */
.main-view { display: flex; min-height: 100vh; }
.sidebar { width: 220px; background: #1a1a2e; color: #ccc; display: flex; flex-direction: column; position: fixed; height: 100vh; overflow-y: auto; }
.sidebar-header { padding: 20px; border-bottom: 1px solid rgba(255,255,255,.1); }
.sidebar-header h2 { font-size: 16px; color: #fff; }
.sidebar-nav { flex: 1; padding: 12px 0; }
.nav-item { display: block; padding: 10px 20px; color: #aaa; text-decoration: none; font-size: 14px; cursor: pointer; transition: all .2s; }
.nav-item:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-item.active { background: rgba(83,74,183,.3); color: #fff; border-left: 3px solid #7F77DD; }
.nav-divider { height: 1px; background: rgba(255,255,255,.1); margin: 8px 16px; }
.logout-btn { padding: 12px 20px; background: transparent; border: none; border-top: 1px solid rgba(255,255,255,.1); color: #aaa; text-align: left; cursor: pointer; font-size: 14px; }
.logout-btn:hover { color: #e74c3c; }

.content { flex: 1; margin-left: 220px; padding: 24px; }

/* ===== 通用组件 ===== */
.section { background: #fff; border-radius: 12px; padding: 24px; margin-bottom: 20px; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.section-title { font-size: 16px; font-weight: 500; margin-bottom: 16px; color: #333; padding-bottom: 12px; border-bottom: 1px solid #eee; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-size: 13px; color: #666; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 10px 12px; border: 1px solid #ddd; border-radius: 8px; font-size: 14px; }
.form-group input:focus, .form-group select:focus { outline: none; border-color: #534AB7; }
.form-row { display: flex; gap: 16px; }
.form-row .form-group { flex: 1; }

.btn { padding: 10px 20px; border: none; border-radius: 8px; font-size: 14px; cursor: pointer; transition: all .2s; }
.btn-primary { background: #534AB7; color: #fff; }
.btn-primary:hover { background: #3C3489; }
.btn-success { background: #0F6E56; color: #fff; }
.btn-success:hover { background: #085041; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-edit { background: #E6F1FB; color: #185FA5; border: 1px solid #B5D4F4; }
.btn-delete { background: #FCEBEB; color: #A32D2D; border: 1px solid #F7C1C1; }
.btn-toggle { background: #FAEEDA; color: #854F0B; border: 1px solid #FAC775; }

/* ===== 表格 ===== */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { text-align: left; padding: 12px; font-size: 13px; color: #666; border-bottom: 2px solid #eee; font-weight: 500; }
.data-table td { padding: 12px; font-size: 14px; border-bottom: 1px solid #f0f0f0; }
.data-table tr:hover { background: #f9f9fb; }
.status-badge { display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: 12px; }
.status-pending { background: #FAEEDA; color: #854F0B; }
.status-published { background: #E1F5EE; color: #085041; }

/* ===== 下拉外链选择 ===== */
.link-selector { display: flex; gap: 8px; align-items: center; }
.link-selector select { flex: 1; }

/* ===== 开关 ===== */
.switch { position: relative; display: inline-block; width: 48px; height: 26px; }
.switch input { display: none; }
.switch-slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background: #ccc; border-radius: 26px; transition: .3s; }
.switch-slider:before { content: ""; position: absolute; height: 20px; width: 20px; left: 3px; bottom: 3px; background: #fff; border-radius: 50%; transition: .3s; }
.switch input:checked + .switch-slider { background: #0F6E56; }
.switch input:checked + .switch-slider:before { transform: translateX(22px); }

/* ===== 弹窗 ===== */
.modal { position: fixed; z-index: 999; display: flex; align-items: center; justify-content: center; }
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,.5); }
.modal-box { position: relative; background: #fff; border-radius: 12px; width: 720px; max-height: 85vh; overflow-y: auto; z-index: 1; }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 20px 24px; border-bottom: 1px solid #eee; }
.modal-header h3 { font-size: 18px; }
.modal-close { background: none; border: none; font-size: 24px; cursor: pointer; color: #999; }
.modal-body { padding: 24px; }

/* ===== 文章预览 ===== */
.article-preview { margin-top: 20px; border: 1px solid #eee; border-radius: 8px; padding: 16px; }
.preview-content { max-height: 300px; overflow-y: auto; margin-top: 8px; }
.preview-content h1, .preview-content h2, .preview-content p { margin-bottom: 12px; line-height: 1.8; }
.multi-select { min-height: 120px; }

/* ===== 顶部菜单栏 ===== */
.top-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.top-bar h2 { font-size: 18px; flex: 1; }
