:root {
  color-scheme: light;
  --paper: #fcfaf8;
  --ink: #302622;
  --soft: #6d605a;
  --line: #e9dfd9;
  --accent: #874937;
  --selected: #fbf0eb;
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--paper);
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .48; cursor: default; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.masthead { border-bottom: 1px solid var(--line); }
.header-inner, .layout, .footer { width: min(100% - 80px, 1220px); margin-inline: auto; }
.header-inner { height: 73px; display: flex; align-items: center; justify-content: space-between; }
.wordmark { font: 2.65rem/.9 Georgia, serif; letter-spacing: -.09em; }
.wordmark span { color: var(--accent); margin-left: .07em; }
.header-label { font-size: .875rem; color: var(--soft); letter-spacing: .1em; }
.layout { display: grid; grid-template-columns: minmax(0, 1.19fr) minmax(0, 1fr); gap: clamp(30px, 5vw, 77px); align-items: start; padding-block: 35px 38px; }
.preview-column { position: sticky; top: 20px; min-width: 0; }
.preview {
  position: relative; isolation: isolate; overflow: hidden; aspect-ratio: 1.65; border-radius: 18px;
  border: 1px solid #ead7cd; background:
    radial-gradient(ellipse at 48% 44%, #fff5eacc 0%, #fce7dc60 47%, transparent 77%),
    radial-gradient(ellipse at 9% 0%, #fff9f1 0%, transparent 57%),
    linear-gradient(140deg, #f2dcd0, #e8c6b9 78%, #efcfc4);
}
.preview::before {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: .23; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 150 150' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.73' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Cpath fill='%23905b45' filter='url(%23n)' opacity='.34' d='M0 0h150v150H0z'/%3E%3C/svg%3E");
}
.preview-label { position: absolute; z-index: 1; top: 25px; left: 25px; margin: 0; padding: 7px 12px; border: 1px solid #ffffffb8; background: #fff8f1df; border-radius: 30px; color: #5f493e; font-size: .875rem; font-weight: 600; display: flex; align-items: center; gap: 7px; }
.preview-label span { width: 6px; height: 6px; border-radius: 50%; background: #96614a; }
#necklace { display: block; width: 100%; height: 100%; }
.preview-caption { position: absolute; bottom: 23px; left: 26px; right: 26px; display: flex; gap: 12px; justify-content: space-between; font-size: .875rem; color: #654b3e; }
.preview-message { position: absolute; top: 51%; width: 100%; padding-inline: 16px; margin: 0; text-align: center; color: #644c40; font-size: .875rem; }
.size { margin: 0 0 14px; border: 1px solid var(--line); border-radius: 10px; background: #fffdfb; }
.size summary { padding: 10px 13px; cursor: pointer; font-weight: 600; font-size: .875rem; }
.size-body { padding: 0 16px 13px; font-size: .875rem; color: var(--soft); }
.size-body p, .size-body dl { margin: 0 0 8px; }
.size-body p:last-child { margin: 0; }
.size-body dl div { display: flex; gap: 12px; }
.size-body dt { min-width: 50px; font-weight: 600; }
.size-body dd { margin: 0; }
.chain-note { margin: 0 12px 8px; }
.chain-gallery { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 0 12px 12px; }
.chain-gallery figure { margin: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: #fffdfb; }
.chain-gallery img { display: block; width: 100%; height: auto; aspect-ratio: 520 / 320; background: radial-gradient(ellipse at 42% 36%, #fff5e9, #e9c8bc); }
.chain-gallery figcaption { padding: 5px 7px; color: var(--soft); font-size: .8125rem; overflow-wrap: anywhere; }
.studio { min-width: 0; padding-top: 2px; }
.intro { margin-bottom: 23px; }
h1 { margin: 0; font: 600 clamp(2rem, 3.6vw, 3.3rem)/1.18 "Songti SC", "Noto Serif CJK SC", SimSun, serif; letter-spacing: .045em; }
.field { min-width: 0; margin: 0 0 17px; padding: 0; border: 0; }
.field > label, legend, #manual-copy label { display: block; font-size: .9375rem; font-weight: 650; margin: 0 0 7px; padding: 0; }
.legend-note { margin-left: 5px; font-size: .8125rem; font-weight: 400; color: var(--soft); }
.input-wrap { position: relative; }
#name { padding: 9px 78px 9px 13px; width: 100%; border: 1px solid #d9c8be; border-radius: 9px; background: #fffdfb; color: var(--ink); font-weight: 550; height: 46px; }
#name[aria-invalid="true"] { border-color: #a2463c; }
#count { position: absolute; pointer-events: none; right: 13px; top: 50%; transform: translateY(-50%); color: var(--soft); font-size: .8125rem; font-variant-numeric: tabular-nums; }
.hint, .error, .feedback { font-size: .8125rem; margin: 5px 0 0; color: var(--soft); }
.error { color: #9a392f; }
.font-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.font-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.font-filters button { border: 1px solid #e5d9d2; border-radius: 20px; background: #fffdfb; color: var(--soft); padding: 5px 12px; min-height: 34px; font-size: .875rem; }
.font-filters button:hover { border-color: #b78875; }
.font-filters button[aria-pressed="true"] { background: var(--selected); color: #713e2d; border-color: #a4644c; }
.chain-filters { margin-inline: 12px; }
.show-more { width: 100%; margin-top: 7px; min-height: 40px; padding: 6px 10px; border: 1px solid #e5d9d2; border-radius: 8px; background: #fffdfb; color: #713e2d; font-size: .875rem; }
.show-more:hover { border-color: #b78875; background: var(--selected); }
.show-more.chain-more { width: calc(100% - 24px); margin: 0 12px 12px; }
.font-current { margin-top: 7px; }
.font-review { color: #763f2f; }
.option { position: relative; min-width: 0; display: block; cursor: pointer; }
.option input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.option > span { display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 42px; border: 1px solid #e5d9d2; background: #fffdfb; border-radius: 9px; padding: 5px; font-size: .875rem; }
.option:hover > span { border-color: #b78875; }
.option input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.option input:checked + span { background: var(--selected); border-color: #a4644c; color: #713e2d; box-shadow: inset 0 0 0 .35px #a4644c; }
.font-option > span { min-height: 77px; flex-direction: column; gap: 1px; padding-inline: 3px; }
.sample { display: grid; place-items: center; height: 34px; min-width: 0; width: 100%; padding: 1px 2px; white-space: nowrap; font-size: 1.75rem; line-height: 1.16; font-weight: 400; }
.sample > span { width: max-content; }
.font-name { text-align: center; font-size: .8125rem; line-height: 1.25; }
.font-code { font: .75rem/1.2 ui-monospace, monospace; color: var(--soft); }
.choices { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 5fr); gap: 12px; }
.color-grid, .length-grid { display: grid; gap: 5px; }
.color-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.length-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.swatch { width: 14px; height: 14px; border: 1px solid #0002; border-radius: 50%; flex: none; }
.gold { background: linear-gradient(145deg, #fff0ae, #d99445 48%, #aa632e 75%, #e3aa67); }
.silver { background: linear-gradient(145deg, #fff, #bfc3c8 50%, #8e949e 74%, #d2d5d9); }
.order { padding: 13px 14px 12px; border: 1px solid var(--line); border-radius: 12px; background: #f5eeea; }
.order-head { display: flex; gap: 4px 14px; justify-content: space-between; align-items: baseline; flex-wrap: wrap; }
.order h2 { margin: 0; font-size: .9375rem; }
#config-id { color: #794936; font-size: .8125rem; overflow-wrap: anywhere; }
#order-summary { margin: 6px 0 11px; color: var(--soft); font-size: .875rem; overflow-wrap: anywhere; }
.order-details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px 15px; margin: 9px 0 12px; padding-block: 8px; border-block: 1px solid #e2d2c9; font-size: .875rem; }
.order-details > div { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px; }
.order-details dt { color: var(--soft); }
.order-details dd { margin: 0; font-weight: 550; overflow-wrap: anywhere; }
.actions { display: grid; grid-template-columns: 1.24fr 1fr 1fr; gap: 7px; }
.actions button { border-radius: 8px; border: 1px solid var(--accent); min-height: 42px; padding: 7px; font-size: .875rem; font-weight: 650; }
.primary { color: white; background: var(--accent); }
.secondary { color: #713e2d; background: #fffaf6; }
.primary:enabled:hover { background: #723b2c; }
.secondary:enabled:hover { background: #f9e9e1; }
.feedback:empty { display: none; }
.feedback { color: #763f2f; }
#manual-copy { margin-top: 10px; }
#order-text { width: 100%; border: 1px solid #d9c8be; border-radius: 7px; padding: 8px; color: var(--ink); resize: vertical; }
.footer { display: flex; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); padding-block: 15px 22px; color: var(--soft); font-size: .8125rem; }
.footer a, .catalog a { color: #784333; }
.catalog { width: min(100% - 36px, 930px); margin: 32px auto; }
.catalog h1 { font-size: 2rem; }
.catalog ul { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 12px; padding: 0; }
.catalog li { display: grid; gap: 5px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; }
.catalog li div { display: flex; flex-wrap: wrap; gap: 12px; }
@media (max-width: 840px) {
  .header-inner, .layout, .footer { width: calc(100% - 36px); }
  .layout { gap: 24px; }
  .choices { grid-template-columns: 1fr; gap: 0; }
}
@media (max-width: 660px) {
  .header-inner { height: 55px; }
  .wordmark { font-size: 2.15rem; }
  .layout { display: flex; flex-direction: column; align-items: stretch; gap: 0; padding-block: 14px 24px; }
  .preview-column, .studio, #customizer { display: contents; }
  .intro { order: -4; margin-bottom: 12px; }
  h1 { font-size: 2rem; }
  .preview { order: -3; aspect-ratio: 1.8; margin-bottom: 12px; position: sticky; top: 0; z-index: 2; }
  .preview-label { top: 10px; left: 10px; font-size: .8125rem; padding: 5px 9px; }
  .preview-caption { inset: auto 11px 9px; font-size: .8125rem; }
  .size summary { padding: 9px 12px; }
  .field { margin-bottom: 14px; }
  .choices { grid-template-columns: minmax(0, 4fr) minmax(0, 5fr); gap: 9px; }
}
@media (max-width: 355px) {
  .choices { grid-template-columns: 1fr; gap: 0; }
}
@media (max-height: 480px) and (max-width: 660px) {
  .preview { position: relative; }
}
.retry { padding: 4px 10px; margin-inline-start: 6px; border-radius: 7px; border: 1px solid var(--accent); color: var(--accent); background: #fff8f1; }
