:root {
  --bg: #0a0908;
  --surface: #141210;
  --surface-hover: #1c1a17;
  --accent: #d4a574;
  --accent-dim: #8b6d4f;
  --text-primary: #f5f0e8;
  --text-secondary: #a89f91;
  --text-muted: #5c564e;
  --border: #2a2723;
  --success: #4ade80;
  --error: #f87171;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --shadow-sm: 0 6px 18px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 12px 34px rgba(0, 0, 0, 0.28);
}

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

body {
  font-family: 'Noto Serif SC', 'Georgia', serif;
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.8;
  min-height: 100vh;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* 噪点纹理 */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.03;
  pointer-events: none;
  z-index: 9999;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

*::selection {
  background: rgba(212, 165, 116, 0.25);
  color: var(--text-primary);
}

/* 导航 */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 1.5rem 4rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(to bottom, rgba(10, 9, 8, 0.9) 55%, rgba(10, 9, 8, 0.35) 80%, transparent);
  backdrop-filter: blur(5px);
  border-bottom: 1px solid rgba(42, 39, 35, 0.45);
}

.logo {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
}
.logo span { color: var(--accent); }

nav { display: flex; gap: 2rem; align-items: center; }

nav a, .nav-btn {
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-decoration: none;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: color 0.25s ease, transform 0.25s ease;
}

nav a:hover, .nav-btn:hover { color: var(--accent); text-decoration: none; }
nav a:hover { transform: translateY(-1px); }
nav a:focus-visible, .nav-btn:focus-visible, .btn:focus-visible, .form-control:focus-visible {
  outline: 2px solid rgba(212, 165, 116, 0.55);
  outline-offset: 2px;
}

.nav-btn {
  padding: 0.5rem 1.2rem;
  border: 1px solid var(--accent);
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  border-radius: 999px;
}

.nav-btn:hover { background: var(--accent); color: var(--bg); }

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1.5rem;
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
  text-decoration: none;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}

.btn:hover {
  background: var(--accent);
  color: var(--bg);
  text-decoration: none;
  transform: translateY(-1px);
}

.btn-primary { background: var(--accent); color: var(--bg); }
.btn-primary:hover { background: var(--text-primary); color: #14110f; }
.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-danger { border-color: var(--error); color: var(--error); }
.btn-danger:hover { background: var(--error); color: var(--bg); }

.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.8rem; }

/* 表单 */
.form-group { margin-bottom: 1.5rem; }

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.form-control {
  width: 100%;
  padding: 0.8rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  border-radius: var(--radius-sm);
}

.form-control:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(212, 165, 116, 0.14);
  background: #171411;
}

textarea.form-control { min-height: 300px; resize: vertical; }

select.form-control { cursor: pointer; }

/* 卡片 */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 2rem;
  transition: all 0.25s ease;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.card:hover {
  border-color: var(--accent-dim);
  transform: translateY(-2px);
}

/* 容器 */
.container { max-width: 1200px; margin: 0 auto; padding: 0 2rem; }

/* 页面头部 */
.page-header {
  padding: 8rem 4rem 4rem;
  border-bottom: 1px solid var(--border);
}

.page-header h1 {
  font-family: 'Playfair Display', serif;
  font-size: 2.5rem;
  font-weight: 400;
}

.page-header p { color: var(--text-secondary); margin-top: 0.5rem; }

/* 分隔线标题 */
.section-title {
  display: flex;
  align-items: center;
  gap: 2rem;
  margin-bottom: 2rem;
}

.section-title span {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  white-space: nowrap;
}

.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* 表格 */
.table-wrapper { overflow-x: auto; }
.table-wrapper table { min-width: 760px; }

table {
  width: 100%;
  border-collapse: collapse;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
}

th, td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.015);
}

tr:hover { background: var(--surface-hover); }

/* 状态标签 */
.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border: 1px solid;
  border-radius: 999px;
}

.badge-published { color: var(--success); border-color: var(--success); }
.badge-draft { color: var(--text-muted); border-color: var(--text-muted); }

/* 提示消息 */
.alert {
  padding: 1rem 1.5rem;
  margin-bottom: 1.5rem;
  border-left: 3px solid;
  border-radius: var(--radius-sm);
}

.alert-error { border-color: var(--error); color: var(--error); background: rgba(248,113,113,0.1); }
.alert-success { border-color: var(--success); color: var(--success); background: rgba(74,222,128,0.1); }

/* 加载状态 */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem;
  color: var(--text-muted);
}

/* Toast */
.toast-container {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 1200;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: min(420px, calc(100vw - 2rem));
}

.toast {
  padding: 0.8rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(20, 18, 16, 0.95);
  color: var(--text-primary);
  box-shadow: var(--shadow-md);
}

.toast-success { border-color: rgba(74, 222, 128, 0.35); }
.toast-error { border-color: rgba(248, 113, 113, 0.45); }
.toast-info { border-color: rgba(212, 165, 116, 0.35); }

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: #110f0d;
}

::-webkit-scrollbar-thumb {
  background: #2c2722;
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: #3a332d;
}

/* 响应式 */
@media (max-width: 768px) {
  header { padding: 1rem 1.5rem; }
  .page-header { padding: 6rem 1.5rem 2rem; }
  nav { gap: 1rem; }
  .container { padding: 0 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
