* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --orange: #F58220;
  --orange-dark: #D4721A;
  --orange-light: #FFF4EA;
  --ink: #1a1a1a;
  --ink-2: #555;
  --ink-3: #999;
  --bg: #F5F6F8;
  --white: #fff;
  --line: #E8E8E8;
  --green: #1D9E75;
  --red: #E24B4A;
  --radius: 8px;
}

body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif; background: var(--bg); color: var(--ink); }

/* ====== 登录页 ====== */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%); }
.login-box { background: var(--white); border-radius: 12px; padding: 48px 40px; width: 400px; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.login-box h2 { margin-bottom: 32px; color: var(--orange); font-size: 22px; }
.login-box input { width: 100%; padding: 14px 16px; margin-bottom: 16px; border: 1px solid var(--line); border-radius: var(--radius); font-size: 15px; transition: border-color .2s; }
.login-box input:focus { outline: none; border-color: var(--orange); }
.login-box .btn-primary { width: 100%; padding: 14px; font-size: 16px; }
.error-msg { color: var(--red); margin-top: 12px; font-size: 14px; min-height: 20px; }

/* ====== 按钮 ====== */
.btn-primary { background: var(--orange); color: #fff; border: none; padding: 10px 20px; border-radius: var(--radius); cursor: pointer; font-size: 14px; transition: background .2s; }
.btn-primary:hover { background: var(--orange-dark); }
.btn-secondary { background: var(--white); color: var(--ink-2); border: 1px solid var(--line); padding: 10px 20px; border-radius: var(--radius); cursor: pointer; font-size: 14px; }
.btn-secondary:hover { background: var(--bg); }
.btn-danger { background: var(--red); color: #fff; border: none; padding: 6px 12px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.btn-sm { padding: 6px 12px; font-size: 13px; }

/* ====== 主布局 ====== */
.main-page { display: flex; min-height: 100vh; }

/* 侧边栏 */
.sidebar { width: 220px; background: #1a1a2e; color: #fff; display: flex; flex-direction: column; padding: 20px 0; flex-shrink: 0; }
.sidebar-logo { padding: 0 24px 24px; font-size: 18px; font-weight: 700; color: var(--orange); border-bottom: 1px solid rgba(255,255,255,.1); margin-bottom: 16px; }
.sidebar-nav { flex: 1; }
.nav-item { display: block; padding: 14px 24px; color: rgba(255,255,255,.7); text-decoration: none; font-size: 14px; transition: all .2s; border-left: 3px solid transparent; }
.nav-item:hover { color: #fff; background: rgba(255,255,255,.05); }
.nav-item.active { color: var(--orange); background: rgba(245,130,32,.1); border-left-color: var(--orange); }
.sidebar-link { display: block; padding: 12px 24px; color: rgba(255,255,255,.5); text-decoration: none; font-size: 13px; background: none; border: none; cursor: pointer; width: 100%; text-align: left; }
.sidebar-link:hover { color: #fff; }

/* 内容区 */
.content { flex: 1; padding: 32px; overflow-y: auto; }
.page { display: none; }
.page.active { display: block; }
.page h2 { margin-bottom: 24px; font-size: 22px; }

.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.page-header h2 { margin: 0; }
.page-description { margin: 8px 0 0; color: #7b8190; font-size: 14px; }
.research-admin-section { padding: 24px; margin-bottom: 24px; background: #fff; border: 1px solid #e8eaf0; border-radius: 10px; }
.research-section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.research-section-head h3 { margin: 0; font-size: 18px; }
.empty-state { display: flex; flex-direction: column; gap: 8px; padding: 48px 24px; color: #8a909d; text-align: center; background: #fff; border: 1px dashed #dfe2e8; border-radius: 10px; }
.empty-state strong { color: #4d5360; font-size: 16px; }
.empty-state.error { border-color: #efc6c6; background: #fffafa; }
.import-note { display: flex; flex-direction: column; gap: 6px; margin: 6px 0 18px; padding: 14px 16px; color: #656b78; font-size: 13px; background: #f5f7fb; border-left: 3px solid var(--accent); }
.import-note strong { color: #293043; font-size: 14px; }
.form-row-inline { display: grid; grid-template-columns: 1fr 1fr 180px; gap: 16px; }
.form-row-inline > div { min-width: 0; }
.form-row-inline input { width: 100%; }
.url-import-row { display: flex; gap: 10px; align-items: center; }
.url-import-row input { flex: 1; min-width: 0; }
.url-import-row button { flex: 0 0 auto; }
@media (max-width: 900px) { .form-row-inline { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .url-import-row { align-items: stretch; flex-direction: column; } }

/* ====== 仪表盘 ====== */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.stat-card { background: var(--white); border-radius: var(--radius); padding: 28px 24px; box-shadow: 0 2px 8px rgba(0,0,0,.04); }
.stat-card .stat-num { font-size: 36px; font-weight: 700; color: var(--orange); }
.stat-card .stat-label { font-size: 14px; color: var(--ink-3); margin-top: 8px; }

/* ====== 数据列表 ====== */
.filter-bar { margin-bottom: 16px; }
.filter-bar select { padding: 8px 12px; border: 1px solid var(--line); border-radius: 6px; font-size: 14px; }

.data-list { display: flex; flex-direction: column; gap: 12px; }
.data-item { background: var(--white); border-radius: var(--radius); padding: 20px 24px; display: flex; justify-content: space-between; align-items: center; box-shadow: 0 2px 8px rgba(0,0,0,.04); }
.data-item-left { flex: 1; }
.data-item-title { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.data-item-meta { font-size: 13px; color: var(--ink-3); display: flex; gap: 16px; }
.data-item-actions { display: flex; gap: 8px; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 12px; background: var(--orange-light); color: var(--orange-dark); }
.tag-unread { background: #FEF3C7; color: #92400E; }
.tag-read { background: #F3F4F6; color: var(--ink-3); }
.status-badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 12px; }
.status-published { background: #D1FAE5; color: #065F46; }
.status-draft { background: #FEF3C7; color: #92400E; }

/* ====== 编辑器 ====== */
.editor-form { background: var(--white); border-radius: var(--radius); padding: 32px; max-width: 800px; box-shadow: 0 2px 8px rgba(0,0,0,.04); }
.form-row { margin-bottom: 20px; }
.form-row label { display: block; margin-bottom: 8px; font-size: 14px; font-weight: 500; color: var(--ink-2); }
.form-row input, .form-row textarea, .form-row select { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; font-size: 14px; font-family: inherit; }
.form-row input:focus, .form-row textarea:focus, .form-row select:focus { outline: none; border-color: var(--orange); }
.form-row select { display: inline-block; width: auto; min-width: 150px; }
.form-actions { display: flex; gap: 12px; margin-top: 24px; }

/* ====== Toast ====== */
.toast { position: fixed; bottom: 32px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 24px; border-radius: 8px; font-size: 14px; z-index: 9999; }
.toast.success { background: var(--green); }
.toast.error { background: var(--red); }

/* ====== 联系信息卡片 ====== */
.contact-card { background: var(--white); border-radius: var(--radius); padding: 24px; box-shadow: 0 2px 8px rgba(0,0,0,.04); }
.contact-card .contact-name { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.contact-card .contact-info { font-size: 14px; color: var(--ink-2); margin-bottom: 4px; }
.contact-card .contact-msg { font-size: 14px; color: var(--ink-2); margin-top: 12px; padding: 12px; background: var(--bg); border-radius: 6px; }
.contact-card .contact-time { font-size: 12px; color: var(--ink-3); margin-top: 8px; }

/* ====== 设置页签 ====== */
.settings-tabs { display: flex; gap: 4px; margin-bottom: 20px; flex-wrap: wrap; }
.settings-tab { padding: 8px 16px; border: 1px solid var(--line); border-radius: 6px; background: var(--white); cursor: pointer; font-size: 14px; color: var(--ink-2); transition: all .2s; }
.settings-tab:hover { border-color: var(--orange); color: var(--orange); }
.settings-tab.active { background: var(--orange); color: #fff; border-color: var(--orange); }

/* ====== 图片上传器 ====== */
.image-uploader { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.image-uploader input[type="text"] { flex: 1 1 280px; }
.image-preview { width: 100%; }
.image-preview img { display: block; }

/* ====== 响应式 ====== */
@media (max-width: 768px) {
  .sidebar { width: 60px; }
  .sidebar-logo, .sidebar-link { font-size: 0; padding: 16px; text-align: center; }
  .sidebar-logo::after { content: 'LV'; font-size: 16px; }
  .nav-item { padding: 14px; text-align: center; font-size: 0; }
  .nav-item.active::before { content: '☰'; font-size: 16px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .content { padding: 16px; }
}
