/* 官网基础布局与组件（M3 / W0）。只消费 /theme.css 里的 CSS 变量——配色/字体全在主题层。 */
* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; } /* 防局部 display 样式盖掉 hidden 属性 */

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.7;
}
.wrap { max-width: 1020px; margin: 0 auto; padding: 0 20px; }
a { color: inherit; text-decoration: none; }

/* 顶栏 */
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 2px solid var(--card-border);
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.logo { font-size: 1.25rem; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.logo-mark { font-size: 1.4rem; }
.nav { display: flex; gap: 22px; }
.nav a { color: var(--ink-soft); font-weight: 600; }
.nav a:hover { color: var(--accent); }

/* ── 首屏栖息地场景（官网即产品演示，ADR-023）────────────────────
 * 分层：天空(容器背景) → 日月/云 → 远山/近丘 → 树木 → 草地 → 宠物层(#habitat) → 毛玻璃卡 */
.habitat-scene {
  position: relative; height: calc(100vh - 60px); min-height: 560px; overflow: hidden;
  background: linear-gradient(var(--sky-top), var(--sky-bottom) 70%);
}
.celestial { position: absolute; top: 7%; right: 9%; font-size: 72px; user-select: none; }
.celestial::before { content: var(--celestial); }
.cloud {
  position: absolute; font-size: 56px; opacity: 0.9; user-select: none;
  animation: drift linear infinite;
}
.cloud-1 { top: 10%; animation-duration: 95s; }
.cloud-2 { top: 22%; font-size: 40px; animation-duration: 140s; animation-delay: -60s; }
.cloud-3 { top: 5%; font-size: 32px; animation-duration: 115s; animation-delay: -30s; }
@keyframes drift { from { left: -12%; } to { left: 104%; } }
.hill {
  position: absolute; border-radius: 50%;
}
.hill-far {
  width: 130%; height: 52%; left: -35%; bottom: 14%;
  background: var(--hill-far);
}
.hill-near {
  width: 120%; height: 44%; right: -30%; bottom: 9%;
  background: var(--hill-near);
}
.tree { position: absolute; bottom: 16%; user-select: none; filter: drop-shadow(0 4px 3px rgba(0,0,0,0.12)); }
.ground {
  position: absolute; left: 0; right: 0; bottom: 0; height: 20%;
  background: linear-gradient(var(--grass-top), var(--grass-bottom));
  border-top: 4px solid color-mix(in srgb, var(--grass-top) 72%, black);
}
/* 宠物层：walker.js 往里放 .walker（真精灵帧，整片草原漫游+近大远小，向左走水平镜像） */
.habitat { position: absolute; inset: 0; pointer-events: none; }
.walker {
  position: absolute; left: 0; bottom: 0;
  background-repeat: no-repeat;
  image-rendering: pixelated;
  will-change: transform, background-position;
}

/* 毛玻璃信息卡 */
.glass-card {
  position: absolute; top: 50%; transform: translateY(-56%); z-index: 6000;
  left: max(20px, 6vw); max-width: 480px; padding: 36px;
  background: var(--glass-bg); border: 2px solid var(--glass-border);
  border-radius: calc(var(--radius) + 6px); backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}
.hero-title { font-size: clamp(2.2rem, 5vw, 3.4rem); letter-spacing: 0.02em; }
.hero-tagline { font-size: 1.2rem; color: var(--accent); font-weight: 700; margin-top: 8px; }
.hero-sub { color: var(--ink-soft); margin-top: 12px; }
.hero-cta { margin-top: 24px; display: flex; gap: 14px; flex-wrap: wrap; }
.scroll-hint {
  position: absolute; left: 50%; transform: translateX(-50%); bottom: 10px;
  font-size: 1.6rem; color: var(--ink-soft); animation: bob 1.8s ease-in-out infinite;
}
@keyframes bob { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, 8px); } }
@media (max-width: 640px) {
  .glass-card { left: 16px; right: 16px; max-width: none; padding: 24px; }
}

/* 按钮 */
.btn {
  display: inline-block; padding: 12px 28px; border-radius: 999px;
  font-weight: 700; cursor: pointer; transition: transform 0.15s, box-shadow 0.15s;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow); }
.btn-primary:hover { transform: translateY(-2px) scale(1.03); }
.btn-ghost { border: 2px solid var(--card-border); color: var(--ink-soft); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-disabled { background: var(--card-border); color: var(--ink-soft); pointer-events: none; box-shadow: none; }

/* 区块 */
.section-title { text-align: center; font-size: 1.8rem; margin-bottom: 8px; }
.section-sub { text-align: center; color: var(--ink-soft); margin-bottom: 24px; }

.features { background: var(--bg-alt); padding: 64px 0; }
.features .section-title { margin-bottom: 32px; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }

.card {
  background: var(--card); border: 2px solid var(--card-border);
  border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow);
}
.card-emoji { font-size: 2rem; margin-bottom: 8px; }
.card h3 { margin-bottom: 6px; }
.card p { color: var(--ink-soft); font-size: 0.95rem; }

/* 下载 */
.download { padding: 64px 0 80px; }
.download .section-title { margin-bottom: 28px; }
.dl-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.dl-card { text-align: center; }
.dl-card .btn { margin-top: 10px; }
.dl-meta { margin-top: 10px; font-size: 0.8rem; color: var(--ink-soft); word-break: break-all; }
/* 访客平台高亮（home.js 按 UA 识别）+ 多包逐行可点 + 首次运行提示 */
.dl-card.dl-mine { border: 2px solid var(--accent, #4a90d9); box-shadow: 0 4px 18px rgba(0, 0, 0, 0.12); }
.dl-badge { margin-left: 6px; padding: 1px 8px; border-radius: 999px; font-size: 0.7rem;
  background: var(--accent, #4a90d9); color: #fff; vertical-align: middle; }
.dl-file { display: block; margin-top: 4px; color: inherit; text-decoration: underline; }
.dl-hint { display: block; margin-top: 8px; font-size: 0.75rem; opacity: 0.8; }

/* ── 内页（公告 / 账号）──────────────────────────── */
.page { padding: 48px 0 80px; min-height: calc(100vh - 260px); }
.narrow { max-width: 720px; }
.page-title { font-size: 2rem; margin-bottom: 24px; }
.nav-active { color: var(--accent) !important; }
.muted { color: var(--ink-soft); }

.news-list { display: flex; flex-direction: column; gap: 18px; }
.news-card h2 { font-size: 1.25rem; margin-bottom: 2px; }
.news-date { color: var(--ink-soft); font-size: 0.85rem; margin-bottom: 10px; }
.news-card p + p { margin-top: 8px; }

/* 表单 / 账号页组件 */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-weight: 700; font-size: 0.95rem; }
.field input {
  font: inherit; padding: 10px 14px; border-radius: 12px;
  border: 2px solid var(--card-border); background: var(--bg); color: var(--ink);
}
.field input:focus { outline: none; border-color: var(--accent); }
.form-error { color: #d84a3a; font-size: 0.9rem; min-height: 1.2em; margin-bottom: 8px; }
.form-ok { color: var(--accent); font-size: 0.9rem; min-height: 1.2em; margin-bottom: 8px; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.btn-small { padding: 7px 16px; font-size: 0.9rem; }
.tabs { display: flex; gap: 8px; margin-bottom: 18px; }
.tab {
  padding: 8px 20px; border-radius: 999px; font-weight: 700; cursor: pointer;
  border: 2px solid var(--card-border); background: none; color: var(--ink-soft); font: inherit;
}
.tab.active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

.list-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--card-border);
}
.list-row:last-child { border-bottom: none; }
.list-row .grow { flex: 1; min-width: 0; }
.list-row .sub { color: var(--ink-soft); font-size: 0.85rem; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #b9b3a8; }
.dot.online { background: #58c14e; }
.section-gap { margin-top: 26px; }

/* 页脚 */
.footer {
  border-top: 2px solid var(--card-border); padding: 28px 0 40px;
  text-align: center; color: var(--ink-soft); font-size: 0.9rem;
}
.footer a:hover { color: var(--accent); }

/* 后台管理页（W4） */
.mono { font-family: ui-monospace, 'Cascadia Code', monospace; font-size: 0.85rem; }
.news-edit-row { border-bottom: 1px dashed var(--card-border); padding: 12px 0; display: flex; flex-direction: column; gap: 8px; }
.news-edit-row:last-child { border-bottom: none; }
.news-edit-row input, .news-edit-row textarea, #species-form textarea {
  font: inherit; padding: 8px 12px; border-radius: 10px;
  border: 2px solid var(--card-border); background: var(--bg); color: var(--ink);
}
.news-edit-row textarea, #species-form textarea { width: 100%; resize: vertical; }
