/* mfree — brand design system
   Deep ink-green + charcoal, orange accent. System sans (incl. CJK). */

:root {
  --c-forest: #0f3d2e;
  --c-forest-dark: #0a2a20;
  --c-forest-deep: #061a13;
  --c-forest-light: #1a5a44;
  --c-forest-mist: #2c6b52;
  --c-charcoal: #1a1a1a;
  --c-ink: #232323;
  --c-muted: #6b6b6b;
  --c-line: #e3ddd0;
  --c-cream: #f7f4ee;
  --c-paper: #ffffff;
  --c-mist: #ece7dc;
  --c-accent: #e8772e;
  --c-accent-dark: #c85e1a;
  --c-accent-soft: #fbe9da;

  --radius-sm: 4px;
  --radius: 8px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(15, 61, 46, .06), 0 1px 3px rgba(15, 61, 46, .08);
  --shadow: 0 6px 22px rgba(15, 61, 46, .10);
  --shadow-lg: 0 18px 50px rgba(6, 26, 19, .28);

  --container: 1200px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--c-ink);
  background: var(--c-paper);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.2; font-weight: 700; letter-spacing: -.01em; }
p { margin: 0 0 1em; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.section { padding: 88px 0; }
.section-tight { padding: 56px 0; }
.eyebrow {
  display: inline-block; font-size: 12px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--c-accent); font-weight: 600; margin-bottom: 14px;
}
.section-title { font-size: clamp(26px, 3.4vw, 40px); color: var(--c-forest-deep); }
.section-sub { color: var(--c-muted); max-width: 620px; font-size: 16px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  padding: 12px 22px; border-radius: var(--radius-sm); border: 1px solid transparent;
  font-size: 14px; font-weight: 600; letter-spacing: .02em; transition: all .2s ease;
  background: var(--c-accent); color: #fff; white-space: nowrap;
}
.btn:hover { background: var(--c-accent-dark); transform: translateY(-1px); box-shadow: 0 6px 16px rgba(232, 119, 46, .35); }
.btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.55); }
.btn-ghost:hover { background: #fff; color: var(--c-forest-deep); box-shadow: none; }
.btn-outline { background: transparent; color: var(--c-forest); border-color: var(--c-forest); }
.btn-outline:hover { background: var(--c-forest); color: #fff; box-shadow: none; }
.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

/* ---------- header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.92); backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--c-line);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 70px; }
.brand { display: flex; align-items: baseline; gap: 6px; }
.brand .wordmark { font-size: 24px; font-weight: 800; letter-spacing: .04em; color: var(--c-forest-deep); }
.brand .tm { font-size: 11px; color: var(--c-accent); font-weight: 700; letter-spacing: .18em; text-transform: uppercase; }
.nav-links { display: flex; align-items: center; gap: 30px; }
.nav-links a { font-size: 14px; font-weight: 500; color: var(--c-ink); position: relative; transition: color .2s; }
.nav-links a:hover { color: var(--c-accent); }
.nav-links a.active { color: var(--c-accent); }
.nav-links a.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -8px; height: 2px; background: var(--c-accent); border-radius: 2px; }
.nav-right { display: flex; align-items: center; gap: 14px; }
.lang-switch { display: inline-flex; border: 1px solid var(--c-line); border-radius: 999px; overflow: hidden; }
.lang-switch button { background: #fff; border: 0; padding: 5px 12px; font-size: 12px; font-weight: 600; color: var(--c-muted); }
.lang-switch button.on { background: var(--c-forest); color: #fff; }
.nav-toggle { display: none; background: none; border: 0; font-size: 22px; color: var(--c-forest-deep); }

/* ---------- hero ---------- */
.hero {
  position: relative; min-height: 88vh; display: flex; align-items: center;
  color: #fff; overflow: hidden; background: var(--c-forest-deep);
}
.hero-bg { position: absolute; inset: 0; background-size: cover; background-position: center; }
.hero-overlay { position: absolute; inset: 0; background: linear-gradient(100deg, rgba(6,26,19,.92) 0%, rgba(6,26,19,.62) 42%, rgba(6,26,19,.18) 100%); }
.hero-inner { position: relative; z-index: 2; max-width: 620px; padding: 120px 0 100px; }
.hero .eyebrow { color: var(--c-accent); }
.hero h1 { font-size: clamp(34px, 5.6vw, 64px); font-weight: 800; letter-spacing: -.02em; margin-bottom: 18px; }
.hero p { font-size: clamp(15px, 1.6vw, 19px); color: rgba(255,255,255,.86); max-width: 520px; margin-bottom: 32px; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 36px; margin-top: 54px; flex-wrap: wrap; }
.hero-stats .stat b { display: block; font-size: 28px; color: var(--c-accent); font-weight: 800; }
.hero-stats .stat span { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: rgba(255,255,255,.7); }

/* ---------- feature strip ---------- */
.feature-strip { background: var(--c-cream); border-bottom: 1px solid var(--c-line); }
.feature-strip .grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; padding: 34px 0; }
.feature-strip .item { display: flex; align-items: center; gap: 12px; }
.feature-strip .item .ic { width: 40px; height: 40px; border-radius: 50%; background: var(--c-forest); color: var(--c-accent); display: grid; place-items: center; font-size: 18px; flex-shrink: 0; }
.feature-strip .item b { display: block; font-size: 14px; color: var(--c-forest-deep); }
.feature-strip .item span { font-size: 12px; color: var(--c-muted); }

/* ---------- categories ---------- */
.cat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-top: 40px; }
.cat-card {
  position: relative; border-radius: var(--radius); overflow: hidden; aspect-ratio: 4/5;
  background: var(--c-forest); color: #fff; cursor: pointer; transition: transform .3s, box-shadow .3s;
  box-shadow: var(--shadow-sm);
}
.cat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.cat-card .bg { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: .78; transition: transform .5s, opacity .3s; }
.cat-card:hover .bg { transform: scale(1.06); opacity: .92; }
.cat-card .shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(6,26,19,.1) 0%, rgba(6,26,19,.85) 100%); }
.cat-card .body { position: absolute; left: 0; right: 0; bottom: 0; padding: 22px; }
.cat-card .body .name { font-size: 20px; font-weight: 700; }
.cat-card .body .count { font-size: 12px; color: var(--c-accent); letter-spacing: .12em; text-transform: uppercase; margin-top: 4px; }

/* ---------- product grid / cards ---------- */
.product-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; margin-top: 40px; }
.product-card {
  background: var(--c-paper); border: 1px solid var(--c-line); border-radius: var(--radius);
  overflow: hidden; transition: transform .25s, box-shadow .25s, border-color .25s; display: flex; flex-direction: column;
}
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: transparent; }
.product-card .thumb { position: relative; aspect-ratio: 1/1; background: var(--c-mist); overflow: hidden; }
.product-card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.product-card:hover .thumb img { transform: scale(1.05); }
.product-card .badge { position: absolute; top: 12px; left: 12px; background: var(--c-accent); color: #fff; font-size: 11px; font-weight: 700; letter-spacing: .08em; padding: 4px 10px; border-radius: 999px; text-transform: uppercase; }
.product-card .body { padding: 18px 20px 22px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.product-card .cat { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--c-accent); font-weight: 600; }
.product-card .name { font-size: 17px; font-weight: 700; color: var(--c-forest-deep); }
.product-card .desc { font-size: 13px; color: var(--c-muted); flex: 1; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-card .foot { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.product-card .price { font-size: 18px; font-weight: 800; color: var(--c-forest-deep); }
.product-card .price .cur { font-size: 12px; font-weight: 600; color: var(--c-muted); margin-right: 2px; }
.product-card .link { font-size: 13px; color: var(--c-accent); font-weight: 600; }

/* ---------- filters (products page) ---------- */
.filters { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 28px; }
.filters .search { flex: 1; min-width: 220px; position: relative; }
.filters .search input { width: 100%; padding: 11px 16px 11px 40px; border: 1px solid var(--c-line); border-radius: var(--radius-sm); font-size: 14px; background: var(--c-paper); }
.filters .search input:focus { outline: none; border-color: var(--c-accent); }
.filters .search .ic { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--c-muted); }
.chip-group { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { padding: 8px 16px; border: 1px solid var(--c-line); border-radius: 999px; background: #fff; font-size: 13px; font-weight: 500; color: var(--c-ink); transition: all .2s; }
.chip:hover { border-color: var(--c-accent); color: var(--c-accent); }
.chip.on { background: var(--c-forest); color: #fff; border-color: var(--c-forest); }
.pager { display: flex; justify-content: center; gap: 8px; margin-top: 48px; }
.empty { text-align: center; padding: 60px 20px; color: var(--c-muted); }
.empty .big { font-size: 40px; margin-bottom: 10px; }

/* ---------- product detail ---------- */
.detail { display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: start; }
.gallery .main { aspect-ratio: 1/1; border-radius: var(--radius); overflow: hidden; background: var(--c-mist); }
.gallery .main img { width: 100%; height: 100%; object-fit: cover; }
.gallery .thumbs { display: flex; gap: 10px; margin-top: 12px; }
.gallery .thumbs .t { width: 78px; height: 78px; border-radius: var(--radius-sm); overflow: hidden; border: 2px solid transparent; cursor: pointer; background: var(--c-mist); }
.gallery .thumbs .t.on { border-color: var(--c-accent); }
.gallery .thumbs .t img { width: 100%; height: 100%; object-fit: cover; }
.detail .meta .cat { color: var(--c-accent); font-size: 12px; letter-spacing: .16em; text-transform: uppercase; font-weight: 600; }
.detail .meta h1 { font-size: clamp(26px, 3.6vw, 38px); color: var(--c-forest-deep); margin: 10px 0 14px; }
.detail .meta .price { font-size: 30px; font-weight: 800; color: var(--c-accent); margin-bottom: 22px; }
.detail .meta .desc { color: #444; font-size: 15px; }
.detail .specs { margin-top: 28px; background: var(--c-cream); border-radius: var(--radius); padding: 20px 22px; }
.detail .specs h4 { font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--c-forest); margin-bottom: 10px; }
.detail .specs pre { margin: 0; white-space: pre-wrap; font-family: var(--font); font-size: 14px; color: var(--c-ink); line-height: 1.9; }
.breadcrumb { font-size: 13px; color: var(--c-muted); margin-bottom: 22px; }
.breadcrumb a:hover { color: var(--c-accent); }

/* ---------- about / CTA band ---------- */
.about-band { background: var(--c-forest-deep); color: #fff; }
.about-band .grid { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; }
.about-band .section-title { color: #fff; }
.about-band .section-sub { color: rgba(255,255,255,.74); }
.about-band .ic-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.about-band .ic-box { background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1); border-radius: var(--radius); padding: 20px; }
.about-band .ic-box b { display: block; color: var(--c-accent); font-size: 15px; margin-bottom: 5px; }
.about-band .ic-box span { font-size: 13px; color: rgba(255,255,255,.7); }

/* ---------- footer ---------- */
.site-footer { background: var(--c-forest-deep); color: rgba(255,255,255,.7); padding: 60px 0 28px; }
.site-footer .grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 40px; }
.site-footer .brand .wordmark { color: #fff; }
.site-footer .about { font-size: 13px; line-height: 1.8; max-width: 300px; }
.site-footer h5 { color: #fff; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; margin-bottom: 16px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 9px; font-size: 13px; }
.site-footer li a:hover { color: var(--c-accent); }
.site-footer .contact li { display: flex; gap: 8px; }
.site-footer .bottom { border-top: 1px solid rgba(255,255,255,.1); margin-top: 44px; padding-top: 20px; font-size: 12px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }

/* ---------- forms / admin ---------- */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--c-forest-deep); margin-bottom: 6px; }
.field input, .field textarea, .field select {
  width: 100%; padding: 10px 13px; border: 1px solid var(--c-line); border-radius: var(--radius-sm);
  font-size: 14px; font-family: inherit; background: #fff; color: var(--c-ink);
}
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--c-accent); }
.field textarea { min-height: 90px; resize: vertical; }
.field .row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; }
.check input { width: auto; }

.admin-shell { display: grid; grid-template-columns: 220px 1fr; min-height: calc(100vh - 70px); background: var(--c-cream); }
.admin-side { background: var(--c-forest-deep); color: rgba(255,255,255,.75); padding: 24px 0; }
.admin-side .tab { display: block; width: 100%; text-align: left; padding: 13px 24px; background: none; border: 0; color: inherit; font-size: 14px; font-weight: 500; border-left: 3px solid transparent; }
.admin-side .tab:hover { background: rgba(255,255,255,.05); color: #fff; }
.admin-side .tab.on { background: rgba(255,255,255,.08); color: #fff; border-left-color: var(--c-accent); }
.admin-main { padding: 28px 32px; }
.admin-main h2 { color: var(--c-forest-deep); font-size: 22px; margin-bottom: 18px; }
.admin-card { background: #fff; border: 1px solid var(--c-line); border-radius: var(--radius); padding: 22px; margin-bottom: 18px; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { text-align: left; padding: 11px 10px; border-bottom: 1px solid var(--c-line); }
.table th { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--c-muted); }
.table .actions { display: flex; gap: 8px; }
.icon-btn { background: none; border: 1px solid var(--c-line); border-radius: var(--radius-sm); padding: 5px 10px; font-size: 12px; color: var(--c-ink); }
.icon-btn:hover { border-color: var(--c-accent); color: var(--c-accent); }
.icon-btn.danger:hover { border-color: #c0392b; color: #c0392b; }
.tag { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.tag-green { background: #e4f4ec; color: #0f7a4a; }
.tag-gray { background: #eee; color: #777; }
.thumb-mini { width: 46px; height: 46px; border-radius: 4px; object-fit: cover; background: var(--c-mist); }
.login-wrap { max-width: 380px; margin: 8vh auto; }
.login-wrap .card { background: #fff; border: 1px solid var(--c-line); border-radius: var(--radius); padding: 32px; box-shadow: var(--shadow); }
.muted { color: var(--c-muted); }

/* ---------- toast / modal ---------- */
.toast { position: fixed; bottom: 26px; right: 26px; background: var(--c-forest-deep); color: #fff; padding: 13px 20px; border-radius: var(--radius-sm); font-size: 14px; box-shadow: var(--shadow-lg); z-index: 200; transform: translateY(20px); opacity: 0; transition: all .25s; max-width: 320px; }
.toast.show { transform: translateY(0); opacity: 1; }
.toast.error { background: #a33; }
.toast.ok { background: #1a7a4a; }
.modal-mask { position: fixed; inset: 0; background: rgba(6,26,19,.6); display: none; align-items: center; justify-content: center; z-index: 150; padding: 20px; }
.modal-mask.show { display: flex; }
.modal { background: #fff; border-radius: var(--radius); width: 100%; max-width: 560px; max-height: 90vh; overflow-y: auto; padding: 26px; }
.modal h3 { color: var(--c-forest-deep); margin-bottom: 14px; }
.modal .actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.spinner { display: inline-block; width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.center { text-align: center; }

/* ---------- responsive ---------- */
@media (max-width: 1024px) {
  .cat-grid { grid-template-columns: repeat(2, 1fr); }
  .product-grid { grid-template-columns: repeat(2, 1fr); }
  .feature-strip .grid { grid-template-columns: repeat(2, 1fr); }
  .site-footer .grid { grid-template-columns: 1fr 1fr; }
  .detail { grid-template-columns: 1fr; gap: 28px; }
  .about-band .grid { grid-template-columns: 1fr; gap: 32px; }
}
@media (max-width: 768px) {
  .section { padding: 60px 0; }
  .nav-links { display: none; position: absolute; top: 70px; left: 0; right: 0; background: #fff; flex-direction: column; gap: 0; border-bottom: 1px solid var(--c-line); padding: 8px 0; }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 13px 24px; border-bottom: 1px solid var(--c-mist); }
  .nav-links a.active::after { display: none; }
  .nav-toggle { display: block; }
  .hero { min-height: 78vh; }
  .hero-inner { padding: 80px 0 60px; }
  .hero-stats { gap: 22px; }
  .admin-shell { grid-template-columns: 1fr; }
  .admin-side { display: flex; overflow-x: auto; padding: 8px; }
  .admin-side .tab { white-space: nowrap; border-left: 0; border-bottom: 3px solid transparent; }
  .admin-side .tab.on { border-bottom-color: var(--c-accent); border-left-color: transparent; }
  .field .row { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .container { padding: 0 16px; }
  .product-grid { grid-template-columns: 1fr; }
  .cat-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .feature-strip .grid { grid-template-columns: 1fr 1fr; gap: 14px; }
  .site-footer .grid { grid-template-columns: 1fr; gap: 26px; }
  .gallery .thumbs .t { width: 60px; height: 60px; }
  .nav-right .btn { display: none; }
}
@media (max-width: 360px) {
  .brand .wordmark { font-size: 20px; }
  .hero h1 { font-size: 30px; }
  .cat-grid { grid-template-columns: 1fr; }
}
