:root {
  --ink: #1f2428;
  --muted: #6d6258;
  --paper: #fffaf2;
  --cream: #f6efe4;
  --card: #ffffff;
  --line: #e7d9c9;
  --navy: #183247;
  --brown: #4d3327;
  --orange: #d97706;
  --green: #0f766e;
  --shadow: 0 20px 60px rgba(64, 44, 28, .13);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; }
button { border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: minmax(210px, 320px) minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 14px clamp(16px, 5vw, 56px);
  border-bottom: 1px solid rgba(231, 217, 201, .95);
  background: rgba(255, 250, 242, .94);
  backdrop-filter: blur(14px);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mark {
  display: grid;
  place-items: center;
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  color: #fff;
  background: var(--brown);
  font-weight: 950;
}
.brand strong { display: block; overflow: hidden; font-size: 18px; text-overflow: ellipsis; white-space: nowrap; }
.brand span { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }
.nav { display: flex; justify-content: center; gap: clamp(12px, 2vw, 24px); color: #4f463d; font-size: 14px; font-weight: 850; }
.nav a:hover { color: var(--orange); }
.header-actions, .actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border-radius: 8px;
  padding: 0 15px;
  color: var(--brown);
  background: #eadfce;
  font-weight: 900;
}
.btn.primary { color: #fff; background: var(--orange); }
.btn.dark { color: #fff; background: var(--navy); }
.btn.ghost { background: #fff; border: 1px solid var(--line); }
.btn.danger { color: #fff; background: #b42318; }
.section { padding: clamp(42px, 7vw, 88px) clamp(16px, 5vw, 56px); }
.section.alt { background: var(--cream); }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 24px; }
.section-head h2 { margin: 0; font-size: clamp(28px, 4vw, 48px); letter-spacing: 0; }
.section-head p { max-width: 680px; margin: 0; color: var(--muted); line-height: 1.75; }
.hero {
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(340px, 1.05fr);
  gap: clamp(24px, 5vw, 64px);
  align-items: center;
  min-height: calc(100vh - 72px);
  padding: clamp(34px, 7vw, 88px) clamp(16px, 5vw, 56px) 48px;
  background: linear-gradient(180deg, #fffaf2 0%, #f4eadc 100%);
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-radius: 999px;
  padding: 0 12px;
  color: var(--brown);
  background: #f3dfc2;
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}
h1 { max-width: 780px; margin: 18px 0 16px; color: var(--brown); font-size: clamp(44px, 7vw, 88px); line-height: .94; letter-spacing: 0; }
.lead { max-width: 720px; margin: 0; color: #4e463e; font-size: clamp(17px, 2vw, 22px); line-height: 1.85; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hero-main { overflow: hidden; border-radius: 8px; box-shadow: var(--shadow); background: #f7efe4; }
.hero-main img { display: block; width: 100%; min-height: 560px; object-fit: contain; image-rendering: auto; }
.entry-grid, .case-grid, .flow-grid, .scene-grid, .series-grid { display: grid; gap: 16px; }
.entry-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.case-grid, .series-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.flow-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.scene-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.entry, .card, .series, .case, .flow-step, .scene, .panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(64,44,28,.08);
}
.entry { display: grid; grid-template-columns: minmax(0, .95fr) minmax(180px, .75fr); gap: 18px; overflow: hidden; min-height: 310px; }
.entry-copy, .case div, .series div, .panel { padding: 22px; }
.entry h3, .card h3, .case h3, .series h3 { margin: 0; font-size: 24px; letter-spacing: 0; }
.entry p, .case p, .series p { color: var(--muted); line-height: 1.7; }
.entry img, .series img, .case img { width: 100%; height: 100%; object-fit: contain; background: #f7efe4; }
.catalog-tools { display: grid; grid-template-columns: minmax(220px, 1fr) repeat(3, minmax(160px, 220px)); gap: 10px; margin-bottom: 18px; }
.catalog-tools input, .catalog-tools select, .form input, .form select, .form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--ink);
  background: #fff;
  outline: 0;
}
.catalog-tools input, .catalog-tools select { height: 42px; }
.category-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.category-tab { min-height: 34px; border: 1px solid #d9c7b3; border-radius: 999px; padding: 0 14px; color: var(--brown); background: #fffaf2; font-weight: 900; }
.category-tab:hover, .category-tab.is-active { color: #fff; border-color: var(--brown); background: var(--brown); }
.product-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.card { display: flex; flex-direction: column; overflow: hidden; min-width: 0; }
.card-media { position: relative; background: #f7efe4; cursor: pointer; }
.card-media img { width: 100%; aspect-ratio: 1.08 / 1; object-fit: contain; background: #f7efe4; }
.badge { position: absolute; left: 10px; top: 10px; min-height: 28px; border-radius: 999px; padding: 5px 10px; color: #fff; background: rgba(77, 51, 39, .9); font-size: 12px; font-weight: 950; }
.card-body { display: grid; gap: 10px; padding: 16px; }
.sku { color: var(--orange); font-size: 20px; font-weight: 950; }
.path { color: var(--green); font-size: 12px; font-weight: 950; }
.desc { display: -webkit-box; overflow: hidden; min-height: 48px; margin: 0; color: var(--muted); line-height: 1.6; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { border-radius: 999px; padding: 5px 8px; color: #52473c; background: var(--cream); font-size: 12px; font-weight: 850; }
.tag:nth-child(2n) { background: #dff4ea; }
.tag:nth-child(3n) { background: #dbeafe; }
.tag:nth-child(4n) { background: #f9dfe6; }
.card-actions { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 2px; }
.empty { display: none; min-height: 240px; border: 1px solid var(--line); border-radius: 8px; background: #fff; place-items: center; color: var(--muted); text-align: center; }
.empty.show { display: grid; }
.flow-step, .scene { min-height: 116px; padding: 16px; }
.flow-step strong { display: block; color: var(--orange); font-size: 24px; }
.flow-step span, .scene span { display: block; margin-top: 10px; font-weight: 900; }
.scene p, .flow-step p { margin: 8px 0 0; color: var(--muted); line-height: 1.55; font-size: 13px; }
.contact { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 420px); gap: 22px; align-items: stretch; border-radius: 8px; padding: clamp(24px, 5vw, 46px); color: #fff; background: var(--navy); }
.contact h2 { margin: 0 0 12px; font-size: clamp(30px, 4vw, 52px); letter-spacing: 0; }
.contact p { max-width: 720px; color: rgba(255,255,255,.78); line-height: 1.8; }
.contact-card { border-radius: 8px; padding: 18px; color: var(--ink); background: #fffaf2; }
.contact-line { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.contact-line:last-child { border-bottom: 0; }
.contact-line strong { text-align: right; overflow-wrap: anywhere; }
.contact-edit { display: grid; gap: 10px; margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.contact-edit h3 { margin: 0; font-size: 20px; }
.contact-edit label { display: grid; gap: 6px; font-size: 13px; font-weight: 850; }
.contact-edit input { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.drawer { position: fixed; inset: 0; z-index: 100; display: none; background: rgba(24, 50, 71, .52); }
.drawer.show { display: block; }
.drawer-panel { position: absolute; right: 0; top: 0; display: grid; grid-template-rows: auto minmax(0, 1fr); width: min(940px, 100%); height: 100%; background: #fffaf2; box-shadow: -22px 0 54px rgba(0,0,0,.18); }
.drawer-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.drawer-body { overflow: auto; padding: 18px; }
.icon-btn { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 8px; color: var(--brown); background: #eadfce; font-size: 22px; font-weight: 900; }
.detail-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(300px, 1fr); gap: 18px; }
.image-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.image-box { overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.image-box.featured { grid-column: 1 / -1; }
.image-box img { display: block; width: 100%; aspect-ratio: 1 / 1; object-fit: contain; background: #f7efe4; image-rendering: auto; }
.image-box.featured img { aspect-ratio: 4 / 3; max-height: 620px; }
.image-box span { display: block; padding: 10px 12px; color: var(--brown); font-size: 13px; font-weight: 950; }
.detail-card { border: 1px solid var(--line); border-radius: 8px; padding: 18px; background: #fff; }
.detail-card h2 { margin: 10px 0; color: var(--brown); font-size: clamp(28px, 4vw, 44px); letter-spacing: 0; }
.spec-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.spec { min-height: 78px; border: 1px solid var(--line); border-radius: 8px; padding: 12px; background: #fffaf2; }
.spec span { display: block; color: var(--muted); font-size: 12px; font-weight: 850; }
.spec strong { display: block; margin-top: 6px; overflow-wrap: anywhere; line-height: 1.45; }
.consult-box { display: none; margin-top: 14px; border: 1px solid var(--line); border-radius: 8px; padding: 14px; background: #fff7e8; }
.consult-box.show { display: grid; gap: 10px; }
.consult-box textarea { width: 100%; min-height: 96px; border: 1px solid var(--line); border-radius: 8px; padding: 10px; resize: vertical; }
.consult-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.consult-actions .btn { flex: 1 1 150px; }
.notice { border-left: 3px solid var(--orange); padding: 10px 12px; color: #5d5147; background: #fff7e8; line-height: 1.65; }
.adminbar {
  position: sticky;
  top: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px clamp(14px, 4vw, 44px);
  color: #fff;
  background: var(--navy);
  font-size: 13px;
}
.adminbar .actions { justify-content: flex-end; }
.admin-mode .site-header { top: 50px; }
.card-edit-btn {
  position: absolute;
  right: 10px;
  bottom: 10px;
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-radius: 999px;
  padding: 0 10px;
  color: #fff;
  background: rgba(217, 119, 6, .94);
  font-size: 12px;
  font-weight: 950;
}
.visual-admin-panel {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(64,44,28,.07);
}
.category-list { display: flex; flex-wrap: wrap; gap: 8px; }
.image-edit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.image-upload-box {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fffaf2;
}
.image-upload-box img {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 7px;
  object-fit: contain;
  background: #f7efe4;
}
.image-upload-box input {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 7px;
  background: #fff;
}
.admin-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 18px; padding: 24px clamp(16px, 5vw, 56px); }
.admin-side { display: grid; gap: 12px; align-content: start; }
.admin-main { display: grid; gap: 18px; }
.form { display: grid; gap: 10px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.form label { display: grid; gap: 5px; color: var(--muted); font-size: 12px; font-weight: 850; }
.form textarea { min-height: 82px; resize: vertical; }
.table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.table th, .table td { border-bottom: 1px solid var(--line); padding: 10px; text-align: left; vertical-align: middle; }
.table th { color: var(--brown); background: #fff7e8; font-size: 13px; }
.thumb { width: 74px; height: 74px; object-fit: contain; border-radius: 8px; background: #f7efe4; }
.login-page { display: grid; min-height: 100vh; place-items: center; padding: 20px; background: linear-gradient(180deg, #fffaf2 0%, #f4eadc 100%); }
.login-card { width: min(420px, 100%); border: 1px solid var(--line); border-radius: 8px; padding: 24px; background: #fff; box-shadow: var(--shadow); }
.hidden { display: none !important; }
@media (max-width: 1120px) {
  .product-grid, .case-grid, .series-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .flow-grid, .scene-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .catalog-tools { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-layout { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .site-header, .hero, .entry-grid, .contact, .detail-grid { grid-template-columns: 1fr; }
  .nav { justify-content: flex-start; overflow-x: auto; padding-bottom: 4px; }
  .hero-main img { min-height: 360px; }
  .entry { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .header-actions, .product-grid, .case-grid, .series-grid, .flow-grid, .scene-grid, .catalog-tools, .form-grid, .spec-grid, .image-pair { grid-template-columns: 1fr; }
  .section-head { display: grid; }
  h1 { font-size: 44px; }
}
