@font-face { font-family: "Smiley"; src: url("fonts/smiley-subset.woff2") format("woff2"); font-display: swap; }
:root {
  --paper: #f6f1e7; --paper-2: #fffdf8; --ink: #1f1d1a; --ink-2: #6c655a; --line: #d9d0c1;
  --red: #e8452c; --red-dark: #bd3019; --yellow: #ffd23f; --green: #1c7f61;
  --gutter: 16px; --radius: 14px;
  --body: -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --display: "Smiley", var(--body);
  color-scheme: light;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--ink); font: 16px/1.55 var(--body);
  background: radial-gradient(80% 40% at 10% 90%, rgba(35,160,122,.09), transparent), radial-gradient(70% 35% at 95% 45%, rgba(232,69,44,.06), transparent), var(--paper);
  background-attachment: fixed; min-height: 100dvh;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }

/* 顶栏：和竖屏四区模板的黑色标题带同一个语言 */
.bar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--ink); color: #fff; padding: calc(10px + env(safe-area-inset-top)) var(--gutter) 10px; }
.brand { font: 26px/1.1 var(--display); color: #fff; text-decoration: none; letter-spacing: .02em; }
.brand em { font-style: normal; color: var(--yellow); }
.bar-action { background: var(--yellow); color: var(--ink); font-weight: 700; text-decoration: none; padding: 8px 14px; border-radius: 99px; font-size: 15px; white-space: nowrap; }

.bar-nav { display: flex; align-items: center; gap: 14px; }
.bar-link { color: #fff; font-size: 15px; text-underline-offset: 4px; white-space: nowrap; }

main { max-width: 680px; margin: 0 auto; padding: 20px var(--gutter) 120px; outline: none; }
h1 { font: 34px/1.15 var(--display); margin: 8px 0 6px; overflow-wrap: anywhere; }
h1.title { font: 800 26px/1.25 var(--body); }   /* 用户起的标题什么字都有，子集字体覆盖不了 */
h2 { font: 22px/1.2 var(--display); margin: 32px 0 10px; }
.lead { color: var(--ink-2); margin: 0 0 18px; }
.muted { color: var(--ink-2); font-size: 14px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 48px; padding: 10px 20px; border: 2px solid var(--ink);
  border-radius: 12px; background: var(--paper-2); font-weight: 700; text-decoration: none; cursor: pointer; touch-action: manipulation; }
.btn.primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn.primary:active { background: var(--red-dark); }
.btn.wide { width: 100%; }
.btn.quiet { border-color: var(--line); background: transparent; font-weight: 500; min-height: 44px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.link { background: none; border: 0; padding: 0; color: var(--red-dark); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-size: inherit; }

.field { display: block; margin: 0 0 22px; }
.field > .label { display: block; font-weight: 700; margin-bottom: 8px; }
.input { width: 100%; min-height: 48px; padding: 11px 13px; border: 2px solid var(--line); border-radius: 12px; background: var(--paper-2); font-size: 16px; }
.input:focus { border-color: var(--ink); outline: none; }
textarea.input { min-height: 132px; resize: vertical; }

/* 选文件 */
.drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 148px; padding: 18px; text-align: center;
  border: 2px dashed var(--ink); border-radius: var(--radius); background: var(--paper-2); cursor: pointer; }
.drop strong { font: 24px/1.2 var(--display); }
.drop.has-file { border-style: solid; }
.drop.has-file strong { font: 700 16px/1.4 var(--body); overflow-wrap: anywhere; }
.sr { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.sr:focus-visible + .drop { outline: 3px solid var(--red); outline-offset: 2px; }

/* 版式卡片 */
.layouts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.lc { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 12px; min-height: 100%; border: 2px solid var(--line); border-radius: var(--radius); background: var(--paper-2); cursor: pointer; text-align: left; }
.lc.on { border-color: var(--red); box-shadow: inset 0 0 0 1px var(--red); }
.lc input { position: absolute; opacity: 0; }
.lc:has(input:focus-visible) { outline: 3px solid var(--red); outline-offset: 2px; }
.lc svg { height: 92px; width: 100%; display: block; }
.lc b { font-size: 16px; }
.lc small { color: var(--ink-2); font-size: 13px; line-height: 1.4; }
.lc .tag { position: absolute; top: 8px; right: 8px; background: var(--yellow); font-size: 12px; font-weight: 700; padding: 1px 7px; border-radius: 99px; }
.t-ink { fill: var(--ink); } .t-red { fill: var(--red); } .t-mid { fill: #bdb4a5; } .t-paper { fill: #efe8da; } .t-yel { fill: var(--yellow); }

.note { padding: 11px 14px; border-radius: 12px; font-size: 15px; margin: 0 0 16px; border-left: 5px solid var(--ink); background: var(--paper-2); }
.note.warn { border-color: var(--yellow); background: #fff6d6; }
.note.err { border-color: var(--red); background: #fdeae5; }

/* 进度 */
.progress { height: 12px; background: #e7dfd1; border-radius: 99px; overflow: hidden; margin: 10px 0 6px; }
.progress > i { display: block; height: 100%; width: 0; background: var(--red); transition: width .3s; }

.stages { list-style: none; margin: 18px 0; padding: 0; border-left: 3px solid var(--line); }
.stages li { position: relative; padding: 7px 0 7px 18px; color: var(--ink-2); }
.stages li::before { content: ""; position: absolute; left: -9px; top: 13px; width: 15px; height: 15px; border-radius: 50%; background: var(--paper); border: 3px solid var(--line); }
.stages li.done { color: var(--ink); } .stages li.done::before { background: var(--ink); border-color: var(--ink); }
.stages li.now { color: var(--ink); font-weight: 700; } .stages li.now::before { background: var(--red); border-color: var(--red); animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(232,69,44,.18); } }

/* 视频列表 */
.jobs { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 10px; }
.job { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; align-items: center; padding: 14px; border-radius: var(--radius); background: var(--paper-2); border: 2px solid transparent; box-shadow: 0 1px 0 var(--line); text-decoration: none; }
.job:active { border-color: var(--ink); }
.job b { overflow-wrap: anywhere; font-size: 17px; }
.job span.muted { grid-column: 1; }
.pill { grid-row: 1 / span 2; grid-column: 2; font-size: 13px; font-weight: 700; padding: 3px 10px; border-radius: 99px; background: #e7dfd1; white-space: nowrap; }
.pill.SUCCEEDED { background: #d5eee4; color: #115a44; } .pill.FAILED { background: #fbd9d1; color: var(--red-dark); } .pill.RUNNING { background: var(--yellow); }
.empty { text-align: center; padding: 42px 10px; }
.empty p { font: 26px/1.3 var(--display); margin: 0 0 16px; }

/* 成片 */
.player { display: block; width: 100%; max-height: 72dvh; background: #111; border-radius: var(--radius); margin: 12px 0; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0 8px; }
.actions .btn { flex: 1 1 140px; }

/* 校样稿：逐句改，像在稿子上批改 */
.proof { list-style: none; counter-reset: none; margin: 0; padding: 4px 0; background: var(--paper-2); border-radius: var(--radius); box-shadow: 0 1px 0 var(--line); }
.ph { display: grid; grid-template-columns: 46px minmax(0, 1fr) 44px; align-items: center; border-bottom: 1px solid #eee7da; min-height: 50px; }
.ph:last-child { border-bottom: 0; }
.ph .ts { background: none; border: 0; height: 100%; min-height: 44px; color: var(--ink-2); font-size: 12px; font-variant-numeric: tabular-nums; cursor: pointer; padding: 0 0 0 6px; }
.ph .tx { width: 100%; min-height: 48px; border: 0; background: transparent; padding: 11px 4px; font-size: 17px; line-height: 1.4; border-radius: 0; }
.ph .tx:focus { outline: none; background: #fff6d6; }
.ph .rm { width: 44px; height: 48px; border: 0; background: none; color: var(--ink-2); font-size: 20px; cursor: pointer; }
.ph.edited .tx { background: linear-gradient(transparent 62%, var(--yellow) 62%); font-weight: 600; }
.ph.dropped .tx { color: var(--red-dark); text-decoration: line-through; text-decoration-thickness: 2px; background: none; }
.ph.dropped .rm { color: var(--red-dark); font-size: 13px; font-weight: 700; }

.dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 9; background: var(--ink); color: #fff; padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom)); }
.dock > div { max-width: 648px; margin: 0 auto; display: flex; align-items: center; gap: 12px; justify-content: space-between; }
.dock .btn { border-color: var(--yellow); background: var(--yellow); color: var(--ink); white-space: nowrap; }
.dock .link { color: #fff; }

/* 截图素材 */
.shots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 14px 0; padding: 0; list-style: none; }
.shot { background: var(--paper-2); border-radius: var(--radius); overflow: hidden; box-shadow: 0 1px 0 var(--line); }
.shot img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; background: #e7dfd1; }
.shot div { padding: 9px 11px; }
.shot b { display: block; font-size: 15px; overflow-wrap: anywhere; }
.shot .link { display: block; font-size: 14px; margin-top: 4px; }
.shot .warn { color: var(--red-dark); }
.row { display: flex; gap: 8px; align-items: stretch; }
.row .input { flex: 1; min-width: 0; }
@media (min-width: 560px) { .shots { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.danger { margin-top: 42px; text-align: center; }
#toast { position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 20; max-width: min(92vw, 480px); width: max-content; padding: 10px 16px; border-radius: 12px; background: var(--ink); color: #fff; font-size: 15px; box-shadow: 0 8px 24px rgba(0,0,0,.25); }

@media (min-width: 560px) { .layouts { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
