/* ============================================================
   猫与发条 · Mobile layout
   独立移动端排版；桌面端规则全部留在 site.css，不在此处覆盖。
   设计目标：紧凑导航、可读信息密度、明确卡片层级、触屏友好。
   ============================================================ */

@media (max-width: 760px) {
  :root {
    --mobile-gutter: 18px;
    --mobile-nav-offset: calc(104px + env(safe-area-inset-top, 0px));
  }

  html {
    scroll-padding-top: var(--mobile-nav-offset);
    scrollbar-gutter: auto;
  }

  body {
    font-size: 15px;
    line-height: 1.75;
    overflow-x: clip;
  }

  img, canvas, svg { max-width: 100%; }
  button, a, input, select, summary { -webkit-tap-highlight-color: transparent; }
  button, .btn, .icon-btn, .chip, .seg button, .stamp-btn { touch-action: manipulation; }

  .wrap {
    width: 100%;
    max-width: var(--wrap);
    margin-inline: auto;
    padding-inline: var(--mobile-gutter);
  }

  /* -------------------- 固定双层导航 -------------------- */
  .nav {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "brand actions"
      "links links";
    align-items: center;
    gap: 5px 10px;
    top: 0;
    left: 0;
    right: 0;
    padding: calc(7px + env(safe-area-inset-top, 0px)) max(14px, env(safe-area-inset-right, 0px)) 8px max(14px, env(safe-area-inset-left, 0px));
    background: color-mix(in srgb, var(--bg) 94%, transparent);
    border-bottom: 1px solid var(--line-soft);
    box-shadow: 0 8px 26px rgba(0, 0, 0, .10);
    backdrop-filter: blur(18px) saturate(145%);
    -webkit-backdrop-filter: blur(18px) saturate(145%);
  }

  .nav::before { display: none; }
  .nav-brand { grid-area: brand; min-width: 0; gap: 8px; margin: 0; }
  .mark { width: 23px; height: 23px; }
  .nav-name { display: inline; font-size: 14px; letter-spacing: .08em; white-space: nowrap; }
  .nav-actions { grid-area: actions; display: flex; align-items: center; gap: 4px; margin: 0; }
  .nav-actions #hudBtn { display: none; }
  .icon-btn {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 34px;
    min-width: 34px;
    height: 34px;
    padding: 0;
    border-radius: 50%;
    border-color: var(--line);
    background: color-mix(in srgb, var(--surf) 84%, transparent);
  }
  .icon-btn svg { width: 16px; height: 16px; }
  .icon-btn .kbd { display: none; }
  #themeBtn { width: 34px; min-width: 34px; height: 34px; }

  .nav-links {
    grid-area: links;
    display: flex;
    flex: none;
    align-items: center;
    gap: 5px;
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 1px 0 2px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    mask-image: linear-gradient(90deg, #000 0%, #000 90%, transparent 100%);
    -webkit-mask-image: linear-gradient(90deg, #000 0%, #000 90%, transparent 100%);
  }
  .nav-links::-webkit-scrollbar { display: none; }
  .nav-links a {
    flex: none;
    min-height: 31px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 11px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: transparent;
    color: var(--dim);
    font-size: 12px;
    line-height: 1;
    letter-spacing: .01em;
    white-space: nowrap;
  }
  .nav-links a.is-active,
  .nav-links a[aria-current="true"] {
    color: var(--brass);
    border-color: color-mix(in srgb, var(--brass) 36%, var(--line));
    background: color-mix(in srgb, var(--brass) 9%, var(--surf));
  }
  .nav-links a.is-active::after { display: none; }

  /* -------------------- 首屏 -------------------- */
  .hero {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    gap: 0;
    min-height: max(650px, 100svh);
    padding: calc(92px + env(safe-area-inset-top, 0px)) 0 calc(78px + env(safe-area-inset-bottom, 0px));
  }
  .hero-bg { inset: -2%; background-position: 58% center; animation-duration: 52s; }
  .hero-scrim {
    background:
      linear-gradient(180deg, rgba(7, 8, 10, .78) 0%, rgba(7, 8, 10, .54) 22%, rgba(7, 8, 10, .64) 62%, rgba(7, 8, 10, .94) 100%),
      linear-gradient(90deg, rgba(7, 8, 10, .48), transparent 86%);
  }
  html[data-theme="light"] .hero-scrim {
    background:
      linear-gradient(180deg, rgba(20, 17, 12, .72) 0%, rgba(20, 17, 12, .48) 22%, rgba(20, 17, 12, .62) 62%, rgba(20, 17, 12, .92) 100%),
      linear-gradient(90deg, rgba(20, 17, 12, .4), transparent 86%);
  }
  .hero-inner {
    width: 100%;
    max-width: 590px;
    padding: 18px 0 10px;
  }
  .eyebrow {
    display: inline-flex;
    max-width: 100%;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0 0 15px;
    font-size: 10.5px;
    line-height: 1.55;
    letter-spacing: .09em;
    color: rgba(255, 255, 255, .82);
    text-shadow: 0 2px 12px rgba(0, 0, 0, .4);
  }
  .eyebrow .dot { flex: none; width: 6px; height: 6px; }
  .hero-title {
    font-size: clamp(2.45rem, 11.5vw, 3.3rem);
    line-height: 1.08;
    letter-spacing: .065em;
    text-shadow: 0 3px 28px rgba(0, 0, 0, .58);
  }
  .hero-wordmark {
    margin-top: 11px;
    font-size: 10px;
    letter-spacing: .34em;
    line-height: 1.5;
  }
  .hero-lede {
    margin-top: 20px;
    max-width: 28em;
    font-size: 14px;
    line-height: 1.9;
    color: rgba(255, 255, 255, .86);
    text-shadow: 0 2px 16px rgba(0, 0, 0, .52);
  }
  .hero-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 23px; }
  .hero-chip {
    max-width: 100%;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(10, 12, 14, .40);
    border-color: rgba(255, 255, 255, .18);
    font-size: 11.5px;
    line-height: 1.5;
    backdrop-filter: blur(10px);
  }
  .hero-chip b { font-size: 12.5px; }
  .hero-cap { display: none; }
  .hero-gl, .hero-fx { opacity: .42; }
  .clockwork {
    position: static;
    order: 2;
    display: block !important;
    width: max-content;
    max-width: calc(100% - 36px);
    margin: 17px auto 0;
    padding: 7px 13px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, .17);
    background: rgba(10, 12, 14, .48);
    box-shadow: 0 8px 22px rgba(0, 0, 0, .13);
    text-align: center;
  }
  .clock-svg, .clock-note { display: none !important; }
  .clock-read { margin: 0; }
  .clock-time { font-size: 12.5px; letter-spacing: .1em; }
  .hero-gl-btn {
    position: static !important;
    order: 3;
    align-self: center;
    margin: 12px 0 0;
    padding: 6px 10px;
    border-color: rgba(255, 255, 255, .15);
    background: rgba(10, 12, 14, .35);
    color: rgba(255, 255, 255, .75);
    font-size: 10.5px;
    line-height: 1.4;
  }
  .enter-btn {
    position: absolute;
    left: 50%;
    bottom: calc(18px + env(safe-area-inset-bottom, 0px));
    padding: 11px 23px;
    font-size: 13px;
    letter-spacing: .04em;
    transform: translateX(-50%);
    white-space: nowrap;
  }
  .enter-btn:hover { transform: translateX(-50%); }
  .like-box { flex-wrap: wrap; gap: 10px; margin-top: 21px; }
  .like-btn { min-height: 42px; padding: 9px 16px; font-size: 13px; }
  .like-num { font-size: 13px; }

  /* -------------------- 栏目与标题 -------------------- */
  main > section.sec {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-height: 0;
    padding-top: calc(var(--mobile-nav-offset) + 12px);
    padding-bottom: 10px;
    scroll-margin-top: var(--mobile-nav-offset);
  }
  main > section.sec.is-tall { justify-content: flex-start; }
  #overview { padding-top: calc(var(--mobile-nav-offset) + 6px); }
  #stamps { padding-bottom: 38px; }
  .sec-head { max-width: 100%; margin-bottom: 23px; }
  .sec-num { display: none; }
  .sec-head h2 { margin-top: 0; font-size: clamp(1.55rem, 7vw, 1.85rem); line-height: 1.25; letter-spacing: .015em; }
  .sec-sub { margin-top: 9px; font-size: 13.5px; line-height: 1.8; color: var(--dim); }
  .sec-sub br { display: none; }

  /* -------------------- 概况与统计 -------------------- */
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-bottom: 14px; }
  .stat {
    min-width: 0;
    padding: 15px 13px 13px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: linear-gradient(155deg, var(--surf) 0%, var(--surf-2) 100%);
  }
  .stat-grid .stat:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .stat-num { font-size: clamp(1.5rem, 7vw, 1.9rem); line-height: 1.1; overflow-wrap: anywhere; }
  .stat-num em { font-size: .62em; }
  .stat-label { margin-top: 7px; font-size: 12.5px; line-height: 1.55; }
  .stat-note { margin-top: 4px; font-size: 11.5px; line-height: 1.6; }
  .split { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .panel {
    min-width: 0;
    padding: 17px 15px 18px;
    margin: 0 0 12px;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: linear-gradient(160deg, var(--surf) 0%, var(--surf-2) 100%);
    box-shadow: var(--shadow-sm);
  }
  .panel-title { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 14px; padding-bottom: 11px; font-size: 14px; }
  .panel-title small { display: block; max-width: 58%; margin: 0; font-size: 11px; line-height: 1.5; text-align: right; }
  .donut-wrap { flex-direction: column; align-items: center; gap: 13px; margin-top: 16px; }
  .donut { width: 142px; height: 142px; max-width: 48vw; }
  .donut-legend { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 9px; width: 100%; }
  .donut-legend li { min-width: 0; padding: 5px 1px; gap: 6px; font-size: 12px; border-bottom: 1px solid var(--line-soft); }
  .donut-legend .lg-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .donut-legend .lg-val { flex: none; font-size: 11px; }
  .mats { gap: 8px; margin-top: 17px; }
  .mats li { gap: 7px; padding: 9px 0; font-size: 12.5px; border-bottom: 1px solid var(--line-soft); }
  .mats .m-id { display: none; }
  .mats .m-name { width: 5.5em; }
  .mats .m-val { width: auto; font-size: 11.5px; }
  .bars { gap: 10px; }
  .bars li { gap: 8px; font-size: 12px; }

  /* -------------------- 模组库与筛选 -------------------- */
  .toolbar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 11px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: var(--surf);
  }
  .toolbar .search {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    min-width: 0;
    min-height: 46px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: var(--bg-2);
  }
  .toolbar .search svg { flex: none; width: 17px; height: 17px; }
  #modSearch, .search-input {
    width: 100%;
    min-width: 0;
    padding: 0;
    border: 0;
    outline: 0;
    background: transparent;
    font-size: 14px;
  }
  #modSearch::placeholder, .wiki-search::placeholder { color: var(--dim-2); }
  .toolbar .search .kbd { display: none; }
  .toolbar-right { display: flex; flex-direction: column; align-items: stretch; gap: 8px; width: 100%; min-width: 0; }
  .seg {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    width: 100%;
    min-width: 0;
    overflow: visible;
  }
  .seg button {
    min-width: 0;
    min-height: 36px;
    padding: 7px 4px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--dim);
    font-size: 11.5px;
    line-height: 1.3;
    white-space: nowrap;
  }
  .seg button.is-on,
  .seg button[aria-pressed="true"] { border-color: color-mix(in srgb, var(--brass) 54%, var(--line)); background: var(--brass-soft); color: var(--brass); }
  .seg-actions { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .chips {
    display: flex;
    flex-wrap: nowrap;
    gap: 7px;
    max-width: 100%;
    margin-top: 15px;
    padding: 1px 0 5px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
  }
  .chips::-webkit-scrollbar { display: none; }
  .chip { flex: none; padding: 7px 11px; font-size: 12px; line-height: 1.4; white-space: nowrap; }
  .result-line { display: flex; align-items: center; gap: 7px; margin: 14px 0 9px; color: var(--dim); font-size: 12.5px; }
  .mod-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .mod-card {
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 4px 11px;
    padding: 14px 3px 15px;
    border: 0;
    border-bottom: 1px solid var(--line-soft);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }
  .mod-ico { width: 40px; height: 40px; border-radius: 10px; }
  .mod-name { font-size: 14px; line-height: 1.45; }
  .mod-meta { flex-wrap: wrap; gap: 4px 7px; font-size: 11px; }
  .mod-meta .m-en { max-width: 100%; }
  .mod-note { font-size: 12px; line-height: 1.65; -webkit-line-clamp: 2; }
  .mod-card:hover { transform: none; box-shadow: none; background: transparent; }
  .more-wrap { margin-top: 18px; }

  /* -------------------- 依赖图谱 -------------------- */
  .graph-shell { height: 430px; min-height: 360px; border-radius: 14px; }
  #graphCanvas { touch-action: pan-y; }
  .graph-ui { padding: 9px; }
  .graph-tools { display: flex; flex-wrap: wrap; gap: 5px; max-width: 100%; }
  .graph-tools .btn { min-height: 31px; padding: 6px 9px; border-radius: 999px; font-size: 10.5px; line-height: 1.3; }
  .graph-legend { position: absolute; left: 9px; right: 9px; bottom: 9px; max-width: none; gap: 4px 9px; padding: 8px 9px; border: 1px solid var(--line-soft); border-radius: 10px; background: color-mix(in srgb, var(--bg) 85%, transparent); font-size: 10.5px; }
  .graph-hint { display: none; }
  .graph-tip { max-width: calc(100% - 20px); white-space: normal; overflow-wrap: anywhere; font-size: 11px; }
  .graph-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
  .gs { min-width: 0; padding: 11px 12px; font-size: 11.5px; overflow-wrap: anywhere; }
  .gs b { font-size: 14px; }

  /* -------------------- 影像志 -------------------- */
  .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-top: 15px; }
  .shot { aspect-ratio: 4 / 3; border: 1px solid var(--line); border-radius: 11px; transform: none; }
  .shot img { opacity: 1; }
  .shot .s-cap {
    display: block;
    padding: 18px 8px 7px;
    background: linear-gradient(180deg, transparent 0%, rgba(8, 9, 11, .82) 100%);
    font-size: 10.5px;
    line-height: 1.45;
    opacity: 1;
    transform: none;
  }
  .shot .s-cap span { display: none; }
  .shot:hover { transform: none; }
  .shot:hover img { transform: none; }

  /* -------------------- 存档、wiki、建筑 -------------------- */
  .dl-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .dl-card { min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 13px; background: linear-gradient(155deg, var(--surf) 0%, var(--surf-2) 100%); gap: 8px; }
  .dl-card:hover { transform: none; box-shadow: none; }
  .dl-title { font-size: 14.5px; }
  .dl-note { font-size: 12px; }
  .wiki-bar { display: flex; flex-direction: column; align-items: stretch; gap: 8px; }
  .wiki-search { width: 100%; min-width: 0; min-height: 46px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 11px; background: var(--surf); font-size: 14px; }
  .wiki-search:focus { outline: none; border-color: var(--brass); }
  .wiki-stat { font-size: 12px; text-align: left; }
  .wiki-body { display: flex; flex-direction: column; gap: 8px; }
  .wiki-sec { border: 1px solid var(--line); border-radius: 12px; background: var(--surf); overflow: hidden; }
  .wiki-sec > summary { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 13px 14px; }
  .wiki-sec-name { min-width: 0; font-size: 14.5px; }
  .wiki-sec-count { margin-left: auto; flex: none; font-size: 11.5px; }
  .wiki-items { display: grid; grid-template-columns: minmax(0, 1fr); padding: 0 14px 14px; }
  .wiki-item { min-width: 0; padding: 12px 0 5px; border-top: 1px solid var(--line-soft); }
  .wiki-item-title { font-size: 14px; line-height: 1.5; }
  .wiki-line { font-size: 13px; line-height: 1.8; overflow-wrap: anywhere; }
  .wiki-line.is-link a { word-break: break-word; overflow-wrap: anywhere; }
  .build-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .build-card { border: 1px solid var(--line); border-radius: 14px; background: linear-gradient(155deg, var(--surf) 0%, var(--surf-2) 100%); }
  .build-card:hover { transform: none; box-shadow: none; }
  .build-shot { aspect-ratio: 16 / 9; }
  .build-meta { padding: 13px 14px 15px; }
  .build-name { margin-bottom: 6px; font-size: 15px; }
  .coord-text { font-size: 13px; overflow-wrap: anywhere; }
  .build-note { font-size: 12.5px; line-height: 1.75; }

  /* -------------------- 创作者、更新、配置、FAQ -------------------- */
  .creator-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .creator-card { min-width: 0; border: 1px solid var(--line); border-radius: 13px; background: var(--surf); }
  .creator-card:hover { transform: none; box-shadow: none; }
  .creator-stage { border-radius: 0; }
  .creator-meta { padding: 10px 10px 11px; gap: 7px; }
  .creator-face { width: 33px; height: 33px; border-radius: 9px; }
  .creator-name { font-size: 13px; line-height: 1.45; overflow-wrap: anywhere; }
  .creator-tag { font-size: 10.5px; line-height: 1.5; }
  .creator-hint { opacity: 1; font-size: 10.5px; }
  .log { display: flex; flex-direction: column; gap: 0; background: transparent; }
  .log-item { border-bottom: 1px solid var(--line-soft); }
  .log-item details { border: 0; border-radius: 0; background: transparent; }
  .log-item summary { display: flex; align-items: flex-start; gap: 10px; padding: 15px 0; }
  .log-ver { flex: none; font-size: 15px; }
  .log-brief { min-width: 0; font-size: 12px; line-height: 1.65; }
  .log-body { padding: 0 0 15px; }
  .log-list > li { font-size: 13px; line-height: 1.8; }
  .log-sub > li { font-size: 12px; }
  .req-wrap { grid-template-columns: minmax(0, 1fr); gap: 11px; }
  .req-panel { overflow: hidden; padding: 16px 13px; }
  .req-panel:first-child { overflow-x: visible; }
  .req-table { width: 100%; min-width: 0; table-layout: fixed; border-collapse: collapse; }
  .req-table th, .req-table td { padding: 9px 4px; font-size: 11px; line-height: 1.55; overflow-wrap: anywhere; }
  .req-table th { white-space: normal; }
  .req-table th:first-child, .req-table td:first-child { width: 20%; }
  .req-table th:nth-child(2), .req-table td:nth-child(2) { width: 35%; }
  .req-table th:nth-child(3), .req-table td:nth-child(3) { width: 45%; }
  .req-tip { margin-top: 12px; font-size: 12px; line-height: 1.75; }
  .hw-form { display: flex; flex-direction: column; gap: 12px; }
  .hw-form label { display: flex; flex-direction: column; align-items: stretch; gap: 6px; font-size: 12.5px; }
  .hw-form select { width: 100%; max-width: 100%; min-height: 44px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-2); font-size: 14px; }
  .hw-out { margin-top: 14px; padding: 13px; border: 1px solid var(--line); border-radius: 11px; background: var(--bg-2); font-size: 13px; }
  .hw-out li { font-size: 12px; }
  .faq { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .faq-item { padding: 15px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surf); }
  .faq-item h4 { margin-bottom: 7px; font-size: 14px; }
  .faq-item p { font-size: 13px; line-height: 1.8; }

  /* -------------------- 投稿、赞助、印章墙 -------------------- */
  .two-col { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .big-card { min-width: 0; padding: 18px 16px; border: 1px solid var(--line); border-radius: 14px; background: linear-gradient(155deg, var(--surf) 0%, var(--surf-2) 100%); }
  .big-card-title { margin-bottom: 12px; font-size: 15.5px; }
  .num-list { padding-left: 20px; margin-bottom: 12px; }
  .num-list li { font-size: 13.5px; line-height: 1.8; }
  .big-card-note { font-size: 12.5px; line-height: 1.8; }
  .mail-link { max-width: 100%; font-size: 13px; line-height: 1.7; overflow-wrap: anywhere; }
  .card-actions { gap: 8px; margin-top: 15px; }
  .pill-btn { min-height: 40px; padding: 8px 13px; font-size: 12.5px; }
  .sponsor-card {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 23px 16px 20px;
    border: 1px solid color-mix(in srgb, var(--brass) 26%, var(--line));
    border-radius: 15px;
    background: radial-gradient(120% 90% at 50% 0%, color-mix(in srgb, var(--brass) 8%, transparent) 0%, transparent 62%), linear-gradient(180deg, var(--surf) 0%, var(--surf-2) 100%);
    text-align: left;
  }
  .sponsor-text { margin-bottom: 18px; font-size: 14px; line-height: 1.9; }
  .sponsor-btn { min-height: 44px; justify-content: center; padding: 11px 22px; font-size: 14px; }
  .sponsor-foot { margin-top: 14px; font-size: 11.5px; }
  .sponsor-list-wrap { margin-top: 21px; padding-top: 17px; }
  .sponsor-list-title { font-size: 11.5px; }
  .sponsor-list { gap: 6px; }
  .sponsor-chip { padding: 5px 10px; font-size: 12px; }
  .stamp-wall { padding: 16px 13px 15px; border: 1px solid var(--line); border-radius: 14px; background: linear-gradient(155deg, var(--surf) 0%, var(--surf-2) 100%); }
  .stamp-picker { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .stamp-btn { min-width: 0; min-height: 84px; padding: 11px 5px 9px; border-radius: 12px; gap: 7px; }
  .stamp-emoji { font-size: 23px; }
  .stamp-label { font-size: 11px; }
  .stamp-tip { margin-top: 13px; font-size: 12.5px; line-height: 1.7; }
  .stamp-stats { grid-template-columns: minmax(0, 1fr); gap: 9px; margin-top: 16px; }
  .stamp-row { gap: 7px; font-size: 12px; }
  .stamp-num { font-size: 12px; }
  .stamp-recent-wrap { margin-top: 17px; padding-top: 13px; }
  .stamp-recent-label { font-size: 11.5px; }
  .stamp-recent { gap: 5px; }
  .stamp-chip { width: 31px; height: 31px; font-size: 15px; }

  /* -------------------- 弹层、页脚、背景 -------------------- */
  .drawer { width: 100%; max-height: 100dvh; padding-bottom: env(safe-area-inset-bottom, 0px); }
  .drawer-body { padding: 18px 16px calc(30px + env(safe-area-inset-bottom, 0px)); }
  .drawer-close { top: 10px; right: 10px; }
  .lightbox { grid-template-columns: minmax(0, 1fr); align-content: center; gap: 10px; padding: 12px; padding-bottom: calc(62px + env(safe-area-inset-bottom, 0px)); }
  .lightbox .lb-prev, .lightbox .lb-next { position: absolute; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }
  .lightbox .lb-prev { left: 14px; }
  .lightbox .lb-next { right: 14px; }
  .lb-figure { width: 100%; }
  .lb-imgwrap { max-height: 68svh; }
  .lb-figure img { max-height: 68svh; object-fit: contain; }
  .lb-cap { flex-wrap: wrap; gap: 6px; padding: 0 4px; font-size: 12px; }
  .palette { padding-top: calc(8vh + env(safe-area-inset-top, 0px)); }
  .palette-box { width: calc(100% - 24px); max-height: 78svh; }
  .palette-input input { min-width: 0; font-size: 14px; }
  .help-box { width: calc(100% - 24px); max-height: 82svh; overflow-y: auto; padding: 20px 17px; }
  .help-box h3 { font-size: 16px; }
  .help-box li { font-size: 13px; line-height: 1.75; }
  .iconwall .iw-head { gap: 10px; padding: 12px 14px; }
  .iconwall .iw-head h3 { font-size: 13px; }
  .iconwall .iw-body { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 12px; overflow-y: auto; }
  .iw-name { font-size: 10.5px; overflow-wrap: anywhere; }
  .foot { margin-top: 34px; padding: 0 0 calc(22px + env(safe-area-inset-bottom, 0px)); }
  .foot-inner { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding-top: 22px; text-align: left; }
  .foot-title { font-size: 14px; }
  .foot-links { display: flex; flex-direction: row; flex-wrap: wrap; align-items: flex-start; gap: 8px 13px; font-size: 11.5px; }
  .foot-links > span:last-child { flex-basis: 100%; line-height: 1.7; }
  .toast { left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
  .iconwall, .drawer, .palette, .lightbox, .help-box { -webkit-overflow-scrolling: touch; }

  /* 大表盘和齿轮只作氛围，不抢正文；隐藏高成本装饰动画。 */
  #clockback { right: -64vmin; opacity: .10; }
  .cb-face { opacity: .1; }
  .cb-hand { opacity: .22; }
  .gears { transform: scale(.42); transform-origin: left bottom; opacity: .16; }
  body::before { background-size: 38px 38px, 38px 38px; opacity: .48; }
  body::after { background-size: min(48vw, 250px) auto; opacity: .28; }
}

/* -------------------- 小屏手机 -------------------- */
@media (max-width: 420px) {
  :root { --mobile-gutter: 16px; }
  .nav { gap: 4px 7px; }
  .nav-name { font-size: 13px; letter-spacing: .055em; }
  .mark { width: 21px; height: 21px; }
  .nav-actions { gap: 3px; }
  .icon-btn, #themeBtn { width: 32px; min-width: 32px; height: 32px; }
  .nav-links { gap: 3px; }
  .nav-links a { padding: 5px 9px; font-size: 11.5px; }
  .hero-title { font-size: clamp(2.35rem, 11.2vw, 2.85rem); }
  .hero-lede { font-size: 13.5px; }
  .hero-chip { padding: 6px 9px; font-size: 11px; }
  .stat { padding: 13px 11px 12px; }
  .stat-num { font-size: clamp(1.4rem, 6.8vw, 1.7rem); }
  .panel { padding-inline: 13px; }
  .panel-title { align-items: flex-start; flex-direction: column; gap: 4px; }
  .panel-title small { max-width: 100%; text-align: left; }
  .seg button { font-size: 11px; }
  .gallery-grid { gap: 7px; }
  .shot .s-cap { font-size: 10px; }
  .creator-grid { gap: 8px; }
  .creator-meta { padding-inline: 8px; }
  .stamp-wall { padding-inline: 10px; }
  .stamp-picker { gap: 6px; }
  .stamp-btn { min-height: 78px; }
  .stamp-label { font-size: 10.5px; }
}

@media (max-width: 360px) {
  .nav-name { display: none; }
  .nav-brand { gap: 0; }
  .hero-title { font-size: 2.2rem; }
  .hero-wordmark { letter-spacing: .23em; }
  .hero-chip { font-size: 10.5px; padding: 5px 8px; }
  .stat-grid { gap: 7px; }
  .stat-num { font-size: 1.35rem; }
  .donut-legend { grid-template-columns: minmax(0, 1fr); }
  .seg-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gallery-grid { grid-template-columns: minmax(0, 1fr); }
  .shot { aspect-ratio: 16 / 9; }
  .graph-shell { height: 390px; min-height: 340px; }
  .stamp-picker { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) and (max-width: 760px) {
  .hero-bg { animation: none; }
  .eyebrow .dot, .enter-arrow { animation: none !important; }
  html { scroll-behavior: auto; }
}

/* Bugfix: stable hero background on narrow screens; no moving colour/crop. */
.hero-bg { animation: none !important; transition: none !important; }
