/* ============================================
   Sea of Oblivion Wiki - Main Stylesheet
   ============================================ */

/* CSS Variables */
:root {
  --color-bg-deep: #0a0f1a;
  --color-bg-surface: #111827;
  --color-bg-card: #1a2332;
  --color-bg-hover: #243044;
  --color-primary: #4a9eff;
  --color-primary-dim: #3a7bc8;
  --color-accent: #c9a84c;
  --color-accent-hover: #ddb85a;
  --color-text-primary: #e8ecf1;
  --color-text-secondary: #9ba3af;
  --color-text-muted: #6b7280;
  --color-border: #2a3441;
  --color-success: #34d399;
  --color-danger: #f87171;
  --font-main: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, 'Microsoft YaHei', sans-serif;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.4);
  --shadow-glow: 0 0 20px rgba(74, 158, 255, 0.15);
  --max-width: 1200px;
  --header-height: 64px;
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-main);
  background: var(--color-bg-deep);
  color: var(--color-text-primary);
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--color-accent);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Background decoration */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(ellipse at 20% 80%, rgba(74, 158, 255, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(201, 168, 76, 0.04) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* ============================================
   Header
   ============================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(10, 15, 26, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text-primary);
  letter-spacing: 0.5px;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.logo:hover {
  color: var(--color-accent);
}

/* Desktop Nav */
.desktop-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-link {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  color: var(--color-text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s;
  white-space: nowrap;
}

.nav-link:hover,
.nav-link.active {
  color: var(--color-text-primary);
  background: var(--color-bg-hover);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lang-switcher {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 4px;
  font-size: 0.8rem;
}

.lang-btn {
  padding: 4px 10px;
  border-radius: 4px;
  border: none;
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  transition: all 0.2s;
}

.lang-btn:hover {
  color: var(--color-text-secondary);
}

.lang-btn.active {
  background: var(--color-primary);
  color: #fff;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}

.mobile-menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-text-secondary);
  border-radius: 2px;
  transition: all 0.3s;
}

.mobile-menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile Nav */
.mobile-nav {
  display: none;
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 15, 26, 0.98);
  backdrop-filter: blur(16px);
  padding: 20px 24px;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
  z-index: 999;
}

.mobile-nav.open {
  display: flex;
}

.mobile-nav .nav-link {
  padding: 14px 16px;
  font-size: 1.05rem;
  border-radius: var(--radius-md);
}

/* ============================================
   Main Content
   ============================================ */
.main-content {
  position: relative;
  z-index: 1;
  min-height: calc(100vh - var(--header-height) - 200px);
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ============================================
   Hero Section
   ============================================ */
.hero {
  padding: 100px 0 80px;
  text-align: center;
  position: relative;
  background: url('../images/placeholder-hero.svg') center/cover no-repeat;
}

.hero-badge {
  display: inline-block;
  padding: 6px 16px;
  background: rgba(74, 158, 255, 0.12);
  border: 1px solid rgba(74, 158, 255, 0.25);
  border-radius: 100px;
  color: var(--color-primary);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 24px;
  letter-spacing: 0.5px;
}

.hero-title {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 20px;
  background: linear-gradient(135deg, #fff 0%, var(--color-primary) 60%, var(--color-accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--color-text-secondary);
  max-width: 640px;
  margin: 0 auto 40px;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ============================================
   Buttons
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dim));
  color: #fff;
  box-shadow: 0 4px 15px rgba(74, 158, 255, 0.25);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(74, 158, 255, 0.35);
  color: #fff;
}

.btn-secondary {
  background: var(--color-bg-card);
  color: var(--color-text-primary);
  border: 1px solid var(--color-border);
}

.btn-secondary:hover {
  background: var(--color-bg-hover);
  border-color: var(--color-primary-dim);
  color: var(--color-text-primary);
}

.btn-sm {
  padding: 8px 18px;
  font-size: 0.85rem;
}

/* ============================================
   Section Styles
   ============================================ */
.section {
  padding: 60px 0;
}

.section-header {
  text-align: center;
  margin-bottom: 48px;
}

.section-title {
  font-size: 1.9rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.section-desc {
  color: var(--color-text-secondary);
  font-size: 1rem;
  max-width: 560px;
  margin: 0 auto;
}

/* ============================================
   Cards & Grids
   ============================================ */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.card-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: all 0.25s;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
  opacity: 0;
  transition: opacity 0.25s;
}

.card:hover {
  transform: translateY(-3px);
  border-color: var(--color-primary-dim);
  box-shadow: var(--shadow-glow);
}

.card:hover::before {
  opacity: 1;
}

.card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(74, 158, 255, 0.15), rgba(201, 168, 76, 0.1));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 18px;
}

.card-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.card-text {
  color: var(--color-text-secondary);
  font-size: 0.9rem;
  line-height: 1.65;
}

.card-meta {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

/* ============================================
   Feature Section (Home)
   ============================================ */
.feature-section {
  background: linear-gradient(180deg, transparent, rgba(17, 24, 39, 0.6), transparent);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.feature-block {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all 0.25s;
}

.feature-block:hover {
  border-color: var(--color-primary-dim);
  box-shadow: var(--shadow-glow);
}

.feature-block-header {
  padding: 24px 28px 0;
}

.feature-block-body {
  padding: 16px 28px 24px;
}

.feature-block-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.feature-block-desc {
  color: var(--color-text-secondary);
  font-size: 0.9rem;
}

.feature-list {
  list-style: none;
}

.feature-list li {
  padding: 8px 0;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.feature-list li:last-child {
  border-bottom: none;
}

.feature-list li::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--color-accent);
  border-radius: 50%;
  flex-shrink: 0;
}

/* ============================================
   Guide / Article Styles
   ============================================ */
.guide-content {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 0 60px;
}

.guide-title {
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 16px;
  line-height: 1.25;
}

.guide-meta {
  display: flex;
  gap: 16px;
  margin-bottom: 36px;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  flex-wrap: wrap;
}

.guide-body {
  font-size: 1rem;
  line-height: 1.85;
  color: var(--color-text-secondary);
}

.guide-body h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text-primary);
  margin: 40px 0 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--color-border);
}

.guide-body h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-text-primary);
  margin: 28px 0 12px;
}

.guide-body p {
  margin-bottom: 16px;
}

.guide-body ul,
.guide-body ol {
  margin: 0 0 20px 22px;
  padding-left: 4px;
}

.guide-body li {
  margin-bottom: 8px;
}

.guide-body strong {
  color: var(--color-text-primary);
}

.guide-body code {
  background: var(--color-bg-hover);
  padding: 2px 8px;
  border-radius: 4px;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 0.9em;
  color: var(--color-accent);
}

.guide-body .tip-box {
  background: rgba(52, 211, 153, 0.08);
  border-left: 3px solid var(--color-success);
  padding: 16px 20px;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin: 20px 0;
}

.guide-body .warning-box {
  background: rgba(248, 113, 113, 0.08);
  border-left: 3px solid var(--color-danger);
  padding: 16px 20px;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin: 20px 0;
}

.guide-body .info-box {
  background: rgba(74, 158, 255, 0.08);
  border-left: 3px solid var(--color-primary);
  padding: 16px 20px;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin: 20px 0;
}

/* Table styles */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 0.9rem;
}

.data-table thead th {
  background: var(--color-bg-hover);
  color: var(--color-text-primary);
  font-weight: 600;
  text-align: left;
  padding: 12px 16px;
  border-bottom: 2px solid var(--color-border);
}

.data-table tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text-secondary);
}

.data-table tbody tr:hover td {
  background: rgba(74, 158, 255, 0.04);
}

/* ============================================
   Crew / Ship Cards
   ============================================ */
.entity-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all 0.25s;
}

.entity-card:hover {
  transform: translateY(-3px);
  border-color: var(--color-primary-dim);
  box-shadow: var(--shadow-glow);
}

.entity-card-image {
  width: 100%;
  height: 160px;
  background: linear-gradient(135deg, var(--color-bg-hover), var(--color-bg-surface));
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.entity-card-image-crew {
  background-image: url('../images/placeholder-crew.svg');
}

.entity-card-image-ship {
  background-image: url('../images/placeholder-ship.svg');
}

.entity-card-image-gear {
  background-image: url('../images/placeholder-gear.svg');
}

.entity-card-image-map {
  background-image: url('../images/placeholder-map.svg');
}

.entity-card-rarity {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
}

.rarity-r { background: rgba(107, 114, 128, 0.25); color: #9ca3af; }
.rarity-sr { background: rgba(74, 158, 255, 0.2); color: var(--color-primary); }
.rarity-ssr { background: rgba(201, 168, 76, 0.2); color: var(--color-accent); }

/* Purple / Black ticket rarity colors */
.rarity-purple { background: rgba(147, 112, 219, 0.25); color: #b388ff; }
.rarity-black { background: rgba(255, 215, 0, 0.2); color: #ffd54f; }
.rarity-purple-text { color: #b388ff; }
.rarity-black-text { color: #ffd54f; }
.rarity-purple-bg { background: linear-gradient(135deg, rgba(147, 112, 219, 0.15), rgba(74, 158, 255, 0.08)); }
.rarity-black-bg { background: linear-gradient(135deg, rgba(255, 215, 0, 0.12), rgba(201, 168, 76, 0.08)); }
.rarity-purple-bg-lg { background: linear-gradient(135deg, rgba(147, 112, 219, 0.2), rgba(74, 158, 255, 0.1)); }
.rarity-black-bg-lg { background: linear-gradient(135deg, rgba(255, 215, 0, 0.18), rgba(201, 168, 76, 0.1)); }

.entity-card-body {
  padding: 18px;
}

.entity-card-name {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.entity-card-info {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-bottom: 10px;
}

.entity-card-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.tag {
  padding: 4px 10px;
  background: var(--color-bg-hover);
  border-radius: 100px;
  font-size: 0.75rem;
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
}

/* ============================================
   Filter & Search
   ============================================ */
.filter-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 28px;
  flex-wrap: wrap;
  align-items: center;
}

.search-input {
  flex: 1;
  min-width: 200px;
  padding: 10px 16px;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-primary);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}

.search-input:focus {
  border-color: var(--color-primary);
}

.search-input::placeholder {
  color: var(--color-text-muted);
}

.filter-select {
  padding: 10px 14px;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-primary);
  font-size: 0.9rem;
  outline: none;
  cursor: pointer;
}

/* ============================================
   Tabs
   ============================================ */
.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--color-border);
  overflow-x: auto;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  padding: 10px 18px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--color-text-muted);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
  margin-bottom: -1px;
}

.tab-btn:hover {
  color: var(--color-text-secondary);
}

.tab-btn.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

/* ============================================
   Footer
   ============================================ */
.site-footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--color-border);
  background: var(--color-bg-surface);
  padding: 48px 0 28px;
  margin-top: 60px;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.footer-main {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 36px;
}

.footer-brand .logo {
  margin-bottom: 12px;
}

.footer-brand p {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  line-height: 1.65;
}

.footer-col-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: 16px;
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 10px;
}

.footer-links a {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--color-text-secondary);
}

.footer-bottom {
  border-top: 1px solid var(--color-border);
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-bottom p {
  color: var(--color-text-muted);
  font-size: 0.8rem;
}

.footer-bottom a {
  color: var(--color-text-muted);
  font-size: 0.8rem;
}

/* ============================================
   Contact Page
   ============================================ */
.contact-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 36px;
  max-width: 560px;
  margin: 0 auto;
  text-align: center;
}

.contact-icon {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, rgba(74, 158, 255, 0.15), rgba(201, 168, 76, 0.1));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin: 0 auto 20px;
}

.contact-email {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--color-accent);
  word-break: break-all;
}

/* ============================================
   Privacy / Legal Pages
   ============================================ */
.legal-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 0 60px;
}

.legal-content h1 {
  font-size: 2rem;
  margin-bottom: 24px;
}

.legal-content h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text-primary);
  margin: 32px 0 12px;
}

.legal-content p {
  color: var(--color-text-secondary);
  margin-bottom: 14px;
  line-height: 1.75;
}

.legal-content ul {
  color: var(--color-text-secondary);
  margin: 0 0 16px 20px;
}

.legal-content li {
  margin-bottom: 6px;
}

/* ============================================
   Breadcrumb
   ============================================ */
.breadcrumb {
  padding: 16px 0;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.breadcrumb a {
  color: var(--color-text-muted);
}

.breadcrumb a:hover {
  color: var(--color-primary);
}

.breadcrumb-sep {
  margin: 0 8px;
}

/* ============================================
   Utility
   ============================================ */
.text-center { text-align: center; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

.hidden { display: none !important; }

/* Loading skeleton */
.skeleton {
  background: linear-gradient(90deg, var(--color-bg-hover) 25%, var(--color-bg-card) 50%, var(--color-bg-hover) 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: var(--radius-sm);
}

@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 1024px) {
  .card-grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
  .footer-main {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  :root {
    --header-height: 56px;
  }

  .header-inner {
    padding: 0 16px;
  }

  .desktop-nav {
    display: none;
  }

  .mobile-menu-toggle {
    display: flex;
  }

  .hero {
    padding: 48px 0 40px;
  }

  .hero-title {
    font-size: 2rem;
  }

  .hero-subtitle {
    font-size: 1rem;
  }

  .section {
    padding: 40px 0;
  }

  .section-title {
    font-size: 1.5rem;
  }

  .container {
    padding: 0 16px;
  }

  .card-grid,
  .card-grid-3,
  .feature-grid {
    grid-template-columns: 1fr;
  }

  .footer-main {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }

  .guide-title {
    font-size: 1.6rem;
  }

  .guide-content,
  .legal-content,
  .article-detail {
    padding: 24px 0 40px;
  }

  .article-item {
    padding: 16px 18px;
  }

  .article-item-title {
    font-size: 1rem;
  }

  .article-detail-title {
    font-size: 1.6rem;
  }

  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .search-input,
  .filter-select {
    width: 100%;
  }

  .tabs {
    gap: 0;
  }

  .tab-btn {
    padding: 10px 14px;
    font-size: 0.85rem;
  }

  .data-table {
    font-size: 0.8rem;
  }

  .data-table thead th,
  .data-table tbody td {
    padding: 10px 12px;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 1.6rem;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .btn {
    width: 100%;
  }

  .card {
    padding: 20px;
  }
}

/* ============================================
   Crew Database - Grid & Cards
   ============================================ */
.crew-summary {
  display: flex;
  gap: 24px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.crew-summary-item {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.crew-summary-count {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--color-text-primary);
}

.crew-summary-label {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.crew-filters {
  display: flex;
  gap: 12px;
  margin-bottom: 28px;
  flex-wrap: wrap;
  align-items: center;
}

.crew-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 60px;
}

.crew-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.25s;
}

.crew-card:hover {
  transform: translateY(-4px);
  border-color: var(--color-primary-dim);
  box-shadow: var(--shadow-glow);
}

.crew-card-avatar {
  width: 100%;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.crew-card-rarity-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
}

.crew-card-attr-icon {
  font-size: 2.2rem;
  opacity: 0.7;
}

.crew-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.crew-card-body {
  padding: 14px 16px;
  border-top: 1px solid var(--color-border);
}

.crew-card-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text-primary);
  margin-bottom: 4px;
}

.crew-card-attr {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

/* ============================================
   Crew Detail Modal
   ============================================ */
.crew-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2000;
}

.crew-modal.open {
  display: flex;
}

.crew-modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.crew-modal-content {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 880px;
  max-height: 90vh;
  margin: auto;
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow-y: auto;
  padding: 32px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}

.crew-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  background: var(--color-bg-card);
  color: var(--color-text-secondary);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  z-index: 10;
}

.crew-modal-close:hover {
  background: var(--color-bg-hover);
  color: var(--color-text-primary);
}

/* Detail Header */
.crew-detail-header {
  display: flex;
  gap: 28px;
  margin-bottom: 32px;
  align-items: flex-start;
}

.crew-detail-avatar {
  width: 160px;
  height: 180px;
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  flex-shrink: 0;
}

.crew-detail-attr-icon {
  font-size: 3.5rem;
  opacity: 0.6;
}

.crew-detail-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  border-radius: var(--radius-lg);
}

.crew-detail-profile {
  flex: 1;
  min-width: 0;
}

.crew-detail-name {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 4px;
  line-height: 1.2;
}

.crew-detail-nickname {
  font-size: 0.95rem;
  color: var(--color-text-muted);
  font-style: italic;
  margin-bottom: 16px;
}

.crew-profile-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.crew-profile-table td {
  padding: 7px 0;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text-secondary);
}

.crew-profile-table td:first-child {
  color: var(--color-text-muted);
  width: 140px;
}

.crew-profile-label {
  font-size: 0.85rem;
}

/* Detail Sections */
.crew-detail-section {
  margin-bottom: 28px;
}

.crew-detail-section-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-text-primary);
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--color-border);
}

.crew-detail-bio {
  font-size: 0.95rem;
  color: var(--color-text-secondary);
  line-height: 1.7;
  margin-bottom: 8px;
}

.crew-detail-bio-detail {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  line-height: 1.7;
}

/* Base Stats */
.crew-base-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.crew-stat-item {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 14px;
  text-align: center;
}

.crew-stat-label {
  display: block;
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.crew-stat-value {
  display: block;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--color-primary);
}

/* Core Stats Table */
.crew-stats-table-wrap {
  overflow-x: auto;
}

.crew-core-table {
  min-width: 500px;
}

.crew-core-table td:first-child {
  white-space: nowrap;
}

.crew-core-table td,
.crew-core-table th {
  text-align: center;
  padding: 10px 12px !important;
}

.crew-core-table td:first-child,
.crew-core-table th:first-child {
  text-align: left;
}

/* Skills */
.crew-skills {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.crew-skill {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 16px 20px;
}

.crew-skill-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.crew-skill-type {
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.crew-skill-type.passive { background: rgba(52, 211, 153, 0.15); color: var(--color-success); }
.crew-skill-type.signature { background: rgba(201, 168, 76, 0.15); color: var(--color-accent); }
.crew-skill-type.personal { background: rgba(74, 158, 255, 0.15); color: var(--color-primary); }
.crew-skill-type.defense { background: rgba(107, 114, 128, 0.2); color: #9ca3af; }

.crew-skill-name {
  font-weight: 700;
  color: var(--color-text-primary);
  font-size: 0.95rem;
}

.crew-skill-cost {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-left: auto;
}

.crew-skill-desc {
  font-size: 0.88rem;
  color: var(--color-text-secondary);
  line-height: 1.65;
}

/* ============================================
   Crew Database - Responsive
   ============================================ */
@media (max-width: 768px) {
  .crew-detail-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .crew-detail-avatar {
    width: 140px;
    height: 160px;
  }

  .crew-detail-name {
    font-size: 1.4rem;
  }

  .crew-profile-table td:first-child {
    width: 110px;
  }

  .crew-base-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .crew-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
  }

  .crew-card-avatar {
    height: 100px;
  }

  .crew-card-attr-icon {
    font-size: 1.8rem;
  }

  .crew-modal-content {
    padding: 20px;
    max-height: 95vh;
    border-radius: var(--radius-md);
    margin: 8px;
  }

  .crew-summary {
    gap: 16px;
  }

  .crew-filters {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 480px) {
  .crew-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .crew-card-body {
    padding: 10px 12px;
  }

  .crew-card-name {
    font-size: 0.9rem;
  }

  .crew-card-attr {
    font-size: 0.75rem;
  }
}

/* ============================================
   Article List (Home)
   ============================================ */
.article-list-section {
  background: linear-gradient(180deg, transparent, rgba(17, 24, 39, 0.6), transparent);
}

.article-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 860px;
  margin: 0 auto;
}

.article-item {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 22px 24px;
  text-decoration: none;
  transition: all 0.25s;
}

.article-item:hover {
  border-color: var(--color-primary-dim);
  box-shadow: var(--shadow-glow);
  transform: translateX(4px);
  color: inherit;
}

.article-item-body {
  flex: 1;
  min-width: 0;
}

.article-item-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-text-primary);
  margin-bottom: 6px;
  line-height: 1.4;
}

.article-item-desc {
  font-size: 0.88rem;
  color: var(--color-text-secondary);
  line-height: 1.6;
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-item-meta {
  display: flex;
  gap: 12px;
  font-size: 0.8rem;
  color: var(--color-text-muted);
  align-items: center;
}

.article-tag {
  padding: 2px 10px;
  background: rgba(74, 158, 255, 0.1);
  border: 1px solid rgba(74, 158, 255, 0.2);
  border-radius: 100px;
  color: var(--color-primary);
  font-size: 0.75rem;
  font-weight: 600;
}

.article-item-arrow {
  color: var(--color-text-muted);
  font-size: 1rem;
  flex-shrink: 0;
  transition: transform 0.2s, color 0.2s;
}

.article-item:hover .article-item-arrow {
  transform: translateX(4px);
  color: var(--color-primary);
}

/* ============================================
   Article Detail Page
   ============================================ */
.article-detail {
  max-width: 860px;
  margin: 0 auto;
  padding: 40px 0 60px;
}

.article-detail-title {
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 16px;
  line-height: 1.25;
}

.article-detail-meta {
  display: flex;
  gap: 16px;
  margin-bottom: 36px;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  flex-wrap: wrap;
  align-items: center;
}

.article-detail-body {
  font-size: 1rem;
  line-height: 1.85;
  color: var(--color-text-secondary);
}

.article-detail-body h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text-primary);
  margin: 40px 0 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--color-border);
}

.article-detail-body h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-text-primary);
  margin: 28px 0 12px;
}

.article-detail-body p {
  margin-bottom: 16px;
}

.article-detail-body ul,
.article-detail-body ol {
  margin: 0 0 20px 22px;
  padding-left: 4px;
}

.article-detail-body li {
  margin-bottom: 8px;
}

.article-detail-body strong {
  color: var(--color-text-primary);
}

.article-detail-body code {
  background: var(--color-bg-hover);
  padding: 2px 8px;
  border-radius: 4px;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 0.9em;
  color: var(--color-accent);
}

.article-detail-body .tip-box {
  background: rgba(52, 211, 153, 0.08);
  border-left: 3px solid var(--color-success);
  padding: 16px 20px;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin: 20px 0;
}

.article-detail-body .warning-box {
  background: rgba(248, 113, 113, 0.08);
  border-left: 3px solid var(--color-danger);
  padding: 16px 20px;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin: 20px 0;
}

.article-detail-body .info-box {
  background: rgba(74, 158, 255, 0.08);
  border-left: 3px solid var(--color-primary);
  padding: 16px 20px;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin: 20px 0;
}

.article-detail-body .content-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 0.9rem;
}

.article-detail-body .content-table thead th {
  background: var(--color-bg-hover);
  color: var(--color-text-primary);
  font-weight: 600;
  text-align: left;
  padding: 12px 16px;
  border-bottom: 2px solid var(--color-border);
}

.article-detail-body .content-table tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text-secondary);
}

.article-detail-body .content-table tbody tr:hover td {
  background: rgba(74, 158, 255, 0.04);
}


