/* ============================================================
 *  PIXEL FOLIO — 像素游戏风 × 简约清新
 *  想改配色？调整下面 :root 里的变量即可
 * ============================================================ */

/* 像素字体：本地优先（fonts/ 文件夹），加载失败回退系统字体 */
@font-face {
  font-family: 'Press Start 2P';
  src: url('../fonts/press-start-2p.woff2') format('woff2');
  font-display: swap;
}
/* 中文像素字体 Zpix（CDN 加载失败会自动回退到系统字体） */
@font-face {
  font-family: 'Zpix';
  src: url('https://cdn.jsdelivr.net/gh/SolidZORO/zpix-pixel-font@v3.2.0/dist/zpix.ttf') format('truetype');
  font-display: swap;
}

:root {
  /* —— 清新配色 —— */
  --bg:      #fdf8ec;   /* 奶油底色 */
  --bg-grid: #ece3cd;   /* 网格线 */
  --paper:   #ffffff;
  --ink:     #34324c;   /* 主墨色 */
  --ink-soft:#6b6888;
  --mint:    #9fe3c3;
  --coral:   #ff9eaa;
  --sky:     #9cd2f2;
  --butter:  #ffd97d;
  --lilac:   #c9b8f0;

  --font: 'Press Start 2P', 'Zpix', 'Courier New', monospace;

  --border: 3px solid var(--ink);
  --shadow-hard: 5px 5px 0 var(--ink);
  --shadow-press: 2px 2px 0 var(--ink);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

/* 像素风选中效果 + 滚动条 */
::selection { background: var(--coral); color: #fff; }
::-webkit-scrollbar { width: 12px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: var(--ink);
  border: 3px solid var(--bg);
}

body {
  font-family: var(--font);
  background-color: var(--bg);
  /* 淡格子底纹，像游戏地图 */
  background-image:
    linear-gradient(var(--bg-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--bg-grid) 1px, transparent 1px);
  background-size: 26px 26px;
  color: var(--ink);
  line-height: 1.9;
  font-size: 14px;
  overflow-x: hidden;
}

img { display: block; }

/* ---------- 通用像素盒子 ---------- */
.pixel-box {
  border: var(--border);
  box-shadow: var(--shadow-hard);
  background: var(--paper);
  border-radius: 0;
}

/* ---------- 像素按钮 ---------- */
.btn {
  display: inline-block;
  font-family: var(--font);
  font-size: 13px;
  color: var(--ink);
  text-decoration: none;
  padding: 14px 22px;
  background: var(--butter);
  border: var(--border);
  box-shadow: var(--shadow-hard);
  cursor: pointer;
  transition: transform .08s steps(2), box-shadow .08s steps(2), background .15s;
  image-rendering: pixelated;
}
.btn:hover  { background: #ffe6a3; transform: translate(-2px, -2px); box-shadow: 7px 7px 0 var(--ink); }
.btn:active { transform: translate(3px, 3px); box-shadow: var(--shadow-press); }

/* ============================================================
 *  顶部导航
 * ============================================================ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 22px;
  background: var(--paper);
  border-bottom: var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  font-size: 15px;
  letter-spacing: 1px;
}
.brand__icon { font-size: 22px; }
.brand__text em { font-style: normal; color: var(--coral); }

.nav { display: flex; gap: 10px; flex-wrap: wrap; }
.nav__link {
  font-size: 12px;
  text-decoration: none;
  color: var(--ink);
  padding: 8px 14px;
  background: var(--bg);
  border: 2px solid transparent;
  transition: all .12s steps(2);
}
.nav__link:hover {
  background: var(--mint);
  border-color: var(--ink);
  transform: translateY(-2px);
}

/* ============================================================
 *  首屏 HERO
 * ============================================================ */
.hero {
  position: relative;
  min-height: 88vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 20px 120px;
  overflow: hidden;
}

.hero__inner { position: relative; z-index: 2; }

/* 像素太阳（右上角装饰） */
.hero::before {
  content: '';
  position: absolute;
  top: 9%;
  right: 12%;
  width: 64px;
  height: 64px;
  background: var(--butter);
  border: 3px solid var(--ink);
  box-shadow: 5px 5px 0 rgba(52, 50, 76, .18);
  z-index: 1;
  animation: bob 3s steps(4) infinite;
}
.hero::after {
  content: '';
  position: absolute;
  top: 14%;
  right: 16%;
  width: 34px;
  height: 34px;
  background: rgba(255, 217, 125, .35);
  z-index: 1;
}
@media (max-width: 640px) {
  .hero::before { width: 44px; height: 44px; top: 6%; right: 8%; }
  .hero::after  { width: 22px; height: 22px; top: 10%; right: 11%; }
}

.hero__avatar {
  width: 132px;
  height: 132px;
  margin: 0 auto 28px;
  overflow: hidden;
  background: var(--mint);
  image-rendering: pixelated;
  animation: bob 2.4s steps(4) infinite;
}
.hero__avatar img { width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; }

@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}

.hero__title {
  font-size: clamp(22px, 4.6vw, 40px);
  line-height: 1.5;
  text-shadow: 4px 4px 0 var(--coral), 8px 8px 0 var(--sky);
  margin-bottom: 24px;
}

.hero__tagline {
  font-size: clamp(12px, 2vw, 15px);
  color: var(--ink-soft);
  margin-bottom: 38px;
}

.hero__btn { animation: blink-soft 1.6s steps(2) infinite; }
@keyframes blink-soft {
  0%, 100% { box-shadow: var(--shadow-hard); }
  50%      { box-shadow: var(--shadow-hard), 0 0 0 4px rgba(255, 217, 125, .55); }
}

/* 地面像素草皮 */
.hero__ground {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 26px;
  background:
    repeating-linear-gradient(90deg,
      var(--mint) 0 20px, #8bd4b2 20px 26px);
  border-top: var(--border);
  z-index: 1;
}

/* 漂浮像素云 */
.cloud {
  position: absolute;
  width: 10px; height: 10px;
  background: #fff;
  filter: drop-shadow(3px 3px 0 var(--ink));
  z-index: 1;
  animation: drift 26s linear infinite;
}
.cloud::before, .cloud::after {
  content: '';
  position: absolute;
  background: #fff;
}
.cloud::before { width: 30px; height: 10px; left: -10px; top: -10px; }
.cloud::after  { width: 12px; height: 10px; left: 14px; top: -20px; }
.cloud--1 { top: 18%; left: -60px; animation-duration: 30s; }
.cloud--2 { top: 38%; left: -60px; animation-duration: 38s; animation-delay: -12s; transform: scale(.8); }
.cloud--3 { top: 12%; left: -60px; animation-duration: 46s; animation-delay: -26s; transform: scale(1.25); }

@keyframes drift {
  from { transform: translateX(0); }
  to   { transform: translateX(calc(100vw + 160px)); }
}
/* 缩放和位移动画共存（用内层包裹思路的折中：只给 2/3 号云缩放时保留位移，这里用变量叠加） */
.cloud--2 { animation-name: drift2; }
.cloud--3 { animation-name: drift3; }
@keyframes drift2 {
  from { transform: translateX(0) scale(.8); }
  to   { transform: translateX(calc(100vw + 160px)) scale(.8); }
}
@keyframes drift3 {
  from { transform: translateX(0) scale(1.25); }
  to   { transform: translateX(calc(100vw + 160px)) scale(1.25); }
}

/* 闪烁星星 */
.spark {
  position: absolute;
  color: var(--butter);
  font-size: 18px;
  z-index: 1;
  animation: twinkle 1.4s steps(2) infinite;
}
.spark--1 { top: 22%; right: 14%; }
.spark--2 { top: 55%; left: 10%; animation-delay: .5s; color: var(--coral); }
.spark--3 { top: 30%; left: 22%; animation-delay: .9s; color: var(--lilac); }
@keyframes twinkle { 50% { opacity: 0; } }

/* ============================================================
 *  作品板块
 * ============================================================ */
.module {
  max-width: 1180px;
  margin: 0 auto;
  padding: 70px 24px 30px;
  scroll-margin-top: 90px;
}

.module__head { margin-bottom: 34px; counter-increment: stage; }

.module__title {
  display: inline-block;
  font-size: clamp(18px, 3.2vw, 26px);
  line-height: 1.6;
  background: var(--paper);
  border: var(--border);
  box-shadow: var(--shadow-hard);
  padding: 12px 20px;
}
.module__title::before {
  content: 'STAGE ' counter(stage, decimal-leading-zero);
  font-size: .5em;
  color: var(--coral);
  margin-right: 12px;
  letter-spacing: 1px;
  vertical-align: 3px;
}
main { counter-reset: stage; }
.module__title .bracket { color: var(--coral); }
.module__title small {
  font-size: .55em;
  color: var(--ink-soft);
  margin-left: 12px;
  letter-spacing: 2px;
}

.module__desc {
  margin-top: 18px;
  font-size: 13px;
  color: var(--ink-soft);
  padding-left: 6px;
}

/* ---------- 作品网格 ---------- */
.grid {
  display: grid;
  gap: 26px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  counter-reset: card;
}
.grid--video { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }

.card {
  background: var(--paper);
  border: var(--border);
  box-shadow: var(--shadow-hard);
  cursor: pointer;
  transition: transform .1s steps(2), box-shadow .1s steps(2);
  overflow: hidden;
  counter-increment: card;
}
.card:hover {
  transform: translate(-3px, -3px);
  box-shadow: 8px 8px 0 var(--ink);
}
.card:active { transform: translate(2px, 2px); box-shadow: var(--shadow-press); }

.card__media {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--bg-grid);
  border-bottom: var(--border);
}
.grid--video .card__media { aspect-ratio: 16 / 9; }

.card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
  transition: transform .25s steps(6);
}
.card:hover .card__media img { transform: scale(1.06); }

.card__badge {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 10px;
  padding: 5px 8px;
  background: var(--butter);
  border: 2px solid var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
}

.card__play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  color: #fff;
  text-shadow: 3px 3px 0 var(--ink);
  background: rgba(52, 50, 76, .18);
  transition: background .15s;
}
.card:hover .card__play { background: rgba(52, 50, 76, .32); }

.card__body { padding: 14px 16px 16px; }
.card__body h3 { font-size: 14px; margin-bottom: 6px; }
.card__body h3::before {
  content: '#' counter(card, decimal-leading-zero) ' ';
  color: var(--coral);
  font-size: .85em;
}
.card__body p  { font-size: 11px; color: var(--ink-soft); line-height: 1.8; }

/* ---------- 滚动入场动画 ---------- */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .4s steps(5), transform .4s steps(5);
}
.reveal.in { opacity: 1; transform: translateY(0); }

/* ============================================================
 *  弹窗（灯箱 / 视频）
 * ============================================================ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal.open { display: flex; }

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(52, 50, 76, .55);
}

.modal__panel {
  position: relative;
  z-index: 1;
  max-width: 920px;
  width: 100%;
  max-height: 88vh;
  background: var(--bg);
  padding: 18px;
  overflow: auto;
}

.modal__close {
  position: absolute;
  top: -16px; right: -16px;
  width: 42px; height: 42px;
  font-family: var(--font);
  font-size: 14px;
  background: var(--coral);
  border: var(--border);
  box-shadow: var(--shadow-press);
  cursor: pointer;
  z-index: 2;
}
.modal__close:hover { background: #ffb3bd; }
.modal__close:active { transform: translate(2px, 2px); box-shadow: none; }

.modal__stage {
  border: var(--border);
  background: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  overflow: hidden;
}
.modal__stage img {
  width: 100%;
  max-height: 66vh;
  object-fit: contain;
  image-rendering: pixelated;
}
.modal__stage video {
  width: 100%;
  max-height: 66vh;
  display: block;
}

.modal__caption {
  padding: 14px 4px 2px;
  font-size: 12px;
  line-height: 1.8;
}
.modal__caption strong { font-size: 13px; }
.modal__caption span { color: var(--ink-soft); display: block; margin-top: 4px; }

.modal__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px; height: 44px;
  font-family: var(--font);
  font-size: 14px;
  background: var(--paper);
  border: var(--border);
  box-shadow: var(--shadow-press);
  cursor: pointer;
  z-index: 2;
}
.modal__nav:hover { background: var(--mint); }
.modal__prev { left: -22px; }
.modal__next { right: -22px; }
.modal__nav.hidden { display: none; }

/* ---------- 像素电视机（视频未添加时） ---------- */
.tv {
  width: 100%;
  max-width: 460px;
  padding: 26px 26px 30px;
  text-align: center;
}
.tv__antenna {
  width: 60px; height: 30px;
  margin: 0 auto -6px;
  border-left: 3px solid var(--ink);
  border-top: 3px solid var(--ink);
  transform: rotate(35deg);
  transform-origin: bottom right;
}
.tv__screen {
  position: relative;
  border: var(--border);
  background: #1d1c2e;
  height: 200px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tv__noise {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg,
    rgba(255,255,255,.08) 0 2px, transparent 2px 4px);
  animation: noise .3s steps(3) infinite;
}
@keyframes noise {
  0%   { background-position: 0 0; }
  50%  { background-position: 0 6px; }
  100% { background-position: 0 0; }
}
.tv__text {
  position: relative;
  color: #e8e6ff;
  font-size: 15px;
  line-height: 2.2;
  text-shadow: 2px 2px 0 #000;
}
.tv__text small { font-size: 10px; color: var(--butter); }
.tv__legs {
  width: 60%;
  height: 14px;
  margin: 0 auto;
  border-left: 3px solid var(--ink);
  border-right: 3px solid var(--ink);
}

/* ============================================================
 *  页脚
 * ============================================================ */
.footer {
  margin-top: 70px;
  border-top: var(--border);
  background: var(--paper);
  text-align: center;
  padding: 30px 20px 36px;
  font-size: 11px;
}
.footer__line { margin-bottom: 10px; }
.heart { color: var(--coral); animation: heartbeat 1s steps(2) infinite; display: inline-block; }
@keyframes heartbeat { 50% { transform: scale(1.3); } }

.footer__hint {
  font-size: 10px;
  color: var(--ink-soft);
  line-height: 1.8;
}
.footer__hint code {
  font-family: var(--font);
  background: var(--mint);
  padding: 2px 6px;
  border: 2px solid var(--ink);
}

/* ============================================================
 *  编辑模式
 * ============================================================ */
.card { position: relative; }

.edit-fab {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 90;
  width: 58px;
  height: 58px;
  font-family: var(--font);
  font-size: 22px;
  background: var(--coral);
  border: var(--border);
  box-shadow: var(--shadow-hard);
  cursor: pointer;
  transition: transform .08s steps(2), box-shadow .08s steps(2);
}
.edit-fab:hover  { transform: translate(-2px, -2px); box-shadow: 7px 7px 0 var(--ink); }
.edit-fab:active { transform: translate(3px, 3px); box-shadow: var(--shadow-press); }

.edit-bar {
  display: none;
  position: fixed;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 90;
  background: var(--paper);
  border: var(--border);
  box-shadow: var(--shadow-hard);
  padding: 10px 12px;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}
body.editing .edit-bar { display: flex; }
.edit-bar .btn { font-size: 11px; padding: 10px 12px; box-shadow: var(--shadow-press); }
.btn--ghost { background: var(--bg); }
.btn--ghost:hover { background: var(--bg-grid); }

body.editing .card         { outline: 3px dashed var(--coral); outline-offset: 3px; }
body.editing .module__head { outline: 3px dashed var(--sky); outline-offset: 5px; }

.card-tools { position: absolute; top: 8px; right: 8px; display: flex; gap: 6px; z-index: 6; }
.card-tools button,
.mod-tools button,
.hero-tools button {
  font-family: var(--font);
  font-size: 11px;
  padding: 7px 9px;
  background: var(--paper);
  border: 2px solid var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
  cursor: pointer;
}
.card-tools button:hover,
.mod-tools button:hover,
.hero-tools button:hover { background: var(--butter); }

.mod-tools { display: flex; gap: 8px; margin-top: 14px; }
.hero-tools { margin-top: 26px; text-align: center; }
.hero-tools button { font-size: 11px; }

/* ---------- 拖拽排序 ---------- */
.drag-handle {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: var(--font); font-size: 11px;
  padding: 8px 10px;
  background: var(--butter);
  border: 2px solid var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  letter-spacing: 0.5px;
}
.drag-handle__icon { font-size: 14px; line-height: 1; }
.drag-handle__text { font-size: 9px; }
.drag-handle:hover { background: #ffe6a3; transform: translate(-1px,-1px); box-shadow: 3px 3px 0 var(--ink); }
.drag-handle:active { cursor: grabbing; transform: translate(1px,1px); box-shadow: 1px 1px 0 var(--ink); }
.card[draggable="true"] { cursor: grabbing; }
.card.dragging { opacity: 0.30; transform: scale(0.96); }

/* 鼠标进入卡片范围（未重合）—— 仅虚线外框提示 */
.card.drag-over {
  outline: 4px dashed var(--coral);
  outline-offset: 3px;
  position: relative;
}

/* 拽至重合（鼠标在卡片中心 60% 区域）—— 显示半透明覆盖 + 文字提示 */
.card.drag-over-hit {
  outline: 4px solid var(--coral);
  outline-offset: 3px;
}
.card.drag-over-hit::after {
  content: '✦ 拽至重合 · 松手换序 ✦';
  position: absolute;
  inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 158, 170, 0.86);
  color: var(--ink);
  font-family: var(--font);
  font-size: 13px;
  font-weight: bold;
  text-align: center;
  z-index: 8;
  pointer-events: none;
  border: 4px solid var(--ink);
  letter-spacing: 0.5px;
  text-shadow: 2px 2px 0 #fff, -2px -2px 0 #fff, 2px -2px 0 #fff, -2px 2px 0 #fff;
}

/* 拖动源卡片自身（被拖的那个）—— 半透明 */
.card.dragging { outline: 4px dashed var(--ink) !important; }

/* ---------- 编辑对话框 ---------- */
.dlg__panel { max-width: 480px; padding: 24px; }
.dlg__panel h3 { font-size: 14px; margin-bottom: 16px; }
#dlgForm label {
  display: block;
  font-size: 11px;
  color: var(--ink-soft);
  margin-bottom: 14px;
  line-height: 1.6;
}
#dlgForm input[type=text],
#dlgForm textarea,
#dlgForm select {
  display: block;
  width: 100%;
  margin-top: 6px;
  font-family: var(--font);
  font-size: 12px;
  padding: 10px;
  border: 2px solid var(--ink);
  background: var(--bg);
  color: var(--ink);
}
#dlgForm textarea { min-height: 64px; resize: vertical; }
#dlgForm input[type=file] { margin-top: 6px; font-size: 11px; width: 100%; }
.up-note {
  display: block;
  font-size: 10px;
  margin-top: 5px;
  color: var(--ink-soft);
  word-break: break-all;
}
.dlg-btns { display: flex; gap: 10px; justify-content: flex-end; margin-top: 4px; }

/* ---------- 视频卡片无封面时的占位 ---------- */
.card__media.no-thumb {
  background: repeating-linear-gradient(45deg, var(--mint) 0 14px, #8bd4b2 14px 28px);
}
.card__media.no-thumb .card__play { background: rgba(52, 50, 76, .08); }

/* ---------- 空板块提示 ---------- */
.empty-tip {
  grid-column: 1 / -1;
  text-align: center;
  font-size: 11px;
  color: var(--ink-soft);
  padding: 34px 16px;
  border: 3px dashed var(--bg-grid);
}

/* ---------- 平台欢迎页 / 无头像占位 ---------- */
.landing-panel {
  padding: 30px 26px;
  font-size: 12px;
  line-height: 2.2;
  text-align: center;
}
.landing-panel .landing-url {
  display: inline-block;
  background: var(--mint);
  border: 2px solid var(--ink);
  padding: 8px 14px;
  margin: 8px 0;
  font-size: 13px;
}
.hero__avatar.no-img {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--mint);
}
.hero__avatar.no-img::after {
  content: '🙂';
  font-size: 60px;
}

/* ============================================================
 *  管理后台 admin.html
 * ============================================================ */
.admin-wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 40px 20px 80px;
}
.admin-title {
  font-size: 20px;
  margin-bottom: 6px;
  line-height: 1.6;
}
.admin-sub { font-size: 11px; color: var(--ink-soft); margin-bottom: 26px; }

.admin-card {
  background: var(--paper);
  border: var(--border);
  box-shadow: var(--shadow-hard);
  padding: 22px;
  margin-bottom: 26px;
}
.admin-card h3 { font-size: 13px; margin-bottom: 16px; }
.admin-card label {
  display: block;
  font-size: 11px;
  color: var(--ink-soft);
  margin-bottom: 12px;
}
.admin-card input[type=text], .admin-card input[type=password] {
  display: block;
  width: 100%;
  margin-top: 6px;
  font-family: var(--font);
  font-size: 12px;
  padding: 10px;
  border: 2px solid var(--ink);
  background: var(--bg);
  color: var(--ink);
}
.admin-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.admin-row label { flex: 1; min-width: 160px; }
.admin-card .btn { font-size: 11px; padding: 10px 14px; box-shadow: var(--shadow-press); }

.admin-result {
  margin-top: 16px;
  display: none;
  background: var(--mint);
  border: 2px solid var(--ink);
  padding: 14px;
  font-size: 11px;
  line-height: 2;
}
.admin-result.show { display: block; }
.admin-result .copy-line {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 6px;
}
.admin-result input {
  flex: 1;
  min-width: 200px;
  font-family: var(--font);
  font-size: 11px;
  padding: 8px;
  border: 2px solid var(--ink);
  background: #fff;
}

table.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}
.admin-table th, .admin-table td {
  border: 2px solid var(--ink);
  padding: 9px 10px;
  text-align: left;
  vertical-align: middle;
}
.admin-table th { background: var(--butter); }
.admin-table td .btn { font-size: 10px; padding: 6px 8px; box-shadow: 1px 1px 0 var(--ink); margin-right: 4px; }
.admin-table .uid { font-size: 12px; }
.admin-empty { font-size: 11px; color: var(--ink-soft); text-align: center; padding: 20px; }

/* ---------- 主题配色输入框 ---------- */
.theme-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 2px dashed var(--bg-grid);
}
.preset-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font);
  font-size: 10px;
  padding: 8px 10px;
  background: var(--paper);
  border: 2px solid var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
  cursor: pointer;
  transition: transform .08s steps(2);
}
.preset-btn:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--ink); }
.preset-swatch {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 1px solid var(--ink);
}
#dlgForm input[type="color"] {
  display: block;
  width: 100%;
  height: 42px;
  margin-top: 6px;
  padding: 2px;
  border: 2px solid var(--ink);
  background: var(--bg);
  cursor: pointer;
}
.color-pick-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
}
.color-pick-row input[type="color"] {
  width: 44px;
  height: 44px;
  min-width: 44px;
  padding: 2px;
  border: 2px solid var(--ink);
  background: var(--bg);
  cursor: pointer;
}
.color-pick-row input[type="text"] {
  flex: 1;
  font-family: var(--font);
  font-size: 12px;
  padding: 10px;
  border: 2px solid var(--ink);
  background: var(--bg);
  color: var(--ink);
}

/* ============================================================
 *  手机适配（增强）
 * ============================================================ */
@media (max-width: 640px) {
  body { font-size: 12px; overflow-x: hidden; }
  .topbar {
    flex-direction: column;
    gap: 8px;
    padding: 8px 10px;
    text-align: center;
  }
  .brand__text { font-size: 13px; }
  .nav { justify-content: center; flex-wrap: wrap; gap: 4px; }
  .nav__link { font-size: 9px; padding: 6px 8px; }

  .hero { min-height: auto; padding: 48px 16px 40px; }
  .hero__avatar { width: 100px; height: 100px; }
  .hero__avatar.no-img::after { font-size: 44px; }
  .hero__title { font-size: 18px; }
  .hero__tagline { font-size: 11px; }
  .hero__btn { font-size: 10px; padding: 12px 20px; }

  .module { padding: 24px 14px; }
  .module__title { font-size: 14px; }
  .module__desc { font-size: 10px; }
  .grid, .grid--video { grid-template-columns: 1fr; }

  .card__media { height: 200px; }
  .card__body h3 { font-size: 11px; }
  .card__body p { font-size: 10px; }

  .modal__panel { max-width: 94vw; }
  .modal__prev { left: 4px; }
  .modal__next { right: 4px; }
  .modal__close { top: 6px; right: 6px; }
  .modal__caption strong { font-size: 11px; }
  .modal__caption span { font-size: 10px; }

  .edit-fab { right: 12px; bottom: 12px; width: 48px; height: 48px; font-size: 18px; }
  .edit-bar {
    top: auto;
    bottom: 72px;
    left: 8px;
    right: 8px;
    transform: none;
    width: auto;
    padding: 8px;
    gap: 6px;
  }
  .edit-bar .btn { font-size: 10px; padding: 8px 10px; flex: 1; min-width: 0; text-align: center; }

  .dlg__panel { padding: 16px; max-width: 94vw; }
  .dlg__panel h3 { font-size: 12px; }
  #dlgForm label { font-size: 10px; margin-bottom: 12px; }
  #dlgForm input[type=text],
  #dlgForm textarea,
  #dlgForm select { font-size: 13px; padding: 12px; }
  #dlgForm input[type=file] { font-size: 10px; }
  .dlg-btns .btn { font-size: 11px; padding: 12px 16px; }

  .footer__line { font-size: 10px; }
  .footer__hint { font-size: 9px; }

  .admin-wrap { padding: 20px 12px 60px; }
  .admin-title { font-size: 16px; }
  .admin-card { padding: 16px; }
  .admin-row { flex-direction: column; align-items: stretch; }
  .admin-table { font-size: 10px; }
  .admin-table th, .admin-table td { padding: 6px 4px; }
}

@media (max-width: 380px) {
  .hero__title { font-size: 15px; }
  .nav__link { font-size: 8px; padding: 5px 6px; }
  .edit-bar .btn { font-size: 9px; padding: 7px 6px; }
}
