/* ============ 内容浏览视图（浅色画廊 / 纯白详情）============
   覆盖首页深色星空风格，浏览时整屏切浅色。
   类名统一用 atlas- 前缀，与 styles.css 互不干扰。 */
.app-root { display: none; }
.app-root.browse-active {
  display: block;
  position: fixed; inset: 0; z-index: 50;
  background: #fafaf9; color: #2c2c2c; overflow-y: auto;
  font-family: -apple-system, "Noto Serif SC", "Source Han Serif SC", "Songti SC", serif;
  line-height: 1.6;
}
/* 浏览模式：body 自身也刷白底，避免 .app-root fixed 层在 iframe/内嵌浏览器下露黑 */
body.browsing {
  background: #fafaf9 !important;
  color: #2c2c2c !important;
}
body.browsing .container,
body.browsing .bg-stars,
body.browsing #starfield { display: none !important; }

/* 顶部面包屑 */
.atlas-topbar {
  max-width: 1400px; margin: 0 auto;
  padding: 40px 40px 0;
  display: flex; align-items: baseline; gap: 16px;
}
.atlas-topbar a { font-size: 13px; color: #888; font-weight: 300; letter-spacing: 0.04em; text-decoration: none; }
.atlas-topbar a:hover { color: #444; }
.atlas-topbar .sep { color: #ccc; }

/* ─── 画廊布局（分类列表页）─── */
.atlas-layout { display: flex; min-height: 100vh; }
.atlas-sidebar {
  position: fixed; top: 0; left: 0; width: 220px; height: 100vh;
  background: #f5f4f2; border-right: 1px solid #e8e8e4;
  overflow-y: auto; z-index: 100; padding: 28px 0 40px;
  scrollbar-width: thin; scrollbar-color: #d4d4d0 transparent;
}
.atlas-sidebar::-webkit-scrollbar { width: 4px; }
.atlas-sidebar::-webkit-scrollbar-thumb { background: #d4d4d0; border-radius: 2px; }
.atlas-sidebar-header { padding: 0 20px 20px; border-bottom: 1px solid #e0e0dc; margin-bottom: 12px; }
.atlas-sidebar-header h3 { font-size: 14px; font-weight: 500; color: #555; letter-spacing: 0.5px; }
.atlas-sidebar-header .total { font-size: 12px; color: #aaa; margin-top: 2px; }
.atlas-nav { list-style: none; padding: 0; margin: 0; }
.atlas-nav-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 20px; font-size: 13px; color: #555; text-decoration: none;
  transition: background 0.15s, color 0.15s; border-left: 2px solid transparent;
}
.atlas-nav-item:hover { background: #edebe8; color: #333; }
.atlas-nav-item.active { color: #1a1a1a; background: #ebe9e6; border-left-color: #999; font-weight: 500; }
.atlas-nav-count { font-size: 11px; color: #bbb; margin-left: 8px; }
.atlas-main { margin-left: 220px; flex: 1; min-width: 0; }
/* 画廊页 main 顶部标题区（对齐参考 .header）*/
.atlas-gallery-header { max-width: 1400px; margin: 0 auto; padding: 56px 40px 8px; }
.atlas-gallery-header h1 { font-size: 28px; font-weight: 400; letter-spacing: 1px; color: #1a1a1a; }
.atlas-gallery-header .sub { font-size: 15px; color: #888; font-weight: 300; margin-top: 6px; }
.atlas-gallery-footer { text-align: center; padding: 48px 40px 64px; color: #ccc; font-size: 13px; }
.atlas-section-title { max-width: 1400px; margin: 48px auto 0; padding: 0 40px; }
.atlas-section-title h2 { font-size: 20px; font-weight: 400; color: #444; letter-spacing: 0.5px; padding-bottom: 12px; border-bottom: 1px solid #e8e8e4; }
.atlas-section-title .count { font-size: 13px; color: #aaa; font-weight: 300; margin-left: 8px; }

/* 网格卡片 */
.atlas-gallery {
  max-width: 1400px; margin: 0 auto; padding: 28px 40px 48px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 32px 24px;
}
.atlas-card { text-decoration: none; color: inherit; display: flex; flex-direction: column; transition: transform 0.25s ease, box-shadow 0.25s ease; }
.atlas-card:hover { transform: translateY(-4px); }
.atlas-card:hover .atlas-thumb-wrap { box-shadow: 0 8px 28px rgba(0,0,0,0.12); }
.atlas-thumb-wrap { width: 100%; aspect-ratio: 1242 / 1756; overflow: hidden; background: #f0f0ee; border-radius: 4px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); transition: box-shadow 0.25s ease; }
.atlas-thumb-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }
.atlas-thumb-ph { width: 100%; aspect-ratio: 1242/1756; background: #ececea; display: flex; align-items: center; justify-content: center; color: #bbb; font-size: 13px; border-radius: 4px; }
.atlas-card-info { padding: 12px 4px 0; }
.atlas-card-num { font-size: 11px; color: #1a1a1a; font-weight: 500; letter-spacing: 0.5px; margin-bottom: 4px; }
.atlas-card-name { font-size: 14px; line-height: 1.5; color: #333; font-weight: 500; }
.atlas-card-sub { font-size: 12px; line-height: 1.45; color: #888; margin-top: 2px; }

/* ─── 详情页（纯白单列）─── */
.atlas-case-page { max-width: 960px; margin: 0 auto; padding: 56px 32px 100px; }
.atlas-hero { margin-bottom: 40px; }
.atlas-hero__number { font-size: 11px; letter-spacing: 0.15em; color: #999; text-transform: uppercase; margin-bottom: 24px; }
.atlas-hero__number span { color: #000; }
.atlas-hero__title { font-size: 34px; font-weight: 300; line-height: 1.3; letter-spacing: 0.03em; color: #111; }
.atlas-hero__title em { font-style: normal; font-weight: 600; }
.atlas-hero__case { margin-top: 16px; font-size: 14px; color: #888; font-weight: 300; letter-spacing: 0.08em; }
.atlas-hero__designer { margin-top: 6px; font-size: 14px; color: #888; font-weight: 300; letter-spacing: 0.08em; }
.atlas-hero__designer span { color: #444; font-weight: 400; }
.atlas-divider { width: 60px; height: 1px; background: #ddd; margin-top: 16px; }

.atlas-cover { width: 100%; aspect-ratio: 1 / 1; border-radius: 4px; overflow: hidden; background: #f7f7f7; margin-bottom: 56px; }
.atlas-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }

.atlas-concept-svg { display: flex; justify-content: center; margin-bottom: 56px; }
.atlas-concept-svg svg { width: 100px; height: 100px; display: block; }

.atlas-definition { padding: 32px 40px; border-left: 1px solid #e8e8e8; background: #fafafa; margin-bottom: 72px; }
.atlas-definition__label { font-size: 11px; letter-spacing: 0.18em; color: #bbb; margin-bottom: 14px; }
.atlas-definition__text { font-size: 15px; font-weight: 300; line-height: 2; color: #444; }
.atlas-definition__text strong { font-weight: 500; color: #222; }

.atlas-section { margin-bottom: 72px; }
.atlas-section__label { font-size: 11px; letter-spacing: 0.18em; color: #bbb; text-transform: uppercase; margin-bottom: 18px; }
.atlas-section__title { font-size: 20px; font-weight: 400; margin-bottom: 18px; color: #111; }
.atlas-section__body { font-size: 16px; font-weight: 300; line-height: 2; color: #333; }
.atlas-section__body p { margin-bottom: 14px; }

.atlas-tags { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 72px; }
.atlas-tag { display: inline-block; padding: 6px 18px; font-size: 12px; font-weight: 300; letter-spacing: 0.05em; color: #777; border: 1px solid #e8e8e8; border-radius: 20px; }

/* 详情图廊：首图占满，其余两列 */
.atlas-case-gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 48px; }
.atlas-case-gallery .gc-item { background: #f7f7f7; border-radius: 4px; overflow: hidden; }
.atlas-case-gallery .gc-item a { display: block; text-decoration: none; }
.atlas-case-gallery .gc-item img { width: 100%; height: 280px; object-fit: contain; display: block; padding: 14px; background: #f7f7f7; }
.atlas-case-gallery .gc-item:first-child { grid-column: 1 / -1; }
.atlas-case-gallery .gc-item:first-child img { height: auto; object-fit: none; padding: 0; }

.atlas-footer { margin-top: 80px; padding-top: 32px; border-top: 1px solid #eee; font-size: 12px; color: #bbb; font-weight: 300; letter-spacing: 0.06em; }
.atlas-empty { color: #999; text-align: center; padding: 80px 20px; font-size: 15px; }

/* ─── 全局密码锁：图廊模糊 + 锁层卡 ─── */
.atlas-locked {
  position: relative;
  filter: blur(7px);
  -webkit-filter: blur(7px);
  opacity: 0.85;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  /* 只锁图廊（约视觉 40%），高度收紧，避免后面长图廊全部展开 */
  max-height: 680px;
  overflow: hidden;
}
.atlas-locked::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(250,250,249,0) 0%, rgba(250,250,249,0.55) 55%, rgba(250,250,249,0.96) 100%);
  pointer-events: none;
}
.atlas-case-lock {
  position: relative;
  z-index: 2;
  max-width: 420px;
  margin: -180px auto 60px; /* 上拉覆盖到模糊区底部 */
  padding: 40px 36px;
  background: #ffffff;
  border: 1px solid #e8e8e4;
  border-radius: 16px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.12);
  pointer-events: auto;
}
.atlas-case-lock__icon { font-size: 38px; margin-bottom: 14px; }
.atlas-case-lock__title { font-size: 19px; font-weight: 500; color: #1a1a1a; margin-bottom: 8px; letter-spacing: 0.03em; }
.atlas-case-lock__sub { font-size: 13px; color: #888; font-weight: 300; margin-bottom: 24px; line-height: 1.7; }
.atlas-case-lock__input {
  width: 100%; padding: 13px 16px;
  border: 1px solid #e0e0dc; border-radius: 10px;
  background: #fafaf9; color: #222;
  font-size: 15px; letter-spacing: 3px; text-align: center;
  margin-bottom: 12px; outline: none;
  transition: border-color 0.2s;
}
.atlas-case-lock__input:focus { border-color: #888; }
.atlas-case-lock__btn {
  width: 100%; padding: 13px;
  border: none; border-radius: 10px;
  background: #1a1a1a; color: #fff;
  font-size: 14px; font-weight: 500; letter-spacing: 0.05em;
  cursor: pointer; transition: background 0.2s, transform 0.2s;
}
.atlas-case-lock__btn:hover { background: #000; transform: translateY(-1px); }
.atlas-case-lock__hint { color: #d9534f; font-size: 13px; margin-top: 12px; min-height: 18px; }
.atlas-case-lock__hint.err { animation: shake 0.4s; }
@keyframes shake {
  0%,100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}
.atlas-case-lock__tip { color: #aaa; font-size: 12px; margin-top: 20px; font-weight: 300; }
.atlas-case-lock__tip a { color: #666; text-decoration: underline; }

/* ─── 灯箱 ─── */
.atlas-lightbox { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.92); z-index: 9999; cursor: grab; overflow: hidden; }
.atlas-lightbox.active { display: block; }
.atlas-lightbox img { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); cursor: grab; user-select: none; -webkit-user-drag: none; }
.atlas-lightbox__close { position: fixed; top: 16px; right: 20px; width: 40px; height: 40px; background: rgba(255,255,255,0.15); border-radius: 50%; color: #fff; font-size: 22px; line-height: 38px; text-align: center; cursor: pointer; border: none; z-index: 10000; }
.atlas-lightbox__close:hover { background: rgba(255,255,255,0.3); }

/* ─── 门禁层（保留深色，承接星空首页）─── */
.gate-wrap { position: relative; z-index: 2; max-width: 460px; margin: 0 auto; padding: 0 24px 60px; }
.gate-card { margin-top: 80px; background: rgba(20, 16, 10, 0.82); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border: 1px solid rgba(246, 193, 119, 0.45); border-radius: 20px; padding: 44px 36px; text-align: center; box-shadow: 0 24px 70px rgba(0,0,0,0.65); }
.gate-icon { font-size: 48px; margin-bottom: 16px; }
.gate-title { font-size: 1.5rem; font-weight: 700; color: var(--cream); margin-bottom: 8px; }
.gate-sub { color: var(--text-secondary); font-size: 0.92rem; margin-bottom: 26px; }
.gate-input { width: 100%; padding: 14px 18px; border-radius: 12px; border: 1px solid var(--card-border); background: rgba(0,0,0,0.25); color: var(--cream); font-size: 1.1rem; letter-spacing: 4px; text-align: center; margin-bottom: 14px; outline: none; transition: border-color 0.3s; }
.gate-input:focus { border-color: var(--gold); }
.gate-btn { width: 100%; padding: 14px; border: none; border-radius: 12px; background: linear-gradient(135deg, var(--gold), var(--amber)); color: var(--bg-deep); font-size: 1rem; font-weight: 700; cursor: pointer; transition: transform 0.25s, box-shadow 0.25s; }
.gate-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(246,193,119,0.35); }
.gate-hint { color: #ff8a7a; font-size: 0.85rem; margin-top: 12px; min-height: 18px; }
.gate-tip { color: var(--text-muted); font-size: 0.82rem; margin-top: 22px; }
.gate-tip a { color: var(--gold-soft); text-decoration: underline; }

/* ─── 手机端浮动按钮 + 抽屉式分类导航 ─── */
.atlas-nav-toggle {
  display: none; /* 桌面端隐藏，左侧栏常驻 */
  position: fixed; top: 16px; right: 16px; z-index: 200;
  /* Extended FAB 胶囊形：图标 + 文字横排 */
  height: 40px; padding: 0 16px 0 14px; border-radius: 999px;
  background: #1a1a1a; color: #fff;
  align-items: center; justify-content: center; gap: 6px;
  font-size: 14px; line-height: 1; font-family: inherit;
  letter-spacing: 0.5px;
  border: none; cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,0.25);
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
}
.atlas-nav-toggle:hover {
  background: #000;
  transform: scale(1.03);
  box-shadow: 0 6px 18px rgba(0,0,0,0.32);
}
.atlas-nav-toggle__icon { font-size: 16px; line-height: 1; }
.atlas-nav-toggle__label { font-size: 13px; font-weight: 500; }
.atlas-sidebar-mask {
  display: none;
  position: fixed; inset: 0; z-index: 150;
  background: rgba(0,0,0,0.45);
  opacity: 0; transition: opacity 0.25s;
}
.atlas-sidebar-mask.show { display: block; opacity: 1; }

/* ─── 响应式 ─── */
@media (max-width: 900px) {
  /* 抽屉式：默认滑出到屏外，.open 时滑入 */
  .atlas-sidebar {
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    width: 260px; /* 手机端略宽，方便点 */
    box-shadow: 4px 0 24px rgba(0,0,0,0.15);
    z-index: 160; /* 高于 mask(150)，否则 mask 盖住 nav 导致点击无效 */
  }
  .atlas-sidebar.open { transform: translateX(0); }
  .atlas-nav-toggle { display: flex; }
  /* 手机端 AI 助手 FAB 移到右下角，避免与右上角分类目录按钮重叠（≤900px 时 nav-toggle 才显示） */
  #aiw-fab { top: auto; right: 16px; bottom: 20px; }
  #aiw-panel { top: auto; right: 16px; bottom: 78px; }
  .atlas-main { margin-left: 0; }
  .atlas-topbar { padding: 32px 20px 0; }
  .atlas-gallery-header { padding: 40px 20px 8px; }
  .atlas-gallery-header h1 { font-size: 22px; }
  .atlas-section-title { padding: 0 20px; margin-top: 36px; }
  .atlas-gallery { padding: 20px 16px 28px; gap: 20px 12px; grid-template-columns: repeat(2, 1fr); }
  .atlas-section-title h2 { font-size: 18px; }
  .atlas-case-page { padding: 40px 18px 72px; }
  .atlas-hero__title { font-size: 26px; }
  .atlas-definition { padding: 24px 20px; margin-bottom: 48px; }
  .atlas-section { margin-bottom: 48px; }
  .atlas-case-gallery { grid-template-columns: 1fr; }
  .atlas-case-gallery .gc-item img { height: 220px; }
}

/* ─── 极简单屏购买页（覆盖层，深色星空风，一屏不滚动）─── */
.buy-mini {
  display: none;
  position: fixed; inset: 0; z-index: 120;
  background: radial-gradient(ellipse at center top, #1a1f3a 0%, #0a0e1f 55%, #050614 100%);
  color: #f5f5f4;
  align-items: center; justify-content: center;
  overflow: hidden;
  font-family: -apple-system, "Noto Serif SC", "Songti SC", serif;
}
.buy-mini.show { display: flex; }
/* 模拟星空光斑 */
.buy-mini::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    radial-gradient(1.5px 1.5px at 12% 18%, rgba(255,255,255,0.9), transparent),
    radial-gradient(1px 1px at 78% 22%, rgba(255,255,255,0.7), transparent),
    radial-gradient(1.5px 1.5px at 35% 72%, rgba(255,255,255,0.8), transparent),
    radial-gradient(1px 1px at 88% 68%, rgba(246,193,119,0.7), transparent),
    radial-gradient(1px 1px at 22% 88%, rgba(255,255,255,0.6), transparent),
    radial-gradient(1.2px 1.2px at 62% 12%, rgba(255,255,255,0.7), transparent);
  opacity: 0.8;
}
.buy-mini__back {
  position: absolute; top: 24px; left: 26px;
  color: rgba(245,245,244,0.65); font-size: 1.5rem; text-decoration: none;
  width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; transition: background 0.2s, color 0.2s;
}
.buy-mini__back:hover { background: rgba(255,255,255,0.08); color: #fff; }
.buy-mini__card {
  position: relative; z-index: 2;
  max-width: 760px; width: 94%;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 32px;
  align-items: center;
  padding: 0 16px;
}
.buy-mini__left { min-width: 0; }
.buy-mini__head {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 26px;
}
.buy-mini__emblem {
  font-size: 2rem; flex-shrink: 0;
  filter: drop-shadow(0 0 16px rgba(246,193,119,0.5));
}
.buy-mini__title {
  font-size: 1.6rem; font-weight: 600; margin: 0 0 4px;
  letter-spacing: 0.04em;
  background: linear-gradient(135deg, #fff 0%, #f6c177 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.buy-mini__tagline {
  color: rgba(245,245,244,0.55); font-size: 0.82rem; margin: 0;
  letter-spacing: 0.05em;
}
.buy-mini__features {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 14px;
}
.buy-mini__features li {
  display: flex; align-items: flex-start; gap: 12px;
}
.bf-ic {
  font-size: 1.3rem; flex-shrink: 0; width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(246,193,119,0.1);
  border: 1px solid rgba(246,193,119,0.2);
  border-radius: 8px;
  line-height: 1;
}
.buy-mini__features strong {
  display: block; color: #f5f5f4; font-size: 0.95rem; font-weight: 600;
  line-height: 1.3;
}
.buy-mini__features span {
  display: block; color: rgba(245,245,244,0.5); font-size: 0.78rem;
  margin-top: 2px;
}
.buy-mini__right { text-align: center; }
.buy-mini__price {
  display: inline-flex; align-items: baseline; gap: 4px;
  margin-bottom: 22px;
  padding: 10px 22px;
  border: 1px solid rgba(246,193,119,0.35);
  border-radius: 999px;
  background: rgba(246,193,119,0.06);
}
.buy-mini__price-sym { font-size: 1.1rem; color: #f6c177; font-weight: 600; }
.buy-mini__price-num {
  font-size: 2.6rem; font-weight: 700; color: #f6c177; line-height: 1;
  text-shadow: 0 0 24px rgba(246,193,119,0.4);
}
.buy-mini__price-unit { font-size: 0.78rem; color: rgba(245,245,244,0.55); margin-left: 6px; }
.buy-mini__qr {
  width: 168px; height: 168px; margin: 0 auto 14px;
  padding: 6px; background: #fff; border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.buy-mini__qr img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; display: block; }
.buy-mini__wxid {
  font-size: 0.9rem; color: rgba(245,245,244,0.85); margin: 0 0 8px;
}
.buy-mini__wxid strong { color: #fff; letter-spacing: 0.02em; }
.buy-mini__wxid a {
  font-size: 0.76rem; color: rgba(246,193,119,0.85);
  margin-left: 8px; text-decoration: underline;
}
.buy-mini__remark {
  font-size: 0.8rem; color: rgba(245,245,244,0.5); margin: 0;
}
.buy-mini__remark code {
  background: rgba(246,193,119,0.15); color: #f6c177;
  padding: 1px 6px; border-radius: 4px; font-size: 0.78rem;
}
@media (max-width: 760px) {
  .buy-mini__card { grid-template-columns: 1fr; gap: 28px; }
  .buy-mini__right { text-align: center; }
}
@media (max-height: 720px) {
  .buy-mini__head { margin-bottom: 18px; }
  .buy-mini__features { gap: 10px; }
  .buy-mini__emblem { font-size: 1.6rem; }
  .buy-mini__title { font-size: 1.3rem; }
  .buy-mini__price-num { font-size: 2.1rem; }
  .buy-mini__qr { width: 130px; height: 130px; }
}

/* ============ AI 问答浮窗（aiw- 前缀）============ */
/* 胶囊按钮：右上角，SVG 三星芒 + 「AI 助手」，呼吸光圈 */
#aiw-fab {
  position: fixed; top: 20px; right: 22px; z-index: 9999;
  display: inline-flex; align-items: center; gap: 7px;
  height: 44px; padding: 0 18px 0 14px; border-radius: 999px;
  border: 1px solid rgba(246,193,119,0.35); cursor: pointer;
  background: linear-gradient(135deg, #232323 0%, #141414 100%);
  color: #f6c177; font-size: 14px; font-weight: 600; letter-spacing: 1px;
  font-family: -apple-system, "Noto Serif SC", "Source Han Serif SC", "Songti SC", serif;
  box-shadow: 0 4px 18px rgba(0,0,0,0.28);
  transition: transform 0.2s, box-shadow 0.25s, border-color 0.25s;
  animation: aiwBreath 2.8s ease-in-out infinite;
}
#aiw-fab .aiw-fab-icon {
  width: 20px; height: 20px; display: block; flex: none;
  animation: aiwTwinkle 2.8s ease-in-out infinite;
}
#aiw-fab .aiw-fab-text { line-height: 1; }
/* 呼吸：金色光圈向外扩散 */
@keyframes aiwBreath {
  0%, 100% { box-shadow: 0 4px 18px rgba(0,0,0,0.28), 0 0 0 0 rgba(246,193,119,0.42); }
  50%      { box-shadow: 0 4px 18px rgba(0,0,0,0.28), 0 0 0 10px rgba(246,193,119,0); }
}
/* 星芒闪烁：微缩放 + 微旋转 + 发光 */
@keyframes aiwTwinkle {
  0%, 100% { transform: scale(1) rotate(0deg); filter: drop-shadow(0 0 2px rgba(246,193,119,0.5)); }
  50%      { transform: scale(1.14) rotate(10deg); filter: drop-shadow(0 0 7px rgba(246,193,119,0.95)); }
}
#aiw-fab:hover {
  transform: translateY(-2px); border-color: rgba(246,193,119,0.7);
  box-shadow: 0 8px 26px rgba(0,0,0,0.35), 0 0 18px rgba(246,193,119,0.22);
}
/* 面板打开：呼吸停，边框亮 */
#aiw-fab.active { animation: none; border-color: rgba(246,193,119,0.8); }
#aiw-fab.active .aiw-fab-icon { animation: none; }
#aiw-panel {
  position: fixed; top: 74px; right: 22px; z-index: 9999;
  width: 380px; max-width: calc(100vw - 32px); height: 540px; max-height: calc(100vh - 110px);
  background: #fafaf9; border: 1px solid #e8e8e4; border-radius: 12px;
  box-shadow: 0 12px 48px rgba(0,0,0,0.18);
  display: none; flex-direction: column; overflow: hidden;
  font-family: -apple-system, "Noto Serif SC", "Source Han Serif SC", "Songti SC", serif;
  color: #2c2c2c;
}
#aiw-panel.open { display: flex; }
.aiw-head {
  display: flex; flex-direction: column; gap: 3px;
  padding: 12px 16px 10px; border-bottom: 1px solid #ececea; background: #f5f4f2;
}
.aiw-head-top { display: flex; align-items: baseline; gap: 8px; }
.aiw-head-sub { display: flex; align-items: center; gap: 5px; }
.aiw-title { font-size: 15px; font-weight: 600; color: #1a1a1a; letter-spacing: 1px; }
.aiw-sub { font-size: 11px; color: #aaa; flex: 1; }
/* 状态点：绿 = API 通，灰 = 不通 */
.aiw-dotst {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  flex: none;
  transition: background 0.3s;
}
.aiw-dotst.on { background: #3faa5a; box-shadow: 0 0 6px rgba(63,170,90,0.6); }
.aiw-dotst.off { background: #b8b6b0; box-shadow: none; }
/* 状态点旁文字（第二行超小字） */
.aiw-dottext { font-size: 9.5px; flex: none; transition: color 0.3s; letter-spacing: 0.3px; }
.aiw-dottext.on { color: #3faa5a; }
.aiw-dottext.off { color: #b8b6b0; }
/* 每日配额 */
.aiw-quota { font-size: 11px; color: #aaa; flex: none; }
.aiw-quota.low { color: #c0563f; }
#aiw-close {
  border: none; background: none; font-size: 20px; color: #999; cursor: pointer;
  line-height: 1; padding: 2px 4px; font-family: sans-serif;
}
#aiw-close:hover { color: #333; }
#aiw-msgs { flex: 1; overflow-y: auto; padding: 14px 14px 6px; scrollbar-width: thin; scrollbar-color: #d4d4d0 transparent; }
#aiw-msgs::-webkit-scrollbar { width: 4px; }
#aiw-msgs::-webkit-scrollbar-thumb { background: #d4d4d0; border-radius: 2px; }
.aiw-msg { display: flex; margin-bottom: 12px; }
.aiw-msg.me { justify-content: flex-end; }
.aiw-bubble {
  max-width: 86%; padding: 9px 12px; border-radius: 10px;
  font-size: 13px; line-height: 1.65;
}
.aiw-msg.me .aiw-bubble { background: #1a1a1a; color: #f2f0ec; border-bottom-right-radius: 3px; }
.aiw-msg.ai .aiw-bubble { background: #f0efec; color: #333; border-bottom-left-radius: 3px; max-width: 100%; }
.aiw-lead { font-size: 12px; color: #888; margin-bottom: 10px; letter-spacing: 0.3px; }
/* 自然语言回答（连续对话主体）：比 lead 更大更正式，像聊天回复 */
.aiw-text {
  font-size: 13.5px; line-height: 1.75; color: #333;
  margin-bottom: 10px; white-space: pre-wrap; word-break: break-word;
}
.aiw-card {
  display: flex; text-decoration: none; color: inherit;
  background: #fff; border: 1px solid #eae8e4; border-radius: 8px;
  padding: 10px 12px; margin-bottom: 8px; gap: 10px;
  transition: border-color 0.15s, transform 0.15s;
}
.aiw-card:hover { border-color: #b9b5ae; transform: translateY(-1px); }
.aiw-card-thumb {
  flex: none; width: 58px; height: 72px; object-fit: cover;
  border-radius: 5px; background: #efeeeb; display: block;
}
.aiw-card-body { flex: 1; min-width: 0; }
.aiw-card-num { font-size: 11px; font-weight: 600; color: #1a1a1a; letter-spacing: 0.5px; margin-bottom: 3px; }
.aiw-card-title { font-size: 13px; color: #444; line-height: 1.5; margin-bottom: 4px; }
.aiw-card-reason { font-size: 12px; color: #777; line-height: 1.6; margin-bottom: 4px; }
.aiw-card-reason.aiw-note { color: #999; }
.aiw-card-meta { font-size: 11px; color: #aaa; }
.aiw-tags { color: #b98a4a; margin-left: 4px; }
.aiw-rel-title { font-size: 11px; color: #aaa; letter-spacing: 1px; margin: 12px 0 6px; }
.aiw-empty { font-size: 13px; color: #999; }
.aiw-usage {
  margin-top: 10px; padding-top: 8px; border-top: 1px dashed #e3e1dc;
  font-size: 10.5px; color: #b0aea8; letter-spacing: 0.3px; font-family: sans-serif;
}
.aiw-loading { font-size: 13px; color: #777; }
.aiw-dot {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: #b98a4a; margin-right: 6px; vertical-align: 1px;
  animation: aiwPulse 1s ease-in-out infinite;
}
@keyframes aiwPulse { 0%,100% { opacity: 0.3; } 50% { opacity: 1; } }
.aiw-inputbar {
  display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid #ececea; background: #f5f4f2;
}
#aiw-input {
  flex: 1; border: 1px solid #dedcd6; border-radius: 8px; padding: 8px 12px;
  font-size: 13px; font-family: inherit; background: #fff; color: #2c2c2c; outline: none;
}
#aiw-input:focus { border-color: #b9b5ae; }
/* 未激活：输入框禁用变灰（配合 ai-widget.js 门禁） */
#aiw-input:disabled {
  background: #e9e7e3; border-color: #d7d4cd; color: #8f8c84; cursor: not-allowed;
}
/* ─── AI 面板激活码门禁（未解锁时显示，复用图廊解锁形式） ─── */
.aiw-gate { margin: 2px 0 12px; }
.aiw-gate-btn {
  display: block; width: 100%; padding: 11px;
  border: 1px dashed #d9b98a; border-radius: 10px;
  background: #fdf9f0; color: #9a7b3f; font-size: 13px; font-family: inherit;
  cursor: pointer; letter-spacing: 0.5px;
  transition: background 0.2s, border-color 0.2s;
}
.aiw-gate-btn:hover { background: #faf3e2; border-color: #c9a76a; }
.aiw-lock {
  background: #fff; border: 1px solid #e8e8e4; border-radius: 12px;
  padding: 18px 16px 14px; text-align: center;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.06);
}
.aiw-lock__icon { font-size: 28px; margin-bottom: 8px; }
.aiw-lock__title { font-size: 15px; font-weight: 500; color: #1a1a1a; margin: 0 0 6px; letter-spacing: 0.03em; }
.aiw-lock__sub { font-size: 12px; color: #888; font-weight: 300; margin: 0 0 14px; line-height: 1.7; }
.aiw-lock-row { display: flex; gap: 8px; }
.aiw-lock-row input {
  flex: 1; min-width: 0; padding: 10px 12px;
  border: 1px solid #e0e0dc; border-radius: 10px;
  background: #fafaf9; color: #222;
  font-size: 14px; letter-spacing: 2px; text-align: center; outline: none;
  transition: border-color 0.2s;
}
.aiw-lock-row input:focus { border-color: #888; }
.aiw-lock-row button {
  flex: none; padding: 10px 16px;
  border: none; border-radius: 10px;
  background: #1a1a1a; color: #fff; font-size: 13px; font-family: inherit;
  cursor: pointer; transition: background 0.2s;
}
.aiw-lock-row button:hover { background: #000; }
.aiw-lock-row button:disabled { background: #999; cursor: wait; }
.aiw-lock__hint { color: #d9534f; font-size: 12px; margin: 10px 0 0; min-height: 16px; line-height: 1.5; }
.aiw-lock__hint.err { animation: shake 0.4s; }
.aiw-lock__tip { color: #aaa; font-size: 11.5px; margin: 10px 0 0; font-weight: 300; }
.aiw-lock__tip a { color: #666; text-decoration: underline; }
#aiw-input:disabled::placeholder { color: #8f8c84; opacity: 1; }
#aiw-send {
  border: none; border-radius: 8px; padding: 0 16px; cursor: pointer;
  background: #1a1a1a; color: #f6c177; font-size: 13px; font-family: inherit; letter-spacing: 1px;
}
/* 中窄屏：首页 topnav 右侧「返回褶子城市」给 AI 胶囊让位（body .topnav 提高优先级，防被 styles.css 覆盖） */
@media (max-width: 1200px) {
  body .topnav { padding-right: 158px; }
}
#aiw-send:disabled { opacity: 0.5; cursor: default; }
@media (max-width: 560px) {
  #aiw-panel { right: 0; left: 0; top: auto; bottom: 0; width: 100%; max-width: 100%; height: 72vh; max-height: 72vh; border-radius: 14px 14px 0 0; }
  #aiw-fab { top: auto; right: 12px; bottom: 16px; height: 38px; padding: 0 13px 0 10px; font-size: 12.5px; gap: 5px; }
  #aiw-fab .aiw-fab-icon { width: 17px; height: 17px; }
  body .topnav { padding-right: 110px; }
}
/* 触摸设备（iOS/Android 手机+平板）：输入框字号 <16px 时聚焦会触发系统强制放大整个页面，
   且缩放不会自动复位（需手动捏合缩小）。统一提升到 16px 根治；桌面端保持原精致字号。 */
@media (pointer: coarse) {
  #aiw-input,
  .aiw-lock-row input,
  .atlas-case-lock__input { font-size: 16px; }
}

/* ─── 画廊顶部 · 作品门户 Banner（高级广告条）─── */
.atlas-pbanner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  max-width: 1400px;
  margin: 28px auto 0;
  padding: 14px 24px;
  background: linear-gradient(90deg, #f3f1ec 0%, #f8f6f1 50%, #f3f1ec 100%);
  border-top: 1px solid #e6e3dc;
  border-bottom: 1px solid #e6e3dc;
  text-decoration: none;
  overflow: hidden;
  transition: background 0.35s ease;
}
.atlas-pbanner:hover {
  background: linear-gradient(90deg, #efece4 0%, #f5f1e8 50%, #efece4 100%);
}
.apb-glyph {
  font-size: 9px;
  color: #a5842e;
  opacity: 0.8;
  letter-spacing: 5px;
}
.apb-text { display: flex; align-items: baseline; gap: 16px; }
.apb-text strong {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 3px;
  color: #8a6d21;
}
.apb-text em {
  font-style: normal;
  font-size: 12px;
  color: #a8a49b;
  letter-spacing: 2px;
  font-weight: 300;
}
.apb-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  letter-spacing: 3px;
  color: #8a6d21;
  padding: 5px 16px;
  border: 1px solid rgba(165, 132, 46, 0.4);
  border-radius: 999px;
  background: rgba(165, 132, 46, 0.04);
  transition: all 0.3s ease;
  white-space: nowrap;
}
.atlas-pbanner:hover .apb-cta {
  background: rgba(165, 132, 46, 0.12);
  border-color: rgba(165, 132, 46, 0.7);
  color: #75591a;
}
.apb-cta i { font-style: normal; transition: transform 0.3s ease; }
.atlas-pbanner:hover .apb-cta i { transform: translateX(4px); }
.apb-shine {
  position: absolute;
  top: 0;
  left: -60%;
  width: 40%;
  height: 100%;
  background: linear-gradient(100deg, transparent, rgba(165, 132, 46, 0.06) 45%, rgba(255, 255, 255, 0.5) 50%, rgba(165, 132, 46, 0.06) 55%, transparent);
  transform: skewX(-18deg);
  animation: apbShine 5.5s ease-in-out infinite;
  pointer-events: none;
}
@keyframes apbShine {
  0% { left: -60%; }
  55%, 100% { left: 130%; }
}
@media (max-width: 640px) {
  .apb-text em { display: none; }
  .atlas-pbanner { gap: 12px; margin: 20px 16px 0; }
  .apb-text strong { font-size: 13px; letter-spacing: 2px; }
}
