/* ==========================================================================
   Waves 管理后台样式
   ========================================================================== */

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

:root {
  --bg: #0f172a;
  --surface: #1e293b;
  --border: #334155;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --danger: #ef4444;
  --danger-hover: #dc2626;
  --radius: 8px;
}

body {
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  background: var(--bg); color: var(--text);
  min-height: 100vh; -webkit-font-smoothing: antialiased;
}

/* ====== 登录页 ====== */
.screen { min-height: 100vh; }
#login-screen {
  display: flex; align-items: center; justify-content: center;
}
.login-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 40px 32px;
  width: 360px; max-width: 90vw; text-align: center;
}
.login-title { font-size: 24px; margin-bottom: 8px; }
.login-hint { color: var(--text-muted); font-size: 14px; margin-bottom: 20px; }
.login-error { color: var(--danger); font-size: 14px; margin-top: 12px; min-height: 20px; }

/* ====== 表单控件 ====== */
.input {
  width: 100%; padding: 10px 14px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--bg); color: var(--text);
  font-size: 14px; font-family: inherit; outline: none;
  transition: border-color 0.2s;
  margin-bottom: 12px;
}
.input:focus { border-color: var(--primary); }
.input-lg { font-size: 16px; padding: 12px 16px; }
.input-code { font-family: "SF Mono", "Fira Code", monospace; font-size: 13px; line-height: 1.6; }
textarea.input { resize: vertical; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 20px; border-radius: var(--radius); font-size: 14px;
  font-weight: 500; cursor: pointer; border: 1px solid transparent;
  font-family: inherit; transition: background 0.15s, border-color 0.15s;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-outline { background: transparent; border-color: var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-full { width: 100%; }
.btn-sm { padding: 6px 14px; font-size: 13px; }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; color: var(--text-muted); margin-bottom: 6px; font-weight: 500; }
.form-group-inline { margin-bottom: 16px; }
.checkbox-label { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.checkbox-label input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--primary); }
.label-hint { font-weight: 400; opacity: 0.6; margin-left: 6px; }
.form-actions { display: flex; align-items: center; gap: 12px; }
.form-msg { font-size: 14px; color: var(--primary); min-height: 20px; }

/* ====== 管理布局 ====== */
.admin-header {
  background: var(--surface); border-bottom: 1px solid var(--border);
  padding: 0 24px; height: 56px; display: flex; align-items: center;
  justify-content: space-between;
}
.admin-header h2 { font-size: 18px; }
.admin-header-actions { display: flex; gap: 8px; }

.admin-layout { display: flex; min-height: calc(100vh - 56px); }
.admin-tabs {
  width: 180px; background: var(--surface); border-right: 1px solid var(--border);
  padding: 16px 0; display: flex; flex-direction: column; gap: 2px; flex-shrink: 0;
}
.tab {
  text-align: left; padding: 10px 20px; font-size: 14px;
  background: none; border: none; color: var(--text-muted); cursor: pointer;
  font-family: inherit; transition: color 0.15s, background 0.15s;
  border-left: 3px solid transparent;
}
.tab:hover { color: var(--text); background: rgba(255,255,255,0.03); }
.tab.active { color: var(--primary); background: rgba(59,130,246,0.08); border-left-color: var(--primary); }

.admin-main { flex: 1; padding: 24px; overflow-y: auto; }
.tab-panel { display: none; max-width: 800px; }
.tab-panel.active { display: block; }

/* ====== 工具栏 ====== */
.toolbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
#article-count { color: var(--text-muted); font-size: 14px; }

/* ====== 文章列表 ====== */
.article-list { display: flex; flex-direction: column; gap: 2px; }
.article-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border);
}
.article-row.draft { opacity: 0.65; }
.article-row-info strong { display: block; font-size: 15px; margin-bottom: 4px; }
.article-row-meta {
  display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-muted);
}
.article-row-actions { display: flex; gap: 6px; flex-shrink: 0; }

.badge { font-size: 11px; padding: 2px 8px; border-radius: 100px; font-weight: 500; }
.badge-pub { background: rgba(34,197,94,0.15); color: #22c55e; }
.badge-draft { background: rgba(251,191,36,0.15); color: #fbbf24; }

.empty-hint { color: var(--text-muted); font-size: 14px; padding: 20px 0; }

/* ====== 响应式 ====== */
@media (max-width: 640px) {
  .admin-layout { flex-direction: column; }
  .admin-tabs { width: 100%; flex-direction: row; overflow-x: auto; padding: 8px; gap: 4px; }
  .tab { border-left: none; border-bottom: 3px solid transparent; padding: 8px 14px; white-space: nowrap; }
  .tab.active { border-left-color: transparent; border-bottom-color: var(--primary); }
  .admin-main { padding: 16px; }
  .admin-header { padding: 0 16px; }
  .article-row { flex-direction: column; align-items: flex-start; gap: 10px; }
  .article-row-actions { align-self: flex-end; }
}
