/**
 * 润笔 · 官网样式
 * --------------------------------------------------------------
 * 风格参照扩展内页：暖色纸面 + 墨绿主色 + 衬线刊头 + 微肌理。
 * 故意与常见 SaaS 模板（紫蓝渐变 / Inter 全家桶）拉开距离。
 *
 * 一切色 / 间距 / 字号收敛到 :root 变量，便于做暗色或品牌调整。
 * 字体走 system serif/sans 兜底（无外链 CDN，保证国内访问稳定），
 * 真正部署时可替换为自托管 woff2。
 */

:root {
  color-scheme: light;

  /* 字体：Google Fonts 异步加载思源宋 / 思源黑；未到达时无缝降级到系统字体，
     不会出现 FOIT（字体闪白）。display=swap 在 link 已开启。 */
  --font-sans: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "SimSun", Georgia, serif;
  --font-mono: "SF Mono", "Menlo", "Consolas", monospace;

  --ink: #1a2620;
  --ink-secondary: #3d4f45;
  --soft-ink: #5a6b62;
  --muted: #7a6f62;
  --line: #d4cfc3;
  --line-strong: #c4bdb0;

  --cream: #f7f5ef;
  --surface: #fffdf8;
  --surface-elevated: #ffffff;

  --brand: #173722;
  --brand-hover: #1f4a2e;
  --brand-soft: rgba(23, 55, 34, 0.08);
  --accent: #b8722e;
  --accent-soft: rgba(198, 132, 61, 0.14);
  --gold: #b8893f;

  /* 「润笔」品牌印章红，仅用于 logo / 品牌字 mark / hero 重点字
     —— 用稀缺色，避免和墨绿主色抢戏。 */
  --seal: #b03a2c;
  --seal-soft: rgba(176, 58, 44, 0.12);

  /* 「花下生金」金色，比原 --gold 多一档高光，用于价值主张那一句的下划线 */
  --gold-bright: #d4a45a;
  --gold-soft: rgba(212, 164, 90, 0.18);

  --shadow-sm: 0 4px 14px rgba(32, 40, 29, 0.06);
  --shadow-md: 0 12px 32px rgba(32, 40, 29, 0.08);
  --shadow-lg: 0 20px 48px rgba(28, 36, 30, 0.12);

  --bg-base: linear-gradient(168deg, #f9f6ef 0%, #efe8db 45%, #e6dfd2 100%);
  --bg-bloom-1: radial-gradient(ellipse 120% 85% at 0% -12%, rgba(107, 143, 113, 0.24), transparent 44%);
  --bg-bloom-2: radial-gradient(ellipse 95% 58% at 100% -5%, var(--accent-soft), transparent 40%);

  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-pill: 999px;

  --measure: 60ch;
  --tracking-caps: 0.14em;
}

/* ====== 基础重置 ====== */

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg-bloom-1), var(--bg-bloom-2), var(--bg-base);
  background-attachment: fixed;
  min-height: 100vh;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.04;
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(42, 36, 28, 0.05) 2px, rgba(42, 36, 28, 0.05) 3px),
    repeating-linear-gradient(90deg, transparent, transparent 2px, rgba(42, 36, 28, 0.04) 2px, rgba(42, 36, 28, 0.04) 3px);
  mix-blend-mode: multiply;
}

img,
svg {
  max-width: 100%;
  display: block;
}

a {
  color: var(--brand);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 150ms ease, border-color 150ms ease;
}

a:hover {
  color: var(--brand-hover);
  border-bottom-color: rgba(23, 55, 34, 0.3);
}

button {
  font-family: inherit;
  cursor: pointer;
}

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
  margin: 0 0 0.6em;
  line-height: 1.22;
}

p {
  margin: 0 0 1em;
  color: var(--ink-secondary);
}

code {
  font-family: var(--font-mono);
  font-size: 0.92em;
  background: rgba(0, 0, 0, 0.04);
  padding: 1px 6px;
  border-radius: 4px;
}

/* 让需要置于背景肌理之上的容器拥有 z-index */
.layer {
  position: relative;
  z-index: 1;
}

/* ====== 通用容器 ====== */

.wrap {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

.wrap-narrow {
  max-width: 760px;
}

/* ====== 顶部导航 ====== */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(160%) blur(14px);
  background: rgba(247, 245, 239, 0.78);
  border-bottom: 1px solid rgba(42, 36, 28, 0.07);
}

.site-nav-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 14px 24px;
  max-width: 1180px;
  margin: 0 auto;
}

.site-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--ink);
  border: none;
}

.site-brand:hover {
  color: var(--brand);
  border: none;
}

.site-brand-mark {
  display: inline-block;
  width: 48px;
  height: 48px;
  background-image: url("../img/favicon-192.png");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  /* 隐藏 fallback 文字（无图时备份用） */
  font-size: 0;
  color: transparent;
  flex-shrink: 0;
  margin: -6px 0;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.site-brand:hover .site-brand-mark {
  transform: scale(1.05) rotate(-3deg);
}

.site-nav-links {
  display: flex;
  gap: 22px;
  margin-left: auto;
  font-size: 0.92rem;
}

.site-nav-links a {
  color: var(--ink-secondary);
  border: none;
  padding: 6px 0;
  position: relative;
}

.site-nav-links a:hover,
.site-nav-links a.active {
  color: var(--ink);
}

.site-nav-links a.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}

.site-nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* ====== 按钮 ====== */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease, transform 150ms ease, box-shadow 150ms ease;
  white-space: nowrap;
}

.btn:hover {
  border-color: transparent;
}

.btn-primary {
  background: var(--brand);
  color: #f0d4b0;
}

.btn-primary:hover {
  background: var(--brand-hover);
  color: #f0d4b0;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: rgba(23, 55, 34, 0.18);
}

.btn-ghost:hover {
  background: rgba(23, 55, 34, 0.06);
  color: var(--ink);
}

.btn-block {
  display: flex;
  width: 100%;
  justify-content: center;
}

.btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

/* ====== Hero ====== */

.hero {
  position: relative;
  padding: 88px 0 72px;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: -10% -20% auto -20%;
  height: 380px;
  background: radial-gradient(ellipse at 50% 40%, rgba(184, 137, 63, 0.16), transparent 60%);
  z-index: 0;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px;
  border: 1px solid rgba(23, 55, 34, 0.14);
  border-radius: var(--radius-pill);
  background: rgba(255, 253, 248, 0.8);
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  margin-bottom: 22px;
}

.hero-title {
  font-size: clamp(2.4rem, 4.6vw, 3.6rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  max-width: 18ch;
  margin-bottom: 18px;
}

.hero-title em {
  font-style: normal;
  color: var(--accent);
  position: relative;
}

.hero-title em::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 4%;
  height: 0.32em;
  background: rgba(184, 114, 46, 0.18);
  border-radius: 4px;
  z-index: -1;
}

/* 「花下生金」专属 —— 金色 highlight，比 em 多一点光泽感 */
.hero-title .gold {
  font-weight: inherit;
  font-style: normal;
  color: #6b4520;
  position: relative;
  background: linear-gradient(
    180deg,
    transparent 60%,
    var(--gold-soft) 60%,
    var(--gold-soft) 92%,
    transparent 92%
  );
  padding: 0 0.05em;
}

/* 印章红强调字（"润笔"两个字独立排版时用） */
.seal-text {
  color: var(--seal);
  font-family: var(--font-serif);
  font-weight: 700;
}

.hero-subtitle {
  max-width: 50ch;
  font-size: 1.08rem;
  color: var(--ink-secondary);
  margin-bottom: 28px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  font-size: 0.85rem;
  color: var(--muted);
}

.hero-meta strong {
  color: var(--ink);
}

/* ====== 章节 ====== */

.section {
  padding: 72px 0;
}

.section-tight {
  padding: 48px 0;
}

.section-head {
  max-width: 60ch;
  margin: 0 auto 48px;
  text-align: center;
}

.section-eyebrow {
  display: inline-block;
  font-size: 0.72rem;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 12px;
}

.section-title {
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  margin-bottom: 12px;
}

.section-sub {
  color: var(--ink-secondary);
  font-size: 1rem;
}

/* ====== 卡片网格 ====== */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 26px 24px;
  transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--line-strong);
}

.card-icon {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 1.1rem;
  margin-bottom: 14px;
}

.card-title {
  font-size: 1.08rem;
  margin-bottom: 6px;
}

.card-desc {
  font-size: 0.92rem;
  color: var(--ink-secondary);
  margin: 0;
  line-height: 1.6;
}

/* ====== 价格 ====== */

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 22px;
  align-items: stretch;
}

.price-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  position: relative;
}

.price-card.featured {
  border-color: rgba(23, 55, 34, 0.32);
  box-shadow: var(--shadow-md);
  background: linear-gradient(180deg, #fffdf8 0%, #f7f0e1 100%);
}

.price-card.featured::before {
  content: "推荐";
  position: absolute;
  top: -12px;
  right: 24px;
  padding: 4px 12px;
  background: var(--brand);
  color: #f0d4b0;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  letter-spacing: var(--tracking-caps);
  font-weight: 700;
}

.price-name {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  margin-bottom: 6px;
}

.price-tag {
  font-size: 2.4rem;
  font-family: var(--font-serif);
  color: var(--ink);
  line-height: 1;
  margin: 18px 0 4px;
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.price-tag small {
  font-size: 0.95rem;
  color: var(--muted);
  font-weight: 400;
  font-family: var(--font-sans);
}

.price-period {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 22px;
}

.price-list {
  list-style: none;
  margin: 0 0 28px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 0.95rem;
  color: var(--ink-secondary);
}

.price-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.price-list li::before {
  content: "✓";
  display: inline-block;
  color: var(--brand);
  font-weight: 700;
  flex-shrink: 0;
  width: 16px;
}

.price-list li.muted {
  color: var(--muted);
}

.price-list li.muted::before {
  content: "—";
  color: var(--muted);
}

.price-cta {
  margin-top: auto;
}

/* ====== 表单（登录 / 注册 / dashboard） ====== */

.auth-shell {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  min-height: calc(100vh - 64px);
}

@media (max-width: 880px) {
  .auth-shell {
    grid-template-columns: 1fr;
  }
}

.auth-side {
  padding: 64px 56px;
  background: linear-gradient(168deg, #1d4329 0%, #0e2418 100%);
  color: #e8d4ad;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.auth-side::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.08), transparent 60%),
    radial-gradient(circle at 80% 90%, rgba(184, 137, 63, 0.18), transparent 50%);
  z-index: 0;
}

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

.auth-side h2 {
  color: #f0d4b0;
  font-size: 2rem;
  margin-bottom: 16px;
  max-width: 18ch;
}

.auth-side p {
  color: rgba(232, 212, 173, 0.85);
  max-width: 36ch;
}

.auth-side blockquote {
  border-left: 2px solid rgba(240, 212, 176, 0.4);
  margin: 0;
  padding: 8px 0 8px 16px;
  font-family: var(--font-serif);
  font-size: 1.02rem;
  color: rgba(240, 212, 176, 0.92);
  font-style: italic;
}

.auth-form-side {
  padding: 64px 56px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--surface);
}

.auth-card {
  width: 100%;
  max-width: 380px;
  margin: 0 auto;
}

.auth-card h1 {
  font-size: 1.8rem;
  margin-bottom: 6px;
}

.auth-card .auth-card-sub {
  color: var(--ink-secondary);
  margin-bottom: 28px;
  font-size: 0.92rem;
}

.auth-tabs {
  display: inline-flex;
  background: rgba(0, 0, 0, 0.04);
  padding: 3px;
  border-radius: 8px;
  margin-bottom: 24px;
}

.auth-tabs button {
  border: none;
  background: transparent;
  padding: 7px 16px;
  font-size: 0.88rem;
  border-radius: 6px;
  color: var(--ink-secondary);
}

.auth-tabs button.active {
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.field label {
  font-size: 0.85rem;
  color: var(--ink-secondary);
  font-weight: 600;
}

.field input,
.field select,
.field textarea {
  font-family: inherit;
  font-size: 0.95rem;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-elevated);
  color: var(--ink);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(23, 55, 34, 0.1);
}

.field-hint {
  font-size: 0.78rem;
  color: var(--muted);
}

.field-hint[data-tone="error"] {
  color: #8e3531;
}

/* 一行两侧排布：左侧是「记住我」，右侧是「忘记密码」 */
.field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 0 6px;
  font-size: 0.85rem;
}

.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-secondary);
  cursor: pointer;
  user-select: none;
}

.checkbox input[type="checkbox"] {
  accent-color: var(--brand);
}

.link-quiet {
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px dashed transparent;
}

.link-quiet:hover {
  color: var(--brand);
  border-bottom-color: var(--brand);
}

/* 密码输入框右侧的「显示/隐藏」按钮 */
.password-wrap {
  position: relative;
}

.password-wrap input {
  width: 100%;
  padding-right: 56px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  background: transparent;
  border: 0;
  color: var(--muted);
  font-size: 0.78rem;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
}

.password-toggle:hover {
  color: var(--brand);
  background: rgba(23, 55, 34, 0.06);
}

/* 注册模式才出现的密码强度条；JS 切换 hidden + data-level */
.password-strength {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}

.password-strength[hidden] { display: none; }

.password-strength-bar {
  flex: 1;
  height: 4px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.07);
  overflow: hidden;
}

.password-strength-bar > span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--brand);
  transition: width 200ms ease, background 200ms ease;
}

.password-strength-text {
  font-size: 0.75rem;
  color: var(--muted);
  min-width: 28px;
}

.password-strength[data-level="weak"]   .password-strength-bar > span { width: 28%; background: #c44b4b; }
.password-strength[data-level="medium"] .password-strength-bar > span { width: 60%; background: #c2861d; }
.password-strength[data-level="strong"] .password-strength-bar > span { width: 100%; background: #2e7d4f; }
.password-strength[data-level="weak"]   .password-strength-text { color: #c44b4b; }
.password-strength[data-level="medium"] .password-strength-text { color: #c2861d; }
.password-strength[data-level="strong"] .password-strength-text { color: #2e7d4f; }

.feedback {
  margin: 14px 0 0;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.88rem;
  background: rgba(0, 0, 0, 0.03);
  color: var(--ink-secondary);
  display: none;
}

.feedback.show {
  display: block;
}

.feedback[data-tone="error"] {
  background: rgba(185, 69, 64, 0.1);
  color: #8e3531;
}

.feedback[data-tone="success"] {
  background: rgba(46, 125, 79, 0.12);
  color: #245d39;
}

.feedback[data-tone="warning"] {
  background: rgba(184, 117, 20, 0.14);
  color: #7d4f0d;
}

/* ====== Dashboard ====== */

.dash-shell {
  padding: 56px 0;
}

.dash-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 28px;
  align-items: flex-start;
}

@media (max-width: 880px) {
  .dash-grid {
    grid-template-columns: 1fr;
  }
}

.dash-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.dash-card h2 {
  font-size: 1.05rem;
  margin-bottom: 14px;
  font-family: var(--font-sans);
  font-weight: 700;
  letter-spacing: 0;
}

.dash-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 16px;
}

.dash-meta-label {
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps);
}

.dash-meta-val {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink);
}

.dash-plan-pill {
  display: inline-block;
  padding: 3px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  margin-left: 8px;
  vertical-align: middle;
}

.dash-plan-pill.pro {
  background: linear-gradient(135deg, #b8893f, #8d651b);
  color: #fff;
}

.dash-plan-pill.free {
  background: rgba(0, 0, 0, 0.06);
  color: var(--soft-ink);
}

.dash-license-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dash-license {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-elevated);
}

.dash-license-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.dash-license-key {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  color: var(--ink);
}

.dash-license-info {
  font-size: 0.78rem;
  color: var(--muted);
}

.dash-license-actions {
  display: flex;
  gap: 6px;
}

.dash-license-actions .btn {
  padding: 6px 14px;
  font-size: 0.82rem;
}

.dash-account-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 24px;
}

/* 单张 license 下挂的设备列表 */
.dash-license-devices {
  flex-basis: 100%;
  margin-top: 8px;
  border-top: 1px dashed var(--line);
  padding-top: 10px;
}

.dash-license-devices summary {
  cursor: pointer;
  font-size: 0.78rem;
  color: var(--muted);
  list-style: none;
  user-select: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.dash-license-devices summary::-webkit-details-marker { display: none; }

.dash-license-devices summary::before {
  content: "▸";
  display: inline-block;
  transition: transform 150ms ease;
  font-size: 0.7rem;
}

.dash-license-devices[open] summary::before {
  transform: rotate(90deg);
}

.dash-device {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  margin-top: 8px;
  border-radius: var(--radius-sm, 8px);
  background: rgba(247, 245, 239, 0.6);
  font-size: 0.82rem;
}

.dash-device-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.dash-device-label {
  color: var(--ink);
  font-weight: 500;
}

.dash-device-fp {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 320px;
}

.dash-device-actions .btn {
  padding: 4px 10px;
  font-size: 0.78rem;
}

/* ====== Modal（修改密码 / 二次确认） ====== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 18, 14, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 80;
  padding: 24px;
  animation: site-fade-in 180ms ease;
}

.modal-backdrop[hidden] {
  display: none;
}

.modal {
  background: var(--surface-elevated);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 460px;
  max-height: calc(100vh - 48px);
  overflow: auto;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.25);
  border: 1px solid var(--line);
  animation: site-fade-up 220ms ease;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
}

.modal-head h3 {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1.05rem;
  font-weight: 700;
}

.modal-close {
  background: transparent;
  border: 0;
  font-size: 1.4rem;
  color: var(--muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  line-height: 1;
}

.modal-close:hover {
  color: var(--brand);
  background: rgba(0, 0, 0, 0.04);
}

.modal-body {
  padding: 18px 24px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}

/* ====== Toast（短时间反馈） ====== */
.toast-host {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 90;
  pointer-events: none;
}

.toast {
  background: rgba(28, 36, 30, 0.95);
  color: #fffaee;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 0.88rem;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.25);
  pointer-events: auto;
  animation: site-fade-up 260ms ease;
}

.toast[data-tone="success"] { background: rgba(35, 90, 53, 0.95); }
.toast[data-tone="error"]   { background: rgba(140, 50, 50, 0.95); }
.toast[data-tone="warning"] { background: rgba(150, 95, 20, 0.95); }

.empty-state {
  text-align: center;
  padding: 22px 14px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md);
  color: var(--muted);
  font-size: 0.9rem;
}

/* ====== 页脚 ====== */

.site-foot {
  margin-top: 64px;
  padding: 40px 24px 32px;
  border-top: 1px solid rgba(42, 36, 28, 0.08);
  background: rgba(247, 245, 239, 0.6);
}

.site-foot-inner {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--muted);
}

.site-foot a {
  color: var(--soft-ink);
  border: none;
  margin-left: 18px;
}

.site-foot a:first-of-type {
  margin-left: 0;
}

.site-foot a:hover {
  color: var(--brand);
}

/* ====== 工具类 ====== */

.text-center { text-align: center; }
.muted { color: var(--muted); }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-0 { margin-bottom: 0; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row-end { justify-content: flex-end; }
.divider { height: 1px; background: var(--line); margin: 24px 0; }

/* ====== 入场动效（轻量、克制；尊重 reduced-motion） ====== */

@keyframes site-fade-up {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes site-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* hero 主区域内子元素错开入场（CSS-only，不依赖 JS） */
.hero-stagger > * {
  opacity: 0;
  animation: site-fade-up 600ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.hero-stagger > *:nth-child(1) { animation-delay: 60ms; }
.hero-stagger > *:nth-child(2) { animation-delay: 140ms; }
.hero-stagger > *:nth-child(3) { animation-delay: 220ms; }
.hero-stagger > *:nth-child(4) { animation-delay: 300ms; }
.hero-stagger > *:nth-child(5) { animation-delay: 380ms; }
.hero-stagger > *:nth-child(6) { animation-delay: 460ms; }

/* 滚动揭示：默认隐藏，site.js 给可视项加 .is-visible 触发动画。
   即使 JS 不可用，3 秒后兜底强制显示，避免内容看不见（progressive enhancement）。 */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 700ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 700ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}

.reveal.is-visible,
.no-js .reveal {
  opacity: 1;
  transform: translateY(0);
}

/* ====== Hero 插画区 ====== */

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 40px;
  align-items: center;
}

@media (max-width: 880px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }
  .hero-art {
    order: -1;
    max-width: 360px;
    margin: 0 auto 8px;
  }
}

.hero-art {
  position: relative;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-art svg {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 14px 28px rgba(28, 36, 30, 0.12));
}

/* 装饰性的微浮动（仅 hero 插画内的 .float-* 元素，肉眼几乎察觉不到的呼吸） */
@keyframes hero-float-y {
  0%, 100% { transform: translateY(0) rotate(var(--r, 0deg)); }
  50%      { transform: translateY(-6px) rotate(var(--r, 0deg)); }
}

.hero-art .float-slow { animation: hero-float-y 7s ease-in-out infinite; }
.hero-art .float-mid  { animation: hero-float-y 5s ease-in-out infinite; }
.hero-art .float-fast { animation: hero-float-y 3.5s ease-in-out infinite; }

/* hover 提升（卡片悬停层次感更强） */
.card:hover .card-icon {
  transform: scale(1.06) rotate(-3deg);
  transition: transform 220ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.card-icon {
  transition: transform 220ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* 按钮按下时的细微反馈（避免按钮看起来像无生命的色块） */
.btn:active {
  transform: translateY(1px);
}

.btn.is-disabled,
.btn[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: auto; /* 保留点击以便弹出"未配置"提示 */
  filter: grayscale(0.4);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal {
    opacity: 1 !important;
    transform: none !important;
  }
  .hero-stagger > * {
    opacity: 1 !important;
    animation: none !important;
  }
}
