:root {
  color-scheme: light;
  --ink: #191b1c;
  --muted: #6a6f72;
  --faint: #9aa0a4;
  --line: #e6e8ea;
  --line-strong: #ccd0d3;
  --surface: #ffffff;
  --surface-subtle: #f5f6f7;
  --canvas: #f1f2f3;
  --accent: #23282b;
  --accent-soft: #ebedee;
  --warning: #4d5356;
  --danger: #23282b;
  --dark: #17191a;
  /* 上下两行共用同一套分栏，卡片边缘才能对齐。改这里就两行一起改。
     左宽右窄：左边是每次都要动的预约任务，
     右边是配好就不怎么看的（手机号 / 官方订单）。 */
  --split: minmax(0, 4.2fr) minmax(300px, 1fr);
  --gutter: 12px;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--canvas); color: var(--ink); }
button, input, select { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .42; }
.button.is-busy { position: relative; color: transparent !important; opacity: .75; cursor: progress; }
.button.is-busy img { visibility: hidden; }
.button.is-busy::after {
  content: ""; position: absolute; top: 50%; left: 50%; width: 12px; height: 12px;
  margin: -6px 0 0 -6px; border: 2px solid currentColor; border-top-color: transparent;
  border-radius: 50%; color: var(--muted); animation: button-spin .6s linear infinite;
}
.button.primary.is-busy::after { color: #fff; }
@keyframes button-spin { to { transform: rotate(360deg); } }
[hidden] { display: none !important; }

/* 保留滚轮、触控和键盘滚动，只隐藏可见轨道；长列表仍用底部渐隐提示还有内容。 */
html,
.phone-list,
.log-filter,
.log-list,
.scroll-cap,
.orders-list,
.captcha-queue { scrollbar-width: none; -ms-overflow-style: none; }
html::-webkit-scrollbar,
.phone-list::-webkit-scrollbar,
.log-filter::-webkit-scrollbar,
.log-list::-webkit-scrollbar,
.scroll-cap::-webkit-scrollbar,
.orders-list::-webkit-scrollbar,
.captcha-queue::-webkit-scrollbar { display: none; width: 0; height: 0; }

.auth-gate { min-height: 100vh; padding: 20px; display: grid; place-items: center; }
.auth-panel { width: min(360px, 100%); padding: 24px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); box-shadow: 0 10px 30px rgba(0, 0, 0, .06); }
.auth-icon { width: 22px; height: 22px; margin-bottom: 6px; }
.auth-panel h1 { margin: 0 0 16px; font-size: 18px; line-height: 1.4; letter-spacing: 0; }
.form-error { margin: 0; color: var(--danger); font-size: 11px; font-weight: 700; }

.workspace { width: min(1560px, calc(100% - 40px)); margin: 0 auto 36px; padding-top: 14px; }

/* 页面自上而下分两段：做什么·用谁的号 → 有哪些人·发生了什么。
   row-split 是通用两栏，所有行共用同一套分栏，卡片边缘才对得齐。 */
.row-split { display: grid; grid-template-columns: var(--split); gap: var(--gutter); align-items: stretch; margin-top: var(--gutter); }
.row-split > .panel { display: flex; flex-direction: column; min-height: 0; }
.workspace > .panel { margin-top: var(--gutter); }
/* flex-basis 必须是 0：用 auto 的话列表会拿「内容全高」当基准，号多时会接近上千像素，
   整行被它撑起来、滚动上限失效（试过，整页顶到 2500px）。 */
.row-split .phone-list { flex: 1 1 0; min-height: 168px; overflow: auto; }
.row-split .phone-list.scroll-cap { max-height: none; }
/* 登录或实名表单展开时，右栏需要按内容增高；否则 168px 的常态高度会把表单
   上下同时裁掉。只在桌面双栏启用，窄屏本来就会随内容自然展开。 */
@media (min-width: 981px) {
  .row-split:has(#phone-panel .phone-editor) { align-items: start; }
  #phone-panel:has(.phone-editor) { min-height: 520px; }
  .row-split .phone-list:has(.phone-editor) {
    flex: 0 1 auto;
    min-height: 0;
    max-height: min(520px, calc(100vh - 120px));
  }
}
.row-split .task-list { flex: 0 0 auto; }
/* 主角面板：黑白灰里只能靠一道左边线把「这是要动手的地方」标出来。 */
.task-section.is-primary { box-shadow: inset 3px 0 0 var(--ink), 0 1px 2px rgba(0, 0, 0, .04); }
.people-list > *, .task-list > *, .phone-list > *, .time-options > *, .task-people > * { min-width: 0; }
.person-row > *, .task-card > *, .phone-row > * { min-width: 0; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; box-shadow: 0 1px 2px rgba(0, 0, 0, .04); }
.panel-heading { min-height: 24px; display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 11px; }
.panel-heading > div, .heading-with-icon { display: flex; align-items: center; gap: 8px; min-width: 0; }
.heading-with-icon img { width: 15px; height: 15px; flex: 0 0 auto; }
/* 面板标题只有两三个字，栏一窄就会被折成「手机 / 号」。它不该让步——
   要收缩的是它旁边那句摘要，那个本来就带省略号。 */
.panel-heading h2 { flex: 0 0 auto; white-space: nowrap; }
.panel h2 { margin: 0; font-size: 13px; line-height: 1.4; letter-spacing: 0; }
.badge { display: inline-flex; align-items: center; justify-content: center; min-width: 48px; height: 22px; padding: 0 7px; border: 1px solid var(--line-strong); border-radius: 3px; color: var(--muted); background: var(--surface); font-size: 10px; font-weight: 750; white-space: nowrap; }
.badge.success { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.badge.warning { border-color: var(--line-strong); color: var(--warning); background: var(--surface-subtle); }

.account-setup { margin-top: 16px; display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 12px 18px; align-items: end; }
.account-setup .panel-heading { grid-column: 1 / -1; margin-bottom: 0; }
.account-setup > .button { width: 190px; }
.login-form { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(150px, 1fr) minmax(130px, .75fr) auto auto; gap: 10px; align-items: end; }
.identity-form { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(150px, 1fr) minmax(190px, 1fr) minmax(190px, 1fr) auto; gap: 10px; align-items: end; padding-top: 14px; border-top: 1px solid var(--line); }
.login-form > div, .identity-form > div { display: grid; gap: 6px; }

form { display: grid; gap: 10px; }
label, .field-label { color: #4a4f52; font-size: 10px; font-weight: 700; }
/* input 的固有 min-content 约 170px（浏览器按 size=20 估），不放开会在窄屏撑破栅格。 */
input, select { width: 100%; min-width: 0; height: 32px; border: 1px solid var(--line-strong); border-radius: 6px; padding: 0 11px; background: var(--surface); color: var(--ink); outline: none; }
input:hover:not(:disabled), select:hover:not(:disabled) { border-color: #a8adaf; }
input:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(35, 40, 43, .13); }
.button { height: 32px; border: 1px solid transparent; border-radius: 6px; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; white-space: nowrap; color: var(--ink); background: var(--surface); font-size: 11px; font-weight: 750; }
.button img, .icon-button img { width: 13px; height: 13px; }
.button.primary { color: #fff; background: var(--accent); border-color: var(--accent); }
.button.primary img { filter: brightness(0) invert(1); }
.button.secondary { border-color: var(--line-strong); }
.button.danger { color: var(--danger); background: var(--surface); border-color: var(--line-strong); }
.button.wide { width: 100%; }
.button.compact { height: 28px; padding: 0 10px; font-size: 11px; }
.button:hover:not(:disabled), .icon-button:hover:not(:disabled) { border-color: var(--accent); }
.button.primary:hover:not(:disabled) { background: #0e1113; }
.icon-button { width: 28px; height: 28px; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); display: grid; place-items: center; }

.section-index { color: var(--accent); font-size: 10px; font-weight: 800; }
.schedule-section { display: grid; gap: 9px; }
.field-header, .section-heading-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.field-header small, .section-heading-row small { color: var(--muted); font-size: 10px; }
.time-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(134px, 100%), 1fr)); gap: 4px; }
.time-options > .muted { grid-column: 1 / -1; margin: 0; padding: 12px 0; }
.time-option { position: relative; min-height: 31px; padding: 0 9px; border: 1px solid var(--line); border-radius: 6px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 5px; background: var(--surface); cursor: pointer; }
.time-option input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
/* .on 是给不支持 :has() 的浏览器兜底的（Firefox 121 / Safari 15.4 以前）。
   「选了哪些时段」「带了谁」全靠这个上色，缺了等于看不见自己的选择，
   所以由 JS 把 checked 同步成 class，两条规则并存。 */
.time-option:has(input:checked), .time-option.on { border-color: var(--accent); background: var(--accent-soft); }
.time-option span { color: var(--ink); font-size: 11px; font-weight: 700; white-space: nowrap; }
.time-option:has(input:checked) > span, .time-option.on > span { color: var(--accent); }
.time-option small { color: var(--faint); font-size: 10px; white-space: nowrap; }
.time-option small.open { color: var(--accent); font-weight: 750; }
.time-option.unlisted { border-style: dashed; background: var(--surface-subtle); }
.time-option.unlisted > span { color: var(--muted); }
.time-option small.unlisted { color: var(--faint); }

.section-heading-row h3 { margin-bottom: 2px; }
.booking-user-self { min-height: 42px; padding: 0 10px; border: 1px solid var(--line); border-radius: 4px; display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--surface-subtle); }
.booking-user-self span { font-size: 12px; font-weight: 750; }
.booking-user-self small { color: var(--accent); font-size: 10px; font-weight: 700; }
.booking-users { display: grid; gap: 8px; margin-top: 8px; }
.booking-user-row { padding: 12px; border: 1px solid var(--line); border-radius: 6px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; }
.booking-user-title { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.booking-user-title > span { font-size: 11px; font-weight: 800; }
.booking-user-field { display: grid; gap: 6px; }
.booking-user-number-field { grid-column: 1 / -1; }

.toggle-row { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 14px; cursor: pointer; }
.toggle-row strong, .toggle-row small { display: block; }
.toggle-row strong { color: var(--ink); font-size: 12px; }
.toggle-row small { margin-top: 3px; color: var(--muted); font-size: 10px; font-weight: 400; }
.toggle-row input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.toggle { flex: 0 0 auto; width: 38px; height: 22px; padding: 3px; background: #ccd0d3; border-radius: 11px; transition: background .15s; }
.toggle::after { content: ""; display: block; width: 16px; height: 16px; background: #fff; border-radius: 50%; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.16); }
.toggle-row input:checked + .toggle { background: var(--accent); }
.toggle-row input:checked + .toggle::after { transform: translateX(16px); }

.advanced-settings.panel { padding: 0; overflow: clip; }
.advanced-actions { grid-column: 1 / -1; padding: 8px 14px; border-top: 1px solid var(--line); }
.advanced-actions:empty, .advanced-actions:has(> [hidden]) { display: none; }
.advanced-settings > summary { min-height: 38px; padding: 0 14px; display: flex; align-items: center; justify-content: space-between; gap: 10px; cursor: pointer; list-style: none; }
.advanced-settings > summary::-webkit-details-marker { display: none; }
.advanced-title { font-size: 12px; font-weight: 800; }
.advanced-settings > summary > small { min-width: 0; margin-left: auto; overflow: hidden; color: var(--muted); font-size: 10px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.advanced-settings > summary::after { content: "展开"; flex: 0 0 auto; color: var(--faint); font-size: 10px; font-weight: 650; }
.advanced-settings[open] > summary::after { content: "收起"; color: var(--muted); }
.advanced-settings[open] > summary { border-bottom: 1px solid var(--line); }
.settings-body { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, .85fr) minmax(0, 1.1fr) minmax(0, 1.15fr) minmax(0, 1.9fr); align-items: stretch; }
.settings-section { min-width: 0; padding: 10px 12px; display: grid; align-content: start; gap: 6px; border-left: 1px solid var(--line); }
.settings-section:first-child { border-left: 0; }
.settings-heading { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.settings-title { min-width: 0; }
.settings-title h3 { margin: 0; font-size: 11px; line-height: 1.25; letter-spacing: 0; }
.settings-title p { margin: 1px 0 0; color: var(--muted); font-size: 9px; line-height: 1.3; }
.settings-frequency { height: 18px; padding: 0 6px; border: 1px solid var(--line); border-radius: 3px; display: inline-flex; align-items: center; color: var(--muted); background: var(--surface-subtle); font-size: 9px; font-weight: 750; }
.monitor-settings-grid { width: min(430px, 100%); display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.setting-field { min-width: 0; display: grid; gap: 3px; }
.setting-field > span:first-child { font-size: 9px; }
.unit-input { position: relative; display: block; }
.unit-input input { padding-right: 38px; font-size: 11px; font-variant-numeric: tabular-nums; }
.unit-input small { position: absolute; top: 50%; right: 9px; transform: translateY(-50%); color: var(--faint); font-size: 9px; pointer-events: none; }
.settings-note { margin: 0; color: var(--muted); font-size: 9px; line-height: 1.45; }
.settings-status { min-width: 0; max-width: 55%; margin: 0; overflow: hidden; color: var(--muted); font-size: 9px; line-height: 1.35; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.settings-subhead { min-height: 14px; display: flex; align-items: baseline; gap: 6px; }
.settings-subhead strong { font-size: 9px; }
.settings-subhead small { color: var(--faint); font-size: 9px; }
.advanced-settings .settings-body input,
.advanced-settings .settings-body select { height: 28px; padding-right: 9px; padding-left: 9px; border-radius: 5px; font-size: 11px; }
.advanced-settings .settings-body .secret-input { -webkit-text-security: disc; }
.proxy-config-row { display: grid; grid-template-columns: minmax(74px, 1fr) auto repeat(3, auto); gap: 4px; align-items: center; }
.proxy-config-row > #proxy-api-url { grid-column: 1 / -1; }
.proxy-toggle { min-width: 0; height: 28px; display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 9px; font-weight: 700; white-space: nowrap; }
.advanced-settings .settings-body .proxy-toggle input { flex: 0 0 auto; width: 13px; height: 13px; margin: 0; padding: 0; accent-color: var(--accent); }
.daily-schedule-row { display: grid; grid-template-columns: auto minmax(92px, 1fr) auto; align-items: center; gap: 4px; }
.daily-toggle { min-width: 0; height: 28px; display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 9px; font-weight: 700; white-space: nowrap; }
.advanced-settings .settings-body .daily-toggle input { flex: 0 0 auto; width: 13px; height: 13px; margin: 0; padding: 0; accent-color: var(--accent); }
.daily-schedule-row input[type="time"] { min-width: 92px; font-variant-numeric: tabular-nums; }
.proxy-section > .settings-note { margin-top: 1px; }
.split-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.split-fields > div { display: grid; gap: 6px; }

@media (max-width: 1200px) {
  .settings-body { grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); }
  .settings-section:nth-child(n+3) { border-top: 1px solid var(--line); }
  .settings-section:nth-child(odd) { border-left: 0; }
  .advanced-actions { grid-column: 1 / -1; }
}
.form-actions { padding: 15px 18px 18px; border-top: 1px solid var(--line); display: grid; grid-template-columns: 1fr 92px; gap: 8px; }

.captcha-panel { border: 2px solid var(--warning); }
.captcha-layout { display: grid; grid-template-columns: minmax(280px, 420px) minmax(170px, 1fr); gap: 14px; align-items: center; }
/* 验证码图原图只有三四百像素宽，跟着面板拉满只会又糊又占地方，这里封顶。 */
.captcha-stage { position: relative; width: 100%; max-width: 420px; aspect-ratio: 2 / 1; min-height: 155px; overflow: hidden; border: 1px solid var(--line-strong); border-radius: 4px; background: var(--surface-subtle); cursor: crosshair; }
.captcha-stage.slider-mode { cursor: default; }
/* 拼图块叠在背景图上，left 百分比 = 提交给官网的 x / 310：
   看到的位置就是提交的位置，不然人只能凭空猜缺口在哪。
   舞台是 2/1、背景图 310×155 也是 2/1，所以按高度铺满不会变形。 */
.captcha-piece { position: absolute; top: 0; left: 0; height: 100%; width: auto; display: none; pointer-events: none; filter: drop-shadow(0 0 2px rgba(0, 0, 0, .45)); transition: left .06s linear; }
.captcha-stage.slider-mode > .captcha-piece.on { display: block; }
.captcha-stage > img { width: 100%; height: 100%; object-fit: fill; display: block; user-select: none; -webkit-user-drag: none; }
.marker { position: absolute; width: 23px; height: 23px; transform: translate(-50%, -50%); display: grid; place-items: center; border: 2px solid #fff; border-radius: 50%; background: var(--dark); color: #fff; font-size: 10px; font-weight: 800; pointer-events: none; box-shadow: 0 1px 4px rgba(0,0,0,.35); }
.captcha-instruction > span { color: var(--muted); font-size: 11px; }
.word-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 9px 0; }
.word { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid #b0b4b6; border-radius: 4px; background: #fff; color: var(--ink); font-size: 17px; font-weight: 800; }
.word.done { border-color: var(--accent); background: var(--accent); color: #fff; }
.captcha-slider { height: 38px; margin: 9px 0; padding: 0; accent-color: var(--accent); cursor: ew-resize; touch-action: none; }
.captcha-slider:disabled { cursor: wait; }
.captcha-instruction p { margin: 0; color: var(--muted); font-size: 11px; }

.table-panel { padding-bottom: 8px; }
.muted { color: var(--muted); font-size: 11px; }
.empty { height: 56px; color: var(--muted); text-align: center !important; }

/* 只在有事要处理时才出现的一条，不是常驻横幅。 */
.alert-bar { min-height: 36px; margin-top: var(--gutter); padding: 7px 13px; border: 1px solid var(--line-strong); border-left: 3px solid var(--danger); border-radius: 7px; background: var(--surface-subtle); display: flex; align-items: center; gap: 10px; }
/* 只有告警条真的显示出来时才收紧下方间距，隐藏时保持栅格原本的 16px。 */
.alert-bar:not([hidden]) + * { margin-top: var(--gutter); }
.alert-bar img { width: 14px; height: 14px; flex: 0 0 auto; }
.alert-bar > span { min-width: 0; color: var(--ink); font-size: 11px; font-weight: 750; }
.alert-bar .button { margin-left: auto; flex: 0 0 auto; border-color: var(--danger); color: var(--danger); background: var(--surface); }
.alert-bar .button:hover:not(:disabled) { color: #fff; background: var(--danger); border-color: var(--danger); }

/* 运行记录是抢票时一直要盯的，不折叠。 */
.log-panel { padding: 0; overflow: hidden; }
.log-panel > .panel-heading { min-height: 38px; margin: 0; padding: 0 14px; border-bottom: 1px solid var(--line); }
.log-summary { min-width: 0; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
/* 每个手机号一个 chip，号多时换行会把记录挤下去。
   改成单行横向滚动：高度恒定，多少个号都不影响下面的正文。 */
.log-filter { padding: 7px 14px 0; display: flex; flex-wrap: nowrap; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.log-filter::-webkit-scrollbar { display: none; }
.log-chip { flex: 0 0 auto; }
.log-chip { height: 21px; padding: 0 8px; border: 1px solid var(--line-strong); border-radius: 11px; background: var(--surface); color: var(--muted); font-size: 10px; font-weight: 750; white-space: nowrap; }
.log-chip:hover:not(.on) { border-color: var(--accent); color: var(--accent); }
.log-chip.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.log-list { list-style: none; padding: 4px 14px 9px; margin: 0; max-height: 300px; overflow: auto; }
/* 内容超出时底部渐隐，免得最后一行被硬切、看不出还能滚。 */
.log-list.scrollable { -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 26px), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 26px), transparent); }
.log-list li { min-height: 24px; padding: 5px 0; display: grid; grid-template-columns: 62px 1fr; gap: 8px; border-top: 1px solid var(--line); color: #44484a; font-size: 11px; line-height: 1.45; }
.log-list li:first-child { border-top: 0; }
.log-list time { color: var(--faint); font-family: ui-monospace, monospace; }
.log-list li.error { color: var(--ink); font-weight: 750; }
.log-list li.success { color: var(--ink); }
.log-list li.warning { color: var(--warning); font-weight: 600; }
.log-list li.empty { display: block; }
.toast { position: fixed; right: 18px; bottom: 18px; max-width: min(360px, calc(100vw - 36px)); padding: 12px 14px; border: 1px solid var(--accent); border-radius: 4px; color: #fff; background: var(--dark); box-shadow: 0 10px 26px rgba(0, 0, 0, .18); font-size: 12px; z-index: 20; }
.toast.error { color: var(--danger); background: #fff; border-color: var(--danger); }

@media (max-width: 980px) {
  /* 单栏时把包装层拆掉、按重要性逐块重排 */
  .workspace { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .row-split { display: contents; }
  .alert-bar, .row-split, .workspace > .panel { margin-top: 0; }
  #alert-bar { order: 0; }
  #captcha-panel { order: 1; }
  .task-section { order: 2; }
  #phone-panel { order: 3; }
  .people-section { order: 4; }
  #orders-panel { order: 5; }
  .advanced-settings { order: 6; }
  #log-panel { order: 7; }   /* 运行记录固定在最末 */
  .row-split > .panel { display: block; }
  .row-split .phone-list { flex: none; min-height: 0; max-height: none; }
  .row-split .phone-list.scroll-cap { max-height: 300px; min-height: 0; overflow: auto; }
}

@media (max-width: 720px) {
  .workspace { width: calc(100% - 24px); }
  .account-setup { grid-template-columns: 1fr; }
  .account-setup .panel-heading, .login-form, .identity-form { grid-column: 1; }
  .account-setup > .button { width: 100%; }
  .login-form, .identity-form { grid-template-columns: 1fr 1fr; }
  .captcha-layout { grid-template-columns: 1fr; gap: 12px; }
  .captcha-stage { min-height: 0; }
}

@media (max-width: 520px) {
  .workspace { width: calc(100% - 20px); margin-bottom: 24px; }
  .task-section > .panel-heading { align-items: flex-start; flex-wrap: wrap; }
  .task-section > .panel-heading > .section-buttons {
    width: 100%;
    justify-content: flex-end;
    flex-wrap: wrap;
  }
  .brand-mark { width: 34px; height: 34px; }
  .account-status { gap: 4px; }
  .status-item { min-width: 0; gap: 5px; }
  .panel { padding: 11px 12px; }
  .account-setup { margin-top: 10px; }
  .workspace { gap: 10px; }
  .login-form, .identity-form { grid-template-columns: 1fr; }
  .time-option { padding-right: 6px; padding-left: 6px; gap: 5px; }
  .time-option span { font-size: 10px; }
  .time-option small { font-size: 9px; }
  .booking-user-row { grid-template-columns: 1fr; }
  .booking-user-title, .booking-user-number-field { grid-column: 1; }
  .log-panel, .advanced-settings.panel { padding: 0; }
  .advanced-settings > summary, .log-panel > .panel-heading { padding-right: 14px; padding-left: 14px; }
  .advanced-actions { padding: 8px 12px; }
  .log-list { padding: 6px 14px 12px; }
  .settings-section { padding: 10px; }
  .form-actions { padding: 14px; grid-template-columns: 1fr 82px; }
  .table-panel { padding: 14px 14px 7px; }
}

/* ---------- 长名单的通用件：搜索框、分组标题、内部滚动 ---------- */

/* 名单短的时候这几件都不出现（JS 控制 hidden / scroll-cap），
   人少时界面和以前一样干净，人多时才付出这点复杂度。 */
.mini-search { height: 28px; margin-bottom: 6px; padding: 0 9px; font-size: 11px; }
.mini-search::-webkit-search-cancel-button { cursor: pointer; }

.group-heading { grid-column: 1 / -1; display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 10px 2px 2px; }
.group-heading:first-child { margin-top: 0; }
.group-heading > span { color: var(--faint); font-size: 10px; font-weight: 800; letter-spacing: .04em; }
.group-heading > small { color: var(--faint); font-size: 10px; font-weight: 600; white-space: nowrap; }

/* 超过阈值就把列表关进固定高度，面板不再被内容拉成几屏；
   底部渐隐提示下面还有，和运行记录用同一套观感。 */
.scroll-cap { max-height: 232px; overflow: auto; padding-right: 4px; }
.scroll-cap { -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 20px), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 20px), transparent); }


/* ---------- 预约人（主角） ---------- */
.people-section { display: grid; gap: 10px; }
/* 有任务的人会多显示日期和完整时段；190px 下限兼顾可读性和名单密度。 */
.people-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(190px, 100%), 1fr)); gap: 2px; align-content: start; }
.people-list > .muted { grid-column: 1 / -1; margin: 0; padding: 10px 0; }
.person-row { min-height: 30px; padding: 0 4px 0 8px; border: 0; border-radius: 5px; background: transparent; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 7px; transition: background .12s; }
.person-row:hover { background: var(--surface-subtle); }
.person-row.is-self { background: transparent; }
.person-row.has-tasks { padding-top: 5px; padding-bottom: 5px; row-gap: 3px; }
.person-row strong { font-size: 12px; font-weight: 700; white-space: nowrap; }
.person-meta { min-width: 0; overflow: hidden; color: var(--faint); font-size: 10px; font-family: ui-monospace, monospace; text-overflow: ellipsis; white-space: nowrap; }
.person-owner { padding: 0; color: var(--faint); font-size: 10px; font-weight: 600; white-space: nowrap; }
.person-task-times { grid-column: 1 / -1; min-width: 0; display: flex; flex-wrap: wrap; column-gap: 8px; row-gap: 2px; }
.person-task-time { color: var(--muted); font-size: 9px; font-weight: 700; line-height: 1.35; font-variant-numeric: tabular-nums; }
/* 绿色留给「可操作 / 已选中」，别用来表示身份——分组标题已经说明是本人了 */
.person-row.is-self .person-owner { color: var(--muted); }
.icon-button.remove-person { width: 22px; height: 22px; border-color: transparent; opacity: .3; transition: opacity .12s; }
.person-row:hover .remove-person { opacity: 1; }
.icon-button.remove-person img { width: 13px; height: 13px; }

.icon-button.remove-person:hover:not(:disabled) { border-color: var(--danger); }

/* 新增预约人是高频动作，表单常驻一行，不藏在按钮后面。 */
.person-add { margin-top: 10px; display: grid; grid-template-columns: minmax(0, 1fr) 122px minmax(0, 1.5fr) auto; gap: 8px; align-items: end; padding: 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-subtle); }
.person-add .person-field { display: grid; gap: 3px; min-width: 0; }
.person-add .person-error { grid-column: 1 / -1; }
.person-error { margin: 0; color: var(--danger); font-size: 11px; font-weight: 700; }
.person-add input, .person-add select { height: 28px; font-size: 11px; }
.person-add .button { height: 28px; }
.person-add input.invalid { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(35, 40, 43, .13); }
.person-tip { margin-right: auto; color: var(--faint); font-size: 10px; }

/* 按容器断而不是按视口断：这一行住在只占视口一半的侧栏里，
   用 @media 会在视口 1000px 左右把姓名框挤到 80px 宽。 */
.people-section { container-type: inline-size; }
@container (max-width: 600px) {
  .person-add { grid-template-columns: minmax(0, 1fr) 132px; }
  .person-number-field { grid-column: 1 / -1; }
  .person-add .button { grid-column: 1 / -1; }
}

/* ---------- 手机号（次要区：登录与实名都内联在这里） ---------- */
/* 手机号放在右栏「状态区」：凭证一小时就过期，得和当前任务、运行记录一起盯着。 */
.panel-heading .heading-with-icon small { min-width: 0; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
/* 手机号栏桌面端至少 300px，保证号码与操作在同一行且号码仍可辨认。
   980px 以下整页切为单栏，不会因为这个下限把小屏撑破。 */
.phone-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); gap: 2px; align-content: start; }
.phone-list > .muted { grid-column: 1 / -1; margin: 0; padding: 10px 0; }
/* 登录表单会就地展开，所以留的高度比名单宽松一点，展开后还能看全。 */
.phone-list.scroll-cap { max-height: 232px; }
/* 展开了表单的那一行独占整行，两列挤着填不下三个输入框。 */
.phone-row:has(.phone-editor) { grid-column: 1 / -1; }
.phone-row { padding: 4px 5px 4px 8px; border: 0; border-radius: 6px; background: transparent; display: grid; gap: 6px; align-content: center; min-height: 34px; transition: background .12s; }
.phone-row:hover { background: var(--surface-subtle); }

.phone-row.busy { background: var(--accent-soft); box-shadow: inset 2px 0 0 var(--accent); }
/* 左侧信息可以收缩，右侧操作区固定；再窄也不能把按钮掉到手机号下一行。 */
.phone-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 5px; }
.phone-identity { min-width: 0; display: flex; align-items: center; gap: 5px; overflow: hidden; }
.account-dot { flex: 0 0 auto; width: 6px; height: 6px; border-radius: 50%; background: var(--line-strong); }
.account-dot.on { background: var(--accent); }
.account-dot.busy { background: var(--warning); animation: account-pulse 1.4s ease-in-out infinite; }
@keyframes account-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
.phone-name { min-width: 0; overflow: hidden; padding: 0; border: 0; background: none; color: var(--ink); font: inherit; font-size: 12px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.phone-self { flex: 0 0 auto; padding: 0; color: var(--muted); font-size: 11px; font-weight: 600; white-space: nowrap; }
.phone-state { min-width: 0; overflow: hidden; color: var(--ink); font-size: 10px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.phone-actions { min-width: max-content; display: flex; flex-wrap: nowrap; align-items: center; justify-content: flex-end; gap: 3px; }
.phone-actions .button.compact { height: 25px; padding: 0 9px; font-size: 10px; border-color: var(--line); color: var(--muted); background: var(--surface); }
.phone-row:hover .phone-actions .button.compact { border-color: var(--line-strong); color: var(--ink); }
/* 过期或没实名的必须自己跳出来，不能等鼠标指上去 */
.phone-row:has(.phone-life.expired) .phone-actions .button.compact,
.phone-row:has(.phone-state:not([hidden])) .phone-actions .button.compact { border-color: var(--accent); color: var(--accent); }
.icon-button.danger { width: 22px; height: 22px; color: var(--danger); border-color: transparent; font-size: 13px; line-height: 1; opacity: .3; transition: border-color .12s, color .12s, opacity .12s; }
/* 手机号行操作必须始终同形：不能因为鼠标刚好停在哪一行，就让两行看起来像两套组件。 */
.phone-actions .icon-button.danger { width: 25px; height: 25px; border-color: var(--line); color: var(--faint); opacity: 1; }
.phone-actions .icon-button.danger:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.task-card:hover .icon-button.danger { opacity: 1; border-color: var(--line-strong); }


.phone-editor { padding: 10px; border-radius: 4px; background: var(--surface-subtle); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; gap: 8px; }
.phone-editor .button { align-self: end; }
.phone-editor select { padding-right: 6px; padding-left: 7px; }
.phone-editor .provider-hint { grid-column: 1 / -1; margin: 0; }
.phone-hint { grid-column: 1 / -1; margin: 0; font-size: 10px; }
.inline-field { display: grid; gap: 5px; min-width: 0; }
.inline-field label { font-size: 10px; }
.inline-field input, .inline-field select { height: 32px; font-size: 12px; }
.account-rename { height: 30px; padding: 0 9px; font-size: 12px; font-weight: 750; }

.captcha-owner { color: var(--muted); font-size: 11px; }
.log-list li { grid-template-columns: 62px 68px 1fr; }
/* 只有一个手机号、或已经筛到某一个时，行内不再重复号码，把宽度还给正文。 */
.log-list li.no-owner { grid-template-columns: 62px 1fr; }
.log-list em { overflow: hidden; color: var(--faint); font-style: normal; text-overflow: ellipsis; white-space: nowrap; }
/* 报错信息里常带不可断行的长 URL，不放开会把整个面板顶穿。 */
.log-list li > span { min-width: 0; overflow-wrap: anywhere; }

@media (max-width: 720px) {
  .phone-editor { grid-template-columns: 1fr; }
  .log-list li { grid-template-columns: 58px 1fr; }
  .log-list em { display: none; }
}

.form-actions { position: relative; }
.start-blocker { grid-column: 1 / -1; margin: 2px 0 0; color: var(--warning); font-size: 11px; font-weight: 700; }

/* ---------- 预约任务 ---------- */
.booking-body { display: grid; }
.task-section { display: grid; gap: 10px; }
/* auto-fit：只有一个任务时让它铺满整行，时段才不会被省略成「08:00-08:45 / …」 */
.task-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(290px, 100%), 1fr)); gap: 4px; }
.task-list > .muted { grid-column: 1 / -1; margin: 0; padding: 10px 0; }
.task-card { padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); display: grid; gap: 6px; }
.task-card.running { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 2px 0 0 var(--accent); }
.task-head { display: flex; align-items: center; gap: 6px; }
.task-head > strong { font-size: 12px; font-weight: 800; white-space: nowrap; }
.task-times { min-width: 0; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
/* 就地改任务：和卡片同宽，展开时不把别的卡片挤变形 */
/* 倒计时：卡片上最该看的一条信息，所以放在按钮区最前面、字重压过按钮 */
.task-countdown { flex: 0 0 auto; margin-right: auto; padding: 0 7px; border: 1px solid var(--line-strong); border-radius: 999px; color: var(--ink); font-size: 10px; font-weight: 800; line-height: 22px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.task-countdown.soon { border-color: var(--accent); background: var(--accent-soft); }
.task-editor { grid-column: 1 / -1; margin-top: 8px; padding: 10px; border-radius: 6px; background: var(--surface-subtle); display: grid; gap: 8px; }
.task-editor-field { display: grid; gap: 5px; min-width: 0; }
.task-editor-field > span { color: var(--muted); font-size: 10px; font-weight: 700; }
.task-editor-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.task-editor .pick-hint { margin: 0; }
.task-actions { flex: 0 0 auto; margin-left: auto; display: flex; align-items: center; gap: 4px; }
.task-who { display: flex; align-items: center; gap: 6px; color: #4a4f52; font-size: 10px; font-weight: 700; }
.task-who > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-who .person-owner { margin-left: auto; }
.task-status { display: flex; align-items: baseline; gap: 6px; padding: 3px 7px; border-radius: 3px; background: var(--surface-subtle); font-size: 10px; }
.task-status strong { flex: 0 0 auto; font-size: 10px; font-weight: 800; }
.task-status span { min-width: 0; overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.task-status.success { background: var(--accent-soft); }
.task-status.success strong { color: var(--accent); }
.task-status.attention strong, .task-status.error strong { color: var(--danger); }
.task-status.captcha { background: var(--surface-subtle); }
.task-status.captcha strong { color: var(--warning); }

/* 建任务是这个页面的主动作，表单常驻。 */
.task-form { margin-top: 8px; padding: 11px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-subtle); display: grid; gap: 10px; }
.task-form-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.task-form-head > span { font-size: 11px; font-weight: 800; }
.task-form-head > small { min-width: 0; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.task-form-field { display: grid; gap: 5px; }
.task-basics-row { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; }
.task-basics-row > .task-form-field { flex: 0 1 auto; min-width: 0; }
.task-form select { height: 30px; font-size: 11px; }
#task-account, #task-date { justify-self: start; width: auto; max-width: 100%; }
.task-people { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(146px, 100%), 1fr)); gap: 4px; align-content: start; }
.task-people > .muted { grid-column: 1 / -1; margin: 0; padding: 8px 0; }
/* 同行人勾满 4 位后，剩下的选项灰掉而不是消失，
   让人看得出「还能选谁」和「为什么选不了」。 */
.pick-option.disabled { opacity: .38; cursor: not-allowed; }
.pick-hint { margin: 1px 0 0; color: var(--muted); font-size: 10px; font-weight: 700; }
.pick-option { min-height: 30px; padding: 0 9px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); display: flex; align-items: center; gap: 6px; cursor: pointer; transition: border-color .12s; }
.pick-option:hover:not(.disabled) { border-color: var(--line-strong); }
.pick-option input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.pick-option:has(input:checked), .pick-option.on { border-color: var(--accent); background: var(--accent-soft); }
.pick-option > span { font-size: 11px; font-weight: 750; white-space: nowrap; }
.pick-option > small { min-width: 0; overflow: hidden; margin-left: auto; color: var(--faint); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.pick-option:has(input:checked) > span, .pick-option.on > span { color: var(--accent); }

@media (max-width: 520px) {
  .task-people { grid-template-columns: 1fr; }
}


.phone-life { flex: 0 0 auto; padding: 0; font-size: 10px; font-weight: 600; font-family: ui-monospace, monospace; }
/* 官网侧故障：和「未登录」明确区分开——一个是你的账号问题，一个是官网不让进 */
.phone-issue { flex: 0 0 auto; padding: 0 5px; border: 1px solid var(--line-strong); border-radius: 999px; color: var(--ink); font-size: 9px; font-weight: 800; line-height: 15px; white-space: nowrap; }
.phone-issue.rate-limit { border-color: var(--warning); color: var(--warning); }
.phone-proxy { flex: 0 1 auto; min-width: 0; overflow: hidden; color: var(--muted); font-size: 9px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.phone-life.ok { color: var(--faint); }
/* 越紧急越深越粗——黑白灰里这是唯一能拉开层次的手段 */
.phone-life.soon { color: var(--warning); font-weight: 700; }
.phone-life.expired { color: var(--ink); font-weight: 800; }

.section-buttons { display: flex; gap: 6px; }
.person-form-actions, .task-form-actions { display: flex; align-items: center; justify-content: flex-end; gap: 7px; }
.import-form { margin-top: 8px; display: grid; gap: 9px; padding: 11px; border: 1px solid var(--line-strong); border-radius: 4px; background: var(--surface-subtle); }
.import-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.import-head label { font-size: 10px; }
.import-form textarea { width: 100%; padding: 9px 11px; border: 1px solid var(--line-strong); border-radius: 4px; background: var(--surface); color: var(--ink); font: inherit; font-size: 12px; line-height: 1.6; resize: vertical; outline: none; }
.import-form textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(35, 40, 43, .13); }
.import-preview { display: grid; gap: 3px; }
.import-preview p { margin: 0; font-size: 11px; line-height: 1.5; }
.import-ok { color: var(--accent); font-weight: 700; }
.import-skip { color: var(--muted); }
.import-bad { color: var(--danger); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 官方订单 ---------- */
.orders-body { display: grid; gap: 8px; }
.orders-body > .muted { margin: 0; padding: 8px 0; }
.orders-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); gap: 6px; max-height: 340px; overflow: auto; padding-right: 4px; }
.order-card { padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); display: grid; gap: 3px; min-width: 0; }
.order-field { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; min-width: 0; }
.order-field > span { flex: 0 0 auto; color: var(--faint); font-size: 10px; }
.order-field > strong { min-width: 0; overflow: hidden; font-size: 11px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.order-card .button.wide { margin-top: 4px; height: 26px; font-size: 10px; }
.ticket-details { display: grid; gap: 6px; min-width: 0; }
.ticket-details > .muted { margin: 6px 0 0; }
.ticket-qrs { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(112px, 100%), 1fr)); gap: 8px; margin-top: 6px; }
.ticket-qrs > .muted { grid-column: 1 / -1; margin: 0; }
.ticket-qr { margin: 0; display: grid; justify-items: center; gap: 4px; }
/* 二维码要能被扫，别跟着主题做任何滤镜/反色处理 */
.ticket-qr img { width: 100%; max-width: 128px; aspect-ratio: 1; background: #fff; border: 1px solid var(--line); border-radius: 4px; padding: 4px; }
.ticket-qr figcaption { color: var(--muted); font-size: 9px; text-align: center; overflow-wrap: anywhere; }
.ticket-no-qr { width: 100%; max-width: 128px; aspect-ratio: 1; border: 1px dashed var(--line-strong); border-radius: 4px; display: grid; place-items: center; color: var(--faint); font-size: 9px; }
.ticket-status { color: var(--faint); font-size: 9px; }
.ticket-refund-choice { min-height: 24px; display: inline-flex; align-items: center; gap: 5px; color: var(--ink); font-size: 10px; cursor: pointer; }
.ticket-refund-choice input { flex: 0 0 auto; width: 14px; height: 14px; margin: 0; padding: 0; accent-color: var(--accent); }
.ticket-refund-actions { display: flex; justify-content: flex-end; gap: 5px; padding-top: 6px; border-top: 1px solid var(--line); }
/* 多号并行时的验证码切换条 */
.captcha-queue { display: flex; flex-wrap: nowrap; gap: 6px; overflow-x: auto; margin-bottom: 10px; scrollbar-width: none; }
.captcha-queue::-webkit-scrollbar { display: none; }
.token-row { width: min(590px, 100%); display: grid; grid-template-columns: minmax(80px, 1fr) auto auto; gap: 5px; }
.token-row > input { min-width: 0; }
.provider-config-row { display: grid; grid-template-columns: minmax(100px, 1.5fr) minmax(100px, 1.5fr) minmax(110px, 1.2fr) auto auto; gap: 5px; }
.provider-config-row input { min-width: 0; }
.provider-select-row { margin-bottom: 4px; }
.provider-select-row select { width: 100%; }
#sms-provider-haozhuma-config.provider-config-row { grid-template-columns: 1fr 1fr; }
#sms-provider-eomsg-config.provider-config-row { grid-template-columns: 1fr; }
.provider-code-editor { display: grid; grid-template-columns: minmax(110px, 1.25fr) minmax(90px, .8fr) minmax(120px, 1fr) auto; gap: 5px; }
.provider-code-editor input { min-width: 0; }
.provider-code-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(230px, 100%), 1fr)); gap: 4px; }
.provider-code-item { min-width: 0; min-height: 34px; padding: 3px 4px 3px 8px; border: 1px solid var(--line); border-radius: 5px; display: flex; align-items: center; gap: 6px; }
.provider-code-item > span { min-width: 0; display: grid; gap: 1px; }
.provider-code-item strong, .provider-code-item small, .provider-code-item em { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.provider-code-item strong { font-size: 10px; }
.provider-code-item small { color: var(--muted); font-size: 9px; font-family: ui-monospace, monospace; }
.provider-code-item em { color: var(--muted); font-size: 9px; font-style: normal; }
.provider-code-item em::before { content: "备注 "; color: var(--faint); }
.provider-code-remove { flex: 0 0 auto; margin-left: auto; }
.provider-code-empty { grid-column: 1 / -1; margin: 0; padding: 3px 0; font-size: 9px; }
.provider-account-settings { border-top: 1px solid var(--line); }
.provider-account-settings > summary { min-height: 26px; display: flex; align-items: center; gap: 6px; color: var(--muted); cursor: pointer; list-style: none; }
.provider-account-settings > summary::-webkit-details-marker { display: none; }
.provider-account-settings > summary > span { font-size: 10px; font-weight: 750; }
.provider-account-settings > summary > small { margin-left: auto; color: var(--faint); font-size: 9px; }
.provider-account-settings > summary::after { content: "展开"; color: var(--faint); font-size: 9px; }
.provider-account-settings[open] > summary::after { content: "收起"; color: var(--muted); }
.provider-account-settings[open] > summary { color: var(--ink); }
.provider-account-settings .provider-config-row { padding-top: 4px; }
@media (max-width: 720px) {
  .settings-body { grid-template-columns: 1fr; }
  .settings-section { border-top: 1px solid var(--line); border-left: 0; }
  .settings-section:first-child { border-top: 0; }
  .settings-heading-status { align-items: flex-start; }
  .settings-status { max-width: 56%; white-space: normal; }
  .token-row { grid-template-columns: 1fr 1fr; }
  .token-row > input { grid-column: 1 / -1; }
  .provider-config-row { grid-template-columns: 1fr 1fr; }
  .provider-config-row input:nth-child(-n+3) { grid-column: 1 / -1; }
  .proxy-config-row { grid-template-columns: minmax(0, 1fr) auto auto; }
  .proxy-config-row > #proxy-provider { grid-column: 1; }
  .proxy-config-row > .proxy-toggle { grid-column: 2 / 4; justify-self: end; }
  .provider-code-editor { grid-template-columns: 1fr; }
  .provider-code-editor .button { width: 100%; }
}

/* 与本地服务失联时的全局降饱和：界面上的一切都可能是旧的，
   不能让「监控中」的绿边继续给人正在抢票的错觉。 */
body.is-stale .task-card,
body.is-stale .phone-card {
  filter: saturate(0.35);
}
body.is-stale .task-card.running {
  border-color: var(--line);
}

/* 票码是官网陆续补发的，少于人数时说明一下，别让人以为票丢了 */
.ticket-pending-note {
  margin: 0 0 10px;
  padding: 8px 10px;
  border-radius: 6px;
  background: var(--surface-subtle);
  font-size: 12px;
  line-height: 1.5;
}

/* 「等重新登录」的任务还活着（重登会自动续上），但它一个请求都不发。
   卡片要看得出来和正常在跑的不一样，否则只会以为它在好好工作。 */
.task-card.paused {
  border-color: var(--warning);
}

/* 订单提交出去了但没等到结果：定时开抢明天不会自动重跑，必须说清楚。 */
.task-uncertain-note {
  margin: 8px 0 0;
  padding: 8px 10px;
  border-radius: 6px;
  background: var(--surface-subtle);
  border-left: 3px solid var(--warning);
  font-size: 12px;
  line-height: 1.5;
}

/* 手机号的出口切换下拉。放在操作区，和按钮一样高。 */
.phone-egress {
  height: 28px;
  padding: 0 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  max-width: 118px;
}

/* 云码在处理时，验证码面板整个不显示（见 app.js 的 captchaAccount）。
   0.4 秒的东西顶一块 300px 的面板上来，只会把任务卡挤下去；
   「正在识别」任务卡上已经写了。只有云码搞不定、真要人点时面板才出现。 */
