/* ============================================
   一夜市集 - 繁體中文夜市電商平台樣式 v2
   ============================================ */

:root {
  --primary: #ff6b35;
  --primary-dark: #e55a2b;
  --secondary: #ffd166;
  --accent: #06d6a0;
  --bg: #faf5ef;
  --bg-card: #ffffff;
  --text: #2d2d2d;
  --text-light: #888;
  --border: #eee;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --shadow-hover: 0 6px 24px rgba(0,0,0,0.15);
  --radius: 12px;
  --radius-sm: 8px;
  --max-width: 1200px;
}

/* ===== Night Mode（18:00～06:00 自動啟用） ===== */
body.night-mode {
  --bg: #0f1729;
  --bg-card: #1a2332;
  --text: #e2e8f0;
  --text-light: #8892a4;
  --border: #2a3548;
  --shadow: 0 2px 12px rgba(0,0,0,0.3);
  --shadow-hover: 0 6px 24px rgba(0,0,0,0.45);
}
body.night-mode .market-hours-inline {
  color: rgba(255,255,255,0.45);
  border-left-color: rgba(255,255,255,0.1);
}
body.night-mode .market-hours-inline .hours-text { color: rgba(255,255,255,0.45); }

body.night-mode .header {
  background: rgba(26,35,50,0.92);
  border-bottom-color: var(--border);
}

body.night-mode .slideshow-section {
  background: var(--bg-card);
  border-bottom-color: var(--border);
}
body.night-mode .scroll-card-img-wrap { background: #141d2b; }

body.night-mode .categories-section {
  background: var(--bg-card);
  border-bottom-color: var(--border);
}

body.night-mode .submit-entry-card {
  background: linear-gradient(180deg, #1e2a3d 0%, #1a2332 55%, #1a2332 100%);
  border-color: rgba(255,107,53,0.5);
}
body.night-mode .submit-entry-card::before {
  background: linear-gradient(135deg, #ff6b35 0%, #e55a2b 100%);
  color: white;
}
body.night-mode .submit-entry-card:hover {
  background: linear-gradient(180deg, #243247 0%, #1e2a3d 55%, #1a2332 100%);
  border-color: var(--primary-dark);
}
body.night-mode .submit-entry-bottom {
  background: rgba(255,107,53,0.05);
  border-top-color: rgba(255,107,53,0.2);
}

body.night-mode .product-img-wrap { background: #141d2b; }
body.night-mode .product-badge { color: white; }

body.night-mode .load-more-btn {
  background: var(--bg-card);
  color: var(--primary);
  border-color: var(--primary);
}
body.night-mode .load-more-btn:hover { background: var(--primary); color: white; }

body.night-mode .footer {
  background: #0a0f1a;
}

body.night-mode .fab-top {
  background: rgba(255,255,255,0.12);
}

body.night-mode .modal { background: var(--bg-card); }

body.night-mode .form-input {
  background: #0f1729;
  border-color: var(--border);
  color: var(--text);
}
body.night-mode .form-input:focus {
  background: #0f1729;
  border-color: var(--primary);
}
body.night-mode .form-select {
  background-color: #0f1729;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238892a4' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
}
body.night-mode .delivery-option {
  border-color: var(--border);
  background: #0f1729;
}
body.night-mode .delivery-option:has(input:checked) {
  border-color: var(--primary);
  background: rgba(255,107,53,0.1);
  color: var(--primary);
}

body.night-mode .upload-area {
  border-color: var(--border);
  background: #0f1729;
}
body.night-mode .upload-placeholder { color: var(--text-light); }

body.night-mode .btn {
  background: var(--bg-card);
  border-color: var(--border);
}

body.night-mode .manage-result {
  background: #0f1729;
  border-color: var(--border);
}
body.night-mode .manage-result.result-success {
  border-color: #22c55e;
  background: rgba(34,197,94,0.1);
}
body.night-mode .manage-result.result-error {
  border-color: #ef4444;
  background: rgba(239,68,68,0.1);
  color: #f87171;
}

body.night-mode .skeleton {
  background: linear-gradient(90deg, #1e2a3d 25%, #243247 50%, #1e2a3d 75%);
  background-size: 200% 100%;
}

body.night-mode .modal-desc { color: var(--text-light); }
body.night-mode .modal-cat {
  background: rgba(255,255,255,0.06);
  color: var(--text-light);
}

body.night-mode .empty-state { color: var(--text-light); }

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}
body.modal-open { overflow: hidden; }

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 16px; }

/* ===== 夜市開放時間（logo 後內聯） ===== */
.market-hours-inline {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 12px;
  font-size: 11px;
  color: rgba(0,0,0,0.5);
  border-left: 1px solid rgba(0,0,0,0.15);
  padding-left: 12px;
}
.market-hours-inline .hours-icon { font-size: 13px; }
.market-hours-inline .hours-text { color: rgba(0,0,0,0.55); font-size: 11px; }
.market-hours-inline .hours-status { font-weight: 600; font-size: 11px; }


/* ===== Header ===== */
.header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}
.logo { display: flex; align-items: center; gap: 8px; text-decoration: none; }
.logo-icon { font-size: 28px; }
.logo-text {
  font-size: 22px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), #ff8c42);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.lang-btn {
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 5px 12px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 12px;
  color: var(--text);
  transition: all 0.2s;
  white-space: nowrap;
}
.lang-btn:hover { border-color: var(--primary); color: var(--primary); }
.mode-btn {
  background: var(--bg);
  border: 1px solid var(--border);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  flex-shrink: 0;
}
.mode-btn:hover {
  border-color: var(--primary);
  transform: scale(1.1);
}

/* ===== Header 搜索欄（小） ===== */
.header-search {
  display: flex;
  align-items: center;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 4px 4px 14px;
  flex: 1;
  max-width: 300px;
  margin: 0 12px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.header-search:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255,107,53,0.12);
}
.header-search-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 13px;
  color: var(--text);
  outline: none;
  min-width: 0;
}
.header-search-input::placeholder { color: var(--text-light); }
.header-search-btn {
  background: var(--primary);
  border: none;
  color: white;
  width: 28px;
  height: 28px;
  border-radius: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s;
}
.header-search-btn:hover { background: var(--primary-dark); }

/* ===== 最新商品滚动卡片 ===== */
.slideshow-section {
  background: var(--bg-card);
  padding: 16px 0 20px;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}
.slideshow-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 16px;
}
.slides-track {
  display: flex;
  gap: 14px;
  overflow-x: hidden;
  scroll-behavior: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 4px 0;
}
.slides-track::-webkit-scrollbar { display: none; }

/* 滚动卡片 */
.scroll-card {
  flex-shrink: 0;
  width: 160px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.25s, box-shadow 0.25s;
  background: var(--bg-card);
}
.scroll-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}
.scroll-card-ad {
  text-decoration: none;
  color: inherit;
}

/* 卡片图片 */
.scroll-card-img-wrap {
  position: relative;
  width: 100%;
  padding-top: 100%;
  background: #f0ece6;
  overflow: hidden;
}
.scroll-card-img {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}
.scroll-card:hover .scroll-card-img {
  transform: scale(1.08);
}
.scroll-card-badge {
  position: absolute;
  top: 6px; left: 6px;
  background: rgba(0,0,0,0.55);
  color: rgba(255,255,255,0.95);
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 8px;
  backdrop-filter: blur(2px);
}
.scroll-card-badge.ad {
  background: var(--primary);
}

/* 卡片信息 */
.scroll-card-info {
  padding: 10px 10px 12px;
}
.scroll-card-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.scroll-card-price {
  font-size: 14px;
  font-weight: 800;
  color: var(--primary);
}

/* 空占位卡片 */
.scroll-card-empty {
  cursor: default;
}
.scroll-card-empty:hover {
  transform: none;
  box-shadow: var(--shadow);
}
.scroll-card-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 36px;
  opacity: 0.4;
  position: absolute;
  top: 0; left: 0;
}
.scroll-card-ad-bg {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* ===== Categories ===== */
.categories-section {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
  position: sticky;
  top: 60px;
  z-index: 90;
}
.categories-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 4px 0;
}
.categories-scroll::-webkit-scrollbar { display: none; }
.cat-btn {
  flex-shrink: 0;
  padding: 8px 18px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--bg);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text);
  white-space: nowrap;
}
.cat-btn:hover { border-color: var(--primary); color: var(--primary); }
.cat-btn.active { background: var(--primary); color: white; border-color: var(--primary); }

/* ===== Product Grid ===== */
.main { padding: 24px 0 60px; }
.product-stats { font-size: 14px; color: var(--text-light); margin-bottom: 16px; }
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}

/* ===== 投稿入口卡片（首格）===== */
.submit-entry-card {
  background: linear-gradient(180deg, #fff5f0 0%, #fff 55%, #fefefe 100%);
  border: 2px dashed var(--primary);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  flex-direction: column;
  min-height: 240px;
  animation: breathe 3s ease-in-out infinite;
  overflow: hidden;
  position: relative;
}

/* 右上角 NEW 角標 */
.submit-entry-card::before {
  content: 'NEW';
  position: absolute;
  top: 8px;
  right: -25px;
  background: linear-gradient(135deg, #ff6b35 0%, #ff4757 100%);
  color: white;
  font-size: 0.6rem;
  font-weight: bold;
  padding: 3px 28px;
  transform: rotate(45deg);
  box-shadow: 0 2px 8px rgba(255, 107, 53, 0.4);
  z-index: 1;
}

/* 呼吸光暈動畫（卡片外圈） */
@keyframes breathe {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(255, 107, 53, 0);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(255, 107, 53, 0.15), 0 0 20px rgba(255, 107, 53, 0.08);
  }
}

/* 圖標脈衝動畫 */
.submit-entry-icon {
  width: 56px; height: 56px;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  margin-bottom: 10px;
  animation: iconPulse 2s ease-in-out infinite;
}
@keyframes iconPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}

.submit-entry-card:hover {
  background: linear-gradient(180deg, #fff0e8 0%, #fff8f4 55%, #fefefe 100%);
  border-color: var(--primary-dark);
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(255, 107, 53, 0.2);
  animation: none;
}
.submit-entry-card:hover .submit-entry-icon {
  animation: none;
}

/* 上半部：摆摊图标 + 文字 */
.submit-entry-top {
  flex: 0 0 auto;
  text-align: center;
  padding: 20px 16px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.submit-entry-text { font-size: 15px; font-weight: 700; color: var(--primary); margin-bottom: 2px; }
.submit-entry-sub { font-size: 12px; color: var(--text-light); }

/* 下半部：二维码 + 提示 */
.submit-entry-bottom {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 16px 16px;
  background: rgba(255, 107, 53, 0.03);
  border-top: 1px dashed rgba(255, 107, 53, 0.15);
}
.submit-entry-qr {
  width: 90px; height: 90px;
  border-radius: 8px;
  border: 2px solid rgba(255, 107, 53, 0.2);
  margin-bottom: 6px;
}
.submit-entry-qr-label {
  font-size: 11px;
  color: var(--text-light);
  margin-bottom: 2px;
}
.submit-entry-qr-domain {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.5px;
}

/* ===== Product Card ===== */
.product-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.product-img-wrap {
  position: relative;
  padding-top: 100%;
  background: #f0ece6;
  overflow: hidden;
}
.product-img {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}
.product-card:hover .product-img { transform: scale(1.05); }
.product-badge {
  position: absolute;
  top: 10px; left: 10px;
  background: var(--primary);
  color: white;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}
.product-info { padding: 14px; }
.product-name {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.product-desc {
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: normal;
  word-break: break-all;
}
.product-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px;
}
.product-price { font-size: 17px; font-weight: 800; color: var(--primary); }
.product-meta { font-size: 12px; color: var(--text-light); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

/* 配送標籤 */
.delivery-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}
.delivery-tag.pickup { background: #e8f5e9; color: #388e3c; }
.delivery-tag.delivery { background: #e3f2fd; color: #1976d2; }
.delivery-tag.both { background: #f3e5f5; color: #7b1fa2; }
.view-count { color: var(--text-light); }

/* ===== Ad Card ===== */
.ad-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: var(--radius);
  padding: 24px;
  color: white;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  min-height: 200px;
  cursor: pointer;
  transition: transform 0.2s;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}
.ad-card:hover { transform: translateY(-4px); }
.ad-img-wrap { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
.ad-img-wrap img { width: 100%; height: 100%; object-fit: cover; }
.ad-img-wrap + .ad-badge { position: relative; z-index: 1; }
.ad-card h3 { font-size: 18px; margin-bottom: 8px; position: relative; z-index: 1; }
.ad-card p { font-size: 14px; opacity: 0.85; position: relative; z-index: 1; }
.ad-badge {
  display: inline-block;
  background: rgba(255,255,255,0.2);
  padding: 2px 10px;
  border-radius: 10px;
  font-size: 11px;
  margin-bottom: 12px;
}

/* Load More */
.load-more-wrap { text-align: center; margin-top: 32px; }
.load-more-btn {
  background: var(--bg-card);
  border: 2px solid var(--primary);
  color: var(--primary);
  padding: 12px 36px;
  border-radius: 28px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.load-more-btn:hover { background: var(--primary); color: white; }

/* ===== Footer ===== */
/* ===== 法律聲明區 ===== */
.legal-section {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  padding: 48px 0 32px;
  margin-top: 40px;
}
.legal-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 28px;
}
.legal-card {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius);
  padding: 28px 24px 24px;
  backdrop-filter: blur(8px);
  transition: transform 0.2s ease, background 0.2s ease;
}
.legal-card:hover {
  background: rgba(255,255,255,0.1);
  transform: translateY(-2px);
}
.legal-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.legal-icon {
  font-size: 22px;
  flex-shrink: 0;
}
.legal-card-header h3 {
  font-size: 17px;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.5px;
}
.legal-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.legal-list li {
  position: relative;
  padding-left: 16px;
  font-size: 13px;
  line-height: 1.7;
  color: rgba(255,255,255,0.7);
}
.legal-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 9px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--primary);
  opacity: 0.8;
}
.legal-footer-note {
  text-align: center;
  font-size: 12px;
  color: rgba(255,255,255,0.35);
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

/* ===== 頁尾 ===== */
.footer { background: var(--text); color: rgba(255,255,255,0.7); padding: 24px 0; }
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
}

.footer-left p {
  color: rgba(255,255,255,0.6);
  margin: 0;
  line-height: 1.6;
}

.footer-disclaimer {
  font-size: 11px;
  color: rgba(255,255,255,0.35);
  margin-top: 2px;
}

/* ===== Footer 聯繫方式（SSR 純靜態） ===== */
.footer-contacts {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 12px;
}

.fc-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: rgba(255,255,255,0.7);
  font-size: 13px;
  cursor: pointer;
  transition: color 0.2s;
}

.fc-item:hover { color: rgba(255,255,255,1); }

.fc-tip {
  font-size: 11px;
  color: rgba(255,255,255,0.4);
  margin-left: 2px;
}

.night-mode .fc-item { color: rgba(255,255,255,0.55); }
.night-mode .fc-item:hover { color: rgba(255,255,255,0.9); }

/* ===== 右下角浮動按鈕 ===== */
.fab-group {
  position: fixed;
  bottom: 28px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 150;
}
.fab {
  width: 52px; height: 52px;
  border-radius: 50%;
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  transition: transform 0.2s, box-shadow 0.2s;
}
.fab:hover { transform: scale(1.1); box-shadow: 0 6px 20px rgba(0,0,0,0.3); }
.fab-primary { background: var(--primary); }
.fab-secondary { background: #555; }
.fab-top {
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.2s, box-shadow 0.2s;
}
.fab-top.visible {
  opacity: 1;
  pointer-events: auto;
}
html { scroll-behavior: smooth; }

/* ===== Modal 通用 ===== */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  justify-content: center;
  align-items: center;
  padding: 20px;
  backdrop-filter: blur(2px);
}
.modal-overlay.show { display: flex; }
.modal {
  background: var(--bg-card);
  border-radius: var(--radius);
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}
.modal-close {
  position: absolute;
  top: 12px; right: 16px;
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: var(--text-light);
  z-index: 10;
  line-height: 1;
}
.modal-close:hover { color: var(--text); }
.modal-img {
  width: 100%;
  max-height: 380px;
  object-fit: cover;
  border-radius: var(--radius) var(--radius) 0 0;
}
.modal-content { padding: 24px; }
.modal-title { font-size: 22px; font-weight: 700; margin-bottom: 8px; }
.modal-cat {
  display: inline-block;
  background: var(--bg);
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 12px;
}
.modal-desc { font-size: 14px; color: #555; line-height: 1.8; margin-bottom: 16px; }
.modal-price { font-size: 28px; font-weight: 800; color: var(--primary); margin-bottom: 8px; }
.modal-meta { font-size: 13px; color: var(--text-light); display: flex; gap: 16px; flex-wrap: wrap; }
.modal-related { padding: 24px; border-top: 1px solid var(--border); }
.modal-related h4 { font-size: 16px; margin-bottom: 12px; }
.related-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; }
.related-item { border-radius: var(--radius-sm); overflow: hidden; cursor: pointer; box-shadow: var(--shadow); }
.related-item img { width: 100%; height: 80px; object-fit: cover; }
.related-name { padding: 6px 8px; font-size: 12px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.related-price { padding: 0 8px 6px; font-size: 12px; color: var(--primary); font-weight: 700; }

/* ===== 投稿表單 Modal ===== */
.modal-form { max-width: 520px; }
.modal-manage { max-width: 420px; }
.modal-form-body { padding: 32px 28px 28px; }
.form-title { font-size: 20px; font-weight: 800; margin-bottom: 6px; }
.form-subtitle { font-size: 13px; color: var(--text-light); margin-bottom: 24px; }
.form-group { margin-bottom: 18px; position: relative; }
.form-label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.form-input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  transition: border-color 0.2s, box-shadow 0.2s;
  font-family: inherit;
}
.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255,107,53,0.1);
  background: #fff;
}
.form-textarea { resize: vertical; min-height: 80px; }
.form-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23888' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; cursor: pointer; }
.form-hint { font-size: 12px; color: var(--text-light); position: absolute; right: 0; top: 0; }
.form-row { display: flex; gap: 14px; }
.form-row .half { flex: 1; min-width: 0; }
.input-prefix-wrap { position: relative; display: flex; align-items: center; }
.input-prefix { position: absolute; left: 14px; font-size: 15px; font-weight: 700; color: var(--primary); z-index: 1; }
.input-with-prefix { padding-left: 30px; }

/* 配送方式 */
.delivery-options { display: flex; gap: 12px; flex-wrap: wrap; }
.delivery-option {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}
.delivery-option:has(input:checked) { border-color: var(--primary); background: #fff5f0; color: var(--primary); }
.delivery-option input { accent-color: var(--primary); }

/* 圖片上傳 */
.upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.2s;
  overflow: hidden;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.upload-area:hover { border-color: var(--primary); }
.upload-placeholder { text-align: center; padding: 20px; color: var(--text-light); }
.upload-placeholder p { font-size: 13px; margin-top: 8px; }
.upload-hint { font-size: 11px; margin-top: 4px; }
.image-preview { width: 100%; max-height: 200px; object-fit: contain; display: block; }

/* 提交按鈕 */
.submit-btn {
  width: 100%;
  background: var(--primary);
  color: white;
  border: none;
  padding: 14px;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 8px;
}
.submit-btn:hover { background: var(--primary-dark); }
.submit-btn:disabled { background: #ccc; cursor: not-allowed; }

/* 管理面板按鈕 */
.manage-btn-row { display: flex; gap: 12px; margin-bottom: 16px; }
.btn {
  flex: 1;
  padding: 11px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: 2px solid var(--border);
  background: var(--bg-card);
}
.btn-outline { border-color: var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: white; }
.btn-danger { border-color: #ef4444; color: #ef4444; }
.btn-danger:hover { background: #ef4444; color: white; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* 查詢結果 */
.manage-result {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 16px;
  font-size: 14px;
  border: 1px solid var(--border);
}
.manage-result.result-success { border-color: #86efac; background: #f0fdf4; }
.manage-result.result-error { border-color: #fca5a5; background: #fef2f2; color: #dc2626; }
.result-item { margin-bottom: 8px; }
.result-item:last-child { margin-bottom: 0; }
.status-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
}
.status-1 { background: #dcfce7; color: #16a34a; }
.status-2 { background: #fef9c3; color: #ca8a04; }
.status-0 { background: #f1f5f9; color: #64748b; }
.status-3 { background: #ede9fe; color: #7c3aed; }

/* 成功彈窗 */
.modal-success {
  max-width: 380px;
  text-align: center;
  padding: 36px 28px;
}
.success-icon { font-size: 52px; margin-bottom: 12px; }
.modal-success h2 { font-size: 22px; font-weight: 800; margin-bottom: 8px; }
.modal-success p { font-size: 14px; color: var(--text-light); margin-bottom: 20px; }
.code-box {
  background: #1a1a2e;
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin-bottom: 16px;
}
.code-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.code-row:last-child { border-bottom: none; }
.code-label { font-size: 13px; color: rgba(255,255,255,0.6); }
.code-value { font-size: 20px; font-weight: 800; color: #ffd166; font-family: monospace; }
.code-highlight { color: var(--secondary); letter-spacing: 3px; }
.code-warning { font-size: 12px; color: #ef4444; margin-bottom: 20px; }

/* ===== Loading Skeleton ===== */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius);
}
@keyframes shimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }

/* ===== Empty State ===== */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-light); }
.empty-state .icon { font-size: 48px; margin-bottom: 12px; }
.empty-state p { font-size: 16px; }

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .market-hours-inline { font-size: 10px; margin-left: 8px; padding-left: 8px; }
  .market-hours-inline .hours-text { display: none; }
  .header-search { max-width: 180px; margin: 0 8px; }
  .categories-section { top: 60px; }
  .scroll-card { width: 140px; }
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .submit-entry-card { min-height: 180px; }
  .submit-entry-icon { width: 44px; height: 44px; }
  .submit-entry-icon svg { width: 24px; height: 24px; }
  .submit-entry-text { font-size: 13px; }
  .submit-entry-qr { width: 70px; height: 70px; }
  .submit-entry-qr-label { font-size: 10px; }
  .submit-entry-qr-domain { font-size: 11px; }
  .product-info { padding: 10px; }
  .product-name { font-size: 13px; }
  .product-price { font-size: 15px; }
  .footer-inner { flex-direction: column; gap: 8px; text-align: center; }
  .footer-contacts { gap: 8px; justify-content: center; }
  .fc-item { font-size: 12px; }
  .modal { max-width: 100%; margin: 10px; border-radius: var(--radius-sm); }
  .modal-form-body { padding: 24px 20px 20px; }
  .form-title { font-size: 18px; }
  .modal-title { font-size: 18px; }
  .modal-price { font-size: 24px; }
  .modal-success { padding: 28px 20px; }
  .success-icon { font-size: 44px; }
  .code-box { padding: 12px 16px; }
  .code-value { font-size: 18px; }
  .related-grid { grid-template-columns: repeat(2, 1fr); }
  .form-row { flex-direction: column; gap: 0; }
  .fab { width: 46px; height: 46px; }
  .fab-group { bottom: 20px; right: 16px; }
  .load-more-btn { padding: 10px 28px; font-size: 14px; }
  .legal-grid { grid-template-columns: 1fr; gap: 16px; }
  .legal-section { padding: 32px 0 24px; margin-top: 24px; }
  .legal-card { padding: 20px 16px; }
  .legal-card-header h3 { font-size: 15px; }
  .legal-list li { font-size: 12.5px; }
}
@media (max-width: 480px) {
  .market-hours-inline { display: none; }
  .header-search { max-width: 130px; }
  .logo-text { font-size: 18px; }
  .logo-icon { font-size: 22px; }
  .scroll-card { width: 120px; }
  .scroll-card-info { padding: 8px 8px 10px; }
  .scroll-card-name { font-size: 12px; }
  .scroll-card-price { font-size: 13px; }
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .product-desc { display: none; }
  .delivery-options { flex-direction: column; }
  .modal-form-body { padding: 20px 16px 16px; }
  .form-title { font-size: 17px; }
  .form-subtitle { font-size: 12px; margin-bottom: 16px; }
  .form-group { margin-bottom: 14px; }
  .modal-success { padding: 24px 16px; }
  .modal-success h2 { font-size: 18px; }
  .success-icon { font-size: 40px; }
  .code-value { font-size: 16px; }
  .submit-btn { padding: 12px; font-size: 15px; }
  .product-meta { gap: 4px; }
  .product-badge { font-size: 10px; padding: 2px 8px; top: 6px; left: 6px; }
}
@media (min-width: 1440px) {
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
}
