:root {
  --ink: #111114; --ink2: #5B5D66; --ink3: #70727C; --line: #E7E6E1; --line2: #DAD9D3;
  --soft: #F4F4F1; --page: #FFFFFF; --panel: #FAFAF8; --y: #2B59FF; --y-soft: #E7EDFF; --y-dark: #8DA6FF; --night: #16171C;
  --r: 14px; --mono: 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;
  --display: 'Archivo', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--page); color: var(--ink); font: 500 15px/1.5 Archivo, system-ui, -apple-system, "Segoe UI", "PingFang TC", "Noto Sans TC", sans-serif; }
[hidden] { display: none !important; }
a { color: var(--ink); }
a:hover { color: var(--ink2); }
button { font: inherit; color: inherit; }
input, select, textarea { font: inherit; color: var(--ink); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { color: var(--ink2); }
.small { font-size: 14px; } .xsmall { font-size: 12.5px; }
.center { text-align: center; }
.display { margin: 4px 0 6px; font-family: var(--display); font-weight: 900; font-stretch: 108%; font-size: 30px; line-height: 1.08; letter-spacing: -0.03em; }
.display-2 { margin: 0; font-family: var(--display); font-weight: 900; font-stretch: 108%; font-size: 26px; letter-spacing: -0.03em; }
.h2 { margin: 0 0 6px; font-size: 18px; }
.eyebrow { font-family: var(--mono); font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink2); }
code { font-family: var(--mono); font-size: .92em; background: rgba(255,255,255,.12); padding: 1px 5px; border-radius: 5px; }

/* header */
.top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 24px; border-bottom: 1px solid var(--line); }
.top-left { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-mark { width: 32px; height: 32px; border-radius: 9px; background: var(--y); display: flex; align-items: center; justify-content: center; }
.brand-logo { display: block; height: 20px; width: auto; }
.top-nav { display: flex; gap: 4px; }
.top-nav a { text-decoration: none; font-weight: 500; font-size: 14px; padding: 8px 12px; border-radius: 8px; color: var(--ink2); }
.top-nav a.on { background: var(--soft); color: var(--ink); font-weight: 600; }
.top-right { display: flex; align-items: center; gap: 12px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--ink); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 13px; }

/* controls */
label { display: block; font-size: 13px; color: var(--ink2); margin: 0 0 6px; }
.small-label { margin-top: 12px; font-size: 12.5px; }
input[type=text], input[type=email], input[type=url], input[type=search], textarea, select {
  width: 100%; height: 44px; border: 1px solid var(--line2); border-radius: 10px; padding: 0 12px; background: #fff; outline: none; }
textarea { height: auto; min-height: 140px; padding: 10px 12px; resize: vertical; line-height: 1.55; }
input:focus, textarea:focus, select:focus { border-color: var(--ink); }
input[type=file] { width: 100%; font-size: 14px; }
.plain-input { border: 0 !important; height: 26px !important; padding: 0 !important; background: transparent !important; }
.plain-input.strong { font-weight: 600; }
.plain-input:focus { box-shadow: 0 1px 0 var(--ink); }
.small-select { width: auto; height: 36px; font-size: 13.5px; padding: 0 8px; }
.inline-label { margin: 0; }
.code-input { font-family: var(--mono); font-size: 24px; letter-spacing: .4em; text-align: center; height: 56px !important; }
.btn { height: 44px; padding: 0 16px; border: 0; border-radius: 10px; font-weight: 600; font-size: 14px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap; text-decoration: none; }
.btn.big { height: 48px; font-size: 15px; border-radius: 12px; }
.btn.dark { background: var(--ink); color: #fff; }
.btn.yellow { background: var(--y); color: #fff; }
.btn.ghost { background: #fff; color: var(--ink); border: 1px solid var(--line2); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.grow { flex: 1 1 170px; }
.link-btn { background: none; border: 0; padding: 6px 2px; cursor: pointer; text-decoration: underline; font-weight: 500; color: var(--ink); }
.row { display: flex; gap: 8px; align-items: center; }
.row > input { flex: 1 1 auto; min-width: 0; }
.row.wrap { flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack-lg { display: flex; flex-direction: column; gap: 22px; }
.hint { font-size: 12.5px; color: var(--ink2); margin: 8px 0 0; }
.err { margin-top: 12px; background: #FFE9E5; color: #8E1F12; border-radius: 10px; padding: 10px 12px; font-size: 14px; }
.seg { display: inline-flex; padding: 3px; border-radius: 10px; background: #F0F0EC; margin-bottom: 12px; max-width: 100%; }
.seg.full { display: flex; margin-bottom: 20px; }
.seg.full button { flex: 1 1 0; }
.seg button { height: 36px; padding: 0 14px; border: 0; border-radius: 8px; background: transparent; color: var(--ink2); font-weight: 500; font-size: 13.5px; cursor: pointer; }
.seg button.on { background: #fff; color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips button { height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line2); background: #fff; font-weight: 500; font-size: 14px; cursor: pointer; }
.chips button.on { background: var(--ink); border-color: var(--ink); color: #fff; font-weight: 600; }
.pill { font-size: 13px; font-weight: 500; padding: 6px 12px; border-radius: 999px; background: var(--soft); }
.pill-yellow { display: inline-block; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--y-soft); }
.spin { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; display: inline-block; vertical-align: -2px; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* sign in */
.signin { min-height: calc(100vh - 62px); background: var(--panel); display: flex; flex-direction: column; align-items: center; padding: 48px 20px; }
.signin-card { width: 100%; max-width: 420px; background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 28px; }
.signin-card .display { font-size: 26px; }
.signin-card > p.muted { margin: 0 0 20px; font-size: 14px; }
.sent-to { margin: 0; font-size: 14px; color: var(--ink2); }
.round-icon { width: 52px; height: 52px; border-radius: 50%; background: var(--y-soft); margin: 4px auto 14px; display: flex; align-items: center; justify-content: center; }
#paneDone .muted { font-size: 14px; margin: 0 0 16px; }
.foot-note { margin: 20px 0 0; font-size: 12.5px; color: var(--ink3); }

/* studio layout: rail | tool | library — wraps to one column on phones */
.layout { display: flex; flex-wrap: wrap; align-items: stretch; min-height: calc(100vh - 62px); }
.rail { flex: 1 1 72px; min-width: 0; display: flex; flex-wrap: wrap; align-content: flex-start; gap: 8px; padding: 14px 8px; border-right: 1px solid var(--line); }
.rail-tool, .rail-soon { width: 56px; height: 64px; border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 10.5px; }
.rail-tool { border: 0; background: var(--ink); color: #fff; font-weight: 600; cursor: pointer; }
.rail-soon { border: 1.5px dashed #D6D5CF; color: var(--ink3); font-weight: 500; }
.tool { flex: 100 1 380px; min-width: 0; padding: 28px 24px 48px; border-right: 1px solid var(--line); background: var(--panel); }
.library { flex: 999 1 560px; min-width: 0; padding: 28px 28px 48px; }
@media (max-width: 560px) { .rail { border-right: 0; border-bottom: 1px solid var(--line); } .tool { border-right: 0; padding: 22px 16px 36px; } .library { padding: 24px 16px 40px; } .top { padding: 12px 16px; } }

.card { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 18px; }
.step-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.step-head h2 { margin: 0; font-size: 15px; font-weight: 600; }
.num { width: 22px; height: 22px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.song-card { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 10px; border-radius: 12px; background: var(--soft); }
.song-card img { width: 52px; height: 52px; border-radius: 9px; object-fit: cover; background: var(--night); flex: 0 0 auto; }
.song-fields { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.soft-box { font-size: 14px; color: var(--ink2); padding: 12px; border-radius: 12px; background: var(--soft); }
.found { border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.found-text { font-size: 14px; line-height: 1.6; margin-top: 8px; max-height: 210px; overflow: auto; white-space: pre-line; }
.found.ok { border-color: var(--ink); }
.others { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.others .xsmall { margin: 0; }
.others button { text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; font-size: 13px; cursor: pointer; }
.line-list { max-height: 240px; overflow: auto; border: 1px solid var(--line); border-radius: 12px; margin-top: 4px; }
.line-list button { display: flex; gap: 12px; width: 100%; text-align: left; background: #fff; border: 0; border-bottom: 1px solid #F0EFEA; padding: 10px 12px; cursor: pointer; font-size: 14px; align-items: baseline; }
.line-list button:last-child { border-bottom: 0; }
.line-list button .t { font-family: var(--mono); font-size: 12px; color: var(--ink3); flex: 0 0 auto; }
.line-list button.rep::after { content: "repeats"; margin-left: auto; font-size: 11px; color: var(--ink2); background: var(--soft); border-radius: 6px; padding: 1px 6px; }
.line-list button.on { background: var(--ink); color: #fff; }
.line-list button.on .t { color: #ccc; }
.line-list button.in { background: var(--y-soft); }
.opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.opt { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 15px; border-radius: 12px; border: 1px solid var(--line2); background: #fff; color: var(--ink2); cursor: pointer; text-align: left; }
.opt.on { border: 2px solid var(--ink); padding: 14px; color: var(--ink); }
.opt b { font-size: 14px; }
.shape { border: 2px solid currentColor; border-radius: 4px; }
.shape.v { width: 18px; height: 30px; } .shape.h { width: 34px; height: 20px; margin: 5px 0; }
.dashed { border: 1.5px dashed #D6D5CF; border-radius: 12px; padding: 16px; font-size: 14px; color: var(--ink2); text-align: center; }
.dashed b { color: var(--ink); }
.shot { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 12px; background: var(--soft); }
.shot + .shot { margin-top: 8px; }
.shot-thumb { width: 44px; height: 44px; border-radius: 9px; background: var(--night); color: var(--y-dark); font-family: var(--display); font-weight: 700; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.shot-x { width: 40px; height: 40px; border: 0; border-radius: 10px; background: transparent; cursor: pointer; display: flex; align-items: center; justify-content: center; margin-left: auto; }
.generate { width: 100%; height: 52px; border-radius: 999px; font-size: 16px; font-weight: 800; background: var(--y); color: #fff; }
.generate:disabled { background: #ECEBE6; color: var(--ink3); opacity: 1; }

/* ready */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.stat b { display: block; font-family: var(--display); font-weight: 900; font-size: 26px; line-height: 1.1; }
.stat span { font-size: 12px; color: var(--ink2); }
.files { padding: 6px 14px; }
.file { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid #F0EFEA; }
.file:last-child { border-bottom: 0; }
.ext { width: 46px; height: 26px; border-radius: 6px; background: var(--soft); font: 600 10.5px var(--mono); display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.fmeta { min-width: 0; }
.fname { display: block; font-size: 14px; }
.fdesc { display: block; font-size: 12.5px; color: var(--ink2); }
.ext { white-space: nowrap; overflow: hidden; }
.dark-card { background: var(--night); color: #F4F1EA; border-radius: 14px; padding: 18px; }
.dark-card ol { margin: 10px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; color: #D8D5CE; }
.dark-card a { color: var(--y-dark); }
.dark-card .y { color: var(--y-dark); }

/* library */
.lib-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.lib-head p { margin: 4px 0 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; align-items: start; }
.fx { background: #fff; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; }
.fx-preview { position: relative; background: #0D0E11; }
.fx-preview canvas { display: block; width: 100%; aspect-ratio: 3 / 4; }
.fx-badge { position: absolute; top: 10px; left: 10px; font-size: 11px; font-weight: 600; letter-spacing: .04em; padding: 4px 8px; border-radius: 999px; background: rgba(255,255,255,.14); color: #F4F1EA; }
.fx-soon { aspect-ratio: 3 / 4; background: #F6F6F3; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: var(--ink3); font-size: 13px; font-weight: 500; }
.fx-body { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.fx-body h3 { margin: 0; font-family: var(--display); font-weight: 900; font-stretch: 105%; font-size: 19px; line-height: 1.2; letter-spacing: -0.01em; }
.fx-body p { margin: 0; font-size: 13.5px; color: var(--ink2); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags span { font-size: 12px; font-weight: 500; padding: 3px 9px; border-radius: 999px; background: var(--soft); color: #3C3E46; }
.fx-add { height: 44px; border: 0; border-radius: 11px; background: var(--ink); color: #fff; font-weight: 600; font-size: 14px; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; }
.fx-add.added { background: var(--y); color: #fff; }
.fx-add:disabled { background: #FAFAF8; color: var(--ink3); border: 1px solid var(--line); cursor: not-allowed; font-weight: 500; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 14px; z-index: 10; max-width: calc(100% - 32px); }

.req { display: inline-block; margin-left: 6px; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: var(--y-soft); color: var(--y); vertical-align: 1px; }
.dark-seg { background: rgba(255,255,255,.08); margin: 12px 0 4px; }
.dark-seg button { color: #B9BAC2; }
.dark-seg button.on { background: #fff; color: var(--ink); }
.path-sub { margin: 8px 0 0; font-size: 13px; color: #B9BAC2; }
.path-note { margin: 14px 0 0; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.12); font-size: 13px; color: #B9BAC2; }
.alt-audio { margin-top: 10px; font-size: 13.5px; } .alt-audio summary { cursor: pointer; color: var(--ink2); font-weight: 500; } .alt-audio input { margin-top: 8px; }
.phone-steps { margin: 10px 0; padding: 12px; border-radius: 12px; background: var(--y-soft); font-size: 13.5px; line-height: 1.5; }
.phone-steps ol { margin: 8px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }

.shot-hint { margin: 10px 2px 0; }
