/* 3C 比價網 前台樣式（Bootstrap 5 / AdminLTE 4 之上） */
:root,
[data-bs-theme=light] {
  --p3c-bg: #f4f5f8;
  --p3c-card: #ffffff;
  --p3c-card-2: #f8f9fb;
  --p3c-border: #eceef3;
  --p3c-text: #1c2130;
  --p3c-muted: #6b7280;
  --p3c-primary: #4f46e5;
  --p3c-primary-2: #7c3aed;
  --p3c-primary-soft: #eef0ff;
  --p3c-price: #e11d48;
  --p3c-official: #0f766e;
  --p3c-official-soft: #e6f6f4;
  --p3c-good: #16a34a;
  --p3c-radius: 20px;
  --p3c-radius-sm: 12px;
  --p3c-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 6px 24px rgba(16, 24, 40, .05);
  --p3c-shadow-hover: 0 4px 10px rgba(16, 24, 40, .06), 0 14px 36px rgba(16, 24, 40, .09);
  --p3c-header-h: 72px;
  --bs-body-font-family: "Noto Sans TC", system-ui, -apple-system, "PingFang TC", "Microsoft JhengHei", "Segoe UI", sans-serif;
  --bs-link-color-rgb: 79, 70, 229;
}

[data-bs-theme=dark] {
  --p3c-bg: #0d1017;
  --p3c-card: #161a24;
  --p3c-card-2: #1c2130;
  --p3c-border: #262b39;
  --p3c-text: #e7e9f0;
  --p3c-muted: #9aa3b5;
  --p3c-primary: #8b93ff;
  --p3c-primary-2: #a78bfa;
  --p3c-primary-soft: rgba(139, 147, 255, .14);
  --p3c-price: #fb7185;
  --p3c-official: #2dd4bf;
  --p3c-official-soft: rgba(45, 212, 191, .12);
  --p3c-good: #4ade80;
  --p3c-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 24px rgba(0, 0, 0, .25);
  --p3c-shadow-hover: 0 8px 30px rgba(0, 0, 0, .45);
  --bs-body-bg: #0d1017;
  --bs-link-color-rgb: 139, 147, 255;
}

html { scroll-padding-top: calc(var(--p3c-header-h) + 16px); }
body.p3c {
  background: var(--p3c-bg);
  color: var(--p3c-text);
  font-family: var(--bs-body-font-family);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { text-decoration: none; }
.text-muted, .muted { color: var(--p3c-muted) !important; }
.fw-black { font-weight: 900; }
.price { color: var(--p3c-price); font-weight: 800; font-variant-numeric: tabular-nums; }
.tabular { font-variant-numeric: tabular-nums; }
.min-w-0 { min-width: 0; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 1030;
  height: var(--p3c-header-h);
  background: color-mix(in srgb, var(--p3c-card) 92%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--p3c-border);
}
.header-inner { height: 100%; display: flex; align-items: center; gap: 14px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--p3c-text); font-weight: 900; font-size: 1.25rem; letter-spacing: .5px; white-space: nowrap; }
.brand img { width: 40px; height: 40px; }
/* 後台上傳的 Logo：高度由「品牌與圖示」設定（--logo-h / --logo-h-m），寬度等比 */
.brand img.brand-logo { width: auto; height: var(--logo-h, 40px); max-width: min(56vw, 360px); object-fit: contain; }
.hero-logo-img { display: block; width: auto; max-width: 100%; object-fit: contain; margin: 0 auto 10px; }
.logo-dark { display: none !important; }
[data-bs-theme=dark] .logo-light { display: none !important; }
[data-bs-theme=dark] .brand .logo-dark { display: inline-block !important; }
[data-bs-theme=dark] .hero-logo-img.logo-dark { display: block !important; }
.brand .brand-name { background: linear-gradient(90deg, var(--p3c-primary), #06b6d4); -webkit-background-clip: text; background-clip: text; color: transparent; }
.top-nav { display: flex; gap: 4px; margin-left: 8px; }
.top-nav a { padding: 9px 16px; border-radius: 999px; color: var(--p3c-text); font-weight: 700; white-space: nowrap; transition: background .15s; }
.top-nav a:hover { background: var(--p3c-card-2); }
.top-nav a.active { background: var(--p3c-primary-soft); color: var(--p3c-primary); }
.header-search { position: relative; flex: 1 1 auto; max-width: 560px; margin-left: auto; }
.header-search .bi-search { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); color: var(--p3c-muted); }
.header-search input {
  width: 100%; height: 46px; border-radius: 999px; border: 1px solid transparent;
  background: var(--p3c-card-2); padding: 0 18px 0 46px; color: var(--p3c-text); outline: none; transition: border .15s, background .15s;
}
.header-search input:focus { border-color: var(--p3c-primary); background: var(--p3c-card); }
.suggest-box {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 1050; display: none;
  background: var(--p3c-card); border: 1px solid var(--p3c-border); border-radius: 16px; box-shadow: var(--p3c-shadow-hover); overflow: hidden;
}
.suggest-box.show { display: block; }
.suggest-item { display: flex; gap: 12px; align-items: center; padding: 10px 14px; color: var(--p3c-text); }
.suggest-item:hover, .suggest-item.active { background: var(--p3c-card-2); }
.suggest-item img { width: 40px; height: 40px; object-fit: contain; border-radius: 8px; background: #fff; }
.suggest-item .s-name { font-weight: 600; font-size: .92rem; line-height: 1.3; }
.suggest-item .s-model { font-size: .78rem; color: var(--p3c-muted); }
.suggest-item .s-price { margin-left: auto; white-space: nowrap; }
.icon-btn {
  width: 44px; height: 44px; flex: 0 0 44px; border-radius: 50%; border: 0; background: transparent; color: var(--p3c-text);
  display: inline-flex; align-items: center; justify-content: center; font-size: 1.3rem; position: relative;
}
.icon-btn:hover { background: var(--p3c-card-2); }
.icon-btn .badge-dot { position: absolute; top: 6px; right: 6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--p3c-price); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; }
.btn-cta {
  background: linear-gradient(90deg, #f43f5e, #fb923c); color: #fff !important; border: 0; border-radius: 999px;
  padding: 10px 20px; font-weight: 800; white-space: nowrap; box-shadow: 0 6px 18px rgba(244, 63, 94, .3);
}
.btn-cta:hover { filter: brightness(1.05); transform: translateY(-1px); }
.btn-login { background: #111827; color: #fff !important; border-radius: 999px; padding: 10px 22px; font-weight: 800; white-space: nowrap; }
[data-bs-theme=dark] .btn-login { background: #fff; color: #111827 !important; }
.avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: var(--p3c-card-2); flex: 0 0 auto; }
.avatar-sm { width: 28px; height: 28px; }
.avatar-lg { width: 120px; height: 120px; }
.user-menu .dropdown-menu { border-radius: 16px; border: 1px solid var(--p3c-border); box-shadow: var(--p3c-shadow-hover); padding: 8px; min-width: 220px; }
.user-menu .dropdown-item { border-radius: 10px; padding: 9px 12px; }

/* ---------- Layout ---------- */
.site-body { display: flex; gap: 28px; padding-top: 24px; padding-bottom: 40px; align-items: flex-start; }
.sidebar { width: 250px; flex: 0 0 250px; }
@media (min-width: 992px) {
  .sidebar { position: sticky; top: calc(var(--p3c-header-h) + 20px); max-height: calc(100vh - var(--p3c-header-h) - 40px); overflow-y: auto; scrollbar-width: thin; }
}
.main-col { flex: 1 1 auto; min-width: 0; }
.rightbar { width: 310px; flex: 0 0 310px; position: sticky; top: calc(var(--p3c-header-h) + 20px); }
.side-nav { list-style: none; padding: 0; margin: 0; }
.side-nav a {
  display: flex; align-items: center; gap: 14px; padding: 9px 12px; border-radius: 16px; color: var(--p3c-text); font-weight: 700; font-size: 1.02rem; margin-bottom: 4px;
}
.side-nav a:hover { background: var(--p3c-card); }
.side-nav a.active { background: var(--p3c-card); box-shadow: var(--p3c-shadow); color: var(--p3c-primary); }
.side-nav .tile, .tile {
  width: 40px; height: 40px; border-radius: 13px; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 1.15rem; flex: 0 0 40px;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .08);
}
.side-label { font-size: .85rem; color: var(--p3c-muted); font-weight: 700; padding: 18px 12px 8px; letter-spacing: 1px; }
.side-nav .count { margin-left: auto; font-size: .78rem; color: var(--p3c-muted); font-weight: 600; }

/* ---------- Cards ---------- */
.card-x { background: var(--p3c-card); border: 1px solid var(--p3c-border); border-radius: var(--p3c-radius); box-shadow: var(--p3c-shadow); }
.card-x .card-x-body { padding: 24px; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin: 32px 0 16px; gap: 12px; }
.section-head h2 { font-size: 1.35rem; font-weight: 900; margin: 0; display: flex; align-items: center; gap: 10px; }
.section-head h2 .emoji { font-size: 1.4rem; }
.section-head .more { color: var(--p3c-muted); font-weight: 700; white-space: nowrap; }
.section-head .more:hover { color: var(--p3c-primary); }
.page-head { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.page-head h1 { font-size: 1.6rem; font-weight: 900; margin: 0; }
.page-head .tile { width: 52px; height: 52px; flex-basis: 52px; border-radius: 16px; font-size: 1.5rem; }

/* Hero */
.hero { position: relative; overflow: hidden; padding: 40px 36px; text-align: center; }
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(600px 220px at 15% -10%, rgba(99, 102, 241, .16), transparent 70%), radial-gradient(500px 220px at 95% 110%, rgba(6, 182, 212, .16), transparent 70%);
}
.hero > * { position: relative; }
.hero-logo { width: 84px; height: 84px; margin-bottom: 6px; }
.hero-brand { font-size: 1.1rem; font-weight: 900; letter-spacing: 4px; color: var(--p3c-muted); margin-bottom: 8px; }
.hero h1 { font-weight: 900; font-size: clamp(1.6rem, 3.4vw, 2.4rem); margin-bottom: 14px; }
.hero h1 .hl { background: linear-gradient(90deg, var(--p3c-primary), #06b6d4); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead { color: var(--p3c-muted); font-size: 1.08rem; line-height: 1.9; max-width: 760px; margin: 0 auto 24px; }
.hero p.lead strong { color: var(--p3c-price); }
.feature-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 24px 0; }
.feature { border: 1px solid var(--p3c-border); border-radius: 18px; padding: 22px 14px; background: var(--p3c-card); }
.feature i { font-size: 1.8rem; color: var(--p3c-price); }
.feature h3 { font-size: 1.05rem; font-weight: 900; margin: 10px 0 6px; }
.feature p { color: var(--p3c-muted); font-size: .88rem; margin: 0; line-height: 1.6; }
.btn-google {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; border: 1px solid var(--p3c-border); background: var(--p3c-card);
  color: var(--p3c-text) !important; border-radius: 16px; padding: 12px 26px; font-weight: 800; font-size: 1.05rem;
}
.btn-google:hover { box-shadow: var(--p3c-shadow); }
.btn-google svg { width: 22px; height: 22px; }
.btn-soft { background: var(--p3c-card-2); color: var(--p3c-text); border-radius: 16px; padding: 12px 26px; font-weight: 800; border: 0; }
.btn-soft:hover { background: var(--p3c-border); color: var(--p3c-text); }
.btn-primary-x { background: linear-gradient(90deg, var(--p3c-primary), var(--p3c-primary-2)); color: #fff !important; border: 0; border-radius: 14px; font-weight: 800; padding: 10px 20px; }
.btn-primary-x:hover { filter: brightness(1.07); }
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stat-box { background: var(--p3c-card-2); border-radius: 14px; padding: 14px 10px; text-align: center; }
.stat-box .n { font-size: 1.5rem; font-weight: 900; color: var(--p3c-price); line-height: 1.2; }
.stat-box .l { font-size: .85rem; color: var(--p3c-muted); }

/* ---------- Product card ---------- */
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 18px; }
.pcard {
  background: var(--p3c-card); border: 1px solid var(--p3c-border); border-radius: var(--p3c-radius); box-shadow: var(--p3c-shadow);
  display: flex; flex-direction: column; overflow: hidden; transition: transform .15s, box-shadow .15s;
}
.pcard:hover { transform: translateY(-2px); box-shadow: var(--p3c-shadow-hover); }
.pcard-media { position: relative; display: block; aspect-ratio: 4 / 3; background: #fff; padding: 16px; border-bottom: 1px solid var(--p3c-border); }
.pcard-media img { width: 100%; height: 100%; object-fit: contain; }
.pcard-media .flag { position: absolute; top: 12px; left: 12px; }
.pill { display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 3px 10px; font-size: .78rem; font-weight: 800; white-space: nowrap; }
.pill-drop { background: #fff1f2; color: #e11d48; }
.pill-official { background: var(--p3c-official-soft); color: var(--p3c-official); }
.pill-gray { background: var(--p3c-card-2); color: var(--p3c-muted); }
.pill-primary { background: var(--p3c-primary-soft); color: var(--p3c-primary); }
[data-bs-theme=dark] .pill-drop { background: rgba(251, 113, 133, .14); color: #fb7185; }
.pcard-body { padding: 16px 18px 6px; flex: 1 1 auto; display: flex; flex-direction: column; gap: 8px; }
.pcard-meta { font-size: .8rem; color: var(--p3c-muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.pcard-meta a { color: var(--p3c-muted); font-weight: 700; }
.model-chip { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .76rem; background: var(--p3c-card-2); padding: 1px 8px; border-radius: 6px; color: var(--p3c-muted); }
.pcard-title { font-size: 1.02rem; font-weight: 800; line-height: 1.4; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pcard-title a { color: var(--p3c-text); }
.pcard-title a:hover { color: var(--p3c-primary); }
.pcard-summary { color: var(--p3c-muted); font-size: .85rem; line-height: 1.55; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.stars { color: #f59e0b; letter-spacing: 1px; white-space: nowrap; }
.rating-line { font-size: .85rem; display: flex; align-items: center; gap: 6px; color: var(--p3c-muted); }
.rating-line b { color: var(--p3c-text); }
.pcard-prices { background: var(--p3c-card-2); border-radius: 14px; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; }
.price-row { display: flex; align-items: baseline; gap: 8px; font-size: .88rem; }
.price-row .label { color: var(--p3c-muted); font-weight: 700; min-width: 4.6em; }
.price-row .value { font-weight: 800; font-variant-numeric: tabular-nums; }
.price-row.lowest .value { color: var(--p3c-price); font-size: 1.15rem; }
.price-row.official .label { color: var(--p3c-official); }
.price-row .where { color: var(--p3c-muted); font-size: .8rem; margin-left: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 8em; }
.offer-mini { list-style: none; margin: 0; padding: 0; font-size: .84rem; }
.offer-mini li { display: flex; align-items: center; gap: 8px; padding: 4px 2px; border-bottom: 1px dashed var(--p3c-border); }
.offer-mini li:last-child { border-bottom: 0; }
.offer-mini a { color: var(--p3c-text); display: flex; align-items: center; gap: 8px; width: 100%; }
.offer-mini .p { margin-left: auto; font-weight: 800; font-variant-numeric: tabular-nums; }
.offer-mini .oos { color: var(--p3c-muted); text-decoration: line-through; }
.store-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c, #9ca3af); flex: 0 0 9px; }
.only-official { display: flex; align-items: center; gap: 6px; font-size: .84rem; font-weight: 800; color: var(--p3c-official); background: var(--p3c-official-soft); border-radius: 10px; padding: 7px 10px; }
.no-offer { font-size: .84rem; color: var(--p3c-muted); background: var(--p3c-card-2); border-radius: 10px; padding: 7px 10px; }
.pcard-review { display: flex; gap: 8px; align-items: flex-start; font-size: .82rem; color: var(--p3c-muted); border-top: 1px solid var(--p3c-border); padding-top: 8px; }
.pcard-review .q { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pcard-foot { display: flex; gap: 8px; padding: 10px 18px 16px; }
.pcard-foot .btn-go { flex: 1; border-radius: 12px; font-weight: 800; background: var(--p3c-primary-soft); color: var(--p3c-primary); border: 0; padding: 9px; text-align: center; }
.pcard-foot .btn-go:hover { background: var(--p3c-primary); color: #fff; }
.follow-btn { width: 42px; border-radius: 12px; border: 1px solid var(--p3c-border); background: var(--p3c-card); color: var(--p3c-muted); }
.follow-btn.on { color: #ef4444; border-color: #fecaca; background: #fff1f2; }
[data-bs-theme=dark] .follow-btn.on { background: rgba(239, 68, 68, .12); border-color: rgba(239, 68, 68, .3); }

/* Category tiles */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.cat-tile { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 16px; background: var(--p3c-card); border: 1px solid var(--p3c-border); color: var(--p3c-text); font-weight: 800; }
.cat-tile:hover { box-shadow: var(--p3c-shadow-hover); color: var(--p3c-primary); }
.cat-tile small { display: block; font-weight: 600; color: var(--p3c-muted); font-size: .78rem; }

/* Chips (熱門品牌) */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--p3c-border); border-radius: 999px; padding: 6px 14px; font-weight: 800; color: var(--p3c-primary); background: var(--p3c-card); font-size: .9rem; }
.chip small { color: var(--p3c-muted); font-weight: 600; margin-left: 2px; }
.chip:hover { background: var(--p3c-primary-soft); }
.chip.active { background: var(--p3c-primary); color: #fff; border-color: var(--p3c-primary); }

/* Right bar */
.side-card { padding: 22px; margin-bottom: 18px; }
.side-card h3 { font-size: 1.15rem; font-weight: 900; margin-bottom: 10px; display: flex; align-items: center; justify-content: space-between; }
.side-card h3 a { font-size: .9rem; color: var(--p3c-muted); font-weight: 700; }
.side-card p { color: var(--p3c-muted); font-size: .9rem; line-height: 1.7; }
.store-list { list-style: none; padding: 0; margin: 0; }
.store-list li { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: .9rem; }
.store-list .tag { margin-left: auto; font-size: .75rem; }

/* Filters */
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 14px 16px; margin-bottom: 18px; }
.filter-bar .form-select, .filter-bar .form-control { border-radius: 12px; min-width: 0; }
.sort-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.sort-tabs a { padding: 6px 14px; border-radius: 999px; font-weight: 700; color: var(--p3c-muted); font-size: .9rem; }
.sort-tabs a.active { background: var(--p3c-text); color: var(--p3c-card); }

/* Pagination */
.pager { display: flex; justify-content: center; gap: 6px; margin: 28px 0 8px; flex-wrap: wrap; }
.pager a, .pager span { min-width: 42px; height: 42px; display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; background: var(--p3c-card); border: 1px solid var(--p3c-border); color: var(--p3c-text); font-weight: 700; padding: 0 10px; }
.pager .cur { background: var(--p3c-primary); color: #fff; border-color: var(--p3c-primary); }

/* ---------- Product detail ---------- */
.crumbs { font-size: .88rem; color: var(--p3c-muted); margin-bottom: 14px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.crumbs a { color: var(--p3c-muted); }
.crumbs a:hover { color: var(--p3c-primary); }
.pd-hero { display: grid; grid-template-columns: minmax(0, 360px) minmax(0, 1fr); gap: 28px; padding: 26px; }
.pd-image { background: #fff; border-radius: 18px; border: 1px solid var(--p3c-border); aspect-ratio: 1; display: flex; align-items: center; justify-content: center; padding: 20px; }
.pd-image img { max-width: 100%; max-height: 100%; object-fit: contain; }
.pd-title { font-size: clamp(1.35rem, 2.6vw, 1.9rem); font-weight: 900; line-height: 1.35; margin: 6px 0 10px; }
.pd-meta { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; color: var(--p3c-muted); font-size: .9rem; }
.pd-prices { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 18px 0; }
.pd-price-box { border-radius: 16px; padding: 14px 16px; background: var(--p3c-card-2); min-width: 0; }
.pd-price-box .lbl { font-size: .85rem; font-weight: 800; color: var(--p3c-muted); display: flex; align-items: center; gap: 6px; }
.pd-price-box .amt { font-size: clamp(1.3rem, 2.4vw, 1.7rem); font-weight: 900; font-variant-numeric: tabular-nums; line-height: 1.3; }
.pd-price-box .sub { font-size: .82rem; color: var(--p3c-muted); }
.pd-price-box.official { background: var(--p3c-official-soft); }
.pd-price-box.official .lbl { color: var(--p3c-official); }
.pd-price-box.lowest .amt { color: var(--p3c-price); }
.pd-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.pd-actions .btn { border-radius: 14px; font-weight: 800; padding: 10px 18px; }
.variant-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.variant-chips > a { border: 1px solid var(--p3c-border); border-radius: 10px; padding: 5px 10px; font-size: .82rem; color: var(--p3c-text); background: var(--p3c-card); }
.variant-chips > a.cur { border-color: var(--p3c-primary); color: var(--p3c-primary); font-weight: 800; }
.pd-section { padding: 24px 26px; margin-top: 20px; }
.pd-section > h2 { font-size: 1.25rem; font-weight: 900; margin: 0 0 16px; display: flex; align-items: center; gap: 10px; }
.offer-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.offer-table th { font-size: .8rem; color: var(--p3c-muted); font-weight: 700; padding: 8px 10px; border-bottom: 1px solid var(--p3c-border); white-space: nowrap; }
.offer-table td { padding: 12px 10px; border-bottom: 1px solid var(--p3c-border); vertical-align: middle; }
.offer-table tr.is-official td { background: var(--p3c-official-soft); }
.offer-table tr.is-official td:first-child { border-radius: 12px 0 0 12px; }
.offer-table tr.is-official td:last-child { border-radius: 0 12px 12px 0; }
.offer-table tr.is-best .o-price { color: var(--p3c-price); }
.offer-table .o-store { font-weight: 800; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.offer-table .o-title { font-size: .82rem; color: var(--p3c-muted); max-width: 360px; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.offer-table .o-price { font-weight: 900; font-size: 1.15rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.offer-table .o-orig { font-size: .78rem; color: var(--p3c-muted); text-decoration: line-through; }
.offer-table .o-time { font-size: .78rem; color: var(--p3c-muted); white-space: nowrap; }
.offer-table .btn-buy { border-radius: 10px; font-weight: 800; white-space: nowrap; }
.offer-table .more-row td { padding-top: 0; }
.chart-wrap { position: relative; height: 260px; }
.chart-wrap svg { width: 100%; height: 100%; display: block; }
.chart-tip { position: absolute; pointer-events: none; background: var(--p3c-card); border: 1px solid var(--p3c-border); box-shadow: var(--p3c-shadow-hover); border-radius: 10px; padding: 6px 10px; font-size: .8rem; display: none; white-space: nowrap; }
.spec-table { width: 100%; font-size: .92rem; }
.spec-table th { width: 30%; color: var(--p3c-muted); font-weight: 700; padding: 9px 12px 9px 0; vertical-align: top; border-bottom: 1px solid var(--p3c-border); }
.spec-table td { padding: 9px 0; border-bottom: 1px solid var(--p3c-border); white-space: pre-line; }
.desc { white-space: pre-line; line-height: 1.9; }
.ai-box { border-radius: 16px; padding: 18px 20px; background: linear-gradient(135deg, rgba(99, 102, 241, .08), rgba(6, 182, 212, .08)); border: 1px solid var(--p3c-border); }
.ai-box ul { margin: 6px 0 0; padding-left: 1.2em; }
.rating-summary { display: grid; grid-template-columns: 180px 1fr; gap: 24px; align-items: center; }
.rating-big { text-align: center; }
.rating-big .n { font-size: 3.2rem; font-weight: 900; line-height: 1; }
.dist-row { display: flex; align-items: center; gap: 10px; font-size: .85rem; margin-bottom: 6px; }
.dist-row .bar { flex: 1; height: 8px; background: var(--p3c-card-2); border-radius: 4px; overflow: hidden; }
.dist-row .bar span { display: block; height: 100%; background: #f59e0b; border-radius: 4px; }
.review { padding: 20px 0; border-top: 1px solid var(--p3c-border); }
.review-head { display: flex; gap: 12px; align-items: center; }
.review-head .who { font-weight: 800; }
.review-head .lv { font-size: .72rem; }
.review-title { font-weight: 800; font-size: 1.05rem; margin: 10px 0 4px; }
.review-body { white-space: pre-line; line-height: 1.8; }
.pros-cons { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; font-size: .9rem; }
.pros-cons > div { border-radius: 12px; padding: 10px 12px; }
.pros-cons .pros { background: rgba(22, 163, 74, .08); }
.pros-cons .cons { background: rgba(225, 29, 72, .07); }
.media-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.media-grid .media-item { width: 120px; height: 120px; border-radius: 12px; overflow: hidden; background: #000; display: block; flex: 0 0 auto; }
.media-grid .media-item.is-video { width: 214px; }
.media-grid .media-item img, .media-grid .media-item video { width: 100%; height: 100%; object-fit: cover; display: block; }
.review-actions { display: flex; gap: 8px; margin-top: 12px; }
.review-actions .btn { border-radius: 999px; font-size: .85rem; font-weight: 700; }
.review-actions .btn.voted { background: var(--p3c-primary-soft); color: var(--p3c-primary); border-color: transparent; }
.comments { margin-top: 12px; padding-left: 16px; border-left: 3px solid var(--p3c-border); }
.comment { display: flex; gap: 10px; padding: 8px 0; font-size: .9rem; }
.star-input { display: inline-flex; flex-direction: row-reverse; gap: 4px; }
.star-input input { display: none; }
.star-input label { font-size: 2rem; color: #d1d5db; cursor: pointer; line-height: 1; }
.star-input input:checked ~ label, .star-input label:hover, .star-input label:hover ~ label { color: #f59e0b; }

/* Upload */
.upload-list { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.upload-item { position: relative; width: 104px; height: 104px; border-radius: 12px; overflow: hidden; background: var(--p3c-card-2); border: 1px solid var(--p3c-border); }
.upload-item img, .upload-item video { width: 100%; height: 100%; object-fit: cover; }
.upload-item .bar { position: absolute; left: 0; right: 0; bottom: 0; height: 6px; background: rgba(0, 0, 0, .25); }
.upload-item .bar span { display: block; height: 100%; width: 0; background: var(--p3c-primary); transition: width .2s; }
.upload-item .state { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; flex-direction: column; font-size: .75rem; font-weight: 800; color: #fff; background: rgba(0, 0, 0, .45); text-align: center; padding: 4px; }
.upload-item .rm { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .6); color: #fff; font-size: .8rem; line-height: 1; }
.upload-drop { border: 2px dashed var(--p3c-border); border-radius: 14px; padding: 16px; text-align: center; color: var(--p3c-muted); cursor: pointer; }
.upload-drop:hover, .upload-drop.drag { border-color: var(--p3c-primary); color: var(--p3c-primary); }

/* Profile (like screenshot 3) */
.profile-card { padding: 30px; display: grid; grid-template-columns: 140px 1fr; gap: 28px; align-items: start; }
.profile-card .avatar-xl { width: 130px; height: 130px; border-radius: 50%; object-fit: cover; box-shadow: var(--p3c-shadow); }
.profile-card h1 { font-size: 2rem; font-weight: 900; margin: 0 0 8px; }
.level-pill { display: inline-block; background: linear-gradient(90deg, #f59e0b, #f97316); color: #fff; padding: 4px 14px; border-radius: 999px; font-weight: 900; font-size: .9rem; }
.progress-x { height: 10px; background: var(--p3c-card-2); border-radius: 5px; overflow: hidden; }
.progress-x span { display: block; height: 100%; background: linear-gradient(90deg, #f59e0b, #ef4444); border-radius: 5px; }
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
.badge-card { text-align: center; padding: 18px 10px; border-radius: 16px; background: var(--p3c-card); border: 1px solid var(--p3c-border); }
.badge-card i { font-size: 2.1rem; }
.badge-card .nm { font-weight: 900; margin-top: 6px; }
.badge-card .ds { font-size: .78rem; color: var(--p3c-muted); }
.badge-card.earned i { background: linear-gradient(135deg, #f59e0b, #ef4444); -webkit-background-clip: text; background-clip: text; color: transparent; }
.badge-card.locked { opacity: .5; }
.badge-card.locked i { color: var(--p3c-muted); }

/* Misc */
.empty-state { text-align: center; padding: 50px 20px; color: var(--p3c-muted); }
.empty-state i { font-size: 3rem; display: block; margin-bottom: 10px; opacity: .6; }
.flash-wrap .alert { border-radius: 16px; border: 0; font-weight: 600; }
.notice-bar { border-radius: 16px; padding: 12px 18px; background: var(--p3c-primary-soft); color: var(--p3c-primary); font-weight: 700; margin-bottom: 18px; }
.modal-content { border-radius: 22px; border: 1px solid var(--p3c-border); background: var(--p3c-card); }
.modal-header, .modal-footer { border-color: var(--p3c-border); }
.form-control, .form-select { border-radius: 12px; }
.form-label { font-weight: 700; font-size: .9rem; }
.site-footer { border-top: 1px solid var(--p3c-border); padding: 28px 0 90px; color: var(--p3c-muted); font-size: .88rem; }
.site-footer a { color: var(--p3c-muted); }
.rank-row { display: grid; grid-template-columns: 48px 88px 1fr auto; gap: 16px; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--p3c-border); }
.rank-row:last-child { border-bottom: 0; }
.rank-no { font-size: 1.5rem; font-weight: 900; color: var(--p3c-muted); text-align: center; }
.rank-row:nth-child(1) .rank-no { color: #f59e0b; }
.rank-row:nth-child(2) .rank-no { color: #94a3b8; }
.rank-row:nth-child(3) .rank-no { color: #b45309; }
.rank-row img { width: 88px; height: 88px; object-fit: contain; background: #fff; border-radius: 12px; border: 1px solid var(--p3c-border); }
.feed-item { display: grid; grid-template-columns: 72px 1fr; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--p3c-border); }
.feed-item:last-child { border-bottom: 0; }
.feed-item img.pimg { width: 72px; height: 72px; object-fit: contain; background: #fff; border-radius: 12px; border: 1px solid var(--p3c-border); }

/* Mobile bottom nav */
.mobile-nav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 1030; display: none; background: var(--p3c-card); border-top: 1px solid var(--p3c-border); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
.mobile-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .72rem; color: var(--p3c-muted); font-weight: 700; }
.mobile-nav a i { font-size: 1.3rem; }
.mobile-nav a.active { color: var(--p3c-primary); }

@media (max-width: 1399.98px) {
  .rightbar { width: 280px; flex-basis: 280px; }
  .top-nav a { padding: 9px 12px; }
}
@media (max-width: 1199.98px) {
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .pd-hero { grid-template-columns: minmax(0, 280px) minmax(0, 1fr); }
}
@media (max-width: 991.98px) {
  :root { --p3c-header-h: 62px; }
  .site-body { padding-top: 16px; display: block; }
  .sidebar { width: auto; }
  .sidebar.offcanvas-lg { background: var(--p3c-bg); }
  .sidebar .offcanvas-body { padding: 12px; }
  .header-inner { gap: 6px; }
  .site-header .brand .brand-name { display: none; }
  .brand img.brand-logo { height: var(--logo-h-m, 32px); max-width: 42vw; }
  .header-search input { height: 40px; }
  .mobile-nav { display: flex; }
  .pd-hero { grid-template-columns: 1fr; padding: 18px; }
  .pd-image { max-width: 320px; margin: 0 auto; width: 100%; }
  .profile-card { grid-template-columns: 1fr; text-align: center; padding: 22px; }
  .profile-card .avatar-xl { margin: 0 auto; }
}
@media (max-width: 767.98px) {
  body.p3c { font-size: 14.5px; }
  .container-xxl { padding-left: 14px; padding-right: 14px; }
  .hero { padding: 28px 18px; }
  .feature-grid { gap: 10px; }
  .feature { padding: 16px 10px; }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .pgrid { grid-template-columns: repeat(auto-fill, minmax(100%, 1fr)); }
  .pcard-media { aspect-ratio: 16 / 9; padding: 10px; }
  .pd-image { max-width: 220px; }
  .pd-section > h2 { flex-wrap: wrap; }
  .btn-login { padding: 8px 16px; }
  .pd-prices { grid-template-columns: 1fr; }
  .pd-section { padding: 18px 16px; }
  .rating-summary { grid-template-columns: 1fr; }
  .pros-cons { grid-template-columns: 1fr; }
  .offer-table thead { display: none; }
  .offer-table tr { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 12px 6px; border-bottom: 1px solid var(--p3c-border); }
  .offer-table td { border: 0; padding: 0; }
  .offer-table td.c-title, .offer-table td.c-time { grid-column: 1 / -1; }
  .offer-table td.c-buy { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
  .offer-table tr.is-official { border-radius: 12px; background: var(--p3c-official-soft); }
  .offer-table tr.is-official td { background: transparent; }
  .rank-row { grid-template-columns: 34px 64px 1fr; }
  .rank-row img { width: 64px; height: 64px; }
  .rank-row .rank-price { grid-column: 3; }
  .section-head h2 { font-size: 1.15rem; }
}
@media (min-width: 576px) and (max-width: 767.98px) {
  .pgrid { grid-template-columns: repeat(2, 1fr); }
}

/* 其他規格：多的收進下拉選單 */
.variant-more { border: 1px dashed var(--p3c-border, #d0d5dd); background: transparent; border-radius: 999px; padding: 4px 12px; font-size: .85rem; color: var(--p3c-primary); }
.variant-menu { max-height: 320px; overflow-y: auto; min-width: 260px; max-width: min(92vw, 420px); }
