/* ============================================================
   应用目录 · 仅列表
   ============================================================ */

:root {
  --bg: #f7f4ef;
  --glow-1: rgba(226, 84, 63, 0.11);
  --glow-2: rgba(251, 114, 153, 0.10);
  --surface: #ffffff;
  --surface-soft: #faf8f5;
  --border: rgba(48, 38, 32, 0.09);
  --border-strong: rgba(48, 38, 32, 0.17);
  --text: #2b2622;
  --text-soft: #6e655d;
  --text-faint: #a79e95;
  --accent: #e2543f;
  --accent-soft: rgba(226, 84, 63, 0.11);
  --shadow-sm: 0 2px 8px rgba(60, 45, 35, 0.05);
  --shadow-md: 0 10px 30px rgba(60, 45, 35, 0.08);
  --shadow-lg: 0 24px 60px rgba(60, 45, 35, 0.16);
  --radius: 20px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  --mono: "SF Mono", ui-monospace, "JetBrains Mono", Menlo, Consolas, monospace;
}

[data-theme="dark"] {
  --bg: #171614;
  --glow-1: rgba(226, 84, 63, 0.14);
  --glow-2: rgba(251, 114, 153, 0.10);
  --surface: #22201e;
  --surface-soft: #282623;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.17);
  --text: #f3ede7;
  --text-soft: #b3aaa1;
  --text-faint: #7e766e;
  --accent: #f0755f;
  --accent-soft: rgba(240, 117, 95, 0.16);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.26);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.44);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.35s ease, color 0.35s ease;
  overflow-x: hidden;
}
body::before, body::after {
  content: ""; position: fixed; border-radius: 50%;
  filter: blur(90px); pointer-events: none; z-index: 0;
}
body::before { width: 480px; height: 480px; top: -230px; left: -120px; background: var(--glow-1); }
body::after  { width: 560px; height: 560px; top: 180px; right: -220px; background: var(--glow-2); }

button { font-family: inherit; cursor: pointer; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.app {
  position: relative; z-index: 1;
  max-width: 1000px; margin: 0 auto;
  padding: 56px 26px;
  min-height: 100vh;
  display: flex; flex-direction: column; justify-content: center;
}

/* ---------- group & list ---------- */
.group { margin-bottom: 30px; }
.group:last-child { margin-bottom: 0; }
.group-head {
  display: flex; align-items: center; gap: 10px;
  margin: 0 2px 12px;
}
.group-name { font-size: 12px; font-weight: 700; letter-spacing: 0.06em; color: var(--text-soft); }
.group-line { flex: 1; height: 1px; background: var(--border); }
.group-count { font-size: 11px; color: var(--text-faint); font-variant-numeric: tabular-nums; }

.site-list { display: flex; flex-direction: column; gap: 10px; }
.site-item {
  display: flex; align-items: center; gap: 16px;
  padding: 18px 20px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  animation: rise 0.42s ease both;
}
.site-item:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.site-icon {
  width: 46px; height: 46px; flex: none; border-radius: 14px;
  display: grid; place-items: center; color: #fff;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.10);
}
.site-icon svg { width: 22px; height: 22px; }

.site-main { flex: 1; min-width: 0; }
.site-title-row { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.site-title { font-size: 15px; font-weight: 700; letter-spacing: 0.01em; }
.tag {
  font-size: 10px; font-weight: 600; padding: 3px 8px; border-radius: 999px;
  background: var(--surface-soft); color: var(--text-faint); border: 1px solid var(--border);
  white-space: nowrap;
}
.tag.dup { background: rgba(240, 170, 60, 0.14); color: #b98218; border-color: rgba(240, 170, 60, 0.3); }
[data-theme="dark"] .tag.dup { color: #f0bd63; }
.site-desc { font-size: 12px; color: var(--text-soft); margin-top: 5px; line-height: 1.5; }
.site-url {
  display: block; margin-top: 10px; font-family: var(--mono); font-size: 11.5px;
  color: var(--text-faint); word-break: break-all; line-height: 1.5;
  text-decoration: none; transition: color 0.18s ease;
}
.site-url:hover { color: var(--accent); }
.site-url .path { color: var(--text-soft); }

.site-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.btn-open {
  height: 36px; padding: 0 15px; border-radius: 11px;
  border: 1px solid var(--border-strong); background: var(--surface-soft);
  color: var(--text); font-size: 12px; font-weight: 600;
  text-decoration: none; display: inline-flex; align-items: center; gap: 6px;
  transition: all 0.18s ease;
}
.btn-open:hover { color: #fff; background: var(--accent); border-color: var(--accent); }
.btn-open svg { width: 13px; height: 13px; }
.btn-copy {
  width: 36px; height: 36px; border-radius: 11px;
  border: 1px solid var(--border); background: var(--surface-soft);
  color: var(--text-soft); display: grid; place-items: center;
  transition: all 0.18s ease;
}
.btn-copy:hover { color: var(--accent); border-color: var(--border-strong); }
.btn-copy svg { width: 15px; height: 15px; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 32px; z-index: 60;
  transform: translate(-50%, 14px);
  padding: 11px 20px; border-radius: 13px;
  background: var(--text); color: var(--bg);
  font-size: 12.5px; font-weight: 500; box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none; transition: all 0.26s ease; white-space: nowrap;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- responsive ---------- */
@media (max-width: 680px) {
  .app { padding: 36px 16px; }
  .site-item { align-items: flex-start; flex-wrap: wrap; gap: 12px; padding: 16px; }
  .site-main { flex-basis: calc(100% - 60px); }
  .site-actions { margin-left: 58px; }
  .btn-open { padding: 0 13px; }
}
