:root {
  --bg: #f7f8fa;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --brand: #b91c1c;
  --brand-dark: #7f1d1d;
  --ok: #166534;
  --border: #e5e7eb;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--bg);
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 16px;
}

.topbar {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-weight: 700;
  color: var(--brand);
  white-space: nowrap;
  font-size: 18px;
}

.logo img {
  height: 32px;
  vertical-align: middle;
}

.nav {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.nav a {
  color: var(--muted);
  font-size: 15px;
  white-space: nowrap;
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--bg);
  transition: all .15s;
}

.nav a:hover {
  background: #fee2e2;
  color: var(--brand);
}

.nav a.active {
  background: var(--brand);
  color: #fff;
}

.hero {
  background: linear-gradient(120deg, #7f1d1d, #b91c1c);
  color: #fff;
  border-radius: 12px;
  padding: 32px 20px;
  margin: 16px 0;
  background-size: cover;
  background-position: center;
}

.content-block {
  margin: 16px 0;
}

.content-block .cb-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}

.content-block .cb-body .cb-text {
  white-space: pre-line;
}

.content-block .cb-body img {
  width: 100%;
  border-radius: 8px;
  max-height: 280px;
  object-fit: cover;
}

.content-block .cb-body video {
  width: 100%;
  border-radius: 8px;
  max-height: 280px;
}

.embed-responsive {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: 8px;
}

.embed-responsive iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.product-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.product-gallery img,
.product-gallery video {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
}

@media (max-width: 600px) {
  .content-block .cb-body {
    grid-template-columns: 1fr;
  }
}

.hero h1 {
  margin: 0 0 10px;
}

.muted {
  color: var(--muted);
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 14px;
}

.btn {
  border: none;
  background: var(--brand);
  color: #fff;
  border-radius: 8px;
  padding: 10px 14px;
  cursor: pointer;
}

.btn.secondary {
  background: #374151;
}

.btn.light {
  background: #fff;
  color: var(--brand-dark);
  border: 1px solid #fecaca;
}

.row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  font-size: 14px;
  background: #fff;
}

textarea {
  min-height: 90px;
  resize: vertical;
}

.two-col {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 16px;
}

.timeline {
  border-left: 3px solid #fca5a5;
  margin-left: 10px;
  padding-left: 14px;
}

.timeline-item {
  position: relative;
  margin-bottom: 14px;
}

.timeline-item::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--brand);
  position: absolute;
  left: -21px;
  top: 5px;
}

.tag-ok {
  color: #fff;
  background: var(--ok);
  border-radius: 999px;
  font-size: 12px;
  padding: 2px 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  border-bottom: 1px solid var(--border);
  text-align: left;
  padding: 8px 6px;
  vertical-align: top;
}

.admin-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 14px;
}

.admin-menu a {
  display: block;
  padding: 10px;
  border-radius: 8px;
  color: var(--muted);
}

.admin-menu a.active,
.admin-menu a:hover {
  background: #fee2e2;
  color: var(--brand-dark);
}

.hide {
  display: none;
}

.footer {
  margin-top: 20px;
  padding: 20px 0 30px;
  color: var(--muted);
  font-size: 13px;
}

.bottom-nav {
  display: none;
}

@media (max-width: 860px) {
  .two-col,
  .admin-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .topbar .container {
    justify-content: center;
    padding: 10px 12px;
  }
  .topbar .nav {
    display: none;
  }
  .logo {
    font-size: 17px;
    text-align: center;
  }
  body {
    padding-bottom: 72px;
  }
  .bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--card);
    border-top: 1px solid var(--border);
    padding: 6px 0;
    padding-bottom: max(6px, env(safe-area-inset-bottom));
    box-shadow: 0 -2px 10px rgba(0,0,0,0.06);
  }
  .bottom-nav a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 4px;
    font-size: 14px;
    color: var(--muted);
    text-decoration: none;
    transition: color .15s;
  }
  .bottom-nav a .bnav-icon {
    font-size: 22px;
    line-height: 1;
  }
  .bottom-nav a .bnav-label {
    font-size: 12px;
  }
  .bottom-nav a.active {
    color: var(--brand);
  }
  .bottom-nav a.active .bnav-icon {
    transform: scale(1.1);
  }
  .hero {
    padding: 20px 14px;
  }
  .hero h1 {
    font-size: 20px;
  }
  .container {
    padding: 10px;
  }
  .footer {
    padding-bottom: 10px;
  }
}
