:root { --ink: #111111; --muted: #767676; --line: #deddd9; --paper: #f4f3f1; --blue: #367bd3; }
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--paper); color: var(--ink); font-family: Arial, "PingFang SC", "Microsoft YaHei", sans-serif; }
button, input { font: inherit; }
button { color: inherit; }
.page-shell { max-width: 1470px; margin: 0 auto; padding: 45px 43px 52px; }
.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; margin-bottom: 28px; }
.hero h1 { margin: 0 0 7px; font-size: 28px; line-height: 1.05; letter-spacing: -1px; }
.hero p { margin: 0; color: #444; font-size: 15px; }
.limits { color: var(--muted); white-space: nowrap; font-size: 14px; }
.workspace { display: grid; grid-template-columns: minmax(430px, .84fr) minmax(560px, 1.16fr); gap: 24px; align-items: start; }
.panel { overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 1px 1px rgba(0,0,0,.02); }
.panel-head { height: 43px; padding: 0 20px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); color: #777; font: 700 12px/1 monospace; letter-spacing: 1px; }
.panel-body { padding: 20px 20px 25px; }
.dropzone { width: 100%; height: 208px; border: 1px dashed #cbc9c4; border-radius: 12px; background: #fff; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 18px; cursor: pointer; transition: .18s ease; }
.dropzone:hover, .dropzone.dragging { border-color: var(--blue); background: #f7faff; }
.dropzone strong { font-size: 17px; }
.dropzone span { color: #454545; font-size: 14px; }
.hidden-media { position: fixed; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.file-meta { margin: 16px 0 20px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.file-meta div { min-width: 0; min-height: 78px; padding: 13px 14px 15px; border: 1px solid var(--line); border-radius: 10px; display: flex; flex-direction: column; justify-content: center; gap: 8px; }
.file-meta span { color: #777; font-size: 12px; }
.file-meta strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; line-height: 1.45; padding-bottom: 1px; }
.controls { display: flex; flex-direction: column; gap: 15px; }
.controls label { display: grid; grid-template-columns: 120px 1fr 75px; align-items: center; gap: 12px; font-size: 14px; }
.controls output { text-align: right; font: 700 14px/1 monospace; }
.color-option { grid-template-columns: 18px max-content 1fr !important; cursor: pointer; }
.color-option input { width: 16px; height: 16px; margin: 0; accent-color: var(--blue); }
.color-option small { color: #888; font-size: 12px; }
.disabled-control { color: #aaa; opacity: .55; }
.disabled-control input { cursor: not-allowed; }
input[type="range"] { width: 100%; accent-color: var(--blue); cursor: pointer; }
.actions { display: flex; gap: 10px; margin-top: 20px; }
.actions button, .download { height: 42px; padding: 0 21px; border: 1px solid var(--line); border-radius: 23px; background: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; cursor: pointer; text-decoration: none; }
.actions .primary, .download { border-color: #82aee5; background: #79a7df; color: #fff; }
.actions button:disabled { cursor: not-allowed; opacity: .48; }
.progress-track { height: 7px; margin-top: 18px; overflow: hidden; border-radius: 10px; background: #efefed; }
.progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--blue); transition: width .15s linear; }
.status { margin-top: 16px; min-height: 18px; color: #444; font-size: 13px; }
.note { margin: 16px 0 0; color: #818181; font-size: 13px; line-height: 1.75; }
.preview-panel { min-height: 648px; }
.preview-grid { position: relative; min-height: 604px; padding: 100px 24px; display: flex; align-items: center; justify-content: center; background-color: #fff; background-image: linear-gradient(#eceae7 1px, transparent 1px), linear-gradient(90deg, #eceae7 1px, transparent 1px); background-size: 27px 27px; }
.preview-stage { width: 100%; min-height: 365px; padding: 20px; border: 1px solid #d8d6d2; border-radius: 14px; background: #fff; display: flex; align-items: center; justify-content: center; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,.03); }
.preview-stage span { color: #888; text-align: center; font-size: 14px; }
.preview-stage img { max-width: 100%; max-height: 475px; object-fit: contain; }
.download { position: absolute; right: 38px; bottom: 35px; background: var(--blue); }
.download[hidden] { display: none; }
@media (max-width: 900px) {
  .page-shell { padding: 28px 18px 40px; }
  .hero { align-items: flex-start; flex-direction: column; gap: 10px; }
  .workspace { grid-template-columns: 1fr; }
  .preview-panel { min-height: 520px; }
  .preview-grid { min-height: 476px; padding: 60px 18px; }
}
@media (max-width: 520px) {
  .page-shell { padding-inline: 12px; }
  .limits { white-space: normal; }
  .panel-body { padding-inline: 14px; }
  .dropzone { height: 170px; padding: 18px; text-align: center; }
  .file-meta { grid-template-columns: 1fr; }
  .controls label { grid-template-columns: 78px 1fr 62px; gap: 7px; font-size: 13px; }
  .actions { flex-wrap: wrap; }
}
