/* 入口页和等待页。简洁版：白底黑字，灰色做辅助，红色只在出错时出现。样稿见任务 10-27-link-entry 的 research/mockups/d_simple.png。 */
:root { --fg: #141414; --mute: #8A8A8A; --line: #E6E6E6; --edge: #CFCFCF; --faint: #A3A3A3; --red: #D93025; --red-bg: #FDF2F1; }

* { margin: 0; padding: 0; box-sizing: border-box; }
html { background: #fff; -webkit-text-size-adjust: 100%; }
body { background: #fff; color: var(--fg); font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased; }
body.locked { overflow: hidden; }
.d { max-width: 480px; margin: 0 auto; padding: 30px 22px 48px; min-height: 100vh; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }

.mark { font-size: 13px; color: var(--mute); }
.btn { display: grid; place-items: center; width: 100%; height: 50px; border: 0; border-radius: 10px; background: var(--fg); color: #fff;
  font: inherit; font-size: 16px; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn:disabled { opacity: .6; cursor: default; }
.offline { margin-top: 14px; padding: 10px 12px; border-radius: 8px; background: #F4F4F4; font-size: 13px; line-height: 1.6; }

/* 入口 */
h1 { font-size: 30px; line-height: 1.35; font-weight: 600; margin: 56px 0 30px; }
label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 8px; }
textarea { display: block; width: 100%; height: 76px; resize: none; border: 1px solid var(--edge); border-radius: 10px; padding: 11px 13px;
  font: inherit; font-size: 16px; line-height: 1.5; color: var(--fg); background: #fff; }
textarea::placeholder { color: var(--faint); }
textarea:focus { outline: none; border-color: var(--fg); box-shadow: 0 0 0 1px var(--fg); }
textarea[aria-invalid="true"] { border-color: var(--red); }
textarea[aria-invalid="true"]:focus { box-shadow: 0 0 0 1px var(--red); }
.help { font-size: 13px; line-height: 1.6; color: var(--mute); margin-top: 9px; }
.err { font-size: 13px; line-height: 1.6; color: var(--red); margin-top: 6px; }
.entry .btn { margin-top: 22px; }
input.code { display: block; width: 100%; height: 50px; border: 1px solid var(--edge); border-radius: 10px; padding: 0 13px; background: #fff;
  color: var(--fg); font: 600 18px Menlo, monospace; letter-spacing: .14em; text-transform: uppercase; }
input.code::placeholder { color: var(--faint); font-weight: 400; }
input.code:focus { outline: none; border-color: var(--fg); box-shadow: 0 0 0 1px var(--fg); }
input.code[aria-invalid="true"] { border-color: var(--red); }
input.code[aria-invalid="true"]:focus { box-shadow: 0 0 0 1px var(--red); }
.codebar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 18px; padding: 10px 12px;
  border-radius: 10px; background: #F4F4F4; font-size: 13px; color: var(--mute); }
.codebar b { margin-left: 6px; font: 600 14px Menlo, monospace; letter-spacing: .08em; color: var(--fg); }
.codebar .change { border: 0; background: none; padding: 4px 0; font: inherit; color: var(--fg); text-decoration: underline; cursor: pointer; }
.h1s { font-size: 26px; margin: 30px 0 22px; }
.note { font-size: 13px; line-height: 1.7; color: var(--mute); margin-top: 16px; }

/* 等待 */
.head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 40px 0 22px; }
.head h2 { font-size: 26px; font-weight: 600; }
.head .t { font-size: 14px; color: var(--mute); font-variant-numeric: tabular-nums; white-space: nowrap; }
.gap { height: 40px; }
.queue { font-size: 14px; line-height: 1.7; color: var(--mute); margin: -8px 0 18px; }

.fig { display: grid; grid-template-columns: 76px 1fr; column-gap: 14px; align-items: center; width: 100%; padding: 12px; margin-bottom: 18px;
  border: 1px solid var(--line); border-radius: 12px; background: #fff; color: inherit; font: inherit; text-align: left; }
button.fig { cursor: pointer; padding-bottom: 0; }
button.fig:disabled { cursor: default; }
.fig.noimg { grid-template-columns: 1fr; }
.fig .img { width: 76px; height: 76px; border-radius: 6px; background: #E9E9E9; overflow: hidden; }
.fig .img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.fig .k { font-size: 12.5px; color: var(--mute); }
.fig .nm { font-size: 22px; font-weight: 600; margin-top: 1px; }
.fig .en { font-size: 13px; color: var(--mute); }
.fig .wk { font-size: 12.5px; color: var(--mute); margin-top: 4px; }
.fig .go { grid-column: 1 / -1; display: flex; justify-content: space-between; margin-top: 12px; padding: 11px 0 12px;
  border-top: 1px solid var(--line); font-size: 14px; font-weight: 600; }
.fig .go .ch { color: var(--mute); font-weight: 400; }
button.fig:disabled .go { color: var(--mute); font-weight: 400; }
.wait { font-size: 13px; line-height: 1.6; color: var(--mute); margin: -6px 0 16px; }

.steps { list-style: none; border-top: 1px solid var(--line); }
.st { display: grid; grid-template-columns: 30px 1fr auto; column-gap: 8px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.st .ic { width: 20px; height: 20px; margin-top: 1px; border-radius: 50%; border: 1.5px solid var(--edge); display: grid; place-items: center;
  color: #fff; font-size: 12px; font-weight: 700; line-height: 1; }
.st .nm { font-size: 15.5px; }
.st .tm { grid-column: 3; grid-row: 1; padding-top: 2px; font-size: 13px; color: var(--mute); font-variant-numeric: tabular-nums; white-space: nowrap; }
.st .sub { grid-column: 2; margin-top: 3px; font-size: 13px; line-height: 1.6; color: var(--mute); }
.st .sub span { display: block; }
.st.done .ic { background: var(--fg); border-color: var(--fg); }
.st.running .ic { border-color: #E2E2E2; border-top-color: var(--fg); animation: spin 1s linear infinite; }
.st.pending .nm { color: var(--faint); }
.st.failed .ic { background: var(--red); border-color: var(--red); }
.st.failed .sub { color: var(--red); }
@keyframes spin { to { transform: rotate(360deg); } }

.addr { font-size: 13px; line-height: 1.7; color: var(--mute); margin-top: 18px; }
.addr code { display: block; font: 12.5px Menlo, monospace; color: var(--fg); word-break: break-all; }
.errbox { margin-top: 20px; padding: 14px 14px 16px; border-radius: 10px; background: var(--red-bg); }
.errbox p { font-size: 14px; line-height: 1.7; }
.errbox .why { font-size: 13px; color: #6B6B6B; margin: 2px 0 14px; word-break: break-all; }
.errbox .codeok { font-size: 13px; color: #6B6B6B; margin: -6px 0 14px; }
.errbox .codeok a { color: var(--fg); }
.errbox .retrymsg { font-size: 13px; color: var(--red); margin-top: 8px; }
.errbox .retrymsg:empty { display: none; }
.lost p { font-size: 15px; line-height: 1.8; margin: 56px 0 18px; }
.lost a { color: var(--fg); font-size: 15px; }

/* 分享图弹层 */
.modal { position: fixed; inset: 0; z-index: 10; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 48px 24px 24px; overflow-y: auto; background: rgba(16, 16, 16, .94); color: #fff;
  --w: min(340px, 100%, calc((100vh - 230px) * 3 / 4)); }
.modal :focus-visible { outline-color: #fff; }
.modal .x { position: absolute; top: 8px; right: 10px; width: 44px; height: 44px; border: 0; background: none; color: #fff;
  font-size: 30px; line-height: 1; cursor: pointer; opacity: .85; }
.modal .shareimg { display: block; width: var(--w); aspect-ratio: 3 / 4; border-radius: 8px; background: #2A2A2A; object-fit: contain; flex: none; }
.modal .acts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: var(--w); margin-top: 16px; }
.modal .acts.one { grid-template-columns: 1fr; }
.btn.light { background: #fff; color: var(--fg); }
.btn.ghost { background: transparent; color: #fff; border: 1px solid rgba(255, 255, 255, .6); }
.modal .more { margin-top: 16px; font-size: 14px; color: #fff; opacity: .9; }
.modal .msg { min-height: 1.6em; margin-top: 10px; font-size: 13px; line-height: 1.6; opacity: .85; }

.enter { animation: fade .2s ease-out; }
@keyframes fade { from { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .st.running .ic { animation: none; }
  .enter { animation: none; }
}
