/* hotwrite 页面专用样式（类名统一加前缀 hw-） */
.hw-page [hidden] { display: none !important; }
.hw-grid { display: grid; grid-template-columns: minmax(0, 430px) minmax(0, 1fr); gap: 16px; align-items: start; }
.hw-side { min-width: 0; }
.hw-empty { padding: 18px 12px; text-align: center; color: var(--mute); font-size: 13px; line-height: 1.7; overflow-wrap: anywhere; }
.hw-empty.err { color: var(--red); }
.hw-empty a { color: var(--brand); }
.hw-empty .ic { width: 14px; height: 14px; vertical-align: -2px; }

/* ---------- 左边表单 ---------- */
.hw-form { display: grid; gap: 4px; padding: 6px 18px 18px; }
.hw-sec { display: grid; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line-2); }
.hw-sec-hd { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14.5px; }
.hw-sec-hd b { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand-2)); }
.hw-tabs { display: flex; gap: 4px; padding: 3px; background: var(--line-2); border-radius: 9px; }
.hw-tabs button { flex: 1; height: 30px; border-radius: 7px; color: var(--sub); font-size: 13.5px; white-space: nowrap; }
.hw-tabs button:hover { color: var(--text); }
.hw-tabs button.on { background: #fff; color: var(--brand); font-weight: 600; box-shadow: 0 1px 3px rgba(20, 32, 70, .08); }
.hw-pick { display: grid; gap: 8px; }
.hw-pick-tip { padding: 10px 12px; border-radius: 8px; background: #fafbfd; border: 1px dashed var(--line); color: var(--sub); font-size: 12.5px; line-height: 1.7; }
.hw-pick-warn { padding: 6px 10px; border-radius: 8px; background: #fff7ec; color: #b25e09; font-size: 12px; }
.hw-list { display: grid; gap: 2px; max-height: 280px; overflow-y: auto; padding: 4px; border: 1px solid var(--line); border-radius: 10px; }
.hw-it { display: grid; gap: 1px; text-align: left; padding: 7px 10px; border-radius: 7px; min-width: 0; }
.hw-it:hover { background: #f5f7fc; }
.hw-it.on { background: var(--brand-soft); box-shadow: inset 3px 0 0 var(--brand); }
.hw-it-tt { font-size: 13.5px; line-height: 1.5; overflow-wrap: anywhere; }
.hw-it.on .hw-it-tt { color: var(--brand); font-weight: 600; }
.hw-it small { font-size: 11.5px; color: var(--mute); overflow-wrap: anywhere; }
.hw-it .hw-it-desc { color: var(--sub); line-height: 1.5; }

.hw-seg { display: flex; flex-wrap: wrap; gap: 8px; }
.hw-seg label { position: relative; cursor: pointer; }
.hw-seg input { position: absolute; opacity: 0; pointer-events: none; }
.hw-seg span { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; min-height: 36px; padding: 5px 13px; border: 1.5px solid var(--line); border-radius: 9px; font-size: 13.5px; background: #fff; transition: border-color .15s, background .15s; }
.hw-seg span:hover { border-color: #cfd6e6; }
.hw-seg small { font-size: 11px; color: var(--mute); font-weight: 400; }
.hw-seg input:checked + span { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.hw-seg input:focus-visible + span { box-shadow: 0 0 0 3px var(--brand-soft); }
.hw-seg-kind { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.hw-seg-kind span { height: 100%; padding: 7px 6px; text-align: center; }
.hw-seg-kind b { font-size: 13.5px; }
.hw-seg-kind small { line-height: 1.4; margin-top: 1px; }
.hw-bench-info { display: grid; gap: 3px; font-size: 12.5px; line-height: 1.65; color: var(--sub); overflow-wrap: anywhere; }
.hw-bench-info i { font-style: normal; margin-right: 6px; padding: 0 6px; border-radius: 5px; background: var(--line-2); color: var(--mute); font-size: 11.5px; }
.hw-bench-info a { color: var(--brand); }
.hw-bench-miss { color: var(--orange); }
.hw-bench-old { padding: 6px 10px; border-radius: 8px; background: #fff7ec; color: #b25e09; }
.hw-bench-back { margin-left: 4px; padding: 0 2px; color: var(--brand); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; white-space: nowrap; }
.hw-pick-thin { border-color: #f3d19c; background: #fffaf1; color: #8a5a12; }
.hw-note { display: flex; gap: 6px; margin: 10px 0 2px; padding: 10px 12px; border-radius: 8px; background: #fff8e8; color: #7a4f00; font-size: 12.5px; line-height: 1.65; }
.hw-note .ic { width: 15px; height: 15px; flex: none; margin-top: 2px; }
.hw-formerr { margin: 4px 0 0; padding: 8px 12px; border-radius: 8px; background: #ffecea; color: var(--red); font-size: 13px; }
.hw-go { justify-content: center; height: 42px; margin-top: 8px; font-size: 15px; }
.hw-go:disabled { opacity: .7; cursor: progress; }

/* ---------- 右边结果 ---------- */
.hw-res { overflow: hidden; }
.hw-res-empty { padding: 34px 26px; text-align: center; color: var(--sub); }
.hw-res-empty > b { display: block; font-size: 16px; color: var(--text); }
.hw-res-empty > p { margin: 6px 0 18px; font-size: 13.5px; }
.hw-res-empty ul { list-style: none; margin: 0 auto; padding: 14px 16px; max-width: 460px; display: grid; gap: 8px; text-align: left; background: #fafbfd; border: 1px solid var(--line-2); border-radius: 10px; }
.hw-res-empty li { display: flex; gap: 8px; font-size: 13px; line-height: 1.6; }
.hw-res-empty li .ic { width: 15px; height: 15px; flex: none; margin-top: 3px; color: var(--green); }
.hw-hello { width: 52px; height: 52px; margin: 0 auto 12px; border-radius: 15px; display: grid; place-items: center; background: #fff1e6; color: #e8620a; }
.hw-hello .ic { width: 26px; height: 26px; }

.hw-res-hd { display: flex; align-items: flex-start; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line-2); }
.hw-res-tt { flex: 1; min-width: 0; }
.hw-res-tt h3 { margin: 0; font-size: 16px; line-height: 1.5; overflow-wrap: anywhere; }
.hw-res-tt small { display: block; margin-top: 2px; font-size: 12.5px; color: var(--mute); line-height: 1.6; overflow-wrap: anywhere; }
.hw-badge { flex: none; display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 99px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.hw-badge .ic { width: 14px; height: 14px; }
.hw-badge.ok { background: #e7f8ef; color: #0e9a59; }
.hw-badge.warn { background: #fff4e5; color: #c26a00; }
.hw-badge.bad { background: #ffecea; color: var(--red); }
.hw-badge.run { background: var(--brand-soft); color: var(--brand); }
.hw-res-bd { display: grid; gap: 14px; padding: 16px 18px 18px; min-width: 0; }

.hw-run { display: flex; align-items: center; gap: 10px; color: var(--brand); }
.hw-run > .ic { width: 22px; height: 22px; flex: none; }
.hw-run b { font-size: 14.5px; }
.hw-run small { display: block; margin-top: 2px; font-size: 12.5px; color: var(--mute); font-variant-numeric: tabular-nums; }
.hw-err { display: flex; gap: 10px; padding: 12px 14px; border-radius: 10px; background: #fff3f1; border: 1px solid #ffd6d1; color: var(--red); }
.hw-err > .ic { width: 18px; height: 18px; flex: none; margin-top: 2px; }
.hw-err b { color: var(--red); }
.hw-err p { margin: 2px 0 0; color: var(--text); font-size: 13.5px; overflow-wrap: anywhere; }
.hw-err small { display: block; margin-top: 4px; color: var(--mute); font-size: 12px; }

.hw-cks { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.hw-ck { display: grid; gap: 3px; align-content: start; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line-2); background: #fafbfd; min-width: 0; }
.hw-ck.ok { background: #f1fbf5; border-color: #c9efd9; }
.hw-ck.bad { background: #fff5f3; border-color: #ffd6d1; }
.hw-ck.warn { background: #fff8ef; border-color: #ffe0bd; }
.hw-ck > span { font-size: 12px; color: var(--sub); }
.hw-ck b { font-size: 21px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.hw-ck.ok b { color: #0e9a59; }
.hw-ck.bad b { color: var(--red); }
.hw-ck.warn b { color: #e8620a; }
.hw-ck .pill { justify-self: start; font-size: 11.5px; }
.hw-ck small { font-size: 11.5px; line-height: 1.55; color: var(--mute); overflow-wrap: anywhere; }

.hw-detail > summary, .hw-log > summary, .hw-topic > summary { display: inline-flex; align-items: center; gap: 4px; list-style: none; cursor: pointer; font-size: 13px; color: var(--sub); }
.hw-detail > summary::-webkit-details-marker, .hw-log > summary::-webkit-details-marker, .hw-topic > summary::-webkit-details-marker { display: none; }
.hw-chev { width: 15px; height: 15px; transition: transform .2s; }
details[open] > summary .hw-chev { transform: rotate(180deg); }
.hw-detail-bd { display: grid; gap: 8px; margin-top: 8px; }
.hw-sub { font-size: 12.5px; color: var(--sub); font-weight: 600; }
.hw-hits { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.hw-hits li { padding: 8px 12px; border-radius: 8px; background: #fafbfd; border: 1px solid var(--line-2); font-size: 13px; line-height: 1.65; min-width: 0; }
.hw-hits p { margin: 0; overflow-wrap: anywhere; }
.hw-hits p i { margin-right: 6px; font-style: normal; font-size: 11.5px; color: var(--mute); }
.hw-hits .hw-old { color: var(--sub); }
.hw-hits small { display: block; margin-top: 2px; font-size: 12px; color: #c26a00; overflow-wrap: anywhere; }

.hw-copy { padding: 16px 18px; border-radius: 10px; background: #fffdf8; border: 1px solid #f3e7cf; min-width: 0; }
.hw-title { margin: 0 0 8px; font-size: 16.5px; line-height: 1.5; overflow-wrap: anywhere; }
.hw-hookbox { margin-bottom: 8px; padding: 8px 12px; border-radius: 8px; background: #fff3c4; font-weight: 600; line-height: 1.7; overflow-wrap: anywhere; }
.hw-hookbox span { display: block; font-size: 12px; font-weight: 400; color: #9a6b00; }
.hw-text { font-size: 15.5px; line-height: 1.95; }
.hw-text p { margin: 0 0 10px; overflow-wrap: anywhere; }
.hw-hook { padding: 1px 2px; border-radius: 4px; background: #fff3c4; font-weight: 600; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.hw-stat { margin-top: 4px; font-size: 12.5px; color: var(--mute); line-height: 1.7; }
.hw-stat .hw-hook { font-weight: 400; }
.hw-page mark { padding: 0 1px; color: inherit; border-radius: 2px; }
.hw-page mark.w { background: #ffe0dc; border-bottom: 2px solid var(--red); }
.hw-page mark.s { background: #ffe7e4; border-bottom: 2px dashed var(--red); }

.hw-btns { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.hw-btns .btn:disabled { opacity: .6; cursor: progress; }
.hw-del:hover { color: var(--red); border-color: #ffc9c3; }
.hw-saved { display: inline-flex; align-items: center; gap: 4px; min-height: 30px; padding: 3px 10px; border-radius: 9px; background: #e7f8ef; color: #0e9a59; font-size: 12.5px; overflow-wrap: anywhere; }
.hw-saved .ic { width: 14px; height: 14px; flex: none; }

.hw-cover { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 16px; align-items: start; padding: 14px; border-radius: 10px; border: 1px solid var(--line-2); background: #fafbfd; }
.hw-cover-prev {
  aspect-ratio: 3 / 4; border-radius: 10px; padding: 14px 10px; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center;
  background: radial-gradient(120% 90% at 50% 10%, #3a2f1a 0%, #111 70%); color: #f7e3a8;
}
.hw-cover-prev b { font-size: 17px; line-height: 1.25; letter-spacing: 1px; overflow-wrap: anywhere; text-shadow: 0 2px 6px rgba(0, 0, 0, .5); }
.hw-cover-badge { margin-top: 6px; padding: 2px 8px; border: 1.5px solid #e2b85a; border-radius: 4px; color: #ffe29a; font-size: 11.5px; font-weight: 700; overflow-wrap: anywhere; }
.hw-cover-prev small { margin-top: 6px; color: #d9d2c0; font-size: 9.5px; line-height: 1.4; overflow-wrap: anywhere; }
.hw-cover-bd { display: grid; gap: 8px; justify-items: start; min-width: 0; }
.hw-cover-bd dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; margin: 0; font-size: 13.5px; }
.hw-cover-bd dt { color: var(--mute); font-size: 12.5px; white-space: nowrap; }
.hw-cover-bd dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.hw-cover-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.hw-cover-tip { color: var(--mute); font-size: 12px; line-height: 1.6; }

.hw-notes { margin: -6px 0 0; padding-left: 1.3em; font-size: 13px; line-height: 1.75; color: var(--sub); }
.hw-notes li { overflow-wrap: anywhere; }
.hw-log ol { margin: 6px 0 0; padding-left: 1.4em; font-size: 12.5px; line-height: 1.8; color: var(--sub); font-variant-numeric: tabular-nums; }
.hw-log li { overflow-wrap: anywhere; }
.hw-topic { padding-top: 12px; border-top: 1px dashed var(--line); }
.hw-topic > div, .hw-topic p { margin: 6px 0 0; font-size: 13px; line-height: 1.7; color: var(--sub); overflow-wrap: anywhere; white-space: pre-wrap; }
.hw-topic > div b { color: var(--text); }
.hw-topic p i { font-style: normal; margin-right: 6px; color: var(--mute); }

/* ---------- 写过的稿 ---------- */
.hw-hist { margin-top: 16px; }
.hw-hist .panel-hd .pill { margin-right: auto; }
.hw-hlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 4px 12px; padding: 8px 10px 10px; max-height: 520px; overflow-y: auto; }
.hw-hi { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 9px 10px; border-radius: 9px; text-align: left; }
.hw-hi:hover { background: #f5f7fc; }
.hw-hi.on { background: var(--brand-soft); }
.hw-hi > .ic { width: 14px; height: 14px; flex: none; color: var(--brand); }
.hw-dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--mute); }
.hw-dot.ok { background: var(--green); }
.hw-dot.warn { background: var(--orange); }
.hw-dot.bad { background: var(--red); }
.hw-hi-bd { flex: 1; min-width: 0; display: grid; }
.hw-hi-bd b { font-size: 13.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hw-hi.on .hw-hi-bd b { color: var(--brand); font-weight: 600; }
.hw-hi-bd small { font-size: 12px; color: var(--mute); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hw-hi-time { flex: none; font-size: 12px; color: var(--mute); white-space: nowrap; }

/* ---------- 窄屏 ---------- */
@media (max-width: 1100px) {
  .hw-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .hw-form { padding: 4px 14px 16px; }
  .hw-res-hd, .hw-res-bd { padding-left: 14px; padding-right: 14px; }
  .hw-res-hd { flex-wrap: wrap; }
  .hw-copy { padding: 14px; }
  .hw-text { font-size: 15px; }
  .hw-cks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hw-cover { grid-template-columns: 110px minmax(0, 1fr); gap: 12px; padding: 12px; }
  .hw-cover-prev b { font-size: 13px; }
  .hw-hlist { grid-template-columns: minmax(0, 1fr); }
  .hw-hi-time { display: none; }
  .hw-btns .btn { flex: 1 1 auto; justify-content: center; }
}
