/* ════════════════════════════════════════════════
   abkk — 深色侧栏金色主题
   布局：固定左侧栏 + 右侧滚动主区
   ════════════════════════════════════════════════ */
:root {
  --bg:        #09090f;
  --sidebar:   #0e0c1a;
  --card:      rgba(255,255,255,0.04);
  --card-h:    rgba(255,255,255,0.07);
  --border:    rgba(255,255,255,0.07);
  --border-h:  rgba(245,197,24,0.35);
  --gold:      #f5c518;
  --gold2:     #d4a800;
  --text:      #ccc4e8;
  --sub:       #8b83a8;
  --muted:     #4e4870;
  --radius:    10px;
  --sidebar-w: 230px;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'PingFang SC', 'Microsoft YaHei UI', system-ui, sans-serif;
  min-height: 100vh;
  display: flex;
  font-size: 14px;
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }

/* ── SIDEBAR ───────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 100;
}

/* 侧栏滚动条美化 */
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: var(--muted); border-radius: 4px; }

/* Logo */
.sidebar-logo {
  padding: 26px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.sidebar-logo a {
  display: flex;
  align-items: center;
  gap: 11px;
}
.logo-gem {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, var(--gold) 0%, #b8860b 100%);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 900;
  color: #0a0800;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(245,197,24,0.3);
}
.logo-name {
  font-size: 14px; font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}
.logo-name small {
  display: block;
  font-size: 10px; font-weight: 400;
  color: var(--muted);
  margin-top: 1px;
}

/* 侧栏导航 */
.sidebar-section {
  padding: 18px 0 4px;
}
.section-label {
  padding: 0 20px 8px;
  font-size: 10px; font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1.2px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 20px;
  color: var(--sub);
  font-size: 13px;
  transition: all .15s;
  cursor: pointer;
  border-left: 2px solid transparent;
}
.nav-item:hover,
.nav-item.active {
  background: rgba(245,197,24,0.06);
  color: var(--gold);
  border-left-color: var(--gold);
}
.nav-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--muted);
  flex-shrink: 0;
  transition: background .15s;
}
.nav-item:hover .nav-dot,
.nav-item.active .nav-dot {
  background: var(--gold);
  box-shadow: 0 0 6px rgba(245,197,24,0.6);
}
.nav-count {
  margin-left: auto;
  font-size: 10px; color: var(--muted);
  background: rgba(255,255,255,0.05);
  padding: 1px 7px;
  border-radius: 10px;
  min-width: 24px;
  text-align: center;
}

/* 侧栏底部 */
.sidebar-bottom {
  margin-top: auto;
  padding: 16px 20px 20px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.submit-btn {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%;
  padding: 11px 0;
  background: linear-gradient(135deg, var(--gold), var(--gold2));
  color: #0a0800;
  font-size: 13px; font-weight: 700;
  border-radius: 9px;
  transition: opacity .2s, transform .1s;
  box-shadow: 0 4px 14px rgba(245,197,24,0.2);
}
.submit-btn:hover { opacity: .9; transform: translateY(-1px); }
.submit-btn:active { transform: translateY(0); }

/* ── MAIN AREA ──────────────────────────────────── */
.main-wrap {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* 顶部工具栏 */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 28px;
  background: rgba(9,9,15,0.85);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
  position: sticky; top: 0; z-index: 50;
}
.topbar-stat {
  font-size: 12px; color: var(--muted);
  display: flex; align-items: center; gap: 16px;
}
.topbar-stat span { display: flex; align-items: center; gap: 5px; }
.topbar-stat strong { color: var(--gold); }
.topbar-actions { display: flex; gap: 8px; }
.topbar-btn {
  font-size: 12px; color: var(--muted);
  padding: 5px 13px;
  border: 1px solid var(--border);
  border-radius: 6px;
  transition: all .15s;
}
.topbar-btn:hover { border-color: var(--border-h); color: var(--gold); }

/* 主内容区 */
.content {
  flex: 1;
  padding: 28px 28px 20px;
}

/* ── CATEGORY BLOCK ─────────────────────────────── */
.cat-block { margin-bottom: 40px; }

.cat-header {
  display: flex; align-items: center; gap: 0;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.cat-bar {
  width: 3px; height: 20px;
  background: linear-gradient(to bottom, var(--gold), rgba(245,197,24,0.2));
  border-radius: 2px;
  margin-right: 12px;
  flex-shrink: 0;
}
.cat-header h2 {
  font-size: 16px; font-weight: 700;
  color: var(--text);
}
.cat-header h2 a { color: inherit; }
.cat-header h2 a:hover { color: var(--gold); }
.cat-desc {
  margin-left: 10px;
  font-size: 12px; color: var(--muted);
}
.cat-all {
  margin-left: auto;
  font-size: 12px; color: var(--muted);
  padding: 4px 12px;
  border: 1px solid var(--border);
  border-radius: 20px;
  transition: all .15s;
  white-space: nowrap;
}
.cat-all:hover { border-color: var(--border-h); color: var(--gold); }

/* ── SITE CARDS ─────────────────────────────────── */
.site-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 10px;
}

.site-card {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all .2s;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}
.site-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(245,197,24,0.05), transparent 60%);
  opacity: 0;
  transition: opacity .2s;
}
.site-card:hover {
  background: var(--card-h);
  border-color: var(--border-h);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.5), 0 0 0 1px rgba(245,197,24,0.1);
}
.site-card:hover::after { opacity: 1; }

/* 排名徽章 */
.site-rank {
  position: absolute; top: 7px; right: 9px;
  font-size: 10px; font-weight: 800;
  color: var(--muted);
  letter-spacing: 0;
}
.site-rank.r1 { color: var(--gold); text-shadow: 0 0 8px rgba(245,197,24,0.5); }
.site-rank.r2 { color: #b0b8c8; }
.site-rank.r3 { color: #c97c3a; }

/* favicon 区域 */
.site-icon {
  width: 28px; height: 28px;
  border-radius: 7px;
  object-fit: contain;
  flex-shrink: 0;
  background: rgba(255,255,255,0.03);
}
.site-icon-placeholder {
  width: 28px; height: 28px;
  border-radius: 7px;
  background: rgba(245,197,24,0.12);
  border: 1px solid rgba(245,197,24,0.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800;
  color: var(--gold);
  flex-shrink: 0;
}

.site-info { min-width: 0; flex: 1; }
.site-name {
  font-size: 13px; font-weight: 600;
  color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  padding-right: 20px;  /* 给排名徽章留位 */
  transition: color .15s;
}
.site-card:hover .site-name { color: var(--gold); }
.site-clicks {
  font-size: 10px; color: var(--muted);
  margin-top: 2px;
  display: flex; align-items: center; gap: 3px;
}
.site-clicks::before {
  content: '';
  display: inline-block;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--muted);
}
.site-clicks.hot { color: var(--gold); }
.site-clicks.hot::before { background: var(--gold); box-shadow: 0 0 4px rgba(245,197,24,0.6); }

/* ── FRIEND LINKS ───────────────────────────────── */
.fl-section {
  margin-top: 8px;
  padding: 22px 24px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.fl-header {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 14px;
}
.fl-header-bar {
  width: 2px; height: 14px;
  background: var(--gold);
  border-radius: 2px;
}
.fl-header-title {
  font-size: 11px; font-weight: 700;
  color: var(--muted);
  text-transform: uppercase; letter-spacing: 1px;
}
.fl-list {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.fl-item {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 13px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 12px; color: var(--sub);
  transition: all .15s;
}
.fl-item img {
  width: 14px; height: 14px;
  border-radius: 3px; object-fit: contain;
}
.fl-item:hover { border-color: var(--border-h); color: var(--gold); }

/* ── FOOTER ─────────────────────────────────────── */
.site-footer {
  padding: 14px 28px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; color: var(--muted);
  background: rgba(0,0,0,0.15);
  flex-wrap: wrap; gap: 8px;
}
.site-footer a { color: var(--muted); transition: color .15s; }
.site-footer a:hover { color: var(--gold); }
.footer-right { display: flex; gap: 16px; align-items: center; }

/* ── CATEGORY PAGE ──────────────────────────────── */
.page-hero {
  padding: 28px 0 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}
.breadcrumb {
  font-size: 12px; color: var(--muted);
  margin-bottom: 10px;
  display: flex; align-items: center; gap: 6px;
}
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--gold); }
.breadcrumb-sep { color: var(--muted); }
.page-title {
  font-size: 22px; font-weight: 800;
  color: var(--text);
  display: flex; align-items: center; gap: 12px;
}
.page-title-gem {
  width: 8px; height: 30px;
  background: linear-gradient(to bottom, var(--gold), rgba(245,197,24,0.3));
  border-radius: 4px;
}
.page-sub { font-size: 13px; color: var(--muted); margin-top: 6px; margin-left: 20px; }

.full-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 10px;
}

/* ── SUBMIT PAGE ────────────────────────────────── */
.sf-wrap { padding: 28px; max-width: 640px; }
.sf-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}
.sf-head {
  background: linear-gradient(135deg, rgba(245,197,24,0.12), rgba(245,197,24,0.04));
  border-bottom: 1px solid var(--border);
  padding: 24px 28px;
}
.sf-head h1 { font-size: 18px; font-weight: 800; color: var(--gold); }
.sf-head p  { font-size: 13px; color: var(--sub); margin-top: 8px; line-height: 1.8; }
.sf-body { padding: 26px 28px; }
.sf-field { margin-bottom: 20px; }
.sf-field label {
  display: block; font-size: 12px; font-weight: 700;
  color: var(--muted); margin-bottom: 7px;
  text-transform: uppercase; letter-spacing: .5px;
}
.sf-field .req { color: var(--gold); margin-left: 2px; }
.sf-field input[type=text],
.sf-field input[type=url],
.sf-field input[type=number],
.sf-field select {
  width: 100%;
  padding: 11px 14px;
  background: rgba(255,255,255,0.04);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 13px; font-family: inherit;
  color: var(--text);
  outline: none;
  transition: border-color .2s, background .2s;
  appearance: none;
}
.sf-field input:focus,
.sf-field select:focus {
  border-color: rgba(245,197,24,0.5);
  background: rgba(245,197,24,0.04);
}
.sf-hint { font-size: 11px; color: var(--muted); margin-top: 5px; }
.sf-captcha-row { display: flex; align-items: center; gap: 12px; }
.sf-captcha-box {
  flex-shrink: 0; padding: 10px 18px;
  background: rgba(245,197,24,0.08);
  border: 1.5px solid rgba(245,197,24,0.3);
  border-radius: 8px;
  font-size: 18px; font-weight: 800; color: var(--gold);
  font-family: 'Courier New', monospace; letter-spacing: 2px;
}
.sf-captcha-row input[type=number] { max-width: 110px; }
.sf-btn {
  width: 100%; padding: 14px;
  background: linear-gradient(135deg, var(--gold), var(--gold2));
  color: #0a0800;
  border: none; border-radius: 9px;
  font-size: 14px; font-weight: 800;
  cursor: pointer; transition: opacity .2s, transform .1s;
  font-family: inherit;
}
.sf-btn:hover { opacity: .9; transform: translateY(-1px); }
.sf-btn:active { transform: translateY(0); }
.sf-alert-err {
  background: rgba(229,57,53,0.08);
  border-left: 3px solid #e53935;
  color: #ff7070;
  padding: 10px 14px; border-radius: 6px; font-size: 13px; margin-bottom: 18px;
}
.sf-note {
  margin-top: 18px; padding: 14px;
  background: rgba(245,197,24,0.05);
  border: 1px solid rgba(245,197,24,0.15);
  border-radius: 8px; font-size: 12px; color: var(--sub); line-height: 1.9;
}
.sf-note strong { color: var(--gold); }
/* success */
.sf-ok-box { padding: 26px 28px; }
.sf-ok-title { font-size: 18px; font-weight: 800; color: var(--gold); margin-bottom: 6px; }
.sf-ok-sub   { font-size: 13px; color: var(--sub); margin-bottom: 22px; }
.sf-token-block {
  background: rgba(245,197,24,0.06);
  border: 1.5px solid rgba(245,197,24,0.25);
  border-radius: 10px; padding: 16px; margin-bottom: 14px;
}
.sf-track-block {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 10px; padding: 16px; margin-bottom: 20px;
}
.sf-block-lbl {
  font-size: 10px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: 1px; margin-bottom: 10px;
}
.sf-token-val {
  font-family: 'Courier New', monospace;
  font-size: 22px; font-weight: 900; color: var(--gold); letter-spacing: 2px;
}
.sf-info-row {
  display: flex; align-items: baseline; gap: 10px;
  padding: 6px 0; border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.sf-info-row:last-of-type { border-bottom: none; }
.sf-info-key { font-size: 11px; font-weight: 700; color: var(--gold); min-width: 28px; flex-shrink: 0; }
.sf-info-val { color: var(--text); word-break: break-all; font-family: 'Courier New', monospace; font-size: 12px; }
.sf-copy-row { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.sf-copy-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 14px;
  background: rgba(245,197,24,0.12);
  border: 1px solid rgba(245,197,24,0.3);
  color: var(--gold); border-radius: 6px; font-size: 12px;
  cursor: pointer; font-family: inherit; transition: all .15s;
}
.sf-copy-btn:hover { background: rgba(245,197,24,0.2); }
.sf-copy-btn.alt { background: rgba(255,255,255,0.05); border-color: var(--border); color: var(--sub); }
.sf-copy-btn.alt:hover { color: var(--text); border-color: var(--border-h); }
.sf-steps {
  border: 1px solid var(--border); border-radius: 10px; padding: 16px;
}
.sf-steps h3 { font-size: 13px; font-weight: 700; margin-bottom: 12px; color: var(--text); }
.sf-steps ol  { padding-left: 18px; }
.sf-steps li  { font-size: 13px; color: var(--sub); line-height: 2.1; }
.sf-steps code {
  background: rgba(245,197,24,0.1);
  padding: 1px 6px; border-radius: 4px;
  font-size: 11px; color: var(--gold);
}
.sf-again { text-align: center; margin-top: 20px; font-size: 13px; }
.sf-again a { color: var(--gold); }

/* ── EMPTY / UTILITY ────────────────────────────── */
.empty { padding: 40px 0; text-align: center; font-size: 13px; color: var(--muted); }
.empty a { color: var(--gold); }

/* ══════════════════════════════════════════════════
   MOBILE  ≤ 768px
   侧栏变为两行顶部导航：
     第1行  Logo（左）+ 提交按钮（右）
     第2行  分类横向滚动胶囊
   ══════════════════════════════════════════════════ */
@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }

  /* body 改为纵向堆叠 */
  body { flex-direction: column; }

  /* ── 侧栏 → 粘性顶部 header ── */
  .sidebar {
    position: sticky;
    top: 0;
    width: 100%;
    height: auto;
    min-height: unset;
    flex-direction: row;   /* 子元素横向排列 */
    flex-wrap: wrap;       /* 超出宽度自动换行 */
    border-right: none;
    border-bottom: 1px solid var(--border);
    overflow: visible;
    z-index: 200;
    background: var(--sidebar);
  }

  /* 第1行左侧：Logo */
  .sidebar-logo {
    order: 1;
    flex: 1 1 0;           /* 占满剩余宽度 */
    min-width: 0;
    padding: 11px 14px;
    border-bottom: none;
    border-right: none;
  }
  .sidebar-logo .logo-name small { display: none; }
  .logo-gem { width: 32px; height: 32px; font-size: 15px; border-radius: 8px; }
  .logo-name { font-size: 13px; }

  /* 第1行右侧：提交按钮（sidebar-bottom 移到右边） */
  .sidebar-bottom {
    order: 2;
    flex: 0 0 auto;
    margin-top: 0;
    padding: 11px 14px;
    border-top: none;
    display: flex;
    align-items: center;
  }
  .submit-btn {
    width: auto;
    padding: 8px 14px;
    font-size: 12px;
    white-space: nowrap;
    box-shadow: none;
    border-radius: 7px;
  }

  /* 第2行分类导航：手机端直接隐藏，太占位置 */
  .sidebar-section { display: none; }

  /* ── 主区域 ── */
  .main-wrap { margin-left: 0; }

  /* topbar 在手机不再 sticky，避免与侧栏叠压 */
  .topbar {
    position: static;
    padding: 10px 14px;
    backdrop-filter: none;
  }
  .topbar-stat { gap: 10px; font-size: 11px; }
  .topbar-actions { display: none; }   /* header 已有提交按钮，隐藏此处重复项 */

  /* 内容区减少边距 */
  .content { padding: 14px 14px 10px; }

  /* 分类块 */
  .cat-block { margin-bottom: 28px; }
  .cat-header { flex-wrap: wrap; gap: 6px; padding-bottom: 10px; }
  .cat-header h2 { font-size: 14px; }
  .cat-desc { display: none; }
  .cat-all { font-size: 11px; padding: 3px 10px; }

  /* 网站卡片：手机端强制 2 列 */
  .site-grid, .full-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .site-card { padding: 10px 11px; gap: 8px; }
  .site-icon,
  .site-icon-placeholder { width: 24px; height: 24px; border-radius: 6px; }
  .site-icon-placeholder { font-size: 11px; }
  .site-name { font-size: 12px; }
  .site-rank { font-size: 9px; top: 5px; right: 7px; }

  /* 友情链接 */
  .fl-section { padding: 14px; }

  /* 分类详情页 Hero */
  .page-hero { padding: 18px 0 14px; }
  .page-title { font-size: 18px; }
  .page-sub { margin-left: 14px; }

  /* 提交表单 */
  .sf-wrap { padding: 14px; max-width: 100%; }
  .sf-head { padding: 18px; }
  .sf-body { padding: 18px; }
  .sf-ok-box { padding: 18px; }
  .sf-captcha-row { flex-wrap: wrap; gap: 8px; }
  .sf-token-val { font-size: 18px; letter-spacing: 1px; }

  /* 页脚：版权左，链接右 */
  .site-footer {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    padding: 14px;
    gap: 8px;
  }
  .footer-right { gap: 14px; }
}

/* ── 超小屏 ≤ 380px ───────────────────────────── */
@media (max-width: 380px) {
  .site-grid, .full-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }
  .site-card { padding: 9px 10px; gap: 7px; }
  .site-name { font-size: 11px; }
  .content { padding: 10px; }
}
