:root {
  --candy-pink: #FF6B9D;
  --candy-pink-dark: #E8527F;
  --candy-pink-light: #FFD0E0;
  --candy-mint: #6DD3B0;
  --candy-mint-dark: #4EBA97;
  --candy-lemon: #FFD23F;
  --candy-lemon-dark: #F0B820;
  --candy-grape: #B19CD9;
  --candy-orange: #FF9F68;
  --cream: #FFF8F0;
  --cream-dark: #F5EBE0;
  --receipt: #FBF7EE;
  --ink: #3D2817;
  --ink-light: #7A6A5A;
  --ink-faint: #B0A090;
  --shelf: #D4C4B0;
  --white: #FFFFFF;
  --danger: #E74C3C;
  --success: #4EBA97;
  --shadow-soft: 0 4px 14px rgba(61, 40, 23, 0.08);
  --shadow-gummy: 0 6px 20px rgba(255, 107, 157, 0.25), 0 2px 6px rgba(61, 40, 23, 0.1);
  --shadow-card: 0 2px 8px rgba(61, 40, 23, 0.06), 0 8px 24px rgba(61, 40, 23, 0.08);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-pill: 999px;
  --font-display: 'ZCOOL KuaiLe', 'Fredoka', 'Noto Sans SC', sans-serif;
  --font-body: 'Noto Sans SC', 'Nunito', system-ui, sans-serif;
  --max-width: 1100px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--cream);
  color: var(--ink);
  min-height: 100vh;
  line-height: 1.6;
  background-image:
    radial-gradient(circle at 15% 20%, rgba(255, 107, 157, 0.06) 0%, transparent 40%),
    radial-gradient(circle at 85% 80%, rgba(109, 211, 176, 0.06) 0%, transparent 40%),
    repeating-linear-gradient(0deg, transparent, transparent 39px, rgba(212, 196, 176, 0.15) 39px, rgba(212, 196, 176, 0.15) 40px);
}

a { color: var(--candy-pink-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, .display { font-family: var(--font-display); font-weight: 400; letter-spacing: 0.5px; }

/* ===== 顶部导航 - 便利店招牌 ===== */
.storefront {
  background: var(--white);
  border-bottom: 3px solid var(--candy-pink);
  box-shadow: 0 2px 12px rgba(61, 40, 23, 0.06);
  position: sticky;
  top: 0;
  z-index: 100;
}
.storefront-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--candy-pink);
  box-shadow: var(--shadow-soft);
}
.brand-text {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--ink);
  line-height: 1;
}
.brand-text small {
  display: block;
  font-family: var(--font-body);
  font-size: 10px;
  color: var(--candy-pink);
  letter-spacing: 2px;
  margin-top: 2px;
}
.open-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--candy-mint);
  color: var(--white);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  letter-spacing: 1px;
  animation: blink 2s ease-in-out infinite;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.65; }
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
}
.nav-link {
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-light);
  transition: all 0.2s;
  cursor: pointer;
  border: none;
  background: transparent;
  font-family: var(--font-body);
}
.nav-link:hover { background: var(--candy-pink-light); color: var(--candy-pink-dark); text-decoration: none; }
.nav-link.active { background: var(--candy-pink); color: var(--white); }

/* ===== 按钮 - 软糖质感 ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  border: none;
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  user-select: none;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px) scale(0.98); }
.btn-primary {
  background: linear-gradient(180deg, var(--candy-pink) 0%, var(--candy-pink-dark) 100%);
  color: var(--white);
  box-shadow: var(--shadow-gummy);
}
.btn-primary:hover { box-shadow: 0 8px 26px rgba(255, 107, 157, 0.35), 0 3px 8px rgba(61, 40, 23, 0.12); transform: translateY(-1px); }
.btn-mint {
  background: linear-gradient(180deg, var(--candy-mint) 0%, var(--candy-mint-dark) 100%);
  color: var(--white);
  box-shadow: 0 6px 20px rgba(109, 211, 176, 0.25);
}
.btn-lemon {
  background: linear-gradient(180deg, var(--candy-lemon) 0%, var(--candy-lemon-dark) 100%);
  color: var(--ink);
  box-shadow: 0 6px 20px rgba(255, 210, 63, 0.3);
}
.btn-ghost {
  background: var(--white);
  color: var(--ink);
  border: 2px solid var(--cream-dark);
}
.btn-ghost:hover { border-color: var(--candy-pink); color: var(--candy-pink-dark); }
.btn-danger {
  background: linear-gradient(180deg, #FF6B6B 0%, var(--danger) 100%);
  color: var(--white);
  box-shadow: 0 6px 20px rgba(231, 76, 60, 0.25);
}
.btn-sm { padding: 7px 16px; font-size: 13px; }
.btn-lg { padding: 15px 36px; font-size: 16px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ===== 卡片 - 货架风格 ===== */
.shelf-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 24px;
  position: relative;
  border: 1px solid var(--cream-dark);
}
.shelf-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 24px;
  right: 24px;
  height: 4px;
  background: linear-gradient(90deg, var(--candy-pink), var(--candy-lemon), var(--candy-mint));
  border-radius: 0 0 4px 4px;
}

/* ===== 价签 ===== */
.price-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--candy-lemon);
  color: var(--ink);
  font-weight: 700;
  font-size: 13px;
  padding: 4px 12px 4px 18px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  position: relative;
}
.price-tag::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 8px;
  background: var(--candy-lemon-dark);
  clip-path: polygon(0 50%, 100% 0, 100% 100%);
}

/* ===== 表单 - 收据风 ===== */
.field { margin-bottom: 18px; }
.field-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-light);
  margin-bottom: 6px;
  letter-spacing: 0.5px;
}
.field-input {
  width: 100%;
  padding: 12px 16px;
  border: 2px dashed var(--shelf);
  border-radius: var(--radius-md);
  font-size: 15px;
  font-family: var(--font-body);
  background: var(--receipt);
  color: var(--ink);
  transition: border-color 0.2s, background 0.2s;
}
.field-input:focus {
  outline: none;
  border-color: var(--candy-pink);
  border-style: solid;
  background: var(--white);
}
.field-input::placeholder { color: var(--ink-faint); }
.field-hint { font-size: 12px; color: var(--ink-faint); margin-top: 4px; }
.field-error { font-size: 12px; color: var(--danger); margin-top: 4px; display: none; }
.field-error.show { display: block; }

/* ===== Toast ===== */
.toast-container {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.toast {
  background: var(--white);
  border-left: 4px solid var(--candy-pink);
  padding: 14px 20px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  min-width: 220px;
  max-width: 360px;
  animation: toastIn 0.3s ease;
  pointer-events: auto;
}
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.info { border-left-color: var(--candy-grape); }
@keyframes toastIn {
  from { transform: translateX(120%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
.toast.fade-out { animation: toastOut 0.3s ease forwards; }
@keyframes toastOut {
  to { transform: translateX(120%); opacity: 0; }
}

/* ===== 容器 ===== */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 28px 20px;
}
.page-title {
  font-size: 28px;
  color: var(--ink);
  margin-bottom: 4px;
}
.page-subtitle {
  font-size: 14px;
  color: var(--ink-light);
  margin-bottom: 24px;
}

/* ===== 空状态 ===== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--ink-faint);
}
.empty-state-icon {
  font-size: 48px;
  margin-bottom: 16px;
  font-family: var(--font-display);
}

/* ===== 进度条 ===== */
.progress {
  height: 8px;
  background: var(--cream-dark);
  border-radius: var(--radius-pill);
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--candy-pink), var(--candy-mint));
  border-radius: var(--radius-pill);
  transition: width 0.3s ease;
}

/* ===== 标签 ===== */
.tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.tag-pink { background: var(--candy-pink-light); color: var(--candy-pink-dark); }
.tag-mint { background: rgba(109, 211, 176, 0.2); color: var(--candy-mint-dark); }
.tag-lemon { background: rgba(255, 210, 63, 0.25); color: var(--candy-lemon-dark); }
.tag-gray { background: var(--cream-dark); color: var(--ink-light); }
.tag-danger { background: rgba(231, 76, 60, 0.15); color: var(--danger); }

/* ===== 加载 ===== */
.loader {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid var(--cream-dark);
  border-top-color: var(--candy-pink);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== 底部 ===== */
.storefront-footer {
  background: var(--white);
  border-top: 3px solid var(--candy-pink);
  margin-top: 60px;
  padding: 24px 20px;
  text-align: center;
  color: var(--ink-faint);
  font-size: 13px;
}
.storefront-footer .receipt-line {
  font-family: var(--font-body);
  border-top: 1px dashed var(--shelf);
  padding-top: 16px;
  margin-top: 12px;
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
  .storefront-inner { height: auto; padding: 12px 16px; flex-wrap: wrap; gap: 10px; }
  .nav-links { width: 100%; justify-content: center; flex-wrap: wrap; gap: 6px; }
  .nav-link { padding: 7px 12px; font-size: 14px; }
  .container { padding: 18px 14px; }
  .page-title { font-size: 24px; }
  .shelf-card { padding: 18px; }
  .btn { padding: 11px 22px; font-size: 14px; }
  .btn-block { width: 100%; }
  .brand-text { font-size: 20px; }
  .brand-text small { font-size: 9px; }
  .brand-logo { width: 40px; height: 40px; }
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .data-table { min-width: 640px; }
  .admin-section { padding: 0; }
  .audit-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)) !important; gap: 10px; }
  .result-item { flex-direction: column; align-items: stretch; }
  .result-thumb { width: 100%; height: 160px; }
  .link-tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .storefront-footer { font-size: 13px; padding: 14px 16px; }
}

@media (max-width: 480px) {
  .container { padding: 14px 10px; }
  .page-title { font-size: 20px; }
  .page-subtitle { font-size: 13px; }
  .shelf-card { padding: 14px; }
  .btn { padding: 10px 18px; font-size: 13px; }
  .btn-lg { padding: 12px 20px; }
  .auth-card { padding: 24px 18px; }
  .auth-title { font-size: 22px; }
  .auth-subtitle { font-size: 13px; }
  .field-input { padding: 11px 13px; font-size: 15px; }
  .upload-zone { padding: 28px 14px; }
  .upload-zone-icon { font-size: 40px; }
  .upload-zone-text { font-size: 15px; }
  .format-chip { padding: 6px 12px; font-size: 13px; }
  .stat-card { padding: 14px; }
  .stat-value { font-size: 22px; }
  .image-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)) !important; gap: 8px; }
  .brand-text::after { display: none; }
  .nav-link { padding: 6px 10px; font-size: 13px; }
}

/* ===== 关键帧动画 ===== */
@keyframes bounceGummy {
  0% { transform: scale(1); }
  30% { transform: scale(1.08, 0.94); }
  50% { transform: scale(0.96, 1.04); }
  70% { transform: scale(1.02, 0.98); }
  100% { transform: scale(1); }
}
@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}
@keyframes fadeInUp {
  0% { opacity: 0; transform: translateY(14px); }
  100% { opacity: 1; transform: translateY(0); }
}
@keyframes popIn {
  0% { opacity: 0; transform: scale(0.85); }
  60% { opacity: 1; transform: scale(1.04); }
  100% { transform: scale(1); }
}
@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 107, 157, 0.45); }
  50% { box-shadow: 0 0 0 8px rgba(255, 107, 157, 0); }
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
@keyframes shakeX {
  0%,100% { transform: translateX(0); }
  20%,60% { transform: translateX(-4px); }
  40%,80% { transform: translateX(4px); }
}
@keyframes twistIn {
  0% { opacity: 0; transform: rotate(-6deg) scale(0.9); }
  100% { opacity: 1; transform: rotate(0deg) scale(1); }
}

/* ===== 入场 stagger ===== */
body .container > *,
body .auth-card,
body .shelf-card,
body .admin-layout > * {
  opacity: 0;
  animation: fadeInUp 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
body .container > *:nth-child(1) { animation-delay: 0.02s; }
body .container > *:nth-child(2) { animation-delay: 0.08s; }
body .container > *:nth-child(3) { animation-delay: 0.14s; }
body .container > *:nth-child(4) { animation-delay: 0.2s; }
body .container > *:nth-child(5) { animation-delay: 0.26s; }
body .container > *:nth-child(6) { animation-delay: 0.32s; }
body .container > *:nth-child(7) { animation-delay: 0.38s; }
body .auth-card { animation: twistIn 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards; }

/* ===== 便利店招牌 - 霓虹呼吸 ===== */
.storefront-inner::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: var(--radius-lg);
  background: linear-gradient(120deg, rgba(255,107,157,0), rgba(255,107,157,0.28), rgba(255,210,63,0.28), rgba(109,211,176,0.25), rgba(255,107,157,0));
  background-size: 300% 100%;
  opacity: 0.85;
  animation: shimmer 6s linear infinite;
  z-index: -1;
  filter: blur(6px);
}
.storefront {
  position: relative;
}
.storefront::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -3px;
  height: 3px;
  background: linear-gradient(90deg, var(--candy-pink), var(--candy-lemon), var(--candy-mint), var(--candy-grape), var(--candy-pink));
  background-size: 400% 100%;
  animation: shimmer 8s linear infinite;
}
.brand-logo {
  animation: floatY 3.6s ease-in-out infinite;
}
.brand-text {
  position: relative;
}
.brand-text::after {
  content: 'OPEN 24H';
  position: absolute;
  right: -8px;
  top: -10px;
  transform: translate(100%, 0) rotate(8deg);
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 700;
  padding: 3px 7px;
  background: var(--candy-pink);
  color: #fff;
  border-radius: var(--radius-pill);
  box-shadow: 0 2px 6px rgba(255,107,157,0.4);
  animation: pulseGlow 2.4s ease-in-out infinite;
  letter-spacing: 0.5px;
}

/* ===== 导航链接 hover ===== */
.nav-link {
  position: relative;
  transition: transform 0.2s cubic-bezier(0.22,1,0.36,1), color 0.2s;
}
.nav-link:hover {
  transform: translateY(-1px);
  color: var(--candy-pink-dark);
}
.nav-link.active::after {
  content: '';
  position: absolute;
  left: 10%; right: 10%; bottom: -4px;
  height: 3px;
  background: linear-gradient(90deg, var(--candy-pink), var(--candy-orange));
  border-radius: var(--radius-pill);
  animation: pulseGlow 2s ease-in-out infinite;
}

/* ===== 软糖按钮 - 悬停挤压+光晕 ===== */
.btn {
  position: relative;
  overflow: hidden;
  transition: transform 0.22s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.25s, filter 0.25s;
  will-change: transform;
}
.btn::after {
  content: '';
  position: absolute;
  top: 0; left: -75%;
  width: 50%; height: 100%;
  background: linear-gradient(120deg, transparent 0%, rgba(255,255,255,0.45) 50%, transparent 100%);
  transform: skewX(-20deg);
  transition: left 0.65s ease;
}
.btn:hover {
  transform: translateY(-2px) scale(1.02);
  filter: brightness(1.04);
  box-shadow: 0 10px 26px rgba(61,40,23,0.12), 0 0 0 3px rgba(255,255,255,0.6) inset;
}
.btn:hover::after { left: 130%; }
.btn:active {
  transform: translateY(0px) scale(0.97);
  animation: bounceGummy 0.4s ease;
}
.btn-sm:active { animation-duration: 0.3s; }
.btn-primary {
  animation: pulseGlow 3s ease-in-out infinite;
}

/* ===== 货架卡片 - hover 升起+发光 ===== */
.shelf-card {
  transition: transform 0.35s cubic-bezier(0.22,1,0.36,1), box-shadow 0.35s;
}
.shelf-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 30px rgba(61,40,23,0.1), 0 0 0 2px rgba(255,107,157,0.22), 0 4px 0 var(--shelf);
}
.result-item, .user-card, .stat-card, .file-queue-item {
  animation: popIn 0.45s cubic-bezier(0.22,1,0.36,1) both;
}
.result-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(61,40,23,0.1);
  border-color: var(--candy-pink-light);
}

/* ===== 上传区 drag 抖动 ===== */
.upload-zone.dragover {
  animation: shakeX 0.5s ease;
}

/* ===== 格式 chip 选中弹跳 ===== */
.format-chip {
  transition: transform 0.2s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.2s, background 0.2s, color 0.2s;
}
.format-chip.active {
  animation: bounceGummy 0.45s ease;
  box-shadow: 0 0 0 3px rgba(255,107,157,0.18);
}
.format-chip:hover:not(.active) {
  transform: translateY(-1px) scale(1.04);
}

/* ===== 价签 hover ===== */
.price-tag:hover {
  animation: bounceGummy 0.4s ease;
  transform: translateY(-1px);
}

/* ===== 进度条流光 ===== */
.progress-bar {
  position: relative;
  overflow: hidden;
  background-image: linear-gradient(90deg, var(--candy-pink), var(--candy-orange), var(--candy-lemon));
  background-size: 200% 100%;
  animation: shimmer 1.6s linear infinite;
}
.progress-bar::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.35), transparent);
  transform: translateX(-100%);
  animation: shimmer 1.2s linear infinite;
}

/* ===== Toast 弹入 ===== */
.toast-item {
  animation: popIn 0.32s cubic-bezier(0.22,1,0.36,1) both;
}

/* ===== 管理后台卡片 hover ===== */
.admin-dashboard .stat-card:hover {
  transform: translateY(-3px) rotate(-0.3deg);
  box-shadow: 0 16px 32px rgba(61,40,23,0.12);
}

/* ===== 页面标题软糖装饰 ===== */
.page-title {
  position: relative;
  display: inline-block;
}
.page-title::before {
  content: '';
  position: absolute;
  left: -10px; right: -10px;
  bottom: 4px;
  height: 10px;
  background: linear-gradient(90deg, rgba(255,210,63,0.35), rgba(255,159,104,0.3), rgba(255,107,157,0.3));
  border-radius: var(--radius-pill);
  z-index: -1;
  transform: skewX(-4deg);
}
.page-subtitle {
  opacity: 0;
  animation: fadeInUp 0.6s 0.15s forwards;
}

