/* ===== 墨此导航 · 设计系统 ===== */
:root {
  --brand: #4f46e5;
  --brand-dark: #4338ca;
  --brand-soft: #eef2ff;
  --brand-2: #0ea5e9;
  --ink: #1f2937;
  --ink-2: #4b5563;
  --muted: #6b7280;
  --line: #e5e7eb;
  --bg: #f7f8fb;
  --card: #ffffff;
  --ok: #16a34a;
  --warn: #d97706;
  --shadow-sm: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.08);
  --shadow-md: 0 4px 12px rgba(16,24,40,.08), 0 2px 4px rgba(16,24,40,.06);
  --shadow-lg: 0 12px 32px rgba(16,24,40,.12);
  --radius: 14px;
  --radius-sm: 10px;
  --maxw: 1200px;
  --header-h: 64px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", 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;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.hidden { display: none !important; }

/* ===== Header ===== */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.82);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header .bar {
  height: var(--header-h);
  display: flex; align-items: center; gap: 18px;
}
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 19px; color: var(--ink); }
.logo .mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff; display: grid; place-items: center; font-size: 18px;
  box-shadow: var(--shadow-sm);
}
.logo small { font-weight: 500; color: var(--muted); font-size: 12px; }
.nav-links { display: flex; gap: 4px; margin-left: 8px; }
.nav-links a {
  padding: 8px 14px; border-radius: 999px; font-size: 14px; color: var(--ink-2); font-weight: 600;
  transition: .15s;
}
.nav-links a:hover, .nav-links a.active { background: var(--brand-soft); color: var(--brand); }
.header-search {
  margin-left: auto; position: relative;
}
.header-search input {
  width: 240px; max-width: 38vw; height: 38px; padding: 0 14px 0 38px;
  border: 1px solid var(--line); border-radius: 999px; background: #fff; font-size: 14px; outline: none;
  transition: .15s;
}
.header-search input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.header-search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.cart-btn {
  position: relative; width: 38px; height: 38px; border-radius: 999px; border: 1px solid var(--line);
  background: #fff; display: grid; place-items: center; cursor: pointer; transition: .15s;
}
.cart-btn:hover { border-color: var(--brand); color: var(--brand); }
.cart-count {
  position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px;
  background: #ef4444; color: #fff; border-radius: 999px; font-size: 11px; font-weight: 700;
  display: grid; place-items: center;
}

/* ===== Hero ===== */
.hero { padding: 54px 0 30px; text-align: center; }
.hero h1 { font-size: 38px; margin: 0 0 12px; letter-spacing: -.5px; }
.hero h1 .accent {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p { color: var(--muted); font-size: 16px; max-width: 620px; margin: 0 auto 22px; }
.hero-search {
  max-width: 560px; margin: 0 auto; position: relative;
}
.hero-search input {
  width: 100%; height: 52px; padding: 0 20px; font-size: 16px;
  border: 1px solid var(--line); border-radius: 999px; outline: none; box-shadow: var(--shadow-sm);
}
.hero-search input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.hero-tag { margin-top: 18px; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.hero-tag span {
  font-size: 13px; color: var(--ink-2); background: #fff; border: 1px solid var(--line);
  padding: 5px 12px; border-radius: 999px;
}

/* ===== Category nav (anchor chips) ===== */
.cat-nav { display: flex; gap: 8px; flex-wrap: wrap; padding: 14px 0 4px; }
.cat-nav a {
  font-size: 13px; font-weight: 600; color: var(--ink-2); background: #fff;
  border: 1px solid var(--line); padding: 6px 14px; border-radius: 999px; transition: .15s;
}
.cat-nav a:hover { border-color: var(--brand); color: var(--brand); }

/* ===== Section / Category block ===== */
.section { padding: 26px 0; }
.cat-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.cat-head .ico {
  width: 38px; height: 38px; border-radius: 10px; background: var(--brand-soft); color: var(--brand);
  display: grid; place-items: center; font-size: 20px;
}
.cat-head h2 { font-size: 20px; margin: 0; }
.cat-head .more { margin-left: auto; font-size: 13px; color: var(--brand); font-weight: 600; }
.cat-head .more:hover { text-decoration: underline; }

.grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}
.link-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 14px; transition: .15s; display: flex; flex-direction: column; gap: 4px;
}
.link-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: #d9def7; }
.link-card .name { font-weight: 700; font-size: 15px; }
.link-card .desc { font-size: 12.5px; color: var(--muted); line-height: 1.5; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 18px; border-radius: 999px; font-weight: 700; font-size: 14px; cursor: pointer;
  border: 1px solid transparent; transition: .15s; font-family: inherit;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-ghost { background: #fff; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn-block { width: 100%; }

/* ===== Store ===== */
.store-hero { padding: 44px 0 22px; text-align: center; }
.store-hero h1 { font-size: 32px; margin: 0 0 8px; }
.store-hero p { color: var(--muted); margin: 0; }
.store-feats { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; margin: 22px 0 6px; }
.store-feats .feat { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink-2); }
.store-feats .feat .dot { width: 22px; height: 22px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-size: 12px; }

.product-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.product-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column; transition: .15s;
}
.product-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.product-thumb {
  height: 132px; display: grid; place-items: center; font-size: 40px; color: #fff; position: relative;
}
.product-thumb .tag {
  position: absolute; top: 10px; left: 10px; background: rgba(0,0,0,.28); color: #fff;
  font-size: 11px; padding: 3px 9px; border-radius: 999px; backdrop-filter: blur(4px);
}
.product-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.product-body h3 { font-size: 16px; margin: 0; }
.product-body .summary { font-size: 13px; color: var(--muted); flex: 1; }
.product-foot { display: flex; align-items: center; justify-content: space-between; }
.price { color: #ef4444; font-weight: 800; font-size: 19px; }
.price small { font-size: 12px; font-weight: 600; }
.price .ori { color: var(--muted); text-decoration: line-through; font-weight: 500; font-size: 12px; margin-left: 6px; }
.delivery-pill { font-size: 11px; padding: 3px 9px; border-radius: 999px; font-weight: 600; }
.delivery-pill.auto { background: #dcfce7; color: #15803d; }
.delivery-pill.manual { background: #fef3c7; color: #b45309; }

/* ===== Product detail modal ===== */
.modal-mask {
  position: fixed; inset: 0; background: rgba(15,23,42,.5); z-index: 100;
  display: grid; place-items: center; padding: 20px;
}
.modal {
  background: #fff; border-radius: 18px; max-width: 560px; width: 100%; max-height: 88vh; overflow: auto;
  box-shadow: var(--shadow-lg);
}
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; }
.modal-head h3 { margin: 0; font-size: 18px; }
.modal-close { border: none; background: var(--bg); width: 32px; height: 32px; border-radius: 50%; cursor: pointer; font-size: 18px; color: var(--ink-2); }
.modal-body { padding: 20px; }
.modal-body .thumb { height: 150px; border-radius: 12px; display: grid; place-items: center; font-size: 52px; color: #fff; margin-bottom: 14px; }
.steps { list-style: none; padding: 0; margin: 14px 0 0; counter-reset: s; }
.steps li { position: relative; padding: 0 0 14px 38px; counter-increment: s; color: var(--ink-2); font-size: 14px; }
.steps li::before {
  content: counter(s); position: absolute; left: 0; top: 0; width: 26px; height: 26px; border-radius: 50%;
  background: var(--brand); color: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 700;
}
.steps li::after { content: ""; position: absolute; left: 12px; top: 28px; bottom: 4px; width: 2px; background: var(--line); }
.steps li:last-child::after { display: none; }

/* ===== Cart drawer ===== */
.drawer-mask { position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 90; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 380px; max-width: 92vw; background: #fff; z-index: 91;
  display: flex; flex-direction: column; box-shadow: var(--shadow-lg);
}
.drawer-head { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.drawer-head h3 { margin: 0; font-size: 17px; }
.drawer-body { flex: 1; overflow: auto; padding: 14px 20px; }
.cart-item { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.cart-item .ci-thumb { width: 46px; height: 46px; border-radius: 8px; display: grid; place-items: center; color: #fff; font-size: 20px; flex-shrink: 0; }
.cart-item .ci-info { flex: 1; min-width: 0; }
.cart-item .ci-info .t { font-weight: 600; font-size: 14px; }
.cart-item .ci-info .p { color: #ef4444; font-weight: 700; font-size: 13px; }
.qty { display: inline-flex; align-items: center; gap: 8px; margin-top: 4px; }
.qty button { width: 22px; height: 22px; border-radius: 6px; border: 1px solid var(--line); background: #fff; cursor: pointer; }
.qty span { min-width: 18px; text-align: center; font-size: 13px; }
.ci-remove { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 12px; }
.drawer-foot { padding: 16px 20px; border-top: 1px solid var(--line); }
.drawer-foot .total { display: flex; justify-content: space-between; font-weight: 700; margin-bottom: 12px; }
.drawer-empty { color: var(--muted); text-align: center; padding: 40px 0; }

/* ===== Checkout / order ===== */
.checkout-form { display: flex; flex-direction: column; gap: 14px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--ink-2); }
.field input, .field textarea {
  width: 100%; padding: 11px 14px; border: 1px solid var(--line); border-radius: 10px; font-size: 14px;
  font-family: inherit; outline: none;
}
.field input:focus, .field textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.pay-box { border: 1px dashed var(--brand); border-radius: 12px; padding: 16px; text-align: center; background: var(--brand-soft); }
.qr {
  width: 150px; height: 150px; margin: 10px auto; border-radius: 12px; background: #fff; padding: 10px;
  display: grid; place-items: center;
}
.order-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.order-status { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; padding: 5px 12px; border-radius: 999px; }
.order-status.paid { background: #dcfce7; color: #15803d; }
.order-status.pending { background: #fef3c7; color: #b45309; }
.order-status.delivered { background: #dbeafe; color: #1d4ed8; }

/* ===== Blog ===== */
.blog-head { padding: 40px 0 14px; }
.blog-head h1 { font-size: 32px; margin: 0 0 6px; }
.blog-head p { color: var(--muted); margin: 0; }
.blog-filters { display: flex; gap: 8px; flex-wrap: wrap; padding: 14px 0; }
.blog-filters button {
  font-size: 13px; font-weight: 600; color: var(--ink-2); background: #fff; border: 1px solid var(--line);
  padding: 7px 15px; border-radius: 999px; cursor: pointer; transition: .15s; font-family: inherit;
}
.blog-filters button:hover { border-color: var(--brand); color: var(--brand); }
.blog-filters button.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.blog-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.post-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: .15s; display: flex; flex-direction: column; }
.post-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.post-cover { height: 160px; display: grid; place-items: center; color: #fff; font-size: 44px; position: relative; }
.post-cover .badge {
  position: absolute; top: 10px; left: 10px; font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 999px;
  background: rgba(0,0,0,.3); color: #fff; backdrop-filter: blur(4px);
}
.post-cover .badge.rec { background: linear-gradient(135deg, #f59e0b, #ef4444); }
.post-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.post-cat { font-size: 12px; color: var(--brand); font-weight: 700; }
.post-body h3 { font-size: 16px; margin: 0; line-height: 1.45; }
.post-body .excerpt { font-size: 13px; color: var(--muted); flex: 1; }
.post-meta { font-size: 12px; color: var(--muted); display: flex; gap: 12px; }

/* article */
.article { max-width: 760px; margin: 0 auto; padding: 36px 20px 60px; }
.article .crumb { font-size: 13px; color: var(--muted); margin-bottom: 16px; }
.article .crumb a:hover { color: var(--brand); }
.article h1 { font-size: 30px; line-height: 1.3; margin: 0 0 12px; }
.article .meta { color: var(--muted); font-size: 13px; margin-bottom: 22px; display: flex; gap: 14px; }
.article .cover { height: 220px; border-radius: 14px; display: grid; place-items: center; color: #fff; font-size: 64px; margin-bottom: 24px; }
.article .content { font-size: 16px; color: var(--ink-2); }
.article .content h2 { font-size: 21px; color: var(--ink); margin: 26px 0 10px; }
.article .content p { margin: 0 0 14px; }

/* ===== Footer ===== */
.site-footer { border-top: 1px solid var(--line); background: #fff; margin-top: 40px; }
.site-footer .inner { padding: 30px 0; display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-between; }
.site-footer .col h4 { font-size: 14px; margin: 0 0 10px; }
.site-footer .col a { display: block; font-size: 13px; color: var(--muted); padding: 3px 0; }
.site-footer .col a:hover { color: var(--brand); }
.footer-bottom { border-top: 1px solid var(--line); padding: 16px 0; text-align: center; color: var(--muted); font-size: 12.5px; }

/* ===== Toast ===== */
.toast {
  position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fff; padding: 11px 20px; border-radius: 999px; font-size: 14px;
  opacity: 0; pointer-events: none; transition: .25s; z-index: 200; box-shadow: var(--shadow-lg);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===== Responsive ===== */
@media (max-width: 720px) {
  .nav-links { display: none; }
  .header-search input { width: 150px; }
  .hero h1 { font-size: 28px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}
