:root {
  color-scheme: light;
  --ink: #15223a;
  --muted: #526079;
  --blue: #264fc0;
  --line: #dce3ef;
  --bg: #f5f7fb;
  font-family: "Aptos", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { cursor: pointer; }
button, a, input { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #3870ee; outline-offset: 4px; }
img { display: block; max-width: 100%; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }
.shell { width: min(1192px, calc(100% - 80px)); margin-inline: auto; }
.top { background: #fff; border-bottom: 1px solid var(--line); }
.top-inner, .footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.top-inner { min-height: 76px; }
.wordmark { display: inline-flex; align-items: baseline; gap: 8px; color: #0b1b3a; white-space: nowrap; }
.wordmark span:first-child { font-size: 1.32rem; font-weight: 900; letter-spacing: -.07em; }
.wordmark span:last-child { font-size: .69rem; font-weight: 800; letter-spacing: .16em; }
nav { display: flex; gap: 24px; align-items: center; font-size: .9rem; font-weight: 700; }
.nav-link { padding: 10px 0; color: var(--muted); }
.nav-link[aria-current] { color: var(--blue); }
.wishlist-link { background: #eaf0ff; padding: 9px 13px; border-radius: 8px; display: inline-flex; align-items: center; gap: 7px; color: #203e94; }
.wishlist-link[aria-current] { background: #dce6ff; }
.counter { background: #fff; border-radius: 50px; padding: 2px 6px; min-width: 23px; text-align: center; }
main { padding-block: 28px 72px; min-height: calc(100vh - 160px); }
.detail-actions { display: flex; gap: 12px; align-items: center; margin-top: 27px; flex-wrap: wrap; }
.primary, .secondary { display: inline-flex; justify-content: center; align-items: center; padding: 11px 16px; min-height: 44px; border-radius: 8px; font-weight: 750; border: 1px solid transparent; text-align: center; }
.primary { background: #2b50b6; color: #fff; }
.primary:hover { background: #16388f; }
.secondary { background: #fff; border-color: var(--line); color: var(--blue); }
.secondary:hover { border-color: var(--blue); }
.section-head { margin: 39px 0 18px; display: flex; justify-content: space-between; align-items: end; gap: 15px; flex-wrap: wrap; }
.section-head h2 { font-size: clamp(1.65rem, 4vw, 2.35rem); letter-spacing: -.05em; line-height: 1.2; }
.section-head p { color: var(--muted); margin-top: 6px; }
.search { display: flex; align-items: center; gap: 8px; width: min(100%, 300px); border: 1px solid var(--line); border-radius: 9px; background: white; padding-inline: 12px; min-height: 48px; color: var(--muted); }
.search input { width: 100%; border: 0; background: transparent; color: var(--ink); padding: 9px 0; }
.search input:focus { outline: none; }
.search:focus-within { outline: 2px solid #3870ee; }
.cards { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 17px; }
.card { position: relative; background: #fff; border: 1px solid var(--line); border-radius: 13px; overflow: hidden; min-width: 0; }
.card:hover { border-color: #8faaf2; box-shadow: 0 7px 18px #183b8612; }
.card a { display: block; height: 100%; }
.card a:focus-visible { outline-offset: -4px; }
.card-image { width: 100%; height: auto; aspect-ratio: 1.52; object-fit: cover; background: var(--tone); }
.card-copy { padding: 14px 46px 15px 14px; }
.card-copy h3 { font-size: 1.15rem; line-height: 1.25; overflow-wrap: anywhere; }
.card-copy p { color: var(--muted); font-size: .86rem; margin-top: 5px; }
.heart { display: inline-grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: #fff; color: #294b9d; font-size: 1.35rem; line-height: 1; }
.heart:hover, .heart[aria-pressed=true] { background: #eaf0ff; border-color: #b1c4f5; }
.card .heart { position: absolute; right: 7px; bottom: 12px; width: 40px; height: 40px; }
footer { border-top: 1px solid var(--line); background: white; }
.footer-inner { min-height: 75px; color: var(--muted); font-size: .88rem; }
.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; color: var(--muted); margin-bottom: 18px; font-size: .91rem; }
.breadcrumb a { color: var(--blue); font-weight: 750; }
.detail-hero { display: grid; grid-template-columns: 1fr 1.04fr; overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: #fff; }
.detail-copy { padding: clamp(24px, 5vw, 55px); align-self: center; }
.detail-copy h1, .page-title { font-size: clamp(2rem, 5vw, 4rem); letter-spacing: -.06em; margin: 8px 0 12px; line-height: 1.1; overflow-wrap: anywhere; }
.brand { color: var(--blue); font-weight: 800; letter-spacing: .1em; font-size: .85rem; }
.detail-copy p:not(.brand), .page-description { color: var(--muted); line-height: 1.65; }
.detail-media { background: var(--tone); display: grid; place-items: center; padding: clamp(12px, 3vw, 28px); }
.poster-mini { padding: 0; background: transparent; border: 0; border-radius: 8px; box-shadow: 0 8px 19px #0e23522a; overflow: hidden; width: 100%; }
.poster-mini img { width: 100%; height: auto; }
.flavors { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; list-style: none; padding: 0; margin: 0; }
.flavor { min-width: 0; display: flex; align-items: center; gap: 12px; min-height: 73px; justify-content: space-between; padding: 10px 12px 10px 16px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.flavor strong { overflow-wrap: anywhere; }
.flavor p { font-size: .87rem; color: var(--muted); margin-top: 4px; }
.flavor a { color: var(--blue); }
.empty { border: 1px dashed #b9c6df; padding: 32px 18px; border-radius: 12px; color: var(--muted); text-align: center; }
.empty a { margin-top: 16px; }
dialog { width: min(1100px, calc(100% - 24px)); max-height: 94dvh; border: 0; border-radius: 12px; padding: 0; color: var(--ink); overflow: hidden; }
dialog::backdrop { background: #0b142bc9; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 15px; border-bottom: 1px solid var(--line); }
.zoom-note { padding: 8px 15px; color: var(--muted); font-size: .87rem; }
.zoom-note a { color: var(--blue); text-decoration: underline; }
.close { background: #fff; border: 1px solid var(--line); border-radius: 8px; min-width: 44px; min-height: 44px; font-size: 1.45rem; }
#wechat-dialog, #quantity-dialog { width: min(440px, calc(100% - 24px)); overflow: auto; }
.wechat-body { display: grid; gap: 10px; padding: 18px 16px 20px; }
.wechat-body label { font-weight: 750; }
.wechat-body input { width: 100%; min-height: 47px; border: 1px solid #a8b5ce; border-radius: 8px; padding: 8px 11px; color: var(--ink); }
.wechat-note { font-size: .9rem; color: var(--muted); }
.wechat-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 9px; margin-top: 8px; }
.poster-viewport { overflow: auto; max-height: calc(94dvh - 117px); background: #101a2b; }
.poster-viewport img { width: 100%; min-width: 680px; max-width: none; }
.sr-only, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; white-space: nowrap; clip-path: inset(50%); }
.skip:focus { position: fixed; z-index: 4; background: #fff; padding: 8px; }
@media (max-width: 960px) {
  .shell { width: calc(100% - 48px); }
  .cards { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media (max-width: 700px) {
  .shell { width: calc(100% - 28px); }
  .top-inner { min-height: 61px; }
  nav { gap: 10px; }
  main { padding-block: 16px 44px; }
  .section-head { margin-top: 26px; }
  .cards { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
  .card-copy { padding-left: 10px; padding-right: 41px; }
  .card-copy h3 { font-size: 1rem; }
  .card .heart { right: 4px; }
  .detail-hero { grid-template-columns: 1fr; }
  .flavors { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 420px) {
  .top-inner { gap: 8px; }
  .top-inner .wordmark { gap: 5px; }
  .top-inner .wordmark span:last-child { font-size: .62rem; }
  .wishlist-link { padding-inline: 9px; white-space: nowrap; }
  .nav-link { display: none; }
  .footer-inner { align-items: flex-start; flex-direction: column; padding-block: 15px; gap: 4px; }
  .flavors { grid-template-columns: 1fr; }
  .search { width: 100%; }
}
@media (prefers-reduced-motion: no-preference) {
  .card, .heart, .primary, .secondary { transition: background-color .18s, border-color .18s, box-shadow .18s; }
}
.heart:disabled { opacity: .55; cursor: progress; }
.save-message { position: fixed; z-index: 6; bottom: 16px; left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100% - 28px); padding: 12px 16px; border-radius: 9px; box-shadow: 0 8px 25px #09142a40; background: #132c60; color: #fff; text-align: center; }
.admin-links { display: flex; align-items: center; flex-wrap: wrap; gap: 0 16px; }
.admin-entry { display: inline-flex; align-items: center; min-height: 44px; background: transparent; color: var(--muted); border: 0; padding: 4px 0; text-decoration: underline; text-underline-offset: 4px; }
.admin-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
.admin-page .shell { width: calc(100% - clamp(20px, 4vw, 48px)); }
.admin-page-main { flex: 1; display: flex; flex-direction: column; padding-bottom: clamp(12px, 2vw, 24px); }
.admin-page-main > .admin-page-card { flex: 1; min-width: 0; }
.admin-page-main > h1 { font-size: clamp(1.7rem, 5vw, 2.8rem); margin: 0 0 16px; }
.admin-sections { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.admin-sections a { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 13px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-weight: 750; }
.admin-sections a[aria-current="page"] { background: #244678; border-color: #244678; color: #fff; }
.admin-page-card { border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.admin-page-card > h2 { font-size: clamp(1.2rem, 3vw, 1.5rem); margin: 0; padding: 16px clamp(14px, 4vw, 24px); border-bottom: 1px solid var(--line); }
.admin-stock label { display: block; margin-bottom: 5px; font-weight: 750; }
.admin-stock select { max-width: 100%; min-height: 44px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font: inherit; }
.admin-stock .admin-status { margin: 10px 0; }
.stock-list { list-style: none; margin: 0; padding: 0; }
.stock-item { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; border-top: 1px solid var(--line); padding: 8px 0; }
.stock-item strong { flex: 1 1 9rem; }
.stock-item button { min-height: 36px; padding: 5px 10px; font-size: .9rem; }
.stock-badge { display: inline-block; width: max-content; border-radius: 5px; padding: 2px 7px; background: #e7f4ed; color: #245838; font-size: .8rem; font-weight: 750; }
.stock-badge.sold-out { background: #fde8e7; color: #912f2b; }
.card-copy .stock-badge, .flavor .stock-badge { margin-top: 6px; }
.detail-copy .stock-badge { margin-bottom: 7px; }
.admin-body { padding: 14px clamp(14px, 4vw, 24px) 20px; }
.admin-login { display: grid; gap: 8px; max-width: 20rem; }
.admin-login label { font-weight: 750; }
.admin-login input { min-width: 0; min-height: 44px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; }
.admin-login button { justify-self: start; }
.admin-status { margin: 0 0 12px; color: var(--muted); }
.language { min-height: 40px; padding: 6px 9px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); white-space: nowrap; }
.language:hover { border-color: var(--blue); }
@media (max-width: 420px) {
  .top-inner .wordmark span:last-child { display: none; }
  .top-inner nav { gap: 6px; }
  .top-inner nav .wishlist-link { padding-inline: 7px; }
  .top-inner nav .language { padding-inline: 7px; }
}
#series-list .section-head { margin-top: 0; }
#series-heading { font-size: clamp(1.75rem, 5vw, 2.75rem); line-height: 1.2; }
.customer-session { display: flex; justify-content: flex-end; align-items: center; gap: 8px; padding-top: 8px; }
.customer-login { flex-shrink: 0; min-height: 38px; padding: 5px 10px; font-size: .85rem; }
.customer-name { color: var(--muted); font-size: .85rem; overflow-wrap: anywhere; }
.customer-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.customer-filter input { min-height: 44px; width: min(16rem, 100%); padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; }
.customer-table { width: 100%; border-collapse: collapse; text-align: left; }
.customer-table th, .customer-table td { border-bottom: 1px solid var(--line); padding: 8px; overflow-wrap: anywhere; }
.customer-table th { position: sticky; top: 0; background: #fff; }

.admin-login-page { max-width: 480px; padding-top: clamp(28px, 8vw, 72px); }
.admin-login-page h1 { padding: 16px clamp(14px, 4vw, 24px); border-bottom: 1px solid var(--line); font-size: clamp(1.4rem, 5vw, 1.85rem); }
.admin-login-page .admin-login { max-width: none; }
.admin-login-error { margin-bottom: 12px; color: #912f2b; }

.favorite-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.card-with-quantity > a { height: auto; }
.card-with-quantity .favorite-actions { justify-content: space-between; padding: 0 10px 10px; }
.card-with-quantity .heart { position: static; }
.quantity-button { min-height: 44px; padding-inline: 10px; white-space: nowrap; }
#quantity-item { margin: 0; }

.customer-details-button { border: 0; padding: 4px; min-height: 44px; background: transparent; color: #203e94; text-align: left; text-decoration: underline; text-underline-offset: .18em; overflow-wrap: anywhere; }
.customer-details td { background: #f4f7ff; padding: 12px; }
.customer-wishlist { list-style: none; padding: 0; margin: 0; }
.customer-wishlist li { display: flex; justify-content: space-between; gap: 12px; padding-block: 8px; border-top: 1px solid var(--line); }
.customer-wishlist li > strong { flex: none; }

.password-form { display: grid; gap: 8px; max-width: 28rem; }
.password-form label { font-weight: 650; }
.password-form input[type=password] { width: 100%; min-height: 44px; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.password-form .primary { justify-self: start; margin-top: 6px; }
.password-form .admin-status { margin: 0; }

.admin-top-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.admin-top-inner { padding-block: 8px; }
.save-message a { display: block; margin-top: 8px; text-decoration: underline; text-underline-offset: 3px; font-weight: 750; }
.save-message a:focus-visible { outline-color: #fff; }

.save-message { padding-inline: 18px 44px; }
.save-message .close { position: absolute; right: 6px; top: 4px; color: #fff; }
@media(max-width:640px){.admin-page .admin-top-inner{flex-wrap:wrap}.admin-page .admin-top-actions{justify-content:flex-start}}

.wishlist-heading { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:8px 16px; margin-bottom:12px }
.wishlist-heading .page-title { margin:0 }
#reset-wishlist { color:#a52c38; border-color:#e5bfc4 }
#reset-wishlist:hover { background:#fff4f5 }
#reset-wishlist:disabled { opacity:.55; cursor:progress }
#reset-dialog { width:min(420px,calc(100% - 28px)); overflow:auto }
#reset-title { font-size:1.2rem }
#reset-description { line-height:1.6 }
#confirm-reset { background:#ac2737 }
#wishlist-owner,.flavor,.customer-wishlist,.admin-status { overflow-wrap:anywhere }
@media(max-width:760px) {
  .top-inner,.footer-inner { flex-wrap:wrap; padding-block:10px }
  .top-inner nav { flex-wrap:wrap; gap:8px }
  .top-inner .nav-link { display:inline-flex; align-items:center }
  .language,.customer-login,.stock-item button,.card .heart,.close,.wishlist-link { min-height:44px }
  .card .heart { width:44px }
  .card-copy { padding-right:49px }
  .card-with-quantity .card-copy { padding-right:10px }
  .favorite-actions { flex-wrap:wrap; max-width:100% }
  .flavors { grid-template-columns:repeat(auto-fit,minmax(min(100%,290px),1fr)) }
  .flavor { flex-wrap:wrap; gap:8px }
  .flavor .favorite-actions { margin-left:auto }
  .wechat-actions > button { flex:1 }
  input,select,.wechat-body input,.search input { font-size:16px; min-width:0; max-width:100% }
  .admin-top-actions,.admin-sections { width:100%; gap:6px }
  .admin-top-actions > *, .admin-sections a { flex:1 1 auto; justify-content:center; text-align:center }
  .admin-top-actions .secondary,.admin-sections a { padding:9px 10px }
  .admin-top-actions form button,.admin-stock select,.password-form .primary,.admin-login button { width:100% }
  .customer-filter label { width:100% }
  .customer-filter input { flex:1; width:0 }
  .customer-table { table-layout:fixed }
  .customer-table td,.customer-table th { padding:8px 5px }
  .customer-details-button { max-width:100% }
  .save-message { bottom:calc(12px + env(safe-area-inset-bottom)); width:min(420px,calc(100% - 24px)) }
  .poster-viewport img { min-width:0 }
  .poster-viewport { max-height:calc(90dvh - 135px) }
}
@media(max-width:540px) {
  .top-inner nav { width:100%; justify-content:space-between }
  .top-inner .wordmark span:last-child { display:inline }
  .top-inner nav a,.top-inner nav button { font-size:.84rem }
  .wishlist-heading { align-items:flex-start; flex-direction:column; gap:14px }
  .admin-sections { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)) }
  .admin-sections a { font-size:.86rem; padding:8px 4px; word-break:keep-all }
  .stock-item { display:grid; grid-template-columns:minmax(0,1fr) auto }
  .stock-item button { grid-column:1/-1 }
  .stock-item strong { overflow-wrap:anywhere }
  .card-with-quantity .favorite-actions { gap:4px; padding:0 6px 8px }
  .quantity-button { padding-inline:6px; font-size:.875rem }
}
#menu-dialog[open] { display:flex; flex-direction:column }
.zoom-note { display:flex; align-items:center; flex-wrap:wrap; gap:8px 16px }
.poster-viewport img.enlarged { width:200%; min-width:960px }
#poster-zoom[aria-pressed=true] { background:#eaf0ff }
