/* ============================================================
 *  产品官网样式  —  纯 CSS，无外部依赖
 *  设计：工业专业风，深色 Hero + 浅色内容，橙色行动色
 * ============================================================ */

:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --ink: #0f172a;
  --ink-soft: #475569;
  --ink-faint: #94a3b8;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --accent: #ea580c;
  --accent-hover: #c2410c;
  --accent-soft: #fff3ec;
  --dark: #0f172a;
  --dark-2: #1e293b;
  --ok: #16a34a;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .08);
  --shadow-md: 0 6px 20px rgba(15, 23, 42, .10);
  --shadow-lg: 0 18px 50px rgba(15, 23, 42, .18);
  --maxw: 1240px;
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei",
    "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

/* Focus visibility (accessibility) */
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: 20px;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--accent);
  color: #fff;
  padding: 10px 16px;
  z-index: 200;
  border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
  font-size: 15px;
  padding: 11px 20px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .12s ease, background .2s ease, box-shadow .2s ease, color .2s ease;
  white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--accent-hover); box-shadow: var(--shadow-md); }
.btn-ghost { background: rgba(255,255,255,.08); color: #fff; border-color: rgba(255,255,255,.35); }
.btn-ghost:hover { background: rgba(255,255,255,.16); }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-block { width: 100%; }

/* ---------------- Header ---------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,.86);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 18px;
  height: 64px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.brand-logo { height: 40px; width: auto; display: block; }
.brand-name { font-size: 17px; letter-spacing: .2px; }
.site-nav { display: flex; gap: 22px; margin-left: auto; font-size: 15px; color: var(--ink-soft); }
.site-nav a:hover { color: var(--ink); }
.header-cta { margin-left: 8px; }
.nav-admin {
  margin-left: 4px; padding: 8px 16px; border-radius: 999px; cursor: pointer;
  font-size: 14px; font-weight: 600; border: 1px solid var(--line); background: transparent;
  color: var(--ink-soft); transition: all .18s ease;
}
.nav-admin:hover { border-color: var(--accent); color: var(--accent); background: rgba(245,130,32,.08); }
.nav-admin.active { border-color: var(--accent); color: #fff; background: var(--accent); }
.login-modal .modal-dialog { max-width: 380px; }
.login-dialog { padding: 34px 30px 30px; text-align: center; }
.login-lock {
  width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 50%;
  display: grid; place-items: center; background: rgba(245,130,32,.12); color: var(--accent);
}
.login-lock .ic { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.login-title { font-size: 20px; margin: 0; }
.login-hint { color: var(--ink-faint); font-size: 13px; margin: 6px 0 22px; }
.login-form { display: flex; flex-direction: column; gap: 12px; }
.login-input {
  width: 100%; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line);
  font-size: 15px; background: var(--surface); color: var(--ink); outline: none; transition: border-color .15s ease;
}
.login-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(245,130,32,.15); }
.login-error { color: #dc2626; font-size: 13px; margin: 0; text-align: left; }

/* ---------------- Hero ---------------- */
.hero {
  background:
    radial-gradient(900px 400px at 80% -10%, rgba(234,88,12,.22), transparent 60%),
    linear-gradient(160deg, var(--dark), var(--dark-2));
  color: #fff;
  padding: 84px 0 72px;
}
.hero-inner { max-width: 820px; }
.hero-eyebrow {
  display: inline-block;
  font-size: 13px; letter-spacing: 2px; text-transform: uppercase;
  color: #fdba74; font-weight: 600; margin: 0 0 14px;
}
.hero-title {
  font-size: clamp(30px, 5vw, 52px);
  line-height: 1.1;
  margin: 0 0 16px;
  letter-spacing: -.5px;
  font-weight: 800;
}
.hero-sub { font-size: clamp(16px, 2.2vw, 20px); color: #cbd5e1; margin: 0 0 28px; max-width: 60ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 30px; }
.hero-trust {
  list-style: none; display: flex; flex-wrap: wrap; gap: 18px 26px;
  margin: 0; padding: 0; color: #e2e8f0; font-size: 14.5px;
}
.hero-trust li { display: flex; align-items: center; gap: 8px; }
.hero-trust .ic { width: 18px; height: 18px; stroke: #fdba74; fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }

/* ---------------- Sections ---------------- */
.section { padding: 72px 0; }
.section-eyebrow { color: var(--accent); font-weight: 700; letter-spacing: 1.5px; font-size: 13px; text-transform: uppercase; margin: 0 0 8px; }
.section-title { font-size: clamp(24px, 3.4vw, 34px); margin: 0 0 28px; letter-spacing: -.3px; }
.intro { background: var(--surface); }

/* ---------------- Intro ---------------- */
.intro-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 40px; align-items: start; }
.intro-lead { font-size: 17px; color: var(--ink-soft); margin: 0 0 22px; }
.adv-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.adv-list li {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 14px 16px; font-size: 15px;
}
.adv-list .ic { width: 20px; height: 20px; flex: none; margin-top: 2px; stroke: var(--accent); fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.intro-stats { display: grid; gap: 14px; }
.stat-card {
  background: linear-gradient(160deg, var(--dark), var(--dark-2));
  color: #fff; border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow-md);
}
.stat-card .num { font-size: 28px; font-weight: 800; color: #fdba74; }
.stat-card .label { font-size: 14px; color: #cbd5e1; }

/* ---------------- Products ---------------- */
.product-toolbar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.search-box {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; padding: 10px 16px; flex: 1 1 320px; max-width: 520px;
  box-shadow: var(--shadow-sm);
}
.search-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search-box .ic { width: 18px; height: 18px; stroke: var(--ink-faint); fill: none; stroke-width: 2; stroke-linecap: round; }
.search-box input { border: 0; outline: 0; flex: 1; font-size: 15px; background: transparent; color: var(--ink); }
.result-count { color: var(--ink-soft); font-size: 14px; }

.category-chips, .subcategory-chips { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.subcategory-chips { margin-top: -4px; }
.chip {
  border: 1px solid var(--line-strong); background: var(--surface);
  color: var(--ink-soft); padding: 8px 16px; border-radius: 999px;
  font-size: 14px; cursor: pointer; transition: all .15s ease; font-weight: 500;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip[aria-selected="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip.sub { background: var(--bg); font-size: 13px; padding: 6px 13px; }

.chip.add-cat { border-style: dashed; color: var(--accent); border-color: var(--accent); background: transparent; }
.chip.add-cat:hover { background: rgba(255, 107, 0, .08); }

.chip-edit-wrap { display: inline-flex; align-items: center; }
.chip-edit {
  width: auto; min-width: 84px; max-width: 180px; padding: 8px 14px;
  border-radius: 999px; font-size: 14px; font-weight: 600;
  border: 1px dashed var(--accent); color: var(--accent); background: var(--surface);
  text-align: center;
}
.chip-edit:focus { outline: 2px solid var(--accent); background: #fff; }
.chip-del {
  margin-left: 4px; width: 22px; height: 22px; padding: 0; line-height: 1;
  border-radius: 50%; font-size: 15px; flex: 0 0 auto;
}
.chip-edit-wrap:focus-within { outline: 2px solid var(--accent); border-radius: 999px; }

.edit-hint {
  font-size: 13px; color: var(--accent); background: rgba(255, 107, 0, .08);
  border: 1px solid rgba(255, 107, 0, .25); border-radius: 8px;
  padding: 8px 12px; margin: -4px 0 14px;
}


.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 18px;
  margin-top: 8px;
}
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--line-strong); }
.card-media { position: relative; aspect-ratio: 3 / 4; background: #f1f5f9; overflow: hidden; }
.card-media::before {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(100deg, #eef2f7 30%, #dbe3ec 50%, #eef2f7 70%);
  background-size: 200% 100%;
  animation: media-shimmer 1.25s linear infinite;
}
.card-media.is-loaded::before { display: none; }
.card-media img { position: relative; z-index: 2; width: 100%; height: 100%; object-fit: contain; padding: 8px; opacity: 0; transition: opacity .35s ease, transform .25s ease; }
.card-media.is-loaded img { opacity: 1; }
.card:hover .card-media.is-loaded img { transform: scale(1.05); }
@keyframes media-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .card-media::before { animation: none; } }
.card-badge {
  position: absolute; top: 10px; left: 10px; z-index: 3;
  background: rgba(15,23,42,.82); color: #fff; font-size: 12px;
  padding: 4px 10px; border-radius: 999px; backdrop-filter: blur(4px);
}
.card-body { padding: 14px 14px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-name { font-size: 15px; font-weight: 600; line-height: 1.4; margin: 0; }
.card-spec { font-size: 13px; color: var(--ink-soft); margin: 0; min-height: 18px; }
.card-meta { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ink-soft); margin-top: auto; }
.card-price { color: var(--accent); font-weight: 700; }
.card-cta {
  margin-top: 6px; width: 100%; border: 1px solid var(--accent); color: var(--accent);
  background: var(--accent-soft); border-radius: 999px; padding: 9px; font-weight: 600; font-size: 14px;
  cursor: pointer; transition: all .15s ease;
}
.card-cta:hover { background: var(--accent); color: #fff; }

.empty-state { text-align: center; color: var(--ink-soft); padding: 50px 0; }

.card-img-ph {
  width: 100%; height: 100%; display: grid; place-items: center;
  color: var(--ink-faint); font-size: 13px; background: #eef2f6;
}
.add-card {
  border: 2px dashed var(--line-strong); background: transparent;
  display: grid; place-items: center; text-align: center; color: var(--ink-soft);
  cursor: pointer; min-height: 220px; gap: 6px;
}
.add-card:hover { border-color: var(--accent); color: var(--accent); }
.add-card span { font-size: 28px; font-weight: 700; line-height: 1; }
.add-card small { font-size: 12px; color: var(--ink-faint); }

/* ---------------- Contact ---------------- */
.contact { background: var(--surface); }
.contact-sub { color: var(--ink-soft); margin: -16px 0 28px; font-size: 16px; }
.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.contact-card {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 22px;
  background: var(--bg); display: flex; flex-direction: column; gap: 8px;
}
.contact-card .ic { width: 26px; height: 26px; stroke: var(--accent); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.contact-card .c-label { font-size: 13px; color: var(--ink-faint); }
.contact-card .c-value { font-size: 17px; font-weight: 700; word-break: break-all; }
.contact-card a.c-value:hover { color: var(--accent); }
.contact-card .c-action { margin-top: 6px; }
.copy-btn {
  border: 1px solid var(--line-strong); background: #fff; color: var(--ink-soft);
  border-radius: 8px; padding: 6px 12px; font-size: 13px; cursor: pointer; transition: all .15s ease;
}
.copy-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ---------------- Footer ---------------- */
.site-footer { background: var(--dark); color: #cbd5e1; padding: 36px 0; }
.footer-inner { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; align-items: center; }
.footer-inner .brand-name { color: #fff; font-size: 18px; font-weight: 700; }
.footer-note { margin: 6px 0 0; color: #94a3b8; font-size: 14px; }
.copyright { margin: 0; font-size: 13px; color: #64748b; }

/* ---------------- Modal ---------------- */
.modal { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; padding: 20px; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(15,23,42,.6); backdrop-filter: blur(3px); }
.modal-dialog {
  position: relative; background: var(--surface); border-radius: 18px; max-width: 760px; width: 100%;
  max-height: 90vh; overflow: auto; box-shadow: var(--shadow-lg); animation: pop .2s ease;
}
.modal-close {
  position: absolute; top: 12px; right: 12px; z-index: 2;
  width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(15,23,42,.06);
  display: grid; place-items: center; cursor: pointer;
}
.modal-close .ic { width: 18px; height: 18px; stroke: var(--ink); fill: none; stroke-width: 2; stroke-linecap: round; }
.modal-body { display: grid; grid-template-columns: 1fr 1fr; }
.modal-image { background: #f1f5f9; display: grid; place-items: center; padding: 24px; }
.modal-image img { max-height: 460px; object-fit: contain; opacity: 0; transition: opacity .3s ease; }
.modal-image.is-loaded img { opacity: 1; }
.modal-info { padding: 28px; display: flex; flex-direction: column; gap: 10px; }
.modal-cat { color: var(--accent); font-weight: 600; font-size: 13px; margin: 0; }
.modal-title { font-size: 22px; margin: 0; }
.modal-spec { color: var(--ink-soft); margin: 0; }
.modal-meta { margin: 6px 0 14px; display: grid; gap: 8px; }
.modal-meta div { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px dashed var(--line); padding-bottom: 8px; }
.modal-meta dt { color: var(--ink-faint); font-size: 14px; }
.modal-meta dd { margin: 0; font-weight: 600; }

/* ---------------- Owner Admin ---------------- */
.admin-fab {
  position: fixed; right: 18px; bottom: 18px; z-index: 150;
  width: 52px; height: 52px; border-radius: 50%; border: 0;
  background: var(--dark); color: #fff; box-shadow: var(--shadow-lg); cursor: pointer;
  display: grid; place-items: center; transition: transform .15s ease;
}
.admin-fab:hover { transform: scale(1.06); }
.admin-fab .ic { width: 22px; height: 22px; stroke: #fff; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.admin-bar {
  position: fixed; right: 18px; bottom: 80px; z-index: 150;
  background: var(--dark); color: #fff; border-radius: 12px; padding: 10px;
  display: flex; flex-direction: column; gap: 6px; box-shadow: var(--shadow-lg); width: 200px;
}
.admin-bar[hidden] { display: none; }
.admin-status { font-size: 12px; color: #94a3b8; padding: 2px 4px 6px; }
.admin-btn {
  background: rgba(255,255,255,.1); color: #fff; border: 0; border-radius: 8px;
  padding: 9px 12px; font-size: 14px; cursor: pointer; text-align: left; transition: background .15s ease;
}
.admin-btn:hover { background: rgba(255,255,255,.2); }
.admin-btn-danger { background: rgba(239,68,68,.25); }
.admin-btn-danger:hover { background: rgba(239,68,68,.4); }
.admin-btn-primary { background: var(--accent); }
.admin-btn-primary:hover { background: #e0680f; }
.admin-btn-ghost { background: transparent; border: 1px solid rgba(255,255,255,.2); }
.sync-panel {
  background: #1e293b; border: 1px solid rgba(255,255,255,.15); border-radius: 10px;
  padding: 10px; display: flex; flex-direction: column; gap: 8px; margin-top: 4px;
}
.sync-panel[hidden] { display: none; }
.sync-panel label { font-size: 12px; color: #cbd5e1; display: flex; flex-direction: column; gap: 3px; }
.sync-panel input {
  background: #0f172a; color: #fff; border: 1px solid rgba(255,255,255,.2);
  border-radius: 6px; padding: 6px 8px; font-size: 13px; width: 100%; box-sizing: border-box;
}
.sync-panel .sync-tip { font-size: 11px; color: #94a3b8; margin: 0; line-height: 1.5; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 10px;
  box-shadow: var(--shadow-lg); z-index: 400; font-size: 14px; animation: pop .2s ease;
}
.toast[hidden] { display: none; }

/* ---------------- Edit mode ---------------- */
body.editing [data-edit] {
  outline: 2px dashed transparent;
  border-radius: 6px;
  transition: outline-color .15s ease, background .15s ease;
  cursor: text;
}
body.editing [data-edit]:hover { outline-color: var(--accent); background: var(--accent-soft); }
body.editing [data-edit]:focus { outline: 2px solid var(--accent); background: #fff; }
body.editing .card-media { outline: 2px dashed var(--accent); outline-offset: -2px; }
.edit-field {
  border: 1px dashed var(--line-strong); border-radius: 6px; padding: 4px 6px; width: 100%;
  font: inherit; color: inherit; background: #fff;
}
body.editing .edit-field:focus { outline: 2px solid var(--accent); border-color: var(--accent); }
.edit-controls { display: flex; gap: 6px; margin-top: 6px; }
.edit-mini {
  border: 1px solid var(--line-strong); background: #fff; border-radius: 7px;
  padding: 5px 9px; font-size: 12px; cursor: pointer; color: var(--ink-soft);
}
.edit-mini:hover { border-color: var(--accent); color: var(--accent); }
.edit-mini.danger { color: #dc2626; border-color: #fecaca; }
.edit-mini.danger:hover { background: #fef2f2; }
.edit-img-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.edit-img-row .edit-field { flex: 1 1 140px; min-width: 0; }
.img-upload-btn {
  display: inline-flex; align-items: center; gap: 4px; cursor: pointer; white-space: nowrap;
  border: 1px solid var(--accent); color: var(--accent); background: var(--accent-soft);
  border-radius: 7px; padding: 5px 10px; font-size: 12px;
}
.img-upload-btn:hover { background: var(--accent); color: #fff; }
.edit-img-prev { width: 46px; height: 46px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
.card.featured .card-badge.featured-badge { background: var(--accent); }

/* ---------------- Animations ---------------- */
@keyframes pop { from { transform: scale(.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ---------------- Responsive ---------------- */
@media (max-width: 860px) {
  .intro-grid { grid-template-columns: 1fr; gap: 28px; }
  .modal-body { grid-template-columns: 1fr; }
  .modal-image { padding: 18px; }
  .site-nav { display: none; }
  .header-cta { margin-left: auto; }
}
@media (max-width: 520px) {
  .section { padding: 52px 0; }
  .hero { padding: 60px 0 52px; }
  .hero-actions .btn { flex: 1; }
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .header-inner { gap: 10px; }
  .brand-logo { height: 34px; }
  .brand-name { font-size: 15px; max-width: 42vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

/* ---------------- Reduced motion ---------------- */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .card:hover { transform: none; }
  .card:hover .card-media img { transform: none; }
}
