:root {
  --bg-base: #0b0c10;
  --bg-surface: #13151c;
  --bg-card: #1a1d27;
  --bg-card-hover: #222634;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(244, 63, 94, 0.45);
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --accent: #f43f5e;
  --accent-hover: #e11d48;
  --accent-soft: rgba(244, 63, 94, 0.14);
  --badge-free: #10b981;
  --badge-hd: #3b82f6;
  --badge-hot: #f59e0b;
  --badge-vip: #a855f7;
  --radius-md: 12px;
  --radius-lg: 16px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
  background-color: var(--bg-base);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
}

/* Layout */
.layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 250px;
  background-color: var(--bg-surface);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  flex-shrink: 0;
  z-index: 50;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 10px 20px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 16px;
}

.brand-logo {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, #f43f5e, #9333ea);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.2rem;
  color: #fff;
  box-shadow: 0 4px 14px rgba(244, 63, 94, 0.35);
}

.brand-name {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.brand-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.domain-card {
  background: linear-gradient(135deg, rgba(244, 63, 94, 0.12), rgba(147, 51, 234, 0.12));
  border: 1px solid rgba(244, 63, 94, 0.28);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 16px;
}

.domain-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.domain-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.domain-url {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.3px;
}

.btn-copy {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 3px 9px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-copy:hover {
  background: var(--accent-hover);
}

.site-footer {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.seo-geo-section {
  margin-top: 48px;
  padding: 24px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
}

.seo-geo-header {
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.seo-geo-header h2 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text-main);
}

.seo-geo-header p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.seo-geo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.seo-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
}

.seo-card h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 8px;
}

.seo-card p {
  font-size: 0.83rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.footer-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.footer-link:hover {
  text-decoration: underline;
}

.nav-section-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  padding: 0 10px;
  margin-bottom: 8px;
}

.category-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 0.92rem;
  text-align: left;
  transition: all 0.2s ease;
}

.nav-item:hover {
  background-color: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
}

.nav-item.active {
  background-color: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.nav-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-count {
  font-size: 0.75rem;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
}

.nav-item.active .nav-count {
  background: var(--accent);
  color: #fff;
}

.sidebar-footer {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.data-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

/* Main Content */
.main-content {
  flex: 1;
  padding: 24px 32px 60px;
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
}

/* Topbar */
.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.search-box {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 14px;
  font-size: 0.95rem;
  color: var(--text-muted);
  pointer-events: none;
}

.search-box input {
  width: 100%;
  padding: 12px 16px 12px 42px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 0.95rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-box input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.select-pill {
  padding: 11px 14px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 0.9rem;
  cursor: pointer;
}

/* Tags Bar */
.tags-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.tag-chip {
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.tag-chip:hover {
  border-color: rgba(255, 255, 255, 0.25);
  color: var(--text-main);
}

.tag-chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* Section Header */
.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.section-header h1 {
  font-size: 1.4rem;
  font-weight: 700;
}

.section-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.stats-pill {
  font-size: 0.82rem;
  color: var(--text-muted);
  background: var(--bg-surface);
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-color);
}

/* Category Group Section */
.category-section {
  margin-bottom: 34px;
}

.category-section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.category-section-header h2 {
  font-size: 1.1rem;
  font-weight: 600;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 16px;
}

/* Site Card */
.site-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
  position: relative;
}

.site-card:hover {
  transform: translateY(-3px);
  background-color: var(--bg-card-hover);
  border-color: var(--border-hover);
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.site-identity {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.site-favicon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--accent);
  flex-shrink: 0;
}

.site-title-wrap {
  min-width: 0;
}

.site-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-main);
  text-decoration: none;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.site-title:hover {
  color: var(--accent);
}

.site-domain {
  font-size: 0.74rem;
  color: var(--text-muted);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.badge {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 600;
  flex-shrink: 0;
}

.badge-free {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
}

.badge-hd {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
}

.badge-hot {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
}

.badge-vip {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
}

.site-desc {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin-bottom: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.5em;
}

.card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  overflow: hidden;
}

.mini-tag {
  font-size: 0.72rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  padding: 2px 7px;
  border-radius: 4px;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.action-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  font-size: 0.85rem;
  transition: color 0.15s, background 0.15s;
}

.action-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.08);
}

.action-btn.fav-active {
  color: #fbbf24;
}

.visit-link {
  font-size: 0.78rem;
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--accent-soft);
}

.visit-link:hover {
  background: var(--accent);
  color: #fff;
}

/* Buttons */
.btn {
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  text-align: center;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  border-color: var(--border-color);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.1);
}

.btn-block {
  width: 100%;
}

.btn-sm {
  padding: 6px 8px;
  font-size: 0.75rem;
}

.icon-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 200;
}

.modal-overlay.hidden {
  display: none;
}

.modal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  padding: 24px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}

.age-modal {
  text-align: center;
  max-width: 420px;
}

.age-badge {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  border: 2px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 800;
  margin: 0 auto 16px;
}

.age-modal h2 {
  margin-bottom: 10px;
}

.age-modal p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.form-group {
  margin-bottom: 14px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-group label {
  display: block;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-base);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-main);
  font-size: 0.9rem;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.age-modal .modal-actions {
  justify-content: center;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px dashed var(--border-color);
}

.mobile-only {
  display: none;
}

@media (max-width: 860px) {
  .sidebar {
    position: fixed;
    left: -260px;
    transition: left 0.25s ease;
  }
  .sidebar.open {
    left: 0;
  }
  .mobile-only {
    display: inline-flex;
  }
  .main-content {
    padding: 18px;
  }
}
