/* 烟翎阁装备定制工坊：暗色工坊风，和主站刻意不同 */
:root {
  --bg: #0b0a0f;
  --bg2: #100e16;
  --panel: #15131c;
  --panel2: #1b1924;
  --panel3: #221f2d;
  --line: #2a2736;
  --line2: #3a3549;
  --text: #ece9f3;
  --muted: #a19bb0;
  --dim: #6d6880;
  --ench: #b48cff;
  --ench-2: #7c5cff;
  --ench-soft: rgba(180, 140, 255, .12);
  --gold: #f2c45f;
  --gold-2: #e09a2f;
  --gold-soft: rgba(242, 196, 95, .12);
  --danger: #ff6f6f;
  --ok: #5fd39a;
  --r: 4px;
  --r2: 6px;
  --mono: ui-monospace, "Cascadia Mono", Consolas, "SF Mono", Menlo, monospace;
  --dock-h: 0px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.55 -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  min-height: 100vh;
  padding-bottom: var(--dock-h);
  overflow-x: hidden;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
::selection { background: rgba(180, 140, 255, .35); }

.wrap { width: 100%; max-width: 1360px; margin: 0 auto; padding: 0 24px; }

/* 背景：极淡的网格和顶部紫光 */
.bg-fx {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(900px 420px at 50% -120px, rgba(124, 92, 255, .22), transparent 70%),
    radial-gradient(600px 300px at 85% 10%, rgba(242, 196, 95, .06), transparent 70%),
    linear-gradient(rgba(255,255,255,.022) 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(90deg, rgba(255,255,255,.022) 1px, transparent 1px) 0 0 / 32px 32px,
    var(--bg);
  mask-image: linear-gradient(#000 0, #000 60%, transparent 100%);
}

/* ---------- 顶栏 ---------- */
.top {
  position: sticky; top: 0; z-index: 30;
  background: rgba(11, 10, 15, .78);
  backdrop-filter: blur(12px) saturate(1.4);
  -webkit-backdrop-filter: blur(12px) saturate(1.4);
  border-bottom: 1px solid var(--line);
}
.top-in { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
/* 主站标志是白底的，放在一块小白底里，周围一圈淡紫光和暗色页面衔接 */
.brand-mark {
  width: 34px; height: 34px; border-radius: var(--r2); flex: none;
  background: #fff; object-fit: cover;
  box-shadow: 0 0 0 1px rgba(255,255,255,.08), 0 0 18px rgba(180, 140, 255, .35);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text b { font-size: 16px; letter-spacing: .12em; }
.brand-text i { font-style: normal; font-size: 11px; color: var(--muted); letter-spacing: .2em; }
.top-nav { display: flex; align-items: center; gap: 10px; }
.ver-tag {
  font: 12px var(--mono); color: var(--muted);
  border: 1px solid var(--line2); padding: 3px 8px; border-radius: var(--r);
}
.link-btn { background: none; border: 0; color: var(--muted); padding: 8px 10px; border-radius: var(--r); }
.link-btn:hover { color: var(--text); background: var(--panel2); }
.cart-btn {
  display: flex; align-items: center; gap: 8px;
  background: var(--panel2); border: 1px solid var(--line2); border-radius: var(--r);
  padding: 6px 8px 6px 12px;
}
.cart-btn:hover { border-color: var(--gold); }
.cart-btn b {
  min-width: 22px; height: 22px; padding: 0 6px; border-radius: 3px;
  background: var(--gold); color: #1a1205; font: 700 12px/22px var(--mono); text-align: center;
}
.cart-btn.bump b { animation: bump .45s ease; }
@keyframes bump { 40% { transform: scale(1.35); } }

/* ---------- 顶部区 ---------- */
.hero { padding: 40px 0 30px; }
.eyebrow {
  margin: 0 0 10px; color: var(--ench); font-size: 12px; letter-spacing: .4em;
  display: inline-flex; align-items: center; gap: 10px;
}
.eyebrow::before, .eyebrow::after { content: ""; width: 28px; height: 1px; background: linear-gradient(90deg, transparent, var(--ench)); }
.eyebrow::after { transform: scaleX(-1); }
.hero h1 {
  margin: 0; font-size: clamp(28px, 4.2vw, 44px); line-height: 1.2; letter-spacing: .06em; font-weight: 800;
  background: linear-gradient(180deg, #fff 30%, #c9bce6);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero .sub { margin: 12px 0 26px; color: var(--muted); letter-spacing: .04em; }

@keyframes rise { from { opacity: 0; transform: translateY(6px); } }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid transparent; border-radius: var(--r); padding: 9px 18px; font-weight: 600;
  transition: transform .12s, filter .15s, background .15s, border-color .15s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn.sm { padding: 6px 12px; font-size: 13px; }
.btn.block { width: 100%; }
.btn-ench { background: linear-gradient(135deg, var(--ench-2), #9a72ff); color: #fff; }
.btn-ench:hover { filter: brightness(1.12); }
.btn-gold { background: linear-gradient(180deg, #f7d27a, var(--gold-2)); color: #1d1405; box-shadow: 0 6px 20px -8px rgba(242, 196, 95, .6); }
.btn-gold:hover { filter: brightness(1.08); }
.btn-ghost { background: var(--panel2); border-color: var(--line2); color: var(--text); }
.btn-ghost:hover { border-color: var(--muted); }
.btn:disabled { opacity: .5; cursor: not-allowed; filter: none; }

/* ---------- 主区 ---------- */
.studio {
  display: grid; gap: 16px; align-items: start;
  grid-template-columns: 264px minmax(0, 1fr) 320px;
  padding-bottom: 48px;
}
.pane { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r2); }
.pane-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px 10px; }
.pane-head h2 { margin: 0; font-size: 14px; letter-spacing: .1em; }
.step { font: 700 11px var(--mono); color: var(--ench); border: 1px solid rgba(180,140,255,.4); padding: 1px 5px; border-radius: 3px; }

/* 物品选择 */
.picker { position: sticky; top: 76px; padding-bottom: 14px; }
.cat-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 0 12px; }
.cat {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: var(--bg2); border: 1px solid var(--line); border-radius: var(--r);
  padding: 8px 2px 6px; font-size: 12px; color: var(--muted);
  transition: border-color .15s, background .15s, color .15s;
}
.cat:hover { border-color: var(--line2); color: var(--text); }
.cat.on { border-color: var(--ench); background: linear-gradient(180deg, rgba(124,92,255,.18), rgba(124,92,255,.04)); color: var(--text); }
.cat.on::after { content: ""; position: absolute; left: 50%; bottom: -1px; width: 18px; height: 2px; margin-left: -9px; background: var(--ench); }
.mat-list { display: flex; flex-direction: column; gap: 4px; margin: 12px 12px 0; padding-top: 12px; border-top: 1px dashed var(--line2); }
.mat {
  display: flex; align-items: center; gap: 10px; text-align: left;
  background: transparent; border: 1px solid transparent; border-radius: var(--r);
  padding: 5px 8px; color: var(--muted);
}
.mat:hover { background: var(--panel2); color: var(--text); }
.mat.on { background: var(--panel3); border-color: var(--line2); color: var(--text); }
.mat .nm { flex: 1; }
.mat .pr { font: 12px var(--mono); color: var(--dim); }
.mat.on .pr { color: var(--gold); }

/* 物品图标：同一张雪碧图 */
.ico {
  display: inline-block; width: 32px; height: 32px; flex: none;
  background-image: url(../img/items.png); background-repeat: no-repeat;
  image-rendering: pixelated; image-rendering: crisp-edges;
}
.ico-sm { width: 24px; height: 24px; }
.ico-xl { width: 128px; height: 128px; }

/* 工作台 */
.bench { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.stage {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: minmax(180px, 1fr) minmax(0, 1.25fr); align-items: center; gap: 12px;
  min-height: 280px; padding: 28px 28px 28px 20px;
  background:
    radial-gradient(260px 200px at 26% 50%, rgba(124, 92, 255, .25), transparent 70%),
    linear-gradient(180deg, #13111a, #0d0c12);
  border: 1px solid var(--line); border-radius: var(--r2);
}
.stage::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(255,255,255,.018) 0 1px, transparent 1px 4px);
}
.stage-glow {
  position: absolute; left: 26%; top: 50%; width: 220px; height: 220px; margin: -110px 0 0 -110px; border-radius: 50%;
  background: conic-gradient(from 0deg, transparent, rgba(180,140,255,.28), transparent 30%, rgba(242,196,95,.18), transparent 60%, rgba(124,92,255,.3), transparent);
  filter: blur(18px); animation: spin 14s linear infinite; opacity: .35; transition: opacity .4s;
}
.stage.enchanted .stage-glow { opacity: 1; }
@keyframes spin { to { transform: rotate(360deg); } }
.stage-runes {
  position: absolute; left: 26%; top: 50%; width: 250px; height: 250px; margin: -125px 0 0 -125px; border-radius: 50%;
  border: 1px dashed rgba(180, 140, 255, .22);
  animation: spin 40s linear infinite reverse;
}
.stage-runes::before {
  content: ""; position: absolute; inset: 24px; border-radius: 50%;
  border: 1px solid rgba(180, 140, 255, .12);
}
.stage-item {
  position: relative; justify-self: center; z-index: 1;
  width: 128px; height: 128px;
  animation: float 4s ease-in-out infinite;
  filter: drop-shadow(0 14px 10px rgba(0,0,0,.55));
}
.stage-item.pop { animation: pop .45s cubic-bezier(.3,1.6,.5,1), float 4s ease-in-out .45s infinite; }
@keyframes float { 50% { transform: translateY(-8px); } }
@keyframes pop { from { transform: scale(.6) rotate(-12deg); opacity: 0; } }
/* 附魔光效：用物品图标本身做遮罩，只在物品像素上流动 */
.glint {
  position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .3s;
  -webkit-mask-image: url(../img/items.png); mask-image: url(../img/items.png);
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  background: linear-gradient(115deg, transparent 30%, rgba(200, 160, 255, .85) 45%, rgba(140, 90, 255, .5) 52%, transparent 66%) 0 0 / 300% 300%;
  mix-blend-mode: screen; animation: glint 3.2s linear infinite;
}
.stage.enchanted .glint { opacity: 1; }
@keyframes glint { from { background-position: 120% 0; } to { background-position: -120% 0; } }
.stage-base {
  position: absolute; left: 26%; bottom: 34px; width: 150px; height: 18px; margin-left: -75px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(0,0,0,.6), transparent);
}

/* 游戏内物品说明框 */
.tooltip {
  position: relative; z-index: 1; justify-self: start; max-width: 100%;
  min-width: 200px; padding: 8px 10px;
  background: rgba(16, 0, 16, .94);
  border: 2px solid #1a0a2a; outline: 2px solid rgba(40, 0, 127, .85); outline-offset: -4px;
  border-radius: 2px;
  font: 15px/1.45 var(--mono); letter-spacing: .02em;
  box-shadow: 0 20px 40px -18px #000;
}
.tooltip .ln { white-space: pre-wrap; word-break: break-all; text-shadow: 2px 2px 0 rgba(0,0,0,.45); }
.tooltip .ln-name { margin-bottom: 2px; font-weight: 600; }
.tooltip .gap { height: .7em; }
.c-gray { color: #aaaaaa; } .c-blue { color: #5555ff; } .c-red { color: #ff5555; } .c-dgray { color: #555555; } .c-dpurple { color: #aa00aa; }
.c-aqua { color: #55ffff; }
.tooltip .more { color: #555; }

/* 配置区 */
.config { overflow: visible; }
.config .tabs { border-radius: var(--r2) var(--r2) 0 0; }
.tabs { display: flex; border-bottom: 1px solid var(--line); background: var(--bg2); }
.tab {
  position: relative; flex: 1; background: none; border: 0; padding: 13px 8px 12px; color: var(--muted); font-weight: 600; letter-spacing: .12em;
}
.tab b { margin-left: 6px; font: 600 11px var(--mono); color: var(--gold); letter-spacing: 0; }
.tab:hover { color: var(--text); }
.tab.on { color: var(--text); }
.tab.on::after { content: ""; position: absolute; left: 20%; right: 20%; bottom: -1px; height: 2px; background: linear-gradient(90deg, var(--ench-2), var(--ench)); }
.tab-body { padding: 14px 16px 18px; animation: rise .25s ease; }
.tool-row { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.search { flex: 1; min-width: 160px; position: relative; }
.search::before {
  content: ""; position: absolute; left: 11px; top: 50%; width: 10px; height: 10px; margin-top: -7px;
  border: 1.5px solid var(--dim); border-radius: 50%;
}
.search::after { content: ""; position: absolute; left: 21px; top: 50%; width: 5px; height: 1.5px; background: var(--dim); transform: rotate(45deg); margin-top: 2px; }
input:not([type]), input[type=text], input[type=number], textarea, .search input {
  width: 100%; background: var(--bg2); border: 1px solid var(--line2); border-radius: var(--r);
  padding: 8px 10px; outline: 0; transition: border-color .15s, box-shadow .15s;
}
.search input { padding-left: 32px; }
input:focus, textarea:focus { border-color: var(--ench); box-shadow: 0 0 0 3px rgba(180, 140, 255, .15); }
input::placeholder, textarea::placeholder { color: var(--dim); }
textarea { resize: vertical; }
.hint { margin: 10px 0 0; color: var(--dim); font-size: 12px; }
.hint b { color: var(--muted); font-weight: 600; font-family: var(--mono); }
.hint.center { text-align: center; }
.muted { color: var(--muted); }

/* 开关 */
.switch { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch span {
  position: relative; width: 32px; height: 18px; border-radius: 9px; background: var(--line2); transition: background .2s; flex: none;
}
.switch span::after {
  content: ""; position: absolute; left: 2px; top: 2px; width: 14px; height: 14px; border-radius: 50%; background: #cfc9db; transition: transform .2s, background .2s;
}
.switch input:checked + span { background: var(--ench-2); }
.switch input:checked + span::after { transform: translateX(14px); background: #fff; }
.switch input:focus-visible + span { outline: 2px solid var(--ench); outline-offset: 2px; }
.switch em { font-style: normal; font: 12px var(--mono); color: var(--gold); margin-left: auto; padding-left: 8px; }

/* 附魔列表 */
.ench-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; margin-top: 14px; }
.ench {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto; column-gap: 10px;
  background: var(--bg2); border: 1px solid var(--line); border-radius: var(--r);
  padding: 9px 10px 9px 12px; transition: border-color .15s, background .15s;
}
.ench:hover { border-color: var(--line2); }
.ench.on {
  border-color: rgba(180, 140, 255, .55);
  background: linear-gradient(90deg, rgba(124, 92, 255, .16), rgba(124, 92, 255, .03));
}
.ench.on::before { content: ""; position: absolute; left: -1px; top: 8px; bottom: 8px; width: 2px; background: var(--ench); border-radius: 2px; }
.ench.curse .en-name { color: #ff9a9a; }
.ench.na { opacity: .55; }
.ench.na.on { opacity: 1; }
.en-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.en-meta { grid-column: 1; font-size: 11.5px; color: var(--dim); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.en-meta .pr { font-family: var(--mono); }
.ench.on .en-meta .pr { color: var(--gold); }
.en-warn { color: #ffb36b; }
.en-tag { font-size: 10.5px; padding: 0 4px; border: 1px solid var(--line2); border-radius: 3px; color: var(--muted); }
.stepper {
  grid-column: 2; grid-row: 1 / 3; align-self: center;
  display: flex; align-items: stretch; height: 32px;
  border: 1px solid var(--line2); border-radius: var(--r); overflow: hidden; background: var(--panel);
}
.stepper button { width: 28px; background: none; border: 0; color: var(--muted); font-size: 16px; line-height: 1; }
.stepper button:hover { background: var(--panel3); color: var(--text); }
.stepper input {
  width: 42px; border: 0 !important; border-radius: 0; background: transparent; text-align: center; padding: 0;
  font: 600 14px var(--mono); box-shadow: none !important; -moz-appearance: textfield;
}
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.ench.on .stepper { border-color: rgba(180, 140, 255, .6); }
.ench.on .stepper input { color: #fff; }
.quick { grid-column: 1 / 3; display: none; gap: 4px; margin-top: 8px; }
.ench.on .quick { display: flex; }
.quick button {
  flex: 1; background: var(--panel); border: 1px solid var(--line); border-radius: 3px; padding: 2px 0;
  font: 11.5px var(--mono); color: var(--muted);
}
.quick button:hover { border-color: var(--ench); color: var(--text); }
.quick button.cur { border-color: var(--ench); color: var(--ench); }
.empty { padding: 28px 0 18px; text-align: center; color: var(--dim); font-size: 13px; }

/* 下拉菜单 */
.select { position: relative; display: inline-block; }
.select-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--panel2); border: 1px solid var(--line2); border-radius: var(--r); padding: 8px 14px; font-weight: 600;
}
.select-btn::before { content: "+"; color: var(--ench); font-size: 16px; line-height: 1; }
.select-btn:hover, .select.open .select-btn { border-color: var(--ench); }
.select-menu {
  position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; width: 300px; max-height: 340px; overflow: auto;
  background: var(--panel2); border: 1px solid var(--line2); border-radius: var(--r2);
  box-shadow: 0 18px 40px -10px rgba(0,0,0,.7); padding: 6px;
  opacity: 0; transform: translateY(-4px); pointer-events: none; transition: opacity .15s, transform .15s;
}
.select.open .select-menu { opacity: 1; transform: none; pointer-events: auto; }
.select-menu .grp { padding: 8px 8px 4px; font-size: 11px; color: var(--dim); letter-spacing: .2em; }
.select-menu button {
  display: flex; justify-content: space-between; width: 100%; text-align: left; background: none; border: 0; border-radius: 3px; padding: 7px 8px;
}
.select-menu button:hover { background: var(--panel3); }
.select-menu button small { color: var(--dim); font-family: var(--mono); }

/* 属性 */
.attr-add { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.attr-add .hint { margin: 0; }
.attr-list { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.attr {
  display: grid; grid-template-columns: minmax(110px, 1.2fr) minmax(90px, .9fr) minmax(120px, 1fr) minmax(96px, .8fr) auto 28px; gap: 8px; align-items: center;
  background: var(--bg2); border: 1px solid var(--line); border-left: 2px solid #5f6bff; border-radius: var(--r); padding: 8px 8px 8px 12px;
  animation: rise .2s ease;
}
.attr .at-name { font-weight: 600; }
.attr .at-name small { display: block; font-weight: 400; color: var(--dim); font-size: 11px; }
.attr input { padding: 6px 8px; font-family: var(--mono); }
.attr .pr { font: 12px var(--mono); color: var(--gold); text-align: right; min-width: 56px; }
.mini-sel {
  appearance: none; -webkit-appearance: none; width: 100%;
  background: var(--panel) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%239a94a8' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 8px center;
  border: 1px solid var(--line2); border-radius: var(--r); padding: 6px 24px 6px 8px; outline: 0; font-size: 13px;
}
.mini-sel:focus { border-color: var(--ench); }
.mini-sel option { background: var(--panel2); }
.del { width: 28px; height: 28px; border-radius: var(--r); background: none; border: 1px solid transparent; position: relative; }
.del::before, .del::after { content: ""; position: absolute; left: 8px; top: 13px; width: 11px; height: 1.5px; background: var(--dim); transform: rotate(45deg); }
.del::after { transform: rotate(-45deg); }
.del:hover { border-color: rgba(255, 111, 111, .4); }
.del:hover::before, .del:hover::after { background: var(--danger); }

/* 外观 */
.look .field + .field { margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--line); }
.field label:not(.switch) { display: block; margin-bottom: 6px; font-size: 13px; color: var(--muted); }
.field .opt { margin-left: 6px; color: var(--dim); font-size: 12px; }
.name-row { display: flex; gap: 12px; align-items: center; }
.swatches { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.sw {
  width: 24px; height: 24px; border-radius: 3px; border: 2px solid transparent; padding: 0;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.12);
}
.sw.on { border-color: #fff; box-shadow: 0 0 0 1px var(--bg), 0 0 10px rgba(255,255,255,.3); }
.grad-row { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.grad-row input[type=color] { width: 36px; height: 30px; padding: 0; border: 1px solid var(--line2); border-radius: var(--r); background: none; }
.grad-bar { flex: 1; height: 10px; border-radius: 2px; }
.lore-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.lore { display: flex; gap: 6px; align-items: center; }
.lore .mini-sel { width: 92px; flex: none; }
.toggles { display: grid; gap: 12px; }
.toggles .switch { display: flex; color: var(--text); }

/* 价格清单 */
.receipt { position: sticky; top: 76px; }
.bill { padding: 4px 16px 6px; max-height: calc(100vh - 330px); overflow: auto; }
.bill-sec { padding: 8px 0; border-bottom: 1px dashed var(--line); }
.bill-sec:last-child { border-bottom: 0; }
.bill-sec h4 { margin: 0 0 4px; font-size: 11px; color: var(--dim); letter-spacing: .2em; font-weight: 600; }
.bill-row { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; font-size: 13px; }
.bill-row span { color: var(--muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bill-row span em { font-style: normal; color: var(--dim); font-family: var(--mono); font-size: 11.5px; margin-left: 4px; }
.bill-row b { font: 500 13px var(--mono); flex: none; }
.bill-row.tax span { color: var(--dim); }
.bill-total {
  display: flex; justify-content: space-between; align-items: baseline;
  margin: 0 16px; padding: 12px 0; border-top: 1px solid var(--line2);
}
.bill-total span { color: var(--muted); font-size: 13px; letter-spacing: .2em; }
.bill-total b { font: 700 26px var(--mono); color: var(--gold); text-shadow: 0 0 22px rgba(242, 196, 95, .35); }
.bill-total b.tick { animation: tick .35s ease; }
@keyframes tick { 40% { transform: translateY(-3px); color: #fff3cf; } }
.bill-actions { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 0 16px 16px; }
#editingHint { margin: -6px 16px 14px; }

/* ---------- 抽屉和弹窗 ---------- */
.sheet, .modal { position: fixed; inset: 0; z-index: 60; }
.sheet-mask { position: absolute; inset: 0; background: rgba(5, 4, 8, .66); backdrop-filter: blur(3px); animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; } }
.sheet-panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(440px, 100%);
  display: flex; flex-direction: column;
  background: var(--panel); border-left: 1px solid var(--line2);
  animation: slide .25s cubic-bezier(.2, .8, .2, 1);
}
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.sheet-head h3 { margin: 0; font-size: 16px; letter-spacing: .1em; }
.x { width: 32px; height: 32px; background: none; border: 1px solid transparent; border-radius: var(--r); position: relative; }
.x::before, .x::after { content: ""; position: absolute; left: 9px; top: 15px; width: 14px; height: 1.5px; background: var(--muted); transform: rotate(45deg); }
.x::after { transform: rotate(-45deg); }
.x:hover { border-color: var(--line2); }
.cart-list { flex: 1; overflow: auto; padding: 12px 18px; display: flex; flex-direction: column; gap: 10px; }
.ci {
  display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: start;
  background: var(--bg2); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px;
}
.ci .ico { margin-top: 2px; }
.ci h5 { margin: 0 0 2px; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ci p { margin: 0; color: var(--dim); font-size: 12px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ci .ci-r { text-align: right; }
.ci .ci-r b { display: block; font: 600 14px var(--mono); color: var(--gold); }
.ci .ci-ops { display: flex; gap: 4px; justify-content: flex-end; margin-top: 6px; }
.ci .ci-ops button { background: none; border: 1px solid var(--line2); border-radius: 3px; padding: 1px 7px; font-size: 12px; color: var(--muted); }
.ci .ci-ops button:hover { color: var(--text); border-color: var(--muted); }
.ci .ci-ops button.rm:hover { color: var(--danger); border-color: var(--danger); }
.cart-sum { padding: 12px 18px; border-top: 1px solid var(--line); }
.cart-sum .bill-total { margin: 0; padding: 8px 0 0; border: 0; }
.sheet-foot { padding: 0 18px 18px; padding-bottom: max(18px, env(safe-area-inset-bottom)); }

.modal { display: grid; place-items: center; padding: 20px; overflow: auto; }
.modal-panel {
  position: relative; width: min(460px, 100%);
  background: var(--panel); border: 1px solid var(--line2); border-radius: var(--r2);
  padding: 0 20px 20px; box-shadow: 0 30px 80px -20px #000;
  animation: rise .25s ease;
}
.modal-panel .sheet-head { margin: 0 -20px 16px; }
.modal-panel .field { margin-bottom: 14px; }
.order-total {
  display: flex; justify-content: space-between; align-items: baseline;
  background: var(--gold-soft); border: 1px solid rgba(242, 196, 95, .3); border-radius: var(--r); padding: 10px 14px; margin-bottom: 16px;
}
.order-total span { color: var(--muted); font-size: 13px; }
.order-total b { font: 700 22px var(--mono); color: var(--gold); }
.contact-row { display: grid; gap: 8px; }
.seg { display: flex; background: var(--bg2); border: 1px solid var(--line2); border-radius: var(--r); padding: 2px; }
.seg button { flex: 1; background: none; border: 0; border-radius: 3px; padding: 5px 0; color: var(--muted); font-size: 13px; }
.seg button.on { background: var(--panel3); color: var(--text); box-shadow: inset 0 0 0 1px var(--line2); }
.err { display: block; min-height: 0; color: var(--danger); font-size: 12px; margin-top: 4px; }
.err:empty { display: none; }
.field.bad input { border-color: var(--danger); }

/* 人机验证 */
.captcha {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg2); border: 1px solid var(--line2); border-radius: var(--r); padding: 12px 14px; margin-bottom: 4px;
  cursor: pointer; user-select: none; outline: 0;
}
.captcha:focus-visible { border-color: var(--ench); }
.cap-box {
  position: relative; width: 22px; height: 22px; border: 2px solid var(--line2); border-radius: 3px; background: var(--panel); flex: none;
  transition: border-color .2s, background .2s;
}
.captcha:hover .cap-box { border-color: var(--muted); }
.cap-text { flex: 1; }
.cap-brand { font-size: 11px; color: var(--dim); letter-spacing: .1em; }
.captcha.busy .cap-box { border-color: transparent; }
.captcha.busy .cap-box i {
  position: absolute; inset: -2px; border-radius: 50%; border: 2px solid var(--line2); border-top-color: var(--ench);
  animation: spin .7s linear infinite;
}
.captcha.ok { border-color: rgba(95, 211, 154, .45); cursor: default; }
.captcha.ok .cap-box { border-color: var(--ok); background: var(--ok); }
.captcha.ok .cap-box i { position: absolute; left: 6px; top: 1px; width: 6px; height: 12px; border: solid #0b1a12; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); animation: rise .2s ease; }

/* 提交成功 */
.done { text-align: center; padding-top: 28px; }
.done h3 { margin: 14px 0 4px; font-size: 20px; letter-spacing: .1em; }
.done .muted { margin: 0 0 18px; font-size: 13px; }
.done-mark {
  width: 64px; height: 64px; margin: 0 auto; border-radius: 50%; position: relative;
  background: radial-gradient(circle, rgba(95, 211, 154, .25), transparent 70%);
  border: 2px solid var(--ok); animation: pop .5s cubic-bezier(.3,1.6,.5,1);
}
.done-mark::after { content: ""; position: absolute; left: 22px; top: 12px; width: 14px; height: 26px; border: solid var(--ok); border-width: 0 3px 3px 0; transform: rotate(45deg); }
.order-no, .cc {
  display: flex; align-items: center; gap: 10px; text-align: left;
  background: var(--bg2); border: 1px solid var(--line2); border-radius: var(--r); padding: 10px 12px;
}
.order-no { border-color: rgba(242, 196, 95, .4); background: var(--gold-soft); margin-bottom: 10px; }
.order-no span, .cc span { color: var(--muted); font-size: 12px; width: 44px; flex: none; }
.order-no b { flex: 1; font: 700 17px var(--mono); color: var(--gold); letter-spacing: .04em; }
.cc b { flex: 1; font: 600 14px var(--mono); min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.contact-cards { display: grid; gap: 8px; margin-bottom: 18px; }
.copy { background: var(--panel3); border: 1px solid var(--line2); border-radius: 3px; padding: 3px 10px; font-size: 12px; color: var(--muted); flex: none; }
.copy:hover { color: var(--text); border-color: var(--muted); }

.flow { list-style: none; margin: 0; padding: 0; counter-reset: f; }
.flow li { position: relative; padding: 0 0 16px 40px; counter-increment: f; }
.flow li::before {
  content: counter(f, decimal-leading-zero); position: absolute; left: 0; top: 0;
  font: 700 12px/24px var(--mono); width: 28px; text-align: center; color: var(--ench); border: 1px solid rgba(180,140,255,.4); border-radius: 3px;
}
.flow li:not(:last-child)::after { content: ""; position: absolute; left: 14px; top: 30px; bottom: 4px; width: 1px; background: var(--line2); }
.flow b { display: block; }
.flow span { color: var(--muted); font-size: 13px; }

.toast {
  position: fixed; left: 50%; bottom: calc(24px + var(--dock-h)); z-index: 90; transform: translate(-50%, 20px);
  background: var(--panel3); border: 1px solid var(--line2); border-radius: var(--r); padding: 9px 16px; font-size: 13px;
  box-shadow: 0 12px 30px -10px #000; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
  max-width: calc(100vw - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.foot { border-top: 1px solid var(--line); padding: 20px 0 28px; color: var(--dim); font-size: 12px; }
.foot-in { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

.dock { display: none; }

/* ---------- 中等屏幕：物品选择改为顶部横条 ---------- */
@media (max-width: 1180px) {
  .studio { grid-template-columns: minmax(0, 1fr) 300px; }
  .picker { position: static; grid-column: 1 / -1; padding-bottom: 12px; }
  .picker .pane-head { padding-bottom: 8px; }
  .cat-list { display: flex; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .cat-list::-webkit-scrollbar { display: none; }
  .cat { flex: none; width: 68px; }
  .mat-list { flex-direction: row; overflow-x: auto; scrollbar-width: none; }
  .mat-list::-webkit-scrollbar { display: none; }
  .mat { flex: none; border-color: var(--line); }
  .mat .pr { display: none; }
}

/* ---------- 手机 ---------- */
@media (max-width: 820px) {
  :root { --dock-h: 64px; }
  .wrap { padding: 0 16px; }
  .ver-tag, .link-btn { display: none; }
  .ai-card .ai-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .ai-card .ai-chips::-webkit-scrollbar { display: none; }
  .ai-card .ai-chips button { flex: none; }
  .studio { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .receipt { display: none; }
  .stage { grid-template-columns: 1fr; padding: 22px 14px 16px; min-height: 0; gap: 18px; }
  .stage-glow, .stage-runes { left: 50%; top: 96px; }
  .stage-base { left: 50%; bottom: auto; top: 160px; }
  .stage-item, .stage-item .ico-xl { width: 96px; height: 96px; }
  .tooltip { justify-self: stretch; font-size: 13.5px; }
  .ench-list { grid-template-columns: 1fr; }
  .attr { grid-template-columns: minmax(0, 1fr) 90px 28px; row-gap: 6px; }
  .attr .at-name { grid-column: 1 / 2; }
  .attr .at-val { grid-column: 2 / 3; }
  .attr .del { grid-column: 3; grid-row: 1; }
  .attr .at-op { grid-column: 1 / 2; }
  .attr .at-slot { grid-column: 2 / 4; }
  .attr .pr { grid-column: 1 / -1; text-align: left; }
  .select-menu { width: min(300px, calc(100vw - 64px)); }
  .dock {
    display: flex; align-items: center; gap: 8px;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; height: var(--dock-h);
    padding: 10px 16px; padding-bottom: max(10px, env(safe-area-inset-bottom));
    background: rgba(17, 15, 23, .94); backdrop-filter: blur(10px); border-top: 1px solid var(--line2);
  }
  .dock-sum { flex: 1; display: flex; flex-direction: column; line-height: 1.2; }
  .dock-sum span { font-size: 11px; color: var(--dim); }
  .dock-sum b { font: 700 19px var(--mono); color: var(--gold); }
  .sheet-panel { top: auto; left: 0; width: 100%; max-height: 86vh; border-left: 0; border-top: 1px solid var(--line2); border-radius: 10px 10px 0 0; animation-name: up; }
  #sheet-bill .sheet-panel { padding-bottom: max(14px, env(safe-area-inset-bottom)); }
  #sheet-bill .bill { max-height: 60vh; }
  .modal { place-items: end center; padding: 0; }
  .modal-panel { width: 100%; border-radius: 10px 10px 0 0; padding-bottom: max(20px, env(safe-area-inset-bottom)); max-height: 92vh; overflow: auto; animation-name: up; }
  .foot { padding-bottom: 20px; }
}
@keyframes up { from { transform: translateY(40px); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* 暂停接单提示 */
.closed-note { margin: 0 16px 12px; padding: 8px 10px; border: 1px solid rgba(255, 179, 107, .35); border-radius: var(--r); background: rgba(255, 179, 107, .08); color: #ffcf9f; font-size: 12.5px; }
.sheet-foot .closed-note { margin: 0 0 10px; }

/* ---------- 顶部：文案 + AI 配装师对话窗 ---------- */
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 40px; align-items: center; }
.hero-copy .eyebrow { margin-bottom: 14px; }
.hero-copy .eyebrow::before { display: none; }
.hero-copy h1 { font-size: clamp(30px, 4vw, 48px); text-align: left; }
.hero-copy .sub { margin: 16px 0 22px; font-size: 15px; line-height: 1.75; max-width: 520px; }
.hero-points { list-style: none; margin: 0 0 20px; padding: 0; display: grid; gap: 12px; }
.hero-points li { position: relative; padding-left: 22px; }
.hero-points li::before { content: ""; position: absolute; left: 0; top: 7px; width: 8px; height: 8px; transform: rotate(45deg); background: linear-gradient(135deg, var(--ench), var(--gold)); }
.hero-points b { display: block; font-size: 14px; }
.hero-points span { color: var(--muted); font-size: 13px; }
.hero-meta { margin: 0; color: var(--dim); font-size: 12px; letter-spacing: .04em; }

.ai-slot { min-height: 520px; }
.ai-card {
  position: relative; display: flex; flex-direction: column; height: 520px;
  background: linear-gradient(180deg, rgba(27, 22, 40, .96), rgba(17, 15, 23, .98));
  border: 1px solid rgba(180, 140, 255, .35); border-radius: 10px;
  box-shadow: 0 30px 80px -30px rgba(124, 92, 255, .55), 0 0 0 1px rgba(255,255,255,.02) inset;
}
.ai-card::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(120deg, var(--ench-2), transparent 35%, transparent 65%, var(--gold));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
}
.ai-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.ai-ava {
  position: relative; flex: none; width: 38px; height: 38px; border-radius: 10px; overflow: hidden;
  background: conic-gradient(from 200deg, var(--ench-2), var(--ench), var(--gold), var(--ench-2));
  box-shadow: 0 0 20px rgba(180, 140, 255, .45);
}
.ai-ava i { position: absolute; inset: 3px; border-radius: 8px; background: #17121f; }
.ai-ava i::before, .ai-ava i::after { content: ""; position: absolute; top: 50%; width: 6px; height: 9px; margin-top: -5px; border-radius: 3px; background: #e9dcff; box-shadow: 0 0 8px var(--ench); animation: blink 4s infinite; }
.ai-ava i::before { left: 30%; } .ai-ava i::after { right: 30%; }
.ai-ava.sm { width: 28px; height: 28px; border-radius: 8px; }
.ai-ava.sm i { inset: 2px; border-radius: 6px; }
.ai-ava.sm i::before, .ai-ava.sm i::after { width: 4px; height: 7px; margin-top: -4px; }
@keyframes blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
.ai-title { flex: 1; display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.ai-title b { font-size: 15px; letter-spacing: .06em; }
.ai-title small { color: var(--muted); font-size: 12px; display: flex; align-items: center; gap: 6px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 8px var(--ok); flex: none; }
.dot.off { background: var(--dim); box-shadow: none; }
.ai-tool { background: none; border: 1px solid var(--line2); color: var(--muted); border-radius: var(--r); padding: 3px 10px; font-size: 12px; }
.ai-tool:hover { color: var(--text); border-color: var(--muted); }
.ai-close { display: none; }
.ai-log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 14px; scroll-behavior: smooth; overscroll-behavior: contain; }
.msg { display: flex; gap: 10px; align-items: flex-start; animation: rise .25s ease; }
.msg.me { justify-content: flex-end; }
.msg .bubble { max-width: 86%; padding: 10px 13px; border-radius: 10px; font-size: 14px; line-height: 1.65; word-break: break-word; }
.msg.me .bubble { background: linear-gradient(135deg, var(--ench-2), #9469ff); color: #fff; border-bottom-right-radius: 3px; white-space: pre-wrap; }
.msg.bot .bubble { background: var(--panel2); border: 1px solid var(--line); border-top-left-radius: 3px; color: #e6e1f0; }
.msg.bot .bubble p { margin: 0; white-space: pre-wrap; }
.msg.err .bubble { border-color: rgba(255, 111, 111, .4); color: #ffb3b3; }
.msg.typing .bubble { display: flex; gap: 5px; padding: 14px 16px; }
.msg.typing .bubble i { width: 7px; height: 7px; border-radius: 50%; background: var(--ench); animation: hop 1s infinite; }
.msg.typing .bubble i:nth-child(2) { animation-delay: .15s; } .msg.typing .bubble i:nth-child(3) { animation-delay: .3s; }
@keyframes hop { 0%, 60%, 100% { opacity: .3; transform: none; } 30% { opacity: 1; transform: translateY(-4px); } }
.plans { display: grid; gap: 6px; margin-top: 10px; }
.plan { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: 10px; align-items: center; background: var(--bg2); border: 1px solid var(--line2); border-radius: var(--r); padding: 7px 10px; }
.plan b { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plan small { display: block; color: var(--dim); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plan em { display: block; font-style: normal; color: #ffb36b; font-size: 11px; }
.plan > span { font: 600 13px var(--mono); color: var(--gold); }
.plan-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; font-size: 12px; color: var(--muted); }
.plan-foot span { flex: 1; min-width: 120px; }
.plan-foot button { background: none; border: 1px solid var(--line2); border-radius: 3px; padding: 2px 9px; color: var(--text); font-size: 12px; }
.plan-foot button:hover { border-color: var(--ench); }
.ai-card .ai-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 16px 10px; margin: 0; justify-content: flex-start; max-width: none; }
.ai-card .ai-chips button { background: rgba(180, 140, 255, .08); border: 1px solid rgba(180, 140, 255, .28); color: #d9ccf5; padding: 5px 11px; border-radius: 14px; font-size: 12.5px; }
.ai-card .ai-chips button:hover { background: rgba(180, 140, 255, .18); border-color: var(--ench); color: #fff; }
.ai-input { display: flex; align-items: flex-end; gap: 8px; margin: 0 12px; padding: 8px 8px 8px 12px; background: var(--bg2); border: 1px solid var(--line2); border-radius: 10px; transition: border-color .15s, box-shadow .15s; }
.ai-input:focus-within { border-color: var(--ench); box-shadow: 0 0 0 3px rgba(180, 140, 255, .15); }
.ai-input textarea { flex: 1; min-height: 24px; max-height: 120px; resize: none; border: 0 !important; background: none; padding: 3px 0; box-shadow: none !important; line-height: 1.5; font-size: 14px; }
.ai-send { flex: none; width: 36px; height: 36px; border: 0; border-radius: 8px; background: linear-gradient(135deg, var(--ench-2), var(--ench)); position: relative; }
.ai-send::before { content: ""; position: absolute; left: 50%; top: 50%; width: 11px; height: 11px; margin: -4px 0 0 -7px; border: solid #fff; border-width: 2px 2px 0 0; transform: rotate(45deg); }
.ai-send::after { content: ""; position: absolute; left: 50%; top: 50%; width: 13px; height: 2px; margin: 0 0 0 -8px; background: #fff; }
.ai-send:disabled { opacity: .4; cursor: not-allowed; }
.ai-foot { margin: 8px 16px 12px; color: var(--dim); font-size: 11.5px; text-align: center; }
.ai-card.off .ai-input { opacity: .5; }

/* 浮动模式：对话窗固定在右下角（手机上占满屏幕） */
.ai-card.floating {
  position: fixed; z-index: 70; right: 24px; bottom: 24px; width: min(440px, calc(100vw - 32px)); height: min(620px, calc(100vh - 110px));
  animation: rise .25s ease;
}
.ai-card.floating .ai-close { display: inline-block; }
.ai-fab {
  position: fixed; z-index: 45; right: 24px; bottom: calc(24px + var(--dock-h));
  display: flex; align-items: center; gap: 10px; padding: 8px 18px 8px 8px; border: 0; border-radius: 26px;
  background: linear-gradient(135deg, #2a1f45, #1b1528); color: #fff; font-weight: 700; letter-spacing: .04em;
  box-shadow: 0 0 0 1px rgba(180, 140, 255, .45), 0 14px 34px -10px rgba(124, 92, 255, .7);
  animation: rise .3s ease;
}
.ai-fab:hover { box-shadow: 0 0 0 1px var(--ench), 0 14px 40px -8px rgba(124, 92, 255, .9); }

@media (max-width: 1100px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .hero-copy { text-align: center; }
  .hero-copy h1 { text-align: center; }
  .hero-copy .sub { margin-left: auto; margin-right: auto; }
  .hero-points { display: none; }
  .hero-copy .eyebrow::before { display: inline-block; }
}
@media (max-width: 820px) {
  .hero { padding: 22px 0 18px; }
  .hero-copy h1 br { display: none; }
  .hero-copy .sub { font-size: 13.5px; margin: 10px auto 0; }
  .hero-meta { display: none; }
  .ai-slot { min-height: 460px; }
  .ai-card { height: 460px; }
  .ai-card.floating { inset: 0; width: auto; height: auto; border-radius: 0; padding-bottom: env(safe-area-inset-bottom); }
  .ai-fab { right: 16px; bottom: calc(12px + var(--dock-h)); }
  body.ai-open { overflow: hidden; }
}
