:root {
  --accent: #d9ff43;
  --ink: #151714;
  --paper: #f3f1e9;
  --line: #d7d5cc;
  --muted: #6f736b;
  --admin-bg: #f4f5f2;
  --admin-panel: #fff;
  --admin-ink: #20221f;
  --admin-muted: #777c73;
  --admin-line: #e4e7e1;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; overflow-x: hidden; font-family: Inter, "Noto Sans SC", "Microsoft YaHei", sans-serif; color: var(--ink); }
body:has(.cart-drawer.open) { overflow: hidden; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
.hidden { display: none !important; }

/* Store */
.store-body { background: var(--paper); }
.announcement { padding: 9px 20px; color: #111; background: var(--accent); text-align: center; font-size: 12px; font-weight: 800; letter-spacing: .08em; }
.store-header { height: 84px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 0 4vw; border-bottom: 1px solid var(--line); }
.store-logo { color: var(--ink); font-size: 28px; font-weight: 950; letter-spacing: -.08em; text-decoration: none; }
.store-logo span { color: #71756e; font-size: 10px; vertical-align: top; margin-left: 4px; letter-spacing: 0; }
.store-header nav { display: flex; gap: 34px; }
.store-header nav a { color: var(--ink); text-decoration: none; font-size: 13px; font-weight: 700; }
.cart-toggle { justify-self: end; padding: 10px 0; border: 0; background: transparent; font-weight: 800; }
.cart-toggle span { display: inline-grid; place-items: center; min-width: 24px; height: 24px; margin-left: 6px; border-radius: 50%; background: var(--ink); color: white; font-size: 11px; }
.store-hero { min-height: 720px; display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--line); }
.hero-copy { display: flex; flex-direction: column; justify-content: center; padding: 7vw; }
.store-kicker { margin: 0 0 22px; font-size: 11px; font-weight: 900; letter-spacing: .17em; }
.hero-copy h1 { margin: 0; max-width: 740px; font-family: Georgia, "Noto Serif SC", serif; font-size: clamp(54px, 6vw, 96px); font-weight: 400; line-height: .98; letter-spacing: -.065em; }
.hero-copy > p:not(.store-kicker) { max-width: 560px; margin: 30px 0; color: var(--muted); font-size: 17px; line-height: 1.8; }
.store-cta { width: max-content; display: flex; align-items: center; gap: 52px; padding: 16px 18px; border: 1px solid var(--ink); color: var(--ink); text-decoration: none; font-weight: 800; font-size: 13px; }
.store-cta span { font-size: 18px; }
.hero-visual { position: relative; min-height: 580px; overflow: hidden; background: #ece8df; }
.hero-product { position: absolute; inset: 7%; background: #fff url("/products/001.jpg") center / contain no-repeat; filter: contrast(1.02); }
.hero-index { position: absolute; right: 24px; bottom: 22px; padding: 9px 13px; background: var(--ink); color: white; font-size: 11px; font-weight: 800; }
.catalog-section { padding: 110px 4vw; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 30px; margin-bottom: 42px; }
.section-head h2, .story-section h2 { margin: 0; font-family: Georgia, "Noto Serif SC", serif; font-size: clamp(42px, 5vw, 70px); font-weight: 400; letter-spacing: -.05em; }
.category-filter { display: flex; flex-wrap: wrap; gap: 7px; justify-content: end; }
.category-filter button { padding: 9px 14px; border: 1px solid var(--line); border-radius: 999px; background: transparent; font-size: 12px; }
.category-filter button.active { border-color: var(--ink); background: var(--ink); color: white; }
.product-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 50px 18px; }
.product-card { min-width: 0; }
.product-media { position: relative; aspect-ratio: 1; overflow: hidden; background: #ebe8e0; }
.product-art, .admin-product-image { display: block; width: 100%; height: 100%; padding: 7%; object-fit: contain; background: #fff; transition: transform .5s ease; }
.product-media:hover .product-art { transform: scale(1.035); }
.product-tag { position: absolute; top: 14px; left: 14px; padding: 7px 9px; background: var(--accent); font-size: 10px; font-weight: 900; }
.quick-add { position: absolute; left: 14px; right: 14px; bottom: 14px; padding: 14px; border: 0; background: var(--ink); color: white; font-weight: 800; transform: translateY(76px); transition: transform .25s; }
.product-media:hover .quick-add, .quick-add:focus { transform: translateY(0); }
.product-meta { display: flex; justify-content: space-between; gap: 20px; margin-top: 17px; }
.product-meta p { margin: 0 0 3px; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.product-meta h3 { margin: 0; font-size: 17px; }
.product-meta strong { font-size: 14px; }
.product-desc { max-width: 340px; margin: 9px 0 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.story-section { display: grid; grid-template-columns: .25fr 1fr .7fr; align-items: start; gap: 70px; padding: 110px 4vw; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #1a1c19; color: white; }
.story-number { color: var(--accent); font-size: 14px; font-weight: 900; }
.story-section > p { color: #b7bbb3; line-height: 1.9; }
.store-footer { display: grid; grid-template-columns: 1.7fr 1fr 1fr auto; gap: 50px; padding: 80px 4vw; align-items: start; }
.store-footer div { display: grid; gap: 8px; }
.store-footer strong { margin-bottom: 8px; font-size: 12px; }
.store-footer div a, .store-footer p { color: var(--muted); text-decoration: none; font-size: 12px; }
.cart-overlay { position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.35); opacity: 0; pointer-events: none; transition: opacity .25s; }
.cart-overlay.open { opacity: 1; pointer-events: auto; }
.cart-drawer { position: fixed; top: 0; right: 0; z-index: 50; width: min(480px, 100%); height: 100%; display: grid; grid-template-rows: auto 1fr auto; padding: 30px; background: #fbfaf5; transform: translateX(100%); transition: transform .3s ease; }
.cart-drawer.open { transform: translateX(0); }
.cart-head { display: flex; justify-content: space-between; align-items: center; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.cart-head h2 { margin: 0; font-family: Georgia, serif; font-size: 32px; font-weight: 400; }
.cart-head button { border: 0; background: transparent; }
.cart-items { overflow: auto; }
.cart-line { display: grid; grid-template-columns: 115px 1fr; gap: 18px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.cart-line .product-art { height: 115px; padding: 8px; }
.cart-line h3 { margin: 4px 0; font-size: 15px; }
.cart-line p { margin: 0; color: var(--muted); font-size: 13px; }
.quantity { width: max-content; display: flex; align-items: center; gap: 12px; margin-top: 16px; border: 1px solid var(--line); }
.quantity button { width: 30px; height: 28px; border: 0; background: transparent; }
.quantity span { font-size: 12px; }
.empty-cart { padding: 70px 0; color: var(--muted); text-align: center; line-height: 1.9; }
.cart-summary { padding-top: 20px; border-top: 1px solid var(--line); }
.cart-summary > div:first-child { display: flex; justify-content: space-between; margin-bottom: 8px; }
.cart-summary > p { margin: 0 0 18px; color: var(--muted); font-size: 11px; }
.payment-notice { display: block; padding: 14px; border: 1px solid var(--ink); color: var(--ink); text-align: center; text-decoration: none; font-size: 13px; font-weight: 800; }
.store-result { display: none; margin-top: 12px; padding: 11px; border-left: 3px solid #4a9d5b; background: #e7f3e8; font-size: 12px; overflow-wrap: anywhere; }
.store-result.show { display: block; }
.store-result.error { border-color: #d45a4e; background: #f7e7e5; }

/* Admin */
.admin-body { min-height: 100vh; background: var(--admin-bg); color: var(--admin-ink); }
.admin-login { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; background: #111411; color: white; }
.login-brand { display: flex; align-items: center; padding: 8vw; font-size: clamp(64px, 10vw, 150px); font-weight: 950; letter-spacing: -.09em; background: radial-gradient(circle at 30% 40%, #333b26, #111411 55%); }
.login-brand span, .admin-logo span { color: var(--accent); }
.login-card { align-self: center; width: min(480px, calc(100% - 60px)); margin: auto; padding: 50px; border: 1px solid #343934; background: #191d19; }
.admin-kicker { margin: 0 0 8px; color: #7f867d; font-size: 10px; font-weight: 900; letter-spacing: .17em; }
.login-card .admin-kicker { color: var(--accent); }
.login-card h1 { margin: 4px 0 10px; font-size: 46px; letter-spacing: -.05em; }
.login-card > p:not(.admin-kicker) { color: #9ea39d; }
.login-card label, .settings-form label, dialog label { display: grid; gap: 7px; margin: 22px 0; color: #a7aca6; font-size: 12px; }
.login-card input, .settings-form input, .settings-form select, .settings-form textarea, dialog input, dialog textarea {
  width: 100%; padding: 13px 14px; border: 1px solid #dfe3dc; border-radius: 4px; outline: none; background: white; color: var(--admin-ink);
}
.login-card input { border-color: #3b413b; background: #111411; color: white; }
.admin-primary { padding: 13px 18px; border: 0; border-radius: 4px; background: var(--accent); color: #141711; font-weight: 900; }
.admin-primary.small { width: auto; padding: 11px 16px; font-size: 12px; }
.login-card .admin-primary { width: 100%; margin-top: 4px; }
.admin-message { display: none; margin-top: 14px; padding: 11px; border-left: 3px solid #58a867; background: #eaf6eb; color: #265d30; font-size: 12px; }
.admin-message.show { display: block; }
.admin-message.error { border-color: #dc6257; background: #fae9e7; color: #9a3128; }
.admin-app { min-height: 100vh; display: grid; grid-template-columns: 232px 1fr; }
.admin-sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 28px 18px; background: #151815; color: white; }
.admin-logo { margin: 0 12px 34px; color: white; text-decoration: none; font-size: 23px; font-weight: 950; letter-spacing: -.06em; }
.admin-sidebar nav { display: grid; gap: 3px; }
.admin-sidebar nav button { display: flex; align-items: center; gap: 12px; padding: 11px 13px; border: 0; border-radius: 5px; background: transparent; color: #a6aca5; text-align: left; font-size: 13px; }
.admin-sidebar nav button i { width: 20px; color: #737b72; font-style: normal; text-align: center; }
.admin-sidebar nav button:hover, .admin-sidebar nav button.active { background: #282d27; color: white; }
.admin-sidebar nav button.active i { color: var(--accent); }
.visit-store { margin: auto 10px 0; padding: 12px 13px; border: 1px solid #373d36; color: white; text-decoration: none; font-size: 12px; }
.admin-main { min-width: 0; }
.admin-topbar { height: 68px; display: flex; align-items: center; justify-content: space-between; padding: 0 34px; border-bottom: 1px solid var(--admin-line); background: white; color: var(--admin-muted); font-size: 12px; }
.live-dot { display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: #47a65b; }
.admin-user { display: flex; align-items: center; gap: 12px; }
.admin-user span { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: #1d211c; color: white; font-weight: 800; }
.admin-content { max-width: 1500px; padding: 38px; margin: 0 auto; }
.admin-loading { padding: 80px; color: var(--admin-muted); text-align: center; }
.page-title { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 30px; }
.page-title h1 { margin: 0; font-size: 34px; letter-spacing: -.04em; }
.page-title p:not(.admin-kicker), .panel-title p, .help-card p { margin: 7px 0 0; color: var(--admin-muted); font-size: 13px; }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.metric-grid article { padding: 24px; border: 1px solid var(--admin-line); border-radius: 7px; background: white; }
.metric-grid span { color: var(--admin-muted); font-size: 12px; }
.metric-grid strong { display: block; margin: 10px 0 7px; font-size: 30px; letter-spacing: -.05em; }
.metric-grid small { color: #91978f; }
.admin-panel { padding: 25px; border: 1px solid var(--admin-line); border-radius: 7px; background: var(--admin-panel); }
.panel-title { display: flex; justify-content: space-between; gap: 15px; align-items: start; margin-bottom: 20px; }
.panel-title h2, .admin-panel h2 { margin: 0; font-size: 19px; }
.text-button { border: 0; background: transparent; color: #50564e; font-size: 12px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 14px 12px; border-bottom: 1px solid var(--admin-line); text-align: left; white-space: nowrap; font-size: 12px; }
th { color: #8b9189; font-weight: 700; }
.status { display: inline-flex; padding: 5px 8px; border-radius: 999px; background: #eef0ed; color: #60665f; font-size: 10px; font-weight: 800; }
.status-completed, .status-active { background: #e5f4e7; color: #347140; }
.status-created { background: #fff2d6; color: #876219; }
.status-off { background: #f0f1ef; color: #8a8f88; }
.empty-state { padding: 50px 20px; color: var(--admin-muted); text-align: center; }
.split-panels { display: grid; grid-template-columns: 1.5fr 1fr; gap: 18px; margin-top: 18px; }
.bar-chart { height: 190px; display: flex; align-items: end; gap: 12px; padding: 30px 10px 0; border-bottom: 1px solid var(--admin-line); }
.bar-chart i { flex: 1; min-width: 10px; background: #20251f; border-radius: 3px 3px 0 0; }
.chart-labels { display: flex; justify-content: space-around; color: var(--admin-muted); font-size: 10px; padding-top: 9px; }
.quick-list > div { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--admin-line); }
.quick-list b { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: #222621; color: var(--accent); font-size: 11px; }
.quick-list span { font-size: 12px; }
.quick-list small { display: block; margin-top: 3px; color: var(--admin-muted); }
.product-admin-grid { display: grid; gap: 0; padding: 0; overflow: hidden; }
.product-admin-grid article { display: grid; grid-template-columns: 76px 1fr auto; gap: 18px; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--admin-line); }
.admin-product-image { height: 76px; padding: 5px; background-color: #fff; }
.product-admin-grid article span:first-child { color: var(--admin-muted); font-size: 10px; }
.product-admin-grid h3 { margin: 3px 0; font-size: 14px; }
.product-admin-grid p { margin: 0; color: var(--admin-muted); font-size: 11px; }
dialog { width: min(620px, calc(100% - 30px)); border: 0; border-radius: 8px; box-shadow: 0 30px 90px rgba(0,0,0,.25); }
dialog::backdrop { background: rgba(0,0,0,.45); }
.dialog-head { display: flex; justify-content: space-between; align-items: center; }
.dialog-head button { border: 0; background: transparent; font-size: 24px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form-grid label { color: var(--admin-muted); }
.form-grid .wide { grid-column: 1 / -1; }
.settings-layout { display: grid; grid-template-columns: minmax(0, 1.4fr) .7fr; gap: 18px; align-items: start; }
.settings-form { max-width: 840px; }
.help-card ol { margin: 22px 0 0; padding-left: 20px; color: var(--admin-muted); font-size: 12px; line-height: 2.2; }
.content-list { padding: 0 22px; }
.content-list article { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 20px; padding: 20px 4px; border-bottom: 1px solid var(--admin-line); }
.content-list article > div { display: flex; align-items: center; gap: 18px; }
.content-list article > div span { color: #a5aaa3; font-size: 11px; }
.content-list h3 { margin: 0; font-size: 14px; }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; }
.feature-grid h3 { margin: 18px 0 7px; }
.feature-grid p { min-height: 42px; color: var(--admin-muted); font-size: 12px; }
.feature-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 8px; background: #222621; color: var(--accent); }
.toggle { display: flex; align-items: center; gap: 8px; padding: 0; border: 0; background: transparent; color: var(--admin-muted); font-size: 11px; }
.toggle i { width: 30px; height: 17px; padding: 2px; border-radius: 999px; background: #d9dcd7; }
.toggle i::after { content: ""; display: block; width: 13px; height: 13px; border-radius: 50%; background: white; }
.toggle.on i { background: #77b77f; }
.toggle.on i::after { margin-left: 13px; }

@media (max-width: 1000px) {
  .product-grid { grid-template-columns: repeat(2, 1fr); }
  .store-hero { min-height: 0; }
  .hero-copy { padding: 7vw 4vw; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .settings-layout { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .announcement { padding: 8px 12px; font-size: 9px; line-height: 1.45; letter-spacing: .055em; }
  .store-header { height: 68px; grid-template-columns: minmax(0, 1fr) auto; padding: 0 18px; }
  .store-logo { font-size: 23px; letter-spacing: -.065em; }
  .store-header nav { display: none; }
  .cart-toggle { min-height: 44px; font-size: 12px; }
  .cart-toggle span { min-width: 22px; height: 22px; }
  .store-hero { grid-template-columns: 1fr; }
  .hero-copy { padding: 40px 20px 34px; }
  .hero-copy h1 { max-width: 520px; font-size: clamp(43px, 13vw, 58px); line-height: .98; }
  .hero-copy > p:not(.store-kicker) { margin: 18px 0 22px; font-size: 14px; line-height: 1.65; }
  .store-kicker { margin-bottom: 14px; font-size: 9px; }
  .store-cta { width: 100%; justify-content: space-between; min-height: 48px; padding: 13px 15px; }
  .hero-visual { min-height: clamp(260px, 72vw, 330px); }
  .hero-product { inset: 8%; }
  .hero-index { right: 14px; bottom: 14px; }
  .catalog-section { padding: 68px 12px 76px; }
  .section-head { align-items: stretch; flex-direction: column; gap: 20px; margin-bottom: 25px; padding: 0 4px; }
  .section-head h2, .story-section h2 { font-size: 40px; line-height: 1.02; }
  .category-filter { width: 100%; max-width: 100%; flex-wrap: nowrap; justify-content: start; gap: 6px; overflow-x: auto; padding: 0 0 7px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .category-filter::-webkit-scrollbar { display: none; }
  .category-filter button { flex: 0 0 auto; min-height: 40px; padding: 9px 15px; white-space: nowrap; }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 10px; }
  .product-media { aspect-ratio: 4 / 5; }
  .product-art { padding: 9% 5%; }
  .product-tag { top: 7px; left: 7px; padding: 5px 7px; font-size: 8px; }
  .quick-add { left: 7px; right: 7px; bottom: 7px; min-height: 40px; padding: 9px 6px; transform: none; font-size: 10px; }
  .product-meta { display: block; margin-top: 11px; }
  .product-meta p { margin-bottom: 3px; font-size: 9px; }
  .product-meta h3 { font-size: 13px; line-height: 1.32; overflow-wrap: anywhere; }
  .product-meta strong { display: block; margin-top: 7px; font-size: 13px; }
  .product-desc { display: none; }
  .story-section { grid-template-columns: 1fr; gap: 20px; padding: 66px 20px; }
  .story-section > p { margin: 0; font-size: 14px; line-height: 1.75; }
  .store-footer { grid-template-columns: 1fr 1fr; gap: 42px 22px; padding: 60px 20px; }
  .store-footer > .store-logo, .store-footer > p { grid-column: 1 / -1; }
  .cart-drawer { width: 100vw; max-width: none; height: 100dvh; padding: max(20px, env(safe-area-inset-top)) 18px max(18px, env(safe-area-inset-bottom)); }
  .cart-head { padding-bottom: 15px; }
  .cart-head h2 { font-size: 27px; }
  .cart-head button { min-width: 44px; min-height: 44px; }
  .cart-line { grid-template-columns: 82px minmax(0, 1fr); gap: 13px; padding: 15px 0; }
  .cart-line .product-art { height: 82px; padding: 5px; }
  .cart-line h3 { margin-top: 2px; font-size: 13px; line-height: 1.35; }
  .quantity { margin-top: 11px; }
  .quantity button { width: 38px; height: 34px; }
  .cart-summary { padding-top: 15px; }
  .admin-login { grid-template-columns: 1fr; }
  .login-brand { display: none; }
  .admin-app { grid-template-columns: 72px 1fr; }
  .admin-sidebar { padding: 22px 9px; }
  .admin-logo { margin: 0 auto 28px; font-size: 0; }
  .admin-logo span { font-size: 16px; }
  .admin-sidebar nav button { justify-content: center; padding: 12px 8px; font-size: 0; }
  .admin-sidebar nav button i { font-size: 16px; }
  .visit-store { padding: 10px; font-size: 0; text-align: center; }
  .visit-store::after { content: "↗"; font-size: 18px; }
  .admin-content { padding: 24px 16px; }
  .metric-grid, .split-panels, .feature-grid { grid-template-columns: 1fr; }
  .admin-topbar { padding: 0 18px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .wide { grid-column: auto; }
}

@media (max-width: 370px) {
  .store-header { padding: 0 14px; }
  .store-logo { font-size: 21px; }
  .hero-copy { padding-right: 16px; padding-left: 16px; }
  .hero-copy h1 { font-size: 40px; }
  .catalog-section { padding-right: 9px; padding-left: 9px; }
  .product-grid { column-gap: 8px; }
  .product-meta h3 { font-size: 12px; }
  .store-footer { grid-template-columns: 1fr; }
  .store-footer > .store-logo, .store-footer > p { grid-column: auto; }
}

@media (hover: none) and (pointer: coarse) {
  .quick-add { transform: none; }
}
