/* ============================================================
   王哥私厨 · 极客活力风（Brutalism × Neumorphism）
   配色：亮黄 #FFE66D / 深黑 #1a1a1a / 电光蓝 #4ECDC4 / 珊瑚粉 #FF6B6B
   ============================================================ */
:root {
  --yellow: #FFE66D;
  --ink: #1a1a1a;
  --blue: #4ECDC4;
  --coral: #FF6B6B;
  --paper: #f5f5ef;          /* 中性浅底，不带暖调 */
  --paper-2: #ecece4;
  --white: #ffffff;
  --muted: #6b6b66;

  --border: 2.5px solid var(--ink);
  --shadow-hard: 6px 6px 0 0 var(--ink);
  --shadow-hard-sm: 4px 4px 0 0 var(--ink);
  --shadow-hard-lg: 10px 10px 0 0 var(--ink);

  --font-display: "Arial Black", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  --font-mono: "SF Mono", "JetBrains Mono", "Fira Code", ui-monospace, Menlo, Consolas, monospace;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-sans);
  color: var(--ink);
  line-height: 1.55;
  background: var(--paper);
  /* 细网格背景，强化"设计杂志/极客"氛围 */
  background-image:
    linear-gradient(rgba(26, 26, 26, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(26, 26, 26, 0.04) 1px, transparent 1px);
  background-size: 26px 26px;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

img { display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
::selection { background: var(--yellow); color: var(--ink); }

/* ============ 鼠标聚光灯 ============ */
.spotlight {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s;
  background: radial-gradient(240px circle at var(--mx, 50%) var(--my, 50%),
    rgba(255, 230, 109, 0.16), transparent 70%);
}
@media (hover: hover) and (pointer: fine) {
  body.spotlight-on .spotlight { opacity: 1; }
}

/* ============ 非对称 Header ============ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--paper);
  border-bottom: var(--border);
  padding-top: var(--safe-top);
}
.header-inner {
  position: relative;
  max-width: 1180px;
  margin: 0 auto;
  padding: 14px max(18px, var(--safe-left)) 14px max(18px, var(--safe-right));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  overflow: hidden;
}
.brand {
  font-family: var(--font-display);
  font-size: clamp(30px, 6vw, 60px);
  font-weight: 900;
  letter-spacing: -1px;
  line-height: 0.9;
  display: inline-flex;
}
.brand-char { transition: transform 0.2s; }
.brand:hover .brand-char { transform: translateY(-4px) rotate(-4deg); }
.c1 { color: var(--ink); }
.c2 { color: var(--coral); }
.c3 { color: var(--blue); }
.c4 { color: var(--ink); background: var(--yellow); padding: 0 2px; }

/* 中间穿插斜向彩色分割线 */
.header-diag {
  position: absolute;
  left: 44%;
  top: -20%;
  width: 3px;
  height: 140%;
  background: repeating-linear-gradient(180deg, var(--coral) 0 12px, var(--blue) 12px 24px, var(--yellow) 24px 36px);
  transform: rotate(18deg);
  display: none;
}
@media (min-width: 720px) { .header-diag { display: block; } }

.header-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

/* ============ 斜切按钮（粗野主义主按钮） ============ */
.skew-btn {
  position: relative;
  border: var(--border);
  background: var(--yellow);
  color: var(--ink);
  font-weight: 800;
  font-size: 15px;
  padding: 11px 22px;
  cursor: pointer;
  box-shadow: var(--shadow-hard-sm);
  clip-path: polygon(8% 0, 100% 0, 92% 100%, 0 100%);
  transition: transform 0.12s, box-shadow 0.12s, background 0.15s, color 0.15s;
  -webkit-appearance: none;
  appearance: none;
  white-space: nowrap;
}
.skew-btn span { display: inline-block; }
.skew-btn:hover {
  background: var(--ink);
  color: var(--yellow);
  transform: translate(-2px, -2px);
  box-shadow: var(--shadow-hard);
}
.skew-btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 0 var(--ink); }
.skew-btn--block { width: 100%; clip-path: polygon(4% 0, 100% 0, 96% 100%, 0 100%); }
.skew-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* 幽灵/次要按钮 */
.ghost-btn {
  border: none;
  background: transparent;
  color: var(--ink);
  font-weight: 700;
  font-size: 14px;
  padding: 9px 14px;
  cursor: pointer;
  transition: background 0.15s;
}
.ghost-btn:hover { background: var(--paper-2); }
.ghost-btn--bordered { border: var(--border); box-shadow: var(--shadow-hard-sm); }
.ghost-btn--bordered:hover { background: var(--coral); color: var(--white); }

/* ============ 主区域 ============ */
.main {
  position: relative;
  z-index: 2;
  max-width: 1180px;
  margin: 0 auto;
  padding: 26px max(18px, var(--safe-left)) 40px max(18px, var(--safe-right));
}
.view[hidden] { display: none; }

/* 整页 3D 翻转（视图切换） */
@keyframes page-flip {
  0% { opacity: 0; transform: perspective(1400px) rotateY(-12deg) translateX(40px); }
  100% { opacity: 1; transform: perspective(1400px) rotateY(0) translateX(0); }
}
.main.flipping { animation: page-flip 0.5s cubic-bezier(0.2, 0.7, 0.2, 1); }

/* ============ 通用输入框（新拟态内凹） ============ */
.nb-input {
  width: 100%;
  padding: 12px 15px;
  border: var(--border);
  border-radius: 4px;
  font-size: 16px;                 /* ≥16px 防 iOS 聚焦缩放 */
  font-family: inherit;
  background: var(--white);
  color: var(--ink);
  transition: box-shadow 0.15s, transform 0.1s;
  -webkit-appearance: none;
  appearance: none;
}
.nb-input::placeholder { color: #a5a5a0; }
.nb-input:focus {
  outline: none;
  box-shadow: var(--shadow-hard-sm);
  transform: translate(-1px, -1px);
}
.textarea { resize: none; overflow: hidden; min-height: 108px; line-height: 1.7; }

/* ============ 登录页 ============ */
#view-login { display: flex; justify-content: center; padding-top: calc(9vh + var(--safe-top)); }
#view-login[hidden] { display: none; }
.login-card {
  background: var(--yellow);
  border: var(--border);
  box-shadow: var(--shadow-hard-lg);
  padding: 40px 34px 34px;
  width: 100%;
  max-width: 380px;
  text-align: center;
}
.login-badge {
  width: 76px; height: 76px;
  margin: 0 auto 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 40px;
  background: var(--white);
  border: var(--border);
  box-shadow: var(--shadow-hard-sm);
  transform: rotate(-6deg);
}
.login-title { font-family: var(--font-display); font-size: 46px; font-weight: 900; line-height: 1; margin-bottom: 8px; }
.login-title .c1, .login-title .c4 { color: var(--ink); }
.login-title .c2 { color: var(--coral); }
.login-title .c3 { color: var(--blue); }
.login-sub { font-family: var(--font-mono); font-size: 12px; letter-spacing: 1px; color: var(--ink); opacity: 0.7; margin-bottom: 26px; }
.login-card .nb-input { margin-bottom: 14px; background: var(--white); }

/* ============ 数据展示区 ============ */
.stats-band {
  border: var(--border);
  background: var(--ink);
  color: var(--white);
  box-shadow: var(--shadow-hard);
  padding: 20px 22px;
  margin-bottom: 22px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px 30px;
  align-items: center;
}
.stat-count { display: flex; align-items: baseline; gap: 8px; white-space: nowrap; }
.stat-label { font-family: var(--font-mono); font-size: 14px; color: var(--yellow); }
.stat-number { font-family: var(--font-display); font-size: clamp(40px, 8vw, 64px); font-weight: 900; line-height: 1; color: var(--yellow); }
.stat-unit { font-size: 15px; font-weight: 700; }

.cat-bars { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.cat-bar-row { display: grid; grid-template-columns: 72px 1fr 34px; align-items: center; gap: 10px; }
.cat-bar-name { font-size: 12px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat-bar-track { height: 14px; background: rgba(255, 255, 255, 0.12); border-radius: 2px; overflow: hidden; }
.cat-bar-fill { height: 100%; width: 0; border-radius: 2px; transition: width 0.9s cubic-bezier(0.2, 0.8, 0.2, 1); }
.cat-bar-count { font-family: var(--font-mono); font-size: 12px; text-align: right; color: var(--yellow); }

/* ============ 搜索 + 分类胶囊 ============ */
.toolbar { margin-bottom: 12px; }
.search-box { position: relative; }
.search-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font-size: 15px; pointer-events: none; }
.search-box .nb-input { padding-left: 42px; height: 50px; font-weight: 600; }

.category-chips {
  display: flex; gap: 8px; overflow-x: auto;
  padding: 2px 2px 10px; margin-bottom: 18px;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.category-chips[hidden] { display: none; }
.category-chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto;
  border: var(--border);
  background: var(--white);
  color: var(--ink);
  font-size: 13.5px; font-weight: 700;
  padding: 7px 16px;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.1s, background 0.15s, color 0.15s;
  white-space: nowrap;
}
.chip:hover { transform: translate(-1px, -1px); box-shadow: var(--shadow-hard-sm); }
.chip.active { background: var(--ink); color: var(--yellow); box-shadow: var(--shadow-hard-sm); }

/* ============ 杂志式不规则网格 ============ */
.mag-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 620px) {
  .mag-grid { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 128px; grid-auto-flow: dense; }
  .card--featured { grid-column: span 2; grid-row: span 3; }
  .card--tall { grid-row: span 3; }
  .card--wide { grid-column: span 2; grid-row: span 2; }
  .card--square { grid-row: span 2; }
}
@media (min-width: 1000px) {
  .mag-grid { grid-template-columns: repeat(4, 1fr); gap: 18px; }
  .card--featured { grid-column: span 2; grid-row: span 3; }
}

/* ============ 菜品卡片（粗野主义） ============ */
.card {
  position: relative;
  border: var(--border);
  background: var(--white);
  box-shadow: var(--shadow-hard);
  overflow: visible;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  /* 不规则圆角：四角半径各异 */
  border-radius: 22px 6px 22px 6px;
  transition: transform 0.16s, box-shadow 0.16s;
}
.card:nth-child(3n) { border-radius: 6px 22px 6px 22px; }
.card:nth-child(3n+1) { border-radius: 20px 20px 4px 20px; }
.card:hover { transform: translate(-3px, -3px); box-shadow: var(--shadow-hard-lg); }

.card-media {
  position: relative;
  flex: 1;
  min-height: 128px;
  overflow: hidden;
  border-radius: inherit;
  border-bottom: var(--border);
}
.card-cover {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.4s;
}
.card:hover .card-cover { transform: scale(1.05); }
.card-cover--empty {
  width: 100%; height: 100%; min-height: 128px;
  display: flex; align-items: center; justify-content: center;
  font-size: 46px;
  background:
    repeating-linear-gradient(45deg, var(--yellow) 0 14px, #ffef9c 14px 28px);
}
/* 图片上叠加粗体标题，部分溢出卡片边界 */
.card-title {
  position: absolute;
  left: -6px;
  bottom: 12px;
  max-width: 108%;
  z-index: 3;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 900;
  line-height: 1.02;
  color: var(--ink);
  background: var(--yellow);
  border: 2px solid var(--ink);
  padding: 4px 10px;
  box-shadow: 3px 3px 0 0 var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card--featured .card-title { font-size: 30px; }
.card-count {
  position: absolute; top: 10px; right: 10px; z-index: 3;
  font-family: var(--font-mono); font-size: 11px; font-weight: 700;
  background: var(--ink); color: var(--white);
  padding: 3px 8px;
}
/* 竖排日期 */
.card-date {
  position: absolute; top: 8px; left: 8px; z-index: 3;
  writing-mode: vertical-rl;
  font-family: var(--font-mono); font-size: 11px; font-weight: 700;
  color: var(--ink);
  background: var(--white);
  border: 2px solid var(--ink);
  padding: 6px 3px;
  letter-spacing: 1px;
}
.card-date--muted { background: var(--paper-2); color: var(--muted); }

.card-body { padding: 12px 13px 13px; display: flex; flex-direction: column; gap: 8px; }
/* 斜体分类 + 彩色下划线（非 pill） */
.card-cat {
  align-self: flex-start;
  font-style: italic; font-weight: 800; font-size: 13px;
  border-bottom: 3px solid var(--cat-color, var(--coral));
  padding-bottom: 1px;
}
.card-notes {
  font-size: 12.5px; color: var(--muted); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card--featured .card-notes { -webkit-line-clamp: 4; }

/* 圆点操作按钮，hover 展开成文字 */
.card-dots { display: flex; align-items: center; gap: 8px; margin-top: 2px; }
.dot {
  height: 26px;
  min-width: 26px;
  border: 2px solid var(--ink);
  border-radius: 20px;
  background: var(--white);
  color: var(--ink);
  font-size: 12px; font-weight: 800;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  overflow: hidden;
  padding: 0;
  transition: background 0.15s, color 0.15s, padding 0.18s;
}
.dot .dot-label { max-width: 0; overflow: hidden; white-space: nowrap; transition: max-width 0.2s, margin 0.2s; }
.dot:hover { padding: 0 12px; }
.dot:hover .dot-label { max-width: 60px; margin-left: 5px; }
.dot--edit:hover { background: var(--blue); }
.dot--del:hover { background: var(--coral); color: var(--white); }
.dot--go { margin-left: auto; background: var(--ink); color: var(--yellow); }
.dot--go:hover { background: var(--yellow); color: var(--ink); }

/* ============ 空状态 ============ */
.empty { text-align: center; padding: 54px 20px; }
.empty-illustration { display: inline-block; transform: rotate(-3deg); margin-bottom: 10px; }
.empty-title { font-family: var(--font-display); font-size: 26px; font-weight: 900; letter-spacing: 4px; margin-bottom: 6px; }
.empty-text { color: var(--muted); font-weight: 600; margin-bottom: 22px; }

/* ============ 面板（表单/详情） ============ */
.back-link {
  display: inline-block;
  font-family: var(--font-mono); font-weight: 700; font-size: 14px;
  margin-bottom: 16px;
  border-bottom: 3px solid var(--yellow);
}
.back-link:hover { border-color: var(--coral); }
.panel {
  background: var(--white);
  border: var(--border);
  box-shadow: var(--shadow-hard);
  padding: 26px;
  max-width: 760px;
  margin: 0 auto;
  border-radius: 20px 6px 20px 6px;
}
.panel-title { font-family: var(--font-display); font-size: 26px; font-weight: 900; margin-bottom: 22px; }
.panel-title::after { content: ""; display: block; width: 60px; height: 5px; background: var(--coral); margin-top: 6px; }

/* ============ 表单 ============ */
.field { margin-bottom: 18px; }
.label { display: block; font-size: 13px; font-weight: 800; margin-bottom: 7px; font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.5px; }
.required { color: var(--coral); }
.form-actions { display: flex; align-items: center; gap: 12px; margin-top: 26px; }

/* ============ 图片上传 ============ */
.dropzone {
  border: 2.5px dashed var(--ink);
  border-radius: 6px;
  padding: 30px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 14px; font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  background: var(--paper);
}
.dropzone:hover, .dropzone.dragover { background: var(--yellow); color: var(--ink); }
.preview-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 10px; margin-top: 12px; }
.preview-item { position: relative; }
.preview-item img { width: 100%; aspect-ratio: 1/1; object-fit: cover; border: 2px solid var(--ink); }
.preview-item.pending img { opacity: 0.8; }
.preview-remove {
  position: absolute; top: -7px; right: -7px;
  width: 22px; height: 22px;
  border: 2px solid var(--ink); border-radius: 50%;
  background: var(--coral); color: #fff; font-size: 11px; line-height: 1; cursor: pointer;
}
.preview-tag { position: absolute; left: 3px; bottom: 3px; background: var(--ink); color: #fff; font-size: 10px; padding: 1px 5px; }

/* ============ 详情页 ============ */
.carousel { position: relative; border: var(--border); overflow: hidden; background: var(--paper-2); margin-bottom: 22px; user-select: none; border-radius: 16px 4px 16px 4px; }
.carousel-track { display: flex; transition: transform 0.3s ease; }
.carousel-track img { width: 100%; flex-shrink: 0; aspect-ratio: 4/3; object-fit: cover; cursor: zoom-in; }
.carousel .card-cover--empty { aspect-ratio: 4/3; }
.carousel-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px; border: 2px solid var(--ink); border-radius: 50%;
  background: var(--yellow); color: var(--ink); font-size: 20px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.carousel-nav:hover { background: var(--ink); color: var(--yellow); }
.carousel-prev { left: 10px; }
.carousel-next { right: 10px; }
.carousel-dots { position: absolute; bottom: 10px; left: 0; right: 0; display: flex; justify-content: center; gap: 6px; }
.carousel-dot { width: 9px; height: 9px; border: 2px solid var(--ink); background: var(--white); cursor: pointer; }
.carousel-dot.active { background: var(--coral); }

.detail-name { font-family: var(--font-display); font-size: 30px; font-weight: 900; margin-bottom: 14px; }
.detail-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-bottom: 18px; }
.detail-cat { font-style: italic; font-weight: 800; font-size: 15px; border-bottom: 3px solid var(--cat-color, var(--coral)); }
.detail-metaitem { font-family: var(--font-mono); font-size: 13px; color: var(--muted); }
.detail-notes-title { font-family: var(--font-mono); font-size: 13px; font-weight: 800; text-transform: uppercase; margin-bottom: 8px; }
.detail-notes {
  white-space: pre-wrap; word-break: break-word;
  font-size: 14.5px; line-height: 1.75;
  background: var(--paper); border: 2px solid var(--ink); border-left: 6px solid var(--yellow);
  padding: 15px 17px; margin-bottom: 22px;
}
.detail-empty-notes { color: var(--muted); font-style: italic; }
.detail-actions { display: flex; gap: 12px; }

/* ============ 底部视差标语 ============ */
.slogan {
  position: relative;
  z-index: 2;
  overflow: hidden;
  background: var(--ink);
  border-top: var(--border);
  padding: clamp(30px, 8vw, 70px) 0;
  margin-top: 20px;
}
.slogan[hidden] { display: none; }
.slogan-text {
  font-family: var(--font-display);
  font-size: clamp(30px, 9vw, 84px);
  font-weight: 900;
  color: var(--yellow);
  white-space: nowrap;
  text-align: center;
  letter-spacing: 2px;
  will-change: transform;
  -webkit-text-stroke: 1px var(--coral);
}

/* ============ 悬浮"快速记录"面板 ============ */
.quick-panel {
  position: fixed;
  right: max(20px, var(--safe-right));
  bottom: calc(24px + var(--safe-bottom));
  z-index: 60;
  width: 288px;
}
.quick-panel[hidden] { display: none; }
.quick-toggle {
  position: absolute;
  right: 0; bottom: 0;
  width: 58px; height: 58px;
  border: var(--border); border-radius: 50%;
  background: var(--coral); color: #fff;
  font-size: 26px; cursor: pointer;
  box-shadow: var(--shadow-hard);
  transition: transform 0.15s;
  display: none;
}
.quick-toggle:hover { transform: rotate(20deg) scale(1.05); }
.quick-body {
  background: var(--white);
  border: var(--border);
  box-shadow: var(--shadow-hard-lg);
  border-radius: 18px 4px 18px 4px;
  padding: 16px;
  transition: opacity 0.2s, transform 0.2s;
}
.quick-panel.collapsed .quick-body { display: none; }
.quick-panel.collapsed .quick-toggle { display: flex; }
.quick-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.quick-title { font-family: var(--font-display); font-size: 18px; font-weight: 900; }
.quick-close { border: none; background: none; font-size: 16px; font-weight: 800; cursor: pointer; color: var(--ink); }
.quick-close:hover { color: var(--coral); }
.quick-form-gap > * , #quick-form > * { margin-bottom: 10px; }
#quick-form .nb-input { margin-bottom: 10px; }
.quick-hint { font-size: 11px; color: var(--muted); margin-top: 2px; }
/* 桌面端才显示悬浮面板 */
@media (max-width: 899px) { .quick-panel { display: none !important; } }

/* ============ 滚动触发进入动画 ============ */
.anim { opacity: 0; transition: opacity 0.55s ease, transform 0.55s cubic-bezier(0.2, 0.8, 0.2, 1); }
.anim[data-anim="up"] { transform: translateY(40px); }
.anim[data-anim="down"] { transform: translateY(-40px); }
.anim[data-anim="left"] { transform: translateX(-50px); }
.anim[data-anim="right"] { transform: translateX(50px); }
.anim.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .anim { opacity: 1 !important; transform: none !important; transition: none; }
  .main.flipping { animation: none; }
}

/* ============ Loading ============ */
.loading-mask { position: fixed; inset: 0; background: rgba(245, 245, 239, 0.7); z-index: 300; display: flex; align-items: center; justify-content: center; }
.loading-mask[hidden] { display: none; }
.spinner { width: 44px; height: 44px; border: 5px solid var(--ink); border-top-color: var(--coral); border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ Toast ============ */
.toast-wrap { position: fixed; top: calc(80px + var(--safe-top)); left: 50%; transform: translateX(-50%); z-index: 400; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  background: var(--ink); color: var(--white);
  border: 2px solid var(--ink);
  box-shadow: var(--shadow-hard-sm);
  padding: 11px 20px; font-size: 14px; font-weight: 700;
  animation: toast-in 0.22s ease; max-width: 86vw;
}
.toast.success { background: var(--blue); color: var(--ink); }
.toast.error { background: var(--coral); color: var(--white); }
.toast.out { animation: toast-out 0.3s ease forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-12px); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-12px); } }

/* ============ Lightbox ============ */
.lightbox { position: fixed; inset: 0; background: rgba(10, 10, 10, 0.94); z-index: 500; display: flex; align-items: center; justify-content: center; }
.lightbox[hidden] { display: none; }
.lightbox-img { max-width: 92vw; max-height: 86vh; object-fit: contain; border: 3px solid var(--yellow); }
.lightbox-close { position: absolute; top: calc(16px + var(--safe-top)); right: 20px; background: none; border: none; color: var(--yellow); font-size: 28px; font-weight: 800; cursor: pointer; }
.lightbox-nav { position: absolute; top: 50%; transform: translateY(-50%); background: var(--yellow); border: 2px solid var(--ink); color: var(--ink); font-size: 30px; width: 50px; height: 50px; border-radius: 50%; cursor: pointer; }
.lightbox-nav:hover { background: var(--coral); color: #fff; }
.lightbox-prev { left: 18px; }
.lightbox-next { right: 18px; }
.lightbox-counter { position: absolute; bottom: calc(18px + var(--safe-bottom)); left: 0; right: 0; text-align: center; color: var(--yellow); font-family: var(--font-mono); font-size: 13px; }

/* ============ 移动端细节 ============ */
@media (max-width: 640px) {
  .panel { padding: 20px 16px; }
  .brand { font-size: 34px; }
  .stats-band { grid-template-columns: 1fr; }
  .detail-name { font-size: 24px; }
  /* 移动端卡片恢复自然高度、图片定高，避免竖排网格错乱 */
  .card-media { min-height: 190px; }
}
