:root {
  --primary: #1a56db;
  --primary-dark: #1340a8;
  --accent: #0ea5e9;
  --text: #1f2937;
  --text-light: #6b7280;
  --bg: #ffffff;
  --bg-alt: #f3f6fb;
  --border: #e5e7eb;
  --radius: 12px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  --font: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: var(--font); color: var(--text); background: var(--bg); line-height: 1.7; }
img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ===== Header ===== */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 700; color: var(--primary); }
.brand img { height: 38px; width: auto; }
.nav { display: flex; gap: 8px; }
.nav a { padding: 8px 16px; border-radius: 8px; font-size: 15px; color: var(--text); transition: all .2s; }
.nav a:hover { color: var(--primary); background: var(--bg-alt); }
.nav a.active { color: var(--primary); font-weight: 600; }
.menu-toggle { display: none; background: none; border: none; font-size: 24px; cursor: pointer; color: var(--text); }

/* ===== Hero ===== */
.hero {
  position: relative; min-height: 520px;
  display: flex; align-items: center;
  color: #fff; text-align: center;
  background: linear-gradient(135deg, #1e3a8a 0%, #1a56db 60%, #0ea5e9 100%);
  overflow: hidden;
}
.hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .35; }
.hero-content { position: relative; z-index: 1; width: 100%; padding: 80px 24px; }
.hero h1 { font-size: clamp(30px, 5vw, 52px); font-weight: 800; margin-bottom: 18px; text-shadow: 0 2px 12px rgba(0,0,0,.3); }
.hero p { font-size: clamp(16px, 2vw, 20px); opacity: .92; max-width: 720px; margin: 0 auto 32px; }
.btn {
  display: inline-block; padding: 13px 34px; border-radius: 999px;
  background: #fff; color: var(--primary); font-weight: 600; font-size: 16px;
  transition: transform .2s, box-shadow .2s; border: none; cursor: pointer;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,.2); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }

/* ===== Sections ===== */
.section { padding: 88px 0; }
.section.alt { background: var(--bg-alt); }
.section-title { text-align: center; margin-bottom: 14px; font-size: clamp(26px, 3.5vw, 36px); font-weight: 700; }
.section-subtitle { text-align: center; color: var(--text-light); max-width: 640px; margin: 0 auto 56px; font-size: 16px; }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.split img { border-radius: var(--radius); box-shadow: var(--shadow); width: 100%; object-fit: cover; }
.split h2 { font-size: clamp(24px, 3vw, 32px); margin-bottom: 18px; }
.split p { color: var(--text-light); margin-bottom: 14px; white-space: pre-line; }

/* ===== Feature / Product cards ===== */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 28px; }
.card {
  background: #fff; border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); transition: transform .25s, box-shadow .25s;
  display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-6px); box-shadow: 0 12px 32px rgba(0,0,0,.12); }
.card img { width: 100%; height: 210px; object-fit: cover; }
.card-body { padding: 24px; flex: 1; display: flex; flex-direction: column; }
.card-body h3 { font-size: 19px; margin-bottom: 10px; }
.card-body p { color: var(--text-light); font-size: 15px; flex: 1; white-space: pre-line; }
.card-price { color: var(--primary); font-weight: 700; font-size: 18px; margin-top: 14px; }
.card-icon { font-size: 34px; margin-bottom: 14px; }

/* ===== Contact ===== */
.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; }
.contact-item {
  background: #fff; border-radius: var(--radius); padding: 32px 24px;
  text-align: center; box-shadow: var(--shadow);
}
.contact-item .ico { font-size: 30px; margin-bottom: 12px; }
.contact-item h3 { font-size: 16px; margin-bottom: 6px; }
.contact-item p { color: var(--text-light); font-size: 15px; word-break: break-all; }

/* ===== Footer ===== */
.site-footer { background: #111827; color: #9ca3af; padding: 48px 0 28px; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 32px; justify-content: space-between; margin-bottom: 32px; }
.footer-brand { font-size: 20px; font-weight: 700; color: #fff; margin-bottom: 10px; }
.footer-col h4 { color: #fff; font-size: 15px; margin-bottom: 12px; }
.footer-col a, .footer-col p { display: block; color: #9ca3af; font-size: 14px; margin-bottom: 8px; }
.footer-col a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid #374151; padding-top: 22px; text-align: center; font-size: 13px; }

/* ===== Admin ===== */
.admin-body { background: #f1f5f9; min-height: 100vh; }
.login-box {
  max-width: 380px; margin: 12vh auto 0; background: #fff; padding: 40px;
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.login-box h1 { font-size: 22px; text-align: center; margin-bottom: 24px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.field input[type=text], .field input[type=password], .field input[type=email], .field textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 14px; font-family: var(--font); transition: border-color .2s;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--primary); }
.field textarea { min-height: 90px; resize: vertical; }
.admin-header {
  background: #fff; border-bottom: 1px solid var(--border); padding: 14px 0;
  position: sticky; top: 0; z-index: 50;
}
.admin-header .container { display: flex; align-items: center; justify-content: space-between; }
.admin-header h1 { font-size: 18px; }
.admin-header .actions { display: flex; gap: 10px; }
.btn-sm { padding: 8px 18px; font-size: 14px; }
.admin-main { padding: 32px 0 120px; }
.panel { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 24px; overflow: hidden; }
.panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px; cursor: pointer; user-select: none; border-bottom: 1px solid transparent;
}
.panel-header h2 { font-size: 17px; }
.panel-header .arrow { transition: transform .2s; color: var(--text-light); }
.panel.open .panel-header { border-bottom-color: var(--border); }
.panel.open .panel-header .arrow { transform: rotate(180deg); }
.panel-body { display: none; padding: 24px; }
.panel.open .panel-body { display: block; }
.img-field { display: flex; gap: 16px; align-items: flex-start; }
.img-field .preview {
  width: 180px; height: 110px; object-fit: cover; border-radius: 8px;
  border: 1px solid var(--border); background: var(--bg-alt); flex-shrink: 0;
}
.img-field .controls { flex: 1; }
.item-card { border: 1px solid var(--border); border-radius: 10px; padding: 18px; margin-bottom: 16px; position: relative; }
.item-card .del { position: absolute; top: 12px; right: 12px; background: #fee2e2; color: #dc2626; border: none; border-radius: 6px; padding: 4px 10px; font-size: 13px; cursor: pointer; }
.item-card .del:hover { background: #fecaca; }
.add-btn { width: 100%; padding: 12px; border: 2px dashed var(--border); background: none; border-radius: 10px; color: var(--text-light); font-size: 15px; cursor: pointer; }
.add-btn:hover { border-color: var(--primary); color: var(--primary); }
.toast {
  position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: #111827; color: #fff; padding: 12px 26px; border-radius: 999px;
  opacity: 0; transition: all .3s; z-index: 999; font-size: 14px; pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { background: #dc2626; }
.save-bar {
  position: fixed; bottom: 0; left: 0; right: 0; background: #fff;
  border-top: 1px solid var(--border); padding: 14px 0; z-index: 60;
  box-shadow: 0 -4px 16px rgba(0,0,0,.06);
}
.save-bar .container { display: flex; justify-content: flex-end; gap: 12px; align-items: center; }
.save-hint { color: var(--text-light); font-size: 13px; margin-right: auto; }
.btn-outline { background: #fff; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); box-shadow: none; transform: none; }
.hidden { display: none !important; }

/* ===== Responsive ===== */
@media (max-width: 820px) {
  .split { grid-template-columns: 1fr; gap: 32px; }
  .nav { display: none; position: absolute; top: 68px; left: 0; right: 0; background: #fff; flex-direction: column; padding: 12px; border-bottom: 1px solid var(--border); }
  .nav.open { display: flex; }
  .menu-toggle { display: block; }
  .section { padding: 56px 0; }
  .hero { min-height: 420px; }
}
