:root {
  --bg: #07080d;
  --bg-soft: #0b0d15;
  --card: rgba(6, 10, 20, 0.72);
  --card-hi: rgba(14, 21, 36, 0.84);
  --line: rgba(255, 255, 255, 0.085);
  --line-hi: rgba(255, 255, 255, 0.16);
  --text: #e9edf6;
  --muted: #8d95a9;
  --dim: #646c80;
  --accent: #4ff0c8;
  --accent-2: #8b7bff;
  --accent-3: #ff8fb1;
  --ok: #3ddc97;
  --warn: #ffcc66;
  --danger: #ff6b6b;
  --radius: 18px;
  --shadow: 0 20px 60px -30px rgba(0, 0, 0, 0.9);
  --font: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", -apple-system, "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }

/* 背景色放在 html 上，body 保持透明，否则会盖住 body::before 的背景图 */
html {
  background: var(--bg);
}

html, body { height: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: transparent;
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background-color: #05070c;
  background-image:
    linear-gradient(180deg, rgba(4, 8, 18, 0.7) 0%, rgba(4, 8, 18, 0.82) 38%, rgba(4, 8, 18, 0.94) 100%),
    radial-gradient(120% 70% at 50% 0%, rgba(30, 90, 170, 0.22), transparent 65%),
    url('/bg.jpg');
  background-size: 100% 100%, 100% 100%, cover;
  background-position: center, center, center;
  background-repeat: no-repeat, no-repeat, no-repeat;
  background-attachment: scroll, scroll, fixed;
}

@media (max-width: 720px) {
  body::before {
    background-image:
      linear-gradient(180deg, rgba(4, 8, 18, 0.72) 0%, rgba(4, 8, 18, 0.84) 40%, rgba(4, 8, 18, 0.94) 100%),
      radial-gradient(120% 70% at 50% 0%, rgba(30, 90, 170, 0.2), transparent 65%),
      url('/bg-mobile.jpg');
    background-attachment: scroll, scroll, scroll;
  }
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(circle at 50% 20%, #000 20%, transparent 78%);
  -webkit-mask-image: radial-gradient(circle at 50% 20%, #000 20%, transparent 78%);
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
img { max-width: 100%; }

/* ---------------------------------------------------------- 导航 */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px clamp(16px, 4vw, 48px);
  background: rgba(5, 8, 15, 0.8);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

.logo {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  overflow: hidden;
  background: linear-gradient(140deg, var(--accent), var(--accent-2) 70%);
  color: #06110f;
  font-weight: 900;
  font-size: 17px;
  box-shadow: 0 8px 24px -10px rgba(79, 240, 200, 0.8);
}

.menu { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }

.menu a {
  padding: 7px 13px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 14px;
  transition: 0.18s;
  white-space: nowrap;
}

.menu a:hover { color: var(--text); background: var(--card); }
.menu a.active { color: #06110f; background: linear-gradient(140deg, var(--accent), #79ffd9); font-weight: 600; }

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

.search {
  width: clamp(120px, 18vw, 220px);
  padding: 8px 14px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  outline: none;
  font-size: 13.5px;
  transition: 0.2s;
}

.search:focus { border-color: rgba(79, 240, 200, 0.55); background: rgba(255, 255, 255, 0.08); }
.search::placeholder { color: var(--dim); }

.ghost {
  padding: 8px 14px;
  border-radius: 11px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 13.5px;
  transition: 0.2s;
  white-space: nowrap;
}
.ghost:hover { color: var(--text); border-color: var(--line-hi); background: var(--card); }

/* ---------------------------------------------------------- 布局 */

main {
  width: min(1180px, 100% - 32px);
  margin: 0 auto;
  padding: 42px 0 70px;
  flex: 1 0 auto;
  min-height: 0;
}

.hero { padding: 34px 0 30px; }

.hero h1 {
  margin: 0 0 10px;
  font-size: clamp(32px, 5.4vw, 58px);
  line-height: 1.1;
  letter-spacing: -1.4px;
  font-weight: 800;
  background: linear-gradient(120deg, #ffffff 10%, #d5fff4 42%, #b9b0ff 78%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p { margin: 0; color: var(--muted); font-size: clamp(14px, 1.7vw, 17px); max-width: 640px; }

.hero-badges { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; }

.badge {
  padding: 6px 13px;
  border-radius: 999px;
  font-size: 12.5px;
  color: var(--muted);
  border: 1px solid var(--line);
  background: var(--card);
}
.badge b { color: var(--accent); font-weight: 700; }

.notice {
  margin: 26px 0 0;
  padding: 14px 18px;
  border-radius: 14px;
  border: 1px solid rgba(79, 240, 200, 0.22);
  background: linear-gradient(100deg, rgba(79, 240, 200, 0.09), rgba(139, 123, 255, 0.07));
  color: #cfe6e0;
  font-size: 13.8px;
  white-space: pre-wrap;
}

.section-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 44px 0 18px;
}
.section-head h2 { margin: 0; font-size: 19px; letter-spacing: -0.2px; }
.section-head .sub { color: var(--dim); font-size: 13px; }
.section-head .spacer { flex: 1; }

/* ---------------------------------------------------------- 卡片 */

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

.feature {
  position: relative;
  padding: 22px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--card);
  overflow: hidden;
  transition: 0.24s cubic-bezier(0.22, 1, 0.36, 1);
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 148px;
}

.feature::after {
  content: "";
  position: absolute;
  inset: -60% 40% 55% -20%;
  background: radial-gradient(circle, rgba(79, 240, 200, 0.18), transparent 65%);
  opacity: 0;
  transition: 0.3s;
}

.feature:hover {
  /* 方框跟着鼠标走，鼠标在框内时用极短过渡保证跟手 */
  transition: transform 0.07s linear,
    border-color 0.3s ease,
    background 0.3s ease,
    box-shadow 0.4s ease,
    --mx 0.05s linear,
    --my 0.05s linear;
  border-color: rgba(79, 240, 200, 0.5);
  background: var(--card-hi);
  box-shadow: 0 0 0 1px rgba(79, 240, 200, 0.2), 0 0 46px -16px rgba(79, 240, 200, 0.55),
    0 26px 50px -30px rgba(0, 0, 0, 1);
  z-index: 3;
}
.feature:active {
  border-color: rgba(79, 240, 200, 0.75);
}
.feature:hover::after { opacity: 1; }

.feature .ico { font-size: 25px; }
.feature h3 { margin: 0; font-size: 16.5px; }
.feature p { margin: 0; color: var(--muted); font-size: 13.2px; line-height: 1.6; }
.feature .arrow {
  position: absolute;
  right: 18px;
  top: 18px;
  color: var(--dim);
  font-size: 16px;
  transition: 0.2s;
}
.feature:hover .arrow { color: var(--accent); transform: translate(2px, -2px); }
.feature .count { margin-top: auto; color: var(--dim); font-size: 12px; }

.panel {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px;
}

/* ---------------------------------------------------------- 列表项 */

.feature,
.panel {
  backdrop-filter: blur(12px) saturate(115%);
  -webkit-backdrop-filter: blur(12px) saturate(115%);
}

@media (max-width: 720px) {
  .feature,
  .panel {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

.item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--card);
  transition: 0.2s;
  margin-bottom: 10px;
}
.item:hover { border-color: var(--line-hi); background: var(--card-hi); }

.item .avatar {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 19px;
  font-weight: 700;
  color: #06110f;
  background: linear-gradient(140deg, var(--accent), #9dffdf);
}

.item .body { flex: 1; min-width: 0; }
.item .title-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.item .title-line strong { font-size: 15px; }
.item .desc { color: var(--muted); font-size: 13.2px; margin: 2px 0 0; word-break: break-word; }
.item .meta { color: var(--dim); font-size: 12px; display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }

.tag {
  font-size: 11.5px;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
}

.host {
  font-size: 12px;
  color: var(--accent);
  opacity: 0.85;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------------------------------------------------------- 按钮 */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 18px;
  border-radius: 12px;
  border: 1px solid var(--line-hi);
  background: var(--card);
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  transition: 0.18s;
  white-space: nowrap;
}
.btn:hover { background: var(--card-hi); border-color: rgba(255, 255, 255, 0.28); }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn.primary {
  background: linear-gradient(140deg, var(--accent), #79ffd9);
  color: #06110f;
  font-weight: 700;
  border: none;
  box-shadow: 0 12px 30px -16px rgba(79, 240, 200, 0.9);
}
.btn.primary:hover { filter: brightness(1.06); }

.btn.sm { padding: 6px 12px; font-size: 12.5px; border-radius: 10px; }
.btn.danger { color: var(--danger); border-color: rgba(255, 107, 107, 0.3); }
.btn.danger:hover { background: rgba(255, 107, 107, 0.1); }

/* ---------------------------------------------------------- 表单 */

input[type="text"], input[type="password"], input[type="url"], textarea, select {
  width: 100%;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: 0.18s;
}
input:focus, textarea:focus, select:focus {
  border-color: rgba(79, 240, 200, 0.5);
  background: rgba(255, 255, 255, 0.07);
}
textarea { resize: vertical; min-height: 90px; }
label.field { display: block; margin-bottom: 12px; }
label.field span { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }

.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 120px; }

.cat-row {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
.cat-row input { min-width: 0; }
.cat-row .cat-emoji { text-align: center; padding: 11px 4px; }

.upload-fields {
  display: grid;
  grid-template-columns: minmax(130px, 1.1fr) minmax(100px, 1fr) minmax(90px, 0.8fr);
  gap: 10px;
  margin-top: 14px;
}
.upload-fields .field { margin-bottom: 0; min-width: 0; }
.upload-fields input, .upload-fields select { width: 100%; }

@media (max-width: 520px) {
  .upload-fields { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------- 问答 */

.qa-layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 20px;
  align-items: start;
}

.q-card {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 12px;
  transition: 0.2s;
}
.q-card:hover { border-color: var(--line-hi); }
.q-card.pinned { border-color: rgba(79, 240, 200, 0.35); background: linear-gradient(180deg, rgba(79, 240, 200, 0.06), var(--card) 40%); }

.q-head { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 8px; }
.q-head .who { font-size: 12.5px; color: var(--muted); }
.q-head .dot { color: var(--dim); font-size: 11px; }
.q-head .time { font-size: 12px; color: var(--dim); }
.q-head .pin { font-size: 11px; color: var(--accent); border: 1px solid rgba(79, 240, 200, 0.35); padding: 1px 8px; border-radius: 999px; }

.q-text { font-size: 15px; white-space: pre-wrap; word-break: break-word; }

.replies { margin-top: 12px; padding-left: 12px; border-left: 2px solid var(--line); display: grid; gap: 10px; }

.reply { font-size: 13.6px; color: #cdd4e3; }
.reply .r-meta { font-size: 11.8px; color: var(--dim); margin-bottom: 2px; display: flex; gap: 8px; align-items: center; }
.reply .admin-tag { color: var(--accent); font-weight: 600; }
.reply .r-text { white-space: pre-wrap; word-break: break-word; }

.q-actions { display: flex; gap: 8px; align-items: center; margin-top: 12px; }
.q-actions .linkbtn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 12.5px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
}
.q-actions .linkbtn:hover { color: var(--accent); background: rgba(79, 240, 200, 0.08); }

.reply-form { margin-top: 10px; display: none; gap: 8px; }
.reply-form.open { display: flex; }
.reply-form textarea { min-height: 64px; }

.sticky-form { position: sticky; top: 86px; }

/* ---------------------------------------------------------- 筛选条 */

.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }

.chip {
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  transition: 0.18s;
}
.chip:hover { color: var(--text); border-color: var(--line-hi); }
.chip.active {
  color: #06110f;
  background: linear-gradient(140deg, var(--accent), #79ffd9);
  border-color: transparent;
  font-weight: 700;
}

.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .search { width: 260px; }

/* ---------------------------------------------------------- 空态 */

.empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--dim);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}
.empty .big { font-size: 30px; margin-bottom: 8px; opacity: 0.6; }

.skeleton {
  height: 92px;
  border-radius: 14px;
  background: linear-gradient(90deg, var(--card), var(--card-hi), var(--card));
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite linear;
  margin-bottom: 10px;
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------------------------------------------------------- 页脚 */

.foot {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding: 26px clamp(16px, 4vw, 48px);
  color: var(--dim);
  font-size: 12.6px;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  flex-wrap: wrap;
}
.foot a { color: var(--muted); }
.foot a:hover { color: var(--accent); }

/* ---------------------------------------------------------- 提示 */

#toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translate(-50%, 20px);
  padding: 11px 22px;
  border-radius: 12px;
  background: rgba(20, 24, 34, 0.96);
  border: 1px solid var(--line-hi);
  color: var(--text);
  font-size: 13.5px;
  opacity: 0;
  pointer-events: none;
  transition: 0.25s;
  z-index: 999;
  box-shadow: var(--shadow);
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.err { border-color: rgba(255, 107, 107, 0.5); color: #ffc7c7; }

/* ---------------------------------------------------------- 后台 */

.admin-wrap {
  width: min(1240px, 100% - 32px);
  margin: 0 auto;
  padding: 26px 0 80px;
}

.admin-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.admin-head h1 { margin: 0; font-size: 22px; }
.admin-head .spacer { flex: 1; }

.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 20px; }

.tab {
  padding: 9px 16px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--muted);
  font-size: 13.5px;
  cursor: pointer;
  transition: 0.18s;
}
.tab:hover { color: var(--text); }
.tab.active { color: #06110f; background: linear-gradient(140deg, var(--accent), #79ffd9); border-color: transparent; font-weight: 700; }

.admin-grid { display: grid; grid-template-columns: 400px 1fr; gap: 20px; align-items: start; }

.login-box {
  width: min(400px, 92vw);
  margin: 12vh auto;
  padding: 30px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--card);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}
.login-box h1 { margin: 0 0 6px; font-size: 22px; }
.login-box p { margin: 0 0 22px; color: var(--muted); font-size: 13.5px; }

.drop {
  border: 1.5px dashed var(--line-hi);
  border-radius: 16px;
  padding: 26px;
  text-align: center;
  color: var(--muted);
  font-size: 13.5px;
  cursor: pointer;
  transition: 0.2s;
  background: rgba(255, 255, 255, 0.02);
}
.drop:hover, .drop.over { border-color: var(--accent); background: rgba(79, 240, 200, 0.07); color: var(--text); }
.drop .big { font-size: 26px; display: block; margin-bottom: 6px; }

.progress {
  height: 6px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin-top: 12px;
  display: none;
}
.progress.show { display: block; }
.progress > i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.15s;
}

table.list { width: 100%; border-collapse: collapse; font-size: 13.4px; }
table.list th {
  text-align: left;
  padding: 10px 12px;
  color: var(--dim);
  font-weight: 500;
  font-size: 12.3px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.list td { padding: 11px 12px; border-bottom: 1px solid rgba(255, 255, 255, 0.045); vertical-align: middle; }
table.list tr:hover td { background: rgba(255, 255, 255, 0.022); }
table.list td.actions { text-align: right; white-space: nowrap; }

.mono { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 12px; color: var(--muted); }

.hint { color: var(--dim); font-size: 12.3px; margin-top: 8px; }

.qa-admin-item {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  margin-bottom: 10px;
  background: var(--card);
}
.qa-admin-item .q-line { font-size: 14px; margin-bottom: 6px; }

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 22px; }
.stat-box { padding: 18px; border-radius: 15px; border: 1px solid var(--line); background: var(--card); }
.stat-box b { display: block; font-size: 26px; font-weight: 800; letter-spacing: -0.5px; }
.stat-box span { color: var(--dim); font-size: 12.4px; }

/* ---------------------------------------------------------- 响应式 */

@media (max-width: 900px) {
  .qa-layout, .admin-grid { grid-template-columns: 1fr; }
  .sticky-form { position: static; }
}

@media (max-width: 720px) {
  .nav { flex-wrap: wrap; gap: 10px; padding: 11px 14px; }
  .brand { order: 1; flex: 0 0 auto; }
  .nav-right { order: 2; flex: 1; margin-left: 0; min-width: 0; justify-content: flex-end; }
  .nav-right .search { flex: 1; width: auto; min-width: 0; }
  .nav-right .ghost { flex: 0 0 auto; }
  .menu {
    order: 3;
    flex: 0 0 100%;
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .menu::-webkit-scrollbar { display: none; }
  .menu a { padding: 6px 11px; font-size: 13px; }
  .search { width: 130px; }
  main { padding: 26px 0 70px; }
  .hero { padding: 18px 0 12px; }
  .grid-cards { grid-template-columns: 1fr; }
  .item { padding: 12px; }
  .admin-grid { grid-template-columns: 1fr; }
  table.list { font-size: 12.5px; }
  table.list td, table.list th { padding: 8px 6px; }
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.12); border-radius: 99px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.22); }

::selection { background: rgba(79, 240, 200, 0.28); }

/* ============================================================ 丝滑切换 */

/* 顶部加载进度条 */
#pageProgress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  z-index: 9999;
  pointer-events: none;
  transform: scaleX(0);
  transform-origin: left center;
  opacity: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-2) 60%, var(--accent-3));
  box-shadow: 0 0 12px rgba(79, 240, 200, 0.7);
  will-change: transform, opacity;
}

/* 页面内容入场 */
#view {
  min-height: 0;
}

@keyframes viewIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.994);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

#view.view-in {
  animation: viewIn 0.34s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* 子项交错入场 */
@keyframes itemIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* 用 backwards 而不是 both：动画结束后不再锁定 transform，
   否则会一直覆盖 :hover 的放大/上浮效果 */
.stagger > * {
  animation: itemIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}
.stagger > *:nth-child(1) { animation-delay: 0.03s; }
.stagger > *:nth-child(2) { animation-delay: 0.08s; }
.stagger > *:nth-child(3) { animation-delay: 0.13s; }
.stagger > *:nth-child(4) { animation-delay: 0.18s; }
.stagger > *:nth-child(5) { animation-delay: 0.23s; }
.stagger > *:nth-child(6) { animation-delay: 0.28s; }

/* 骨架屏淡出（替换内容时不闪） */
.skeleton {
  transition: opacity 0.2s ease;
}

/* 统计数字滚动时的等宽 */
.badge b,
.stat-box b {
  font-variant-numeric: tabular-nums;
  transition: color 0.3s ease;
}

/* 导航切换更顺滑 */
.menu a {
  transition: color 0.22s ease, background 0.22s ease, transform 0.18s ease;
}
.menu a:active {
  transform: scale(0.96);
}

/* 卡片入场后 hover 不受影响 */
.feature {
  will-change: transform;
}

/* 按钮按压反馈 */
.btn:active,
.chip:active {
  transform: scale(0.97);
}

.btn,
.chip {
  transition: transform 0.14s ease, background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

/* 问答展开动画 */
.reply-form.open {
  animation: itemIn 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* 尊重系统「减少动态效果」设置 */
@media (prefers-reduced-motion: reduce) {
  #view.view-in,
  .stagger > *,
  .reply-form.open {
    animation: none !important;
  }
  * {
    transition-duration: 0.01ms !important;
  }
}
/* 后台标签页切换的入场 */
#pane.pane-in {
  animation: itemIn 0.3s cubic-bezier(0.22, 1, 0.36, 1) both;
}
/* 后台页面背景压暗，减少干扰 */
body.admin-page::before {
  background-image:
    linear-gradient(180deg, rgba(4, 8, 18, 0.86) 0%, rgba(4, 8, 18, 0.93) 100%),
    radial-gradient(120% 70% at 50% 0%, rgba(30, 90, 170, 0.16), transparent 65%),
    url('/bg.jpg');
}
/* ============================================================ AI 直达栏 */

.ai-section {
  margin-top: 34px;
}

.ai-scroll {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px 2px 12px;
  overflow: visible;
}

@media (max-width: 900px) {
  .ai-scroll {
    flex-wrap: nowrap;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    mask-image: linear-gradient(90deg, #000 0, #000 94%, transparent 100%);
    -webkit-mask-image: linear-gradient(90deg, #000 0, #000 94%, transparent 100%);
  }
}

.ai-scroll::-webkit-scrollbar {
  display: none;
  height: 0;
}
.ai-scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
  border-radius: 99px;
}
.ai-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.ai-label {
  flex: 0 0 auto;
  align-self: center;
  font-size: 11.5px;
  letter-spacing: 0.4px;
  color: var(--accent);
  border: 1px dashed rgba(79, 240, 200, 0.45);
  padding: 4px 10px;
  border-radius: 9px;
  margin-right: 2px;
  white-space: nowrap;
}
.ai-label.warn {
  color: var(--warn);
  border-color: rgba(255, 204, 102, 0.45);
}

.ai-pill {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 14px 8px 8px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--card);
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
  scroll-snap-align: start;
  text-decoration: none;
}
.ai-pill:hover {
  background: var(--card-hi);
  border-color: var(--line-hi);
  transform: translateY(-2px);
}
.ai-pill:active {
  transform: scale(0.97);
}

.ai-ico {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-size: 15px;
  line-height: 1;
  color: #06110f;
  flex: 0 0 auto;
}

.ai-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.ai-name {
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.15;
  white-space: nowrap;
}

.ai-tags {
  display: flex;
  gap: 4px;
}

.ai-tag {
  font-style: normal;
  font-size: 10.5px;
  line-height: 1.5;
  padding: 0 6px;
  border-radius: 5px;
  color: var(--dim);
  background: rgba(255, 255, 255, 0.07);
  white-space: nowrap;
}
.ai-tag.ok {
  color: var(--ok);
  background: rgba(61, 220, 151, 0.14);
}
.ai-tag.warn {
  color: var(--warn);
  background: rgba(255, 204, 102, 0.14);
}

@media (max-width: 720px) {
  .ai-pill {
    padding: 7px 11px 7px 7px;
    gap: 7px;
  }
  .ai-ico {
    width: 27px;
    height: 27px;
    font-size: 14px;
  }
  .ai-name {
    font-size: 12.5px;
  }
}
.ai-break {
  flex: 0 0 100%;
  height: 0;
  margin: 2px 0 0;
}

@media (max-width: 900px) {
  .ai-break {
    display: none;
  }
}
/* 分区页返回首页 */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--muted);
  padding: 6px 12px 6px 10px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--card);
  transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease;
  margin-bottom: 6px;
}
.back-link:hover {
  color: var(--accent);
  background: var(--card-hi);
  border-color: var(--line-hi);
}
/* ============================================================ 交互动效增强 */

/* 全局：可点击元素统一手感 */
a, button, .feature, .chip, .item, .btn {
  -webkit-tap-highlight-color: transparent;
}

/* 卡片：鼠标跟随光斑 + 3D 倾斜 */
.feature {
  --mx: 50%;
  --my: 50%;
  transform-style: preserve-3d;
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.22s ease, background 0.22s ease, box-shadow 0.28s ease;
}

.feature::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    280px circle at var(--mx) var(--my),
    rgba(79, 240, 200, 0.16),
    rgba(139, 123, 255, 0.08) 45%,
    transparent 68%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 0;
}

.feature:hover::before {
  opacity: 1;
}

.feature > * {
  position: relative;
  z-index: 1;
}

/* 图标保持静止，动的是整个卡片框 */
.feature .ico {
  display: inline-block;
}

/* 卡片箭头 */
.feature .arrow {
  transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.2s ease;
}
.feature:hover .arrow {
  transform: translate(4px, -4px) scale(1.15);
}

/* 点击涟漪 */
.ripple {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(79, 240, 200, 0.32), rgba(79, 240, 200, 0.06) 60%, transparent 70%);
  transform: scale(0);
  animation: rippleOut 0.65s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  pointer-events: none;
  z-index: 5;
}

@keyframes rippleOut {
  0% {
    transform: scale(0);
    opacity: 0.9;
  }
  100% {
    transform: scale(1);
    opacity: 0;
  }
}

.btn,
.chip,
.item {
  position: relative;
  overflow: hidden;
}

/* 按钮按下更明显 */
.btn:active {
  transform: scale(0.96) translateY(1px);
}
.btn.primary:active {
  filter: brightness(1.12);
}

/* 主按钮：悬停光扫 */
.btn.primary {
  position: relative;
  overflow: hidden;
}
.btn.primary::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    115deg,
    transparent 30%,
    rgba(255, 255, 255, 0.45) 50%,
    transparent 70%
  );
  transform: translateX(-130%);
  transition: transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}
.btn.primary:hover::after {
  transform: translateX(130%);
}

/* 列表项：悬停位移 + 左侧发光 */
.item {
  transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.2s ease, background 0.2s ease, box-shadow 0.24s ease;
}
.item:hover {
  transform: translateX(5px);
  box-shadow: -3px 0 0 0 var(--accent), 0 8px 24px -18px rgba(79, 240, 200, 0.8);
}

/* 问答卡片 */
.q-card {
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.2s ease, background 0.2s ease, box-shadow 0.24s ease;
}
.q-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 40px -30px rgba(79, 240, 200, 0.9);
}

/* 分类标签 */
.chip {
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1),
    background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}
.chip:hover {
  transform: translateY(-2px);
}
.chip:active {
  transform: scale(0.94);
}

/* 页面切换：带方向的滑入 */
@keyframes viewInRight {
  from {
    opacity: 0;
    transform: translateX(26px) scale(0.995);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes viewInLeft {
  from {
    opacity: 0;
    transform: translateX(-26px) scale(0.995);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

#view.view-in-right {
  animation: viewInRight 0.36s cubic-bezier(0.22, 1, 0.36, 1) both;
}

#view.view-in-left {
  animation: viewInLeft 0.36s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* 链接悬停底线动画 */
.foot a {
  position: relative;
  transition: color 0.2s ease;
}
.foot a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
.foot a:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* 输入框聚焦光晕 */
input:focus,
textarea:focus,
select:focus {
  box-shadow: 0 0 0 3px rgba(79, 240, 200, 0.12);
}

/* 骨架屏柔和呼吸 */
.skeleton {
  animation: shimmer 1.4s infinite linear, breathe 2.4s ease-in-out infinite;
}
@keyframes breathe {
  0%, 100% { opacity: 0.85; }
  50% { opacity: 1; }
}

/* 减少动态效果时全部关掉 */
@media (prefers-reduced-motion: reduce) {
  .feature::before,
  .ripple,
  .btn.primary::after {
    display: none !important;
  }
  #view.view-in-right,
  #view.view-in-left,
  .feature:hover,
  .item:hover,
  .q-card:hover,
  .chip:hover {
    animation: none !important;
    transform: none !important;
  }
}
/* ============================================================ 丝滑升级 */

/* 注册自定义属性，让光斑坐标可以参与过渡（浏览器支持：Edge/Chrome 85+） */
@property --mx {
  syntax: '<length-percentage>';
  inherits: false;
  initial-value: 50%;
}

@property --my {
  syntax: '<length-percentage>';
  inherits: false;
  initial-value: 50%;
}

@property --dx {
  syntax: '<number>';
  inherits: true;
  initial-value: 0;
}

@property --dy {
  syntax: '<number>';
  inherits: true;
  initial-value: 0;
}

/* 卡片：更长的缓动 + 光斑平滑跟随 */
.feature {
  --mx: 50%;
  --my: 50%;
  will-change: transform;
  position: relative;
  transition: transform 0.52s cubic-bezier(0.16, 1, 0.3, 1),
    border-color 0.32s ease,
    background 0.32s ease,
    box-shadow 0.52s cubic-bezier(0.16, 1, 0.3, 1),
    --mx 0.05s linear,
    --my 0.05s linear;
}

.feature::before {
  transition: opacity 0.42s ease;
}

/* 其他元素也放慢一点点，手感统一 */
.item {
  transition: transform 0.42s cubic-bezier(0.16, 1, 0.3, 1),
    border-color 0.28s ease, background 0.28s ease,
    box-shadow 0.42s cubic-bezier(0.16, 1, 0.3, 1);
}

.q-card {
  transition: transform 0.42s cubic-bezier(0.16, 1, 0.3, 1),
    border-color 0.28s ease, background 0.28s ease,
    box-shadow 0.42s cubic-bezier(0.16, 1, 0.3, 1);
}

.chip {
  transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1),
    background 0.22s ease, color 0.22s ease, border-color 0.22s ease;
}

.btn {
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
    background 0.22s ease, border-color 0.22s ease, color 0.22s ease;
}

/* ============================================================ 首屏加载动画 */

.boot {
  min-height: 62vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 26px;
}

.boot-wrap {
  position: relative;
  width: 96px;
  height: 96px;
  display: grid;
  place-items: center;
}

.boot-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: var(--accent);
  border-right-color: rgba(139, 123, 255, 0.55);
  animation: bootSpin 1.1s linear infinite;
}

.boot-ring.second {
  inset: 12px;
  border-top-color: rgba(139, 123, 255, 0.7);
  border-right-color: transparent;
  border-left-color: rgba(79, 240, 200, 0.4);
  animation-duration: 1.8s;
  animation-direction: reverse;
}

@keyframes bootSpin {
  to { transform: rotate(360deg); }
}

.boot::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background: radial-gradient(620px circle at 50% 46%, rgba(79, 240, 200, 0.07), transparent 68%);
}

.boot-logo {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: linear-gradient(140deg, var(--accent), var(--accent-2) 75%);
  animation: bootPulse 1.6s ease-in-out infinite;
}

.logo img,
.boot-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

@keyframes bootPulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 28px -10px rgba(79, 240, 200, 0.85);
  }
  50% {
    transform: scale(1.07);
    box-shadow: 0 0 52px -6px rgba(79, 240, 200, 1), 0 0 22px -8px rgba(139, 123, 255, 0.9);
  }
}

.boot-dots {
  display: flex;
  gap: 7px;
}

.boot-dots i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.35;
  animation: bootDot 1.25s ease-in-out infinite;
}

.boot-dots i:nth-child(2) { animation-delay: 0.16s; }
.boot-dots i:nth-child(3) { animation-delay: 0.32s; }

@keyframes bootDot {
  0%, 100% { opacity: 0.28; transform: translateY(0) scale(0.9); }
  50% { opacity: 1; transform: translateY(-5px) scale(1.15); }
}

.boot-text {
  font-size: 12.5px;
  color: var(--dim);
  letter-spacing: 1px;
}

/* 首屏内容淡入（替换加载动画时） */
@keyframes homeFadeIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

#view.home-in {
  animation: homeFadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@media (prefers-reduced-motion: reduce) {
  .boot-ring,
  .boot-logo,
  .boot-dots i {
    animation: none !important;
  }
  .feature,
  .item,
  .q-card,
  .chip,
  .btn {
    transition-duration: 0.01ms !important;
  }
}