*,*::before,*::after{box-sizing:border-box}
[hidden]{display:none !important}
html,body{margin:0;padding:0;background:#fff;color:#111;font:14px/1.55 -apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,"PingFang SC","Microsoft YaHei",sans-serif}
body{min-height:100vh;display:flex;flex-direction:column}

.top{display:flex;align-items:center;justify-content:space-between;padding:14px 22px;border-bottom:1px solid #000;background:#fff;position:sticky;top:0;z-index:10}
.brand{font-weight:700;letter-spacing:2px;font-size:15px}
.tabs{display:flex;gap:0}
.tab{all:unset;cursor:pointer;padding:8px 16px;border:1px solid #000;font-size:13px}
.tab+.tab{border-left:none}
.tab.active{background:#000;color:#fff}

.wrap{flex:1;display:grid;grid-template-columns:340px 1fr;gap:0}
@media(max-width:900px){.wrap{grid-template-columns:1fr}}

.panel{padding:20px;border-right:1px solid #000;display:flex;flex-direction:column;gap:14px;background:#fafafa}
@media(max-width:900px){.panel{border-right:none;border-bottom:1px solid #000}}
.field{display:flex;flex-direction:column;gap:6px}
.field>span{font-size:11px;letter-spacing:1px;text-transform:uppercase;color:#555}
.row{display:grid;grid-template-columns:1fr 1fr;gap:12px}

textarea,input[type=file],select,input[type=text]{
  width:100%;font:inherit;color:#111;background:#fff;border:1px solid #000;border-radius:0;padding:8px 10px;outline:none;
}
textarea{resize:vertical;font-family:ui-monospace,SFMono-Regular,Menlo,monospace}
select{appearance:none;background-image:linear-gradient(45deg,transparent 50%,#000 50%),linear-gradient(135deg,#000 50%,transparent 50%);background-position:calc(100% - 16px) 50%,calc(100% - 11px) 50%;background-size:5px 5px,5px 5px;background-repeat:no-repeat;padding-right:28px}

textarea:focus,select:focus,input:focus{box-shadow:inset 0 0 0 1px #000}

.thumbs{display:flex;flex-wrap:wrap;gap:6px;margin-top:4px}
.thumbs img{width:56px;height:56px;object-fit:cover;border:1px solid #000}

.go{all:unset;cursor:pointer;text-align:center;padding:12px;border:1px solid #000;background:#000;color:#fff;font-weight:700;letter-spacing:2px;margin-top:4px}
.go:hover{background:#fff;color:#000}
.go:disabled{opacity:.5;cursor:wait}

.stage{padding:24px;display:flex;flex-direction:column;gap:16px;min-width:0}

.progress .bar{height:4px;background:#eee;border:1px solid #000;position:relative;overflow:hidden}
.progress .fill{height:100%;background:#000;width:0;transition:width .3s ease}
.progress .meta{display:flex;justify-content:space-between;font-size:12px;color:#555;margin-top:6px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace}

.error{padding:12px;border:1px solid #000;background:#000;color:#fff;white-space:pre-wrap;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px}

.revised{padding:10px 12px;border:1px dashed #000;color:#333;font-size:12px;white-space:pre-wrap}

.gallery{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:14px}
.card{border:1px solid #000;background:#fff;display:flex;flex-direction:column}
.card img{width:100%;height:auto;display:block;cursor:zoom-in;background:#f3f3f3}
.card .foot{display:flex;justify-content:space-between;align-items:center;padding:8px 10px;border-top:1px solid #000;font-size:12px;color:#555;font-family:ui-monospace,SFMono-Regular,Menlo,monospace}
.card a{color:#000;text-decoration:underline}

.lightbox{position:fixed;inset:0;background:rgba(0,0,0,.92);display:flex;align-items:center;justify-content:center;z-index:50;cursor:zoom-out}
.lightbox img{max-width:96vw;max-height:92vh;display:block;cursor:default}
.lb-close{all:unset;position:fixed;top:14px;right:20px;color:#fff;font-size:32px;cursor:pointer;line-height:1;padding:4px 10px}
