:root {
  --bg-dark: #0f172a; --color-blue: #7ec8ff; --color-green: #b8ff7e;
  --color-pink: #ff7eb3; --muted: #94a3b8; --border: rgba(255,255,255,.1);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg-dark); color: #f8fafc; font-family: Arial, "PingFang SC", "Microsoft YaHei", sans-serif; min-height: 100vh; }
button, input, textarea, select { font: inherit; }
button, select, summary { cursor: pointer; }
button { -webkit-tap-highlight-color: transparent; }
button:disabled { opacity: .4; cursor: default; }
button, a, input, select, textarea, summary { outline-offset: 4px; }
:focus-visible { outline: 2px solid var(--color-blue); }
a { color: inherit; }
.site-header { height: 72px; border-bottom: 1px solid rgba(255,255,255,.06); background: rgba(0,0,0,.18); }
.header-inner { max-width: 1100px; height: 100%; margin: auto; padding: 0 22px; display: flex; justify-content: space-between; align-items: center; }
.site-logo { text-decoration: none; font-size: 21px; font-weight: 800; letter-spacing: .05em; background: linear-gradient(135deg,#38bdf8,#818cf8); color: transparent; background-clip: text; -webkit-background-clip: text; }
.local-badge { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; }
.local-badge span { width: 6px; height: 6px; background: #b8ff7e; border-radius: 50%; }
.header-nav { display: flex; align-items: center; gap: 16px; }
.home-link { color: #94a3b8; font-size: 12px; text-decoration: none; }
.home-link:hover { color: #7ec8ff; }
.site-main { padding: 34px 16px 0; }
.intro { text-align: center; margin-bottom: 30px; }
.intro h1 { font-size: 25px; letter-spacing: .04em; margin: 0 0 10px; background: linear-gradient(135deg,#38bdf8,#818cf8); background-clip: text; -webkit-background-clip: text; color: transparent; }
.intro p { font-size: 14px; line-height: 1.6; color: var(--muted); margin: 0; }
.workbench { display: grid; grid-template-columns: minmax(0,500px) minmax(0,560px); align-items: start; gap: 30px; max-width: 1090px; margin: auto; }
.jar-maker-container { width: 100%; background: rgba(255,255,255,.05); padding: 20px; border-radius: 16px; box-shadow: 0 4px 30px rgba(0,0,0,.5); border: 1px solid rgba(255,255,255,.04); }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 20px; }
h2 { font-size: 19px; margin: 0; letter-spacing: .04em; }
#item-count { color: var(--muted); font-size: 12px; }
.settings-card { background: rgba(0,0,0,.18); padding: 16px; border-radius: 12px; border: 1px solid rgba(255,255,255,.05); }
.field-label { display: block; color: #cbd5e1; font-size: 13px; margin-bottom: 9px; }
.field-label span { color: #64748b; font-size: 11px; margin-left: 4px; }
.text-input, textarea { width: 100%; border: 1px solid #334155; border-radius: 8px; background: rgba(15,23,42,.65); color: #f1f5f9; padding: 10px 12px; line-height: 1.5; }
.text-input::placeholder, textarea::placeholder { color: #64748b; }
.settings-card .text-input { margin-bottom: 16px; }
.text-input:focus, textarea:focus { border-color: #818cf8; }
.layout-line { display: flex; align-items: center; justify-content: space-between; color: #cbd5e1; font-size: 13px; }
select { border: 1px solid #334155; border-radius: 8px; background: #1e293b; color: #cbd5e1; padding: 7px 10px; }
.bulk-card { margin: 14px 0 22px; border: 1px solid var(--border); border-radius: 10px; background: rgba(0,0,0,.1); }
summary { padding: 13px 14px; font-size: 13px; color: #cbd5e1; }
summary span { color: #64748b; font-size: 11px; margin-left: 8px; }
.bulk-body { padding: 0 14px 14px; }
textarea { resize: vertical; min-height: 100px; }
.small-note { color: #64748b; font-size: 11px; line-height: 1.7; margin: 9px 0; }
.button-row { display: flex; flex-wrap: wrap; gap: 8px; }
.small-btn { background: #334155; color: #e2e8f0; border: 1px solid #475569; border-radius: 8px; padding: 8px 13px; font-size: 12px; }
.small-btn.secondary { background: transparent; }
.editor-help { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; color: #64748b; margin-bottom: 12px; }
.item-row { background: rgba(0,0,0,.25); border: 1px solid rgba(255,255,255,.05); border-radius: 12px; padding: 12px 14px 14px; margin-bottom: 10px; }
.item-header { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.mini-jar { flex-shrink: 0; width: 36px; height: 52px; filter: drop-shadow(0 3px 4px rgba(0,0,0,.3)); }
.mini-jar svg { width: 100%; height: 100%; }
.name-wrap { flex: 1; min-width: 0; }
.bottle-number { font-size: 10px; color: #64748b; display: block; margin-bottom: 3px; letter-spacing: .06em; }
.bottle-name { font-size: 16px; line-height: 1.4; font-weight: 600; color: #e2e8f0; overflow-wrap: anywhere; }
.bottle-name.is-empty { font-size: 12px; font-weight: 400; color: #64748b; }
.item-actions { display: flex; align-items: center; gap: 6px; }
.ng-btn { border: 1px solid #475569; color: #94a3b8; background: transparent; border-radius: 12px; padding: 7px 5px; font-size: 12px; font-weight: 700; line-height: 1.2; width: 51px; height: 44px; }
.ng-btn.active { color: #ef4444; border-color: #ef4444; background: rgba(239,68,68,.15); box-shadow: 0 0 10px rgba(239,68,68,.15); }
.remove-btn { background: transparent; border: 0; color: #64748b; font-size: 19px; width: 24px; padding: 6px 0; }
.remove-btn:hover { color: #f87171; }
.bottle-note { margin: 3px 0 0; font-size: 11px; line-height: 1.4; color: #94a3b8; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rating-control { margin-top: 6px; padding-bottom: 4px; }
.rating-tip-row { position: relative; height: 26px; }
.rating-tip { position: absolute; transform: translateX(-50%); padding: 4px 9px; background: var(--tip-color); color: white; font-size: 13px; font-weight: 700; border-radius: 9px; text-shadow: 0 1px 3px rgba(0,0,0,.55); white-space: nowrap; visibility: hidden; }
.rating-tip::after { content: ""; position: absolute; bottom: -5px; left: calc(50% - 5px); border: 5px solid transparent; border-top-color: var(--tip-color); border-bottom: 0; }
.rating-tip.visible { visibility: visible; }
.segments { position: relative; height: 22px; margin: 3px 0 8px; }
.segment { position: absolute; transform: translateX(-50%); border: 0; background: transparent; color: #94a3b8; font-size: 12px; padding: 3px; }
.segment:nth-child(1) { left: 18.75%; }
.segment:nth-child(2) { left: 56.25%; }
.segment:nth-child(3) { left: 87.5%; }
.segment.active { color: #e2e8f0; }
.is-blocked .segments { opacity: .3; pointer-events: none; }
input[type="range"] { appearance: none; -webkit-appearance: none; width: 100%; height: 6px; border-radius: 3px; background: linear-gradient(to right,rgba(148,163,184,.4) 0% 6.25%,rgba(59,130,246,.3) 6.25% 35.3%,rgba(148,163,184,.4) 35.3% 39%,rgba(16,185,129,.3) 39% 68.75%,rgba(236,72,153,.3) 68.75% 100%); margin: 0; display: block; touch-action: pan-y; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 0 8px rgba(0,0,0,.5); cursor: grab; }
input[type="range"]::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 0; cursor: grab; }
input[type="range"]:disabled { opacity: .3; }
.pagination { display: flex; justify-content: center; align-items: center; gap: 18px; margin: 18px 0; font-size: 12px; color: #94a3b8; }
.page-btn { color: #cbd5e1; background: transparent; border: 1px solid #334155; width: 34px; height: 32px; border-radius: 8px; }
.add-btn { width: 100%; padding: 12px; border: 1px dashed #475569; border-radius: 10px; background: rgba(255,255,255,.025); color: #cbd5e1; font-size: 13px; }
.add-btn:hover { border-color: #38bdf8; color: #7dd3fc; }
.add-btn span { font-size: 17px; margin-right: 4px; }
.file-actions { display: flex; gap: 20px; justify-content: center; margin-top: 23px; }
.text-btn { background: transparent; border: 0; color: #94a3b8; padding: 4px 0; font-size: 12px; cursor: pointer; text-decoration: none; }
.text-btn:hover { color: #e2e8f0; }
.save-status { text-align: center; margin: 12px 0 0; color: #64748b; font-size: 10px; line-height: 1.6; }
.save-status.warning { color: #fbbf24; }
.preview-column { position: sticky; top: 22px; }
.preview-top { display: flex; align-items: center; justify-content: space-between; margin: 0 0 16px; }
.preview-top h2 { font-size: 15px; color: #cbd5e1; }
.preview-frame { max-height: min(72vh,900px); overflow: auto; border: 1px solid rgba(148,163,184,.13); border-radius: 16px; background: #0f172a; box-shadow: 0 8px 35px rgba(0,0,0,.35); scrollbar-color: #334155 #0f172a; }
.preview { line-height: 0; }
.preview > svg { width: 100%; height: auto; display: block; }
.export-area { text-align: center; margin-top: 22px; }
.save-btn { width: 100%; border: 0; color: #fff; font-size: 15px; font-weight: 700; border-radius: 30px; padding: 16px 24px; background: linear-gradient(135deg,#38bdf8,#818cf8); box-shadow: 0 8px 20px rgba(0,0,0,.4); transition: transform .2s,filter .2s; }
.save-btn span { display: inline-block; font-size: 10px; border: 1px solid rgba(255,255,255,.35); border-radius: 4px; padding: 2px 4px; margin-left: 8px; vertical-align: 1px; }
.save-btn:hover:not(:disabled) { transform: translateY(-2px); filter: brightness(1.12); }
.save-btn:disabled { opacity: .65; }
.svg-btn { width: 100%; background: transparent; border: 1px solid rgba(255,255,255,.15); border-radius: 30px; padding: 12px; color: #94a3b8; font-size: 12px; margin-top: 12px; }
.svg-btn:hover { border-color: #64748b; color: #e2e8f0; }
.export-status { font-size: 12px; color: #7dd3fc; text-align: center; line-height: 1.6; }
footer { text-align: center; color: #475569; font-size: 11px; padding: 32px 0 24px; }
dialog { padding: 0; width: min(860px,96vw); max-height: 92vh; border: 1px solid #334155; border-radius: 16px; background: #0f172a; color: white; }
dialog::backdrop { background: rgba(0,0,0,.75); }
.dialog-toolbar { position: sticky; top: 0; background: #1e293b; padding: 12px 18px; display: flex; align-items: center; justify-content: space-between; z-index: 2; font-size: 13px; }
#large-image > svg { display: block; width: 100%; height: auto; }
#toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: #334155; color: #f8fafc; border: 1px solid #475569; box-shadow: 0 5px 25px rgba(0,0,0,.3); padding: 12px 20px; font-size: 13px; line-height: 1.5; border-radius: 12px; pointer-events: none; opacity: 0; transition: opacity .2s; max-width: 90vw; z-index: 10; }
#toast.visible { opacity: 1; }
@media (max-width: 900px) {
  .workbench { grid-template-columns: minmax(0,500px); justify-content: center; gap: 30px; }
  .preview-column { position: static; }
  .preview-frame { max-height: 78vh; }
}
@media (max-width: 480px) {
  .site-header { height: 60px; }
  .header-inner { padding: 0 16px; }
  .site-logo { font-size: 18px; }
  .site-main { padding: 25px 10px 0; }
  .intro h1 { font-size: 21px; }
  .intro p { font-size: 12px; }
  .jar-maker-container { padding: 14px 10px; }
  .item-row { padding: 10px 12px 14px; }
  .item-header { gap: 8px; }
  .item-actions { gap: 2px; }
  .mini-jar { width: 33px; height: 50px; }
  .bottle-name { font-size: 13px; }
  .settings-card { padding: 13px; }
  input[type="range"]::-webkit-slider-thumb { width: 25px; height: 25px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
