:root {
  --green: #0e3b28; --green-deep: #082a1c; --green-soft: #1a5038;
  --gold: #c9973a; --gold-light: #eccb7c; --gold-pale: #f6ecd6;
  --paper: #f7f3ea; --card: #fffdf8; --ink: #17261e; --mute: #6f766c; --line: #e7dfce; --red: #a93a2c;
  --serif: "Songti SC", "STSong", "Noto Serif SC", "SimSun", serif;
  --sans: -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  --shadow: 0 1px 2px rgba(23, 38, 30, .05), 0 12px 30px -18px rgba(23, 38, 30, .28);
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; min-width: 1180px; background: var(--paper); color: var(--ink); font: 14px/1.65 var(--sans); }
[hidden] { display: none !important; }
h1, h2, h3 { font-family: var(--serif); font-weight: 700; margin: 0; letter-spacing: .02em; }
button, .link { font: inherit; cursor: pointer; border-radius: 9px; padding: 7px 14px; border: 1px solid transparent; transition: background .15s, border-color .15s, color .15s, opacity .15s; text-decoration: none; display: inline-block; text-align: center; }
button:disabled { cursor: default; }
.primary { background: var(--green); color: #fff; font-weight: 600; }
.primary:hover:not(:disabled) { background: var(--green-deep); }
.primary:disabled { background: #d9d6cb; color: #fff; }
.ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.ghost:hover { border-color: var(--gold); background: var(--card); }
.big { width: 100%; padding: 12px; font-size: 15px; }
input { font: inherit; width: 100%; padding: 9px 11px; margin-top: 5px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink); }
input:focus { outline: 2px solid var(--gold); outline-offset: -1px; border-color: transparent; }
label { display: block; font-size: 13px; color: var(--mute); margin-bottom: 14px; }
.error { color: var(--red); margin: 0 0 12px; font-size: 13px; }
.hint { color: var(--mute); font-size: 13px; margin: 0; }

/* 登录 */
.login { position: fixed; inset: 0; display: grid; grid-template-columns: 1fr 460px; }
.login-show { background: radial-gradient(120% 90% at 20% 0%, var(--green-soft), var(--green) 45%, var(--green-deep)); color: #fff; padding: 56px 64px 0; overflow: hidden; display: flex; flex-direction: column; }
.login-logo { height: 40px; width: max-content; }
.login-show h1 { font-size: 40px; line-height: 1.3; margin-top: 48px; }
.login-show p { color: #cfdcd3; font-size: 15px; margin: 14px 0 0; }
.fan { position: relative; flex: 1; min-height: 300px; margin-top: 36px; }
.fan img { position: absolute; bottom: -90px; width: 300px; border-radius: 14px; box-shadow: 0 24px 50px rgba(0, 0, 0, .45); }
.fan img:nth-child(1) { left: 0; transform: rotate(-6deg); }
.fan img:nth-child(2) { left: 230px; z-index: 1; bottom: -50px; }
.fan img:nth-child(3) { left: 460px; transform: rotate(6deg); }
.login-side { background: var(--card); display: grid; place-items: center; padding: 40px; border-left: 3px solid var(--gold); }
.login-form { width: 100%; max-width: 320px; }
.login-form h2 { font-size: 26px; margin-bottom: 26px; }

/* 框架 */
.shell { display: grid; grid-template-columns: 216px 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; background: linear-gradient(180deg, var(--green), var(--green-deep)); color: #fff; padding: 26px 16px; display: flex; flex-direction: column; border-right: 2px solid var(--gold); }
.side-logo { height: 32px; width: max-content; margin: 0 8px 34px; }
.side-label { font-size: 12px; letter-spacing: .2em; color: #8fb09c; margin: 0 10px 10px; }
.nav { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; color: #dfe9e2; text-decoration: none; margin-bottom: 4px; font-size: 15px; }
.nav svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.nav.active { background: rgba(236, 203, 124, .16); color: var(--gold-light); font-weight: 600; box-shadow: inset 2px 0 0 var(--gold-light); }
.nav.off { color: #7f9c8b; cursor: default; }
.nav em { margin-left: auto; font-style: normal; font-size: 11px; color: #a9bfb2; border: 1px solid #4b6f5b; padding: 0 6px; border-radius: 20px; white-space: nowrap; }
.side-note { margin: auto 10px 0; font-size: 12px; color: #8fb09c; line-height: 1.7; }
.work { padding: 32px 40px 60px; min-width: 0; }
.head h1 { font-size: 30px; }
.head p { margin: 4px 0 0; color: var(--mute); }

/* 新建 */
.composer { display: grid; grid-template-columns: minmax(300px, 1fr) minmax(420px, 1.5fr) 250px; margin-top: 22px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.step { padding: 22px 24px; min-width: 0; border-left: 1px solid var(--line); }
.step:first-child { border-left: 0; }
.step h2 { display: flex; align-items: center; gap: 9px; font-size: 17px; margin-bottom: 14px; }
.step h2 i { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--green); color: var(--gold-light); font: 600 12px var(--sans); }
.step > .hint { margin-top: 10px; font-size: 12.5px; }
.count { margin-left: auto; font: 400 13px var(--sans); color: var(--mute); }
.name-row { display: flex; gap: 8px; }
.name-row input { margin: 0; flex: 1; min-width: 0; }
.name-row button { flex: none; }
.name-row button.ok { background: var(--gold-pale); border-color: var(--gold); color: var(--green); }
.name-result { margin-top: 10px; }
.name-result label { display: grid; grid-template-columns: 58px 1fr; align-items: center; margin: 0 0 6px; }
.name-result input { margin: 0; padding: 6px 10px; }
.photo-row { display: flex; flex-direction: column; gap: 10px; }
.drop { height: 66px; margin: 0; display: flex; align-items: center; justify-content: center; gap: 12px; padding: 0 14px; border: 1.5px dashed #d8c28e; border-radius: 12px; background: #fdf9ee; cursor: pointer; transition: background .15s, border-color .15s; }
.drop:hover, .drop.over { background: var(--gold-pale); border-color: var(--gold); }
.drop-text strong { color: var(--green); font-size: 14px; margin-right: 10px; }
.drop-text span { font-size: 12.5px; }
.drop-mark { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--green); }
.drop-mark svg { width: 18px; height: 18px; fill: none; stroke: var(--gold-light); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.thumbs { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; min-width: 0; }
.slot { aspect-ratio: 1; border-radius: 9px; background: var(--paper); border: 1px dashed var(--line); }
.thumb-item { position: relative; aspect-ratio: 1; border-radius: 9px; background: #fff center / contain no-repeat; border: 1px solid var(--line); }
.thumb-item.first { border-color: var(--gold); }
.thumb-item i { position: absolute; left: 5px; bottom: 5px; font: 600 10.5px var(--sans); background: var(--green); color: var(--gold-light); padding: 0 5px; border-radius: 5px; white-space: nowrap; }
.thumb-item button { position: absolute; top: 4px; right: 4px; width: 20px; height: 20px; padding: 0; line-height: 18px; border-radius: 50%; background: rgba(8, 42, 28, .78); color: #fff; font-size: 13px; opacity: 0; }
.thumb-item:hover button { opacity: 1; }
.go { display: flex; flex-direction: column; }
.specs { margin: 0 0 14px; }
.specs div { display: flex; justify-content: space-between; padding: 4px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.specs dt { color: var(--mute); }
.specs dd { margin: 0; font-weight: 600; color: var(--green); }
.go .primary { margin-top: auto; }
.go .error { margin: 8px 0 0; }

/* 作品 */
.gallery { margin-top: 30px; }
.gallery-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; min-height: 36px; }
.gallery-head h2 { font-size: 19px; }
#downloadAll { align-self: center; }
.filter { margin-left: auto; align-self: center; display: flex; align-items: center; gap: 6px; }
.seg { padding: 5px 13px; font-size: 13px; background: transparent; border-color: var(--line); color: var(--ink); }
.seg:hover { border-color: var(--gold); }
.seg.on { background: var(--green); border-color: var(--green); color: #fff; font-weight: 600; }
.seg-date { display: flex; align-items: center; gap: 7px; margin: 0 0 0 6px; font-size: 13px; color: var(--mute); }
.seg-date input { width: 138px; margin: 0; padding: 4px 8px; font-size: 13px; }
.seg-date.on input { border-color: var(--green); box-shadow: inset 0 0 0 1px var(--green); }
.none-day { color: var(--mute); padding: 26px 0; margin: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 20px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; transition: transform .18s, box-shadow .18s; }
.card:hover { transform: translateY(-2px); }
.pic { aspect-ratio: 11 / 15; position: relative; background: #efe9db center / cover no-repeat; }
.pic.done { cursor: zoom-in; }
.pic.waiting::after { content: ""; position: absolute; inset: 0; background: rgba(247, 243, 234, .55); }
.state { position: absolute; z-index: 1; left: 10px; right: 10px; bottom: 10px; background: var(--green-deep); color: #fff; font-size: 13px; padding: 9px 12px; border-radius: 10px; }
.state.failed { background: var(--red); }
.bar { height: 3px; margin-top: 7px; border-radius: 3px; background: rgba(255, 255, 255, .16); overflow: hidden; }
.bar::before { content: ""; display: block; height: 100%; width: 40%; border-radius: 3px; background: var(--gold-light); animation: slide 1.5s ease-in-out infinite; }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(260%); } }
.pcount { position: absolute; z-index: 1; top: 10px; right: 10px; font-size: 12px; background: rgba(8, 42, 28, .8); color: #fff; padding: 1px 8px; border-radius: 20px; }
.meta { padding: 10px 12px 2px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meta.none { color: var(--mute); font-weight: 400; }
.ops { display: flex; gap: 6px; padding: 8px 12px 12px; align-items: center; }
.ops button, .ops a { font-size: 13px; padding: 4px 10px; border-radius: 8px; }
.ops .quiet { background: none; border: 0; color: var(--mute); padding: 4px 6px; }
.ops .quiet:hover { color: var(--ink); }
.ops .danger { margin-left: auto; }
.ops .danger:hover { color: var(--red); }
.empty p { margin: 16px 0 0; color: var(--mute); }
.sample { margin: 0; border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); }
.sample img { display: block; width: 100%; }

/* 弹窗 */
dialog { border: 0; border-radius: 16px; padding: 24px; width: 470px; color: var(--ink); background: var(--card); box-shadow: 0 30px 80px rgba(8, 42, 28, .4); }
dialog::backdrop { background: rgba(8, 42, 28, .62); }
dialog h3 { font-size: 20px; margin-bottom: 2px; }
dialog .hint { margin-bottom: 16px; }
.feats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
#viewer { width: fit-content; max-width: calc(100vw - 60px); padding: 16px; overflow: visible; }
#viewer[open] { display: flex; gap: 24px; }
#viewerImg { display: block; height: calc(100vh - 110px); max-height: 900px; border-radius: 10px; }
.viewer-side { position: relative; width: 268px; flex: none; padding: 8px 8px 8px 0; display: flex; flex-direction: column; gap: 10px; }
.viewer-side h3 { font-size: 20px; line-height: 1.35; margin: 0; padding-right: 30px; }
.viewer-ar { margin: 0; font-size: 15px; color: var(--mute); }
.viewer-spec { margin: 0 0 8px; font-size: 13px; color: var(--green); font-weight: 600; }
.close { position: absolute; top: 2px; right: 4px; width: 28px; height: 28px; padding: 0; font-size: 20px; line-height: 1; background: none; color: var(--mute); }
.close:hover { color: var(--ink); }
.viewer-block { margin-top: 12px; padding-top: 14px; border-top: 1px solid var(--line); }
.viewer-block .hint { margin: 0 0 8px; }
.viewer-sources { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.viewer-sources img { width: 100%; aspect-ratio: 1; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: 7px; }
