/* =============================================================
   AI 应用网址导航 - 样式
   设计原则：克制配色、充足留白、清晰层级
   ============================================================= */

:root[data-theme="light"] {
  --bg: #fafaf9;
  --bg-soft: #f3f3f1;
  --surface: #ffffff;
  --surface-hover: #fdfdfc;
  --text: #17191e;
  --text-2: #5b616d;
  --text-3: #969ba5;
  --line: #e6e6e3;
  --line-soft: #efefed;
  --accent: #3b5bdb;
  --accent-2: #5b6ee1;
  --accent-soft: rgba(59, 91, 219, .08);
  --new-soft: rgba(59, 91, 219, .09);
  --hot-soft: rgba(200, 92, 58, .09);
  --hot: #b85c3c;
  --header-bg: rgba(250, 250, 249, .82);
  --shadow-sm: 0 1px 2px rgba(20, 22, 28, .035);
  --shadow: 0 1px 2px rgba(20, 22, 28, .04), 0 10px 28px rgba(20, 22, 28, .04);
  --shadow-hover: 0 4px 12px rgba(20, 22, 28, .055), 0 18px 40px rgba(20, 22, 28, .075);
  --glow: radial-gradient(760px 420px at 50% -140px, rgba(59, 91, 219, .10), transparent 70%);
}

:root[data-theme="dark"] {
  --bg: #0c0e12;
  --bg-soft: #171a20;
  --surface: #14171d;
  --surface-hover: #181c23;
  --text: #edeef2;
  --text-2: #a0a6b2;
  --text-3: #6f7581;
  --line: #262a32;
  --line-soft: #1f232a;
  --accent: #8ba0ff;
  --accent-2: #a3b2ff;
  --accent-soft: rgba(139, 160, 255, .12);
  --new-soft: rgba(139, 160, 255, .13);
  --hot-soft: rgba(226, 138, 100, .13);
  --hot: #e08a64;
  --header-bg: rgba(12, 14, 18, .82);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .2);
  --shadow: 0 1px 2px rgba(0, 0, 0, .2), 0 10px 28px rgba(0, 0, 0, .16);
  --shadow-hover: 0 4px 12px rgba(0, 0, 0, .24), 0 18px 40px rgba(0, 0, 0, .28);
  --glow: radial-gradient(760px 420px at 50% -140px, rgba(91, 110, 225, .16), transparent 70%);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 88px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color .25s ease, color .25s ease;
}

a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button { cursor: pointer; }
svg { display: block; }

::selection { background: var(--accent-soft); color: var(--text); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.shell { width: 100%; max-width: 1200px; margin: 0 auto; padding-left: 28px; padding-right: 28px; }

.bg-glow { position: absolute; inset: 0 0 auto; height: 620px; background: var(--glow); pointer-events: none; z-index: 0; }

/* ---------------- Header ---------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--header-bg);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--line);
}
.header-inner { height: 68px; display: flex; align-items: center; gap: 32px; position: relative; z-index: 1; }
.brand { display: flex; align-items: center; gap: 11px; flex-shrink: 0; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 11px;
  display: grid; place-items: center;
  background: var(--text); color: var(--bg);
}
.brand-mark svg { width: 23px; height: 23px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { font-size: 15px; font-weight: 650; letter-spacing: -.02em; }
.brand-text small { font-size: 9px; letter-spacing: .14em; color: var(--text-3); margin-top: 2px; }
.header-nav { display: flex; gap: 28px; margin-left: 18px; }
.header-nav a { font-size: 13px; color: var(--text-2); transition: color .18s; }
.header-nav a:hover { color: var(--text); }
.header-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.icon-btn {
  position: relative; width: 36px; height: 36px; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); color: var(--text-2);
  transition: color .18s, border-color .18s, background-color .18s;
}
.icon-btn:hover { color: var(--text); border-color: var(--text-3); }
.icon-btn svg { width: 18px; height: 18px; }
.ico-moon { display: none; }
:root[data-theme="dark"] .ico-sun { display: none; }
:root[data-theme="dark"] .ico-moon { display: block; }
.fav-btn.is-on { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.fav-btn.is-on svg { fill: currentColor; }
.fav-count {
  position: absolute; top: -6px; right: -6px; min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 9px; background: var(--accent); color: #fff;
  font-size: 10px; line-height: 17px; text-align: center; font-weight: 600;
}

/* ---------------- Hero ---------------- */
.hero { position: relative; z-index: 1; padding-top: 86px; padding-bottom: 62px; text-align: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; margin: 0 0 22px;
  font-size: 10px; font-weight: 600; letter-spacing: .18em; color: var(--text-3);
  text-transform: uppercase;
}
.eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.hero h1 {
  margin: 0; font-size: clamp(36px, 5.2vw, 60px); line-height: 1.16;
  font-weight: 680; letter-spacing: -.045em;
}
.hero h1 em {
  font-style: normal;
  background: linear-gradient(100deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-sub { margin: 18px 0 0; color: var(--text-2); font-size: 15px; }

.search-box {
  position: relative; max-width: 660px; height: 60px; margin: 36px auto 0;
  display: flex; align-items: center; gap: 12px; padding: 0 16px 0 20px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: var(--shadow); transition: border-color .2s, box-shadow .2s;
}
.search-box:focus-within { border-color: var(--accent); box-shadow: var(--shadow-hover); }
.search-box > svg { width: 20px; height: 20px; color: var(--text-3); flex-shrink: 0; }
.search-box input {
  flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent;
  color: var(--text); font-size: 14.5px;
}
.search-box input::placeholder { color: var(--text-3); }
.search-box input::-webkit-search-cancel-button { display: none; }
.search-box kbd {
  flex-shrink: 0; padding: 3px 8px; border: 1px solid var(--line); border-radius: 6px;
  background: var(--bg-soft); color: var(--text-3); font-size: 11px; font-family: inherit;
}
.search-clear {
  flex-shrink: 0; width: 24px; height: 24px; border: 0; border-radius: 6px;
  background: var(--bg-soft); color: var(--text-2); font-size: 18px; line-height: 1;
}
.search-clear:hover { color: var(--text); }

.hot-terms { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; margin-top: 18px; }
.hot-terms > span { font-size: 12px; color: var(--text-3); margin-right: 2px; }
.hot-terms button {
  padding: 4px 12px; border: 1px solid var(--line); border-radius: 999px;
  background: transparent; color: var(--text-2); font-size: 12px;
  transition: all .18s;
}
.hot-terms button:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }

.stats {
  display: flex; justify-content: center; gap: 0; margin-top: 52px;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  padding: 22px 0; max-width: 780px; margin-left: auto; margin-right: auto;
}
.stats > div { flex: 1; display: flex; flex-direction: column; gap: 3px; border-right: 1px solid var(--line); }
.stats > div:last-child { border-right: 0; }
.stats strong { font-size: 23px; font-weight: 650; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.stats span { font-size: 11.5px; color: var(--text-3); }

/* ---------------- Section common ---------------- */
.section { padding-top: 30px; padding-bottom: 30px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.section-head h2 { margin: 0; font-size: 21px; font-weight: 650; letter-spacing: -.025em; }
.section-en { font-size: 10px; font-weight: 500; letter-spacing: .12em; color: var(--text-3); margin-left: 6px; vertical-align: 2px; }
.section-head p { margin: 6px 0 0; color: var(--text-2); font-size: 13px; }
.text-btn { border: 0; background: transparent; color: var(--text-2); font-size: 12.5px; padding: 6px 0; white-space: nowrap; }
.text-btn:hover { color: var(--accent); }
.text-btn span { margin-left: 4px; }

/* ---------------- New arrivals ---------------- */
.new-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.new-card {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 15px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow-sm); transition: transform .2s, box-shadow .2s, border-color .2s;
}
.new-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); border-color: var(--accent); }
.new-card .icon-mark { width: 40px; height: 40px; flex-shrink: 0; border-radius: 11px; font-size: 16px; }
.new-card .nc-body { min-width: 0; flex: 1; }
.new-card .nc-name { display: block; font-size: 13.5px; font-weight: 620; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.new-card .nc-desc { display: block; font-size: 11.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.new-card .nc-arrow { width: 15px; height: 15px; color: var(--text-3); flex-shrink: 0; }
.new-card:hover .nc-arrow { color: var(--accent); }

/* ---------------- Directory ---------------- */
.directory { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 36px; padding-top: 42px; padding-bottom: 50px; }
.sidebar { position: sticky; top: 92px; align-self: start; }
.sidebar-title { font-size: 11px; font-weight: 600; letter-spacing: .1em; color: var(--text-3); padding: 0 12px 12px; }
.cat-list { display: flex; flex-direction: column; gap: 2px; }
.cat-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 11px;
  border: 0; border-radius: 10px; background: transparent; color: var(--text-2);
  font-size: 13px; text-align: left; transition: background-color .18s, color .18s;
}
.cat-item:hover { background: var(--bg-soft); color: var(--text); }
.cat-item.is-active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.cat-ico { width: 17px; height: 17px; display: grid; place-items: center; flex-shrink: 0; }
.cat-ico svg { width: 16px; height: 16px; }
.cat-name { flex: 1; white-space: nowrap; }
.cat-count { font-size: 11px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.cat-item.is-active .cat-count { color: var(--accent); }
.sidebar-divider { height: 1px; background: var(--line); margin: 12px 11px; }

.results-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.results-title { display: flex; align-items: baseline; gap: 12px; }
.results-title h2 { margin: 0; font-size: 17px; font-weight: 650; letter-spacing: -.02em; }
.results-title span { font-size: 12px; color: var(--text-3); }
.sort-wrap { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-3); }
.sort-wrap select {
  padding: 6px 28px 6px 10px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); color: var(--text-2); font-size: 12px; cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='m3 4.5 3 3 3-3' fill='none' stroke='%23969ba5' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center;
}
.sort-wrap select:hover { border-color: var(--text-3); }

.active-filter { margin-bottom: 16px; }
.filter-chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 5px 11px;
  border-radius: 8px; background: var(--accent-soft); color: var(--accent); font-size: 12px;
}
.filter-chip button { border: 0; background: transparent; color: inherit; font-size: 15px; line-height: 1; padding: 0; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(252px, 1fr)); gap: 14px; }

.site-card {
  position: relative; display: flex; flex-direction: column; min-height: 168px; padding: 17px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 15px;
  box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease, background-color .2s ease;
}
.site-card:hover { transform: translateY(-3px); background: var(--surface-hover); border-color: var(--accent); box-shadow: var(--shadow-hover); }
.card-top { display: flex; align-items: flex-start; gap: 12px; }
.icon-mark {
  width: 44px; height: 44px; flex-shrink: 0; border-radius: 12px;
  display: grid; place-items: center; font-size: 17px; font-weight: 650;
  border: 1px solid var(--line-soft); letter-spacing: -.02em;
}
:root[data-theme="dark"] .icon-mark { filter: brightness(1.28) saturate(1.05); }
.card-heading { flex: 1; min-width: 0; padding-top: 1px; }
.card-name { display: flex; align-items: center; gap: 6px; font-size: 14.5px; font-weight: 640; letter-spacing: -.015em; }
.card-name span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-sub { font-size: 11px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.badge {
  flex-shrink: 0; padding: 2px 6px; border-radius: 5px; font-size: 9.5px; font-weight: 700;
  letter-spacing: .05em; line-height: 1.5;
}
.badge-new { background: var(--new-soft); color: var(--accent); }
.badge-hot { background: var(--hot-soft); color: var(--hot); }
.card-desc {
  margin: 13px 0 0; font-size: 12.5px; line-height: 1.65; color: var(--text-2);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 14px; }
.card-domain { font-size: 11px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.mini-btn {
  width: 27px; height: 27px; display: grid; place-items: center;
  border: 0; border-radius: 7px; background: transparent; color: var(--text-3);
  transition: color .18s, background-color .18s;
}
.mini-btn:hover { color: var(--accent); background: var(--accent-soft); }
.mini-btn svg { width: 15px; height: 15px; }
.mini-btn.is-fav { color: var(--accent); }
.mini-btn.is-fav svg { fill: currentColor; }

/* 整卡可点击：透明覆盖层在下，操作按钮在上 */
.card-hit { position: absolute; inset: 0; z-index: 1; border-radius: 15px; }
.card-actions { position: relative; z-index: 2; }

.empty-state { padding: 72px 20px; text-align: center; border: 1px dashed var(--line); border-radius: 16px; }
.empty-ico { width: 44px; height: 44px; margin: 0 auto 16px; display: grid; place-items: center; border-radius: 12px; background: var(--bg-soft); color: var(--text-3); }
.empty-ico svg { width: 22px; height: 22px; }
.empty-state h3 { margin: 0 0 6px; font-size: 16px; font-weight: 620; }
.empty-state p { margin: 0 0 18px; color: var(--text-3); font-size: 13px; }
.empty-state button { padding: 8px 18px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--text); font-size: 12.5px; }
.empty-state button:hover { border-color: var(--accent); color: var(--accent); }

/* ---------------- About ---------------- */
.about { padding-top: 20px; padding-bottom: 70px; }
.about-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.about-card { padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: 15px; }
.about-num { font-size: 11px; letter-spacing: .12em; color: var(--accent); font-weight: 600; }
.about-card h3 { margin: 14px 0 8px; font-size: 15px; font-weight: 640; }
.about-card p { margin: 0; color: var(--text-2); font-size: 12.5px; line-height: 1.75; }
.disclaimer { margin: 22px 0 0; font-size: 11.5px; color: var(--text-3); line-height: 1.8; }
.disclaimer a, .footer-info a { color: var(--text-2); border-bottom: 1px solid var(--line); }
.disclaimer a:hover, .footer-info a:hover { color: var(--accent); border-color: var(--accent); }

/* ---------------- Footer ---------------- */
.site-footer { border-top: 1px solid var(--line); background: var(--surface); }
.footer-top { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; padding: 44px 0 38px; }
.footer-logo { font-size: 17px; font-weight: 650; letter-spacing: -.025em; }
.footer-brand p { margin: 10px 0 0; font-size: 12px; color: var(--text-3); line-height: 1.8; max-width: 340px; }
.footer-info h4 { margin: 0 0 14px; font-size: 11px; letter-spacing: .1em; color: var(--text-3); font-weight: 600; }
.footer-info dl { margin: 0; }
.footer-info dl > div { display: flex; gap: 16px; padding: 4px 0; font-size: 12px; }
.footer-info dt { width: 88px; flex-shrink: 0; color: var(--text-3); }
.footer-info dd { margin: 0; color: var(--text-2); }
.footer-bottom {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 16px 0 24px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--text-3);
}

/* ---------------- Back to top ---------------- */
.back-top {
  position: fixed; right: 26px; bottom: 26px; z-index: 40;
  width: 40px; height: 40px; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface); color: var(--text-2); box-shadow: var(--shadow);
  opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: opacity .22s, visibility .22s, transform .22s, color .18s;
}
.back-top.is-show { opacity: 1; visibility: visible; transform: translateY(0); }
.back-top:hover { color: var(--accent); }
.back-top svg { width: 18px; height: 18px; }

/* ---------------- Responsive ---------------- */
@media (max-width: 1000px) {
  .new-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .directory { grid-template-columns: 180px minmax(0, 1fr); gap: 24px; }
  .footer-top { gap: 32px; }
}

@media (max-width: 780px) {
  .shell { padding-left: 18px; padding-right: 18px; }
  html { scroll-padding-top: 76px; }
  .header-inner { height: 62px; gap: 12px; }
  .header-nav { display: none; }
  .brand-text small { display: none; }
  .hero { padding-top: 58px; padding-bottom: 44px; }
  .hero-sub { font-size: 13.5px; }
  .search-box { height: 54px; margin-top: 28px; }
  .search-box input { font-size: 13px; }
  .search-box kbd { display: none; }
  .stats { margin-top: 38px; flex-wrap: wrap; }
  .stats > div { flex: 0 0 50%; padding: 10px 0; border-right: 0; }
  .stats strong { font-size: 20px; }
  .section-head { align-items: flex-start; }
  .new-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .new-card { padding: 12px; gap: 10px; }
  .new-card .icon-mark { width: 34px; height: 34px; font-size: 14px; }
  .new-card .nc-arrow { display: none; }
  .directory { display: block; padding-top: 24px; }
  .sidebar {
    position: sticky; top: 62px; z-index: 20; margin: 0 -18px 20px; padding: 10px 18px;
    background: var(--header-bg); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
  }
  .sidebar-title, .sidebar-divider, .quick-item { display: none; }
  .cat-list { flex-direction: row; gap: 7px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .cat-list::-webkit-scrollbar { display: none; }
  .cat-item {
    width: auto; flex-shrink: 0; padding: 7px 13px; border: 1px solid var(--line);
    border-radius: 999px; background: var(--surface); font-size: 12px; gap: 6px;
  }
  .cat-item .cat-ico, .cat-item .cat-count { display: none; }
  .cat-item.is-active { border-color: var(--accent); }
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .site-card { min-height: 158px; padding: 14px; }
  .about-grid { grid-template-columns: 1fr; }
  .about-card { padding: 20px; }
  .footer-top { grid-template-columns: 1fr; gap: 28px; padding: 34px 0 28px; }
  .footer-info dl > div { flex-direction: column; gap: 0; padding: 5px 0; }
  .footer-info dt { width: auto; font-size: 11px; }
  .footer-bottom { flex-direction: column; gap: 6px; }
  .back-top { right: 16px; bottom: 16px; }
}

@media (max-width: 460px) {
  .hero h1 { font-size: 32px; }
  .hot-terms { gap: 6px; }
  .hot-terms button { padding: 4px 10px; font-size: 11px; }
  .new-grid { grid-template-columns: 1fr; }
  .card-grid { grid-template-columns: 1fr; }
  .section-head { flex-direction: column; gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
