:root {
  --bg: #f3f6f5;
  --paper: #fff;
  --border: #dfe4e2;
  --text: #17201e;
  --muted: #68716f;
  --primary: #087f6a;
  --primary-dark: #056a59;
  --primary-soft: #e6f4f0;
  --sidebar: #151b1a;
  --sidebar-muted: #99a4a1;
  --red: #b43b45;
  --red-soft: #fdecee;
  --amber: #a7650b;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; color: var(--text); background: var(--bg); font-family: Inter, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; -webkit-font-smoothing: antialiased; }
button, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
.hidden { display: none !important; }

.scan-app { min-height: 100vh; display: grid; grid-template-columns: 230px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 28px 14px 20px; background: var(--sidebar); color: #fff; }
.sidebar-brand { display: flex; align-items: center; gap: 11px; padding: 0 8px 26px; color: inherit; text-decoration: none; border-bottom: 1px solid #303a38; }
.brand-mark { width: 36px; height: 36px; flex: 0 0 36px; display: inline-flex; align-items: center; justify-content: center; border-radius: 6px; color: #fff; background: var(--primary); box-shadow: 0 4px 12px rgba(8,127,106,.28); }
.sidebar-brand strong { display: block; font-size: 14px; letter-spacing: .03em; }
.sidebar-brand small { display: block; margin-top: 3px; color: var(--sidebar-muted); font-size: 12px; }
.side-nav { display: grid; gap: 5px; margin-top: 24px; }
.side-nav a { display: flex; align-items: center; gap: 11px; min-height: 42px; padding: 0 12px; border-radius: 5px; color: #abb5b2; font-size: 13px; text-decoration: none; }
.side-nav a:hover, .side-nav a.active { color: #fff; background: #202826; }
.side-nav .purchase-nav { margin-top: 10px; color: #71d7c5; border: 1px solid #30554e; background: rgba(8,127,106,.1); }
.side-nav .purchase-nav:hover { color: #fff; border-color: #087f6a; background: #087f6a; }
.purchase-nav b { margin-left: auto; font-size: 13px; }
.side-note { margin: auto 8px 18px; padding: 14px; border: 1px solid #34403d; border-radius: 6px; color: var(--sidebar-muted); }
.side-note-icon { display: flex; align-items: center; justify-content: center; width: 20px; height: 20px; border: 1px solid #64716e; border-radius: 50%; font-size: 12px; }
.side-note p { margin: 9px 0 0; font-size: 12px; line-height: 1.65; }
.account-link { display: flex; justify-content: space-between; align-items: center; margin: 0 8px; padding: 10px 12px; border: 1px solid #34403d; border-radius: 5px; color: #d9dfdd; text-decoration: none; font-size: 12px; }
.account-link:hover { background: #202826; }

.main { min-width: 0; }
.topbar { height: 82px; padding: 0 32px; display: flex; align-items: center; justify-content: space-between; background: var(--paper); border-bottom: 1px solid var(--border); }
.topbar h1 { margin: 0; font-size: 20px; }
.topbar p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.language-select { min-height: 34px; padding: 0 10px; border: 1px solid var(--border); border-radius: 5px; color: var(--text); background: #fff; outline: none; font: inherit; font-size: 12px; }
.language-select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(8,127,106,.08); }
.service-status { display: inline-flex; align-items: center; gap: 8px; padding: 8px 11px; border: 1px solid var(--border); border-radius: 5px; color: var(--muted); background: #fafcfb; font-size: 12px; }
.service-status i { width: 7px; height: 7px; border-radius: 50%; background: #a9b1af; }
.service-status.online { color: var(--primary); border-color: #baddd4; background: var(--primary-soft); }
.service-status.online i { background: var(--primary); box-shadow: 0 0 0 3px rgba(8,127,106,.12); }
.service-status.offline { color: var(--red); border-color: #efcbd0; background: var(--red-soft); }
.service-status.offline i { background: var(--red); }

.content { width: min(1280px, 100%); margin: 0 auto; padding: 28px 32px 50px; }
.intro-card { display: flex; justify-content: space-between; align-items: center; gap: 30px; padding: 24px 26px; color: #fff; background: var(--sidebar); border-radius: 7px; }
.eyebrow { color: #63d3c0; font-size: 10px; font-weight: 800; letter-spacing: .2em; }
.intro-card h2 { margin: 7px 0 6px; font-size: 22px; }
.intro-card p { max-width: 720px; margin: 0; color: #aab4b1; font-size: 12px; line-height: 1.7; }
.worker-count { min-width: 175px; padding: 13px 17px; border: 1px solid #34403d; border-radius: 6px; text-align: right; }
.worker-count b { display: block; color: #63d3c0; font-size: 24px; }
.worker-count span { color: #aab4b1; font-size: 11px; }

.submit-layout { display: grid; grid-template-columns: minmax(0, 1fr) 235px; gap: 18px; margin-top: 18px; position: relative; }
.panel, .summary-card { background: var(--paper); border: 1px solid var(--border); border-radius: 7px; box-shadow: 0 4px 16px rgba(23,32,30,.025); }
.submit-panel { padding: 24px 26px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.panel-head h3 { margin: 0; font-size: 16px; }
.panel-head p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.secure-badge { padding: 6px 9px; border-radius: 4px; color: var(--primary); background: var(--primary-soft); font-size: 11px; font-weight: 700; }
.submit-panel label { display: block; margin: 18px 0 8px; font-size: 13px; font-weight: 650; }
textarea { width: 100%; padding: 12px 13px; resize: vertical; outline: none; color: var(--text); background: #fbfcfc; border: 1px solid var(--border); border-radius: 5px; font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; font-size: 12px; line-height: 1.7; transition: border-color .15s, box-shadow .15s; }
textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(8,127,106,.08); background: #fff; }
textarea::placeholder { color: #9ba5a2; }
.links-area { min-height: 172px; }
.at-area { min-height: 108px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.at-preview { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.at-preview.hidden { display: none; }
.at-chip { padding: 3px 9px; border-radius: 999px; background: rgba(60, 190, 130, 0.12); border: 1px solid rgba(60, 190, 130, 0.35); color: var(--text); font-size: 11px; }
.at-chip.expired { background: rgba(240, 170, 60, 0.14); border-color: rgba(240, 170, 60, 0.4); }
.field-meta { display: flex; justify-content: space-between; gap: 12px; margin-top: 7px; color: var(--muted); font-size: 11px; }
.field-meta b { color: var(--text); white-space: nowrap; }
.availability-alert { display: flex; flex-direction: column; gap: 3px; margin-top: 18px; padding: 12px 14px; color: var(--red); background: var(--red-soft); border: 1px solid #efcbd0; border-radius: 5px; font-size: 12px; }
.availability-alert span { color: #8d5158; }
.submit-actions { display: flex; align-items: center; gap: 14px; margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--border); }
.btn-primary { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; padding: 0 18px; border: 1px solid var(--primary); border-radius: 5px; color: #fff; background: var(--primary); font-size: 13px; font-weight: 700; }
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); }
.submit-hint { color: var(--muted); font-size: 11px; }

.summary-stack { display: grid; align-content: start; gap: 12px; }
.summary-card { padding: 18px; }
.summary-card > span { color: var(--muted); font-size: 12px; }
.summary-card strong { display: block; margin-top: 8px; font-size: 27px; font-weight: 760; }
.summary-card strong small { margin-left: 4px; color: var(--muted); font-size: 12px; }
.summary-card p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.summary-card.accent { border-top: 3px solid var(--primary); }
.summary-card.accent strong { color: var(--primary); }
.steps ol { display: grid; gap: 13px; margin: 15px 0 0; padding: 0; list-style: none; }
.steps li { display: flex; align-items: center; gap: 9px; color: #4d5855; font-size: 11px; }
.steps i { width: 21px; height: 21px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; color: var(--primary); background: var(--primary-soft); font-style: normal; font-weight: 700; }

.records-panel { margin-top: 18px; padding: 22px 24px; }
.record-actions { display: flex; gap: 7px; }
.record-actions button { padding: 7px 10px; border: 1px solid var(--border); border-radius: 4px; color: var(--text); background: #fff; font-size: 11px; }
.record-actions button:hover { border-color: #b8c1be; background: #f9fbfa; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th { padding: 10px 11px; color: var(--muted); background: #f7f9f8; border-bottom: 1px solid var(--border); text-align: left; font-weight: 650; white-space: nowrap; }
td { padding: 12px 11px; border-bottom: 1px solid #edf0ef; white-space: nowrap; }
tr:last-child td { border-bottom: none; }
.empty td { height: 74px; color: var(--muted); text-align: center; }
.status-pill { display: inline-flex; padding: 4px 7px; border-radius: 999px; font-size: 10px; font-weight: 700; }
.status-waiting { color: var(--amber); background: #fff4df; }
.status-running { color: #226eaa; background: #e8f3fc; }
.status-success { color: var(--primary); background: var(--primary-soft); }
.status-error { color: var(--red); background: var(--red-soft); }
.receipt { max-width: 180px; overflow: hidden; text-overflow: ellipsis; color: var(--muted); font-family: monospace; }

.modal-mask { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 18px; background: rgba(15, 23, 21, .58); backdrop-filter: blur(3px); }
.confirm-modal { width: min(390px, 100%); padding: 24px; border-radius: 7px; background: #fff; box-shadow: 0 18px 50px rgba(0, 0, 0, .18); }
.confirm-modal h3 { margin: 0 0 10px; font-size: 17px; }
.confirm-modal p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 22px; }
.btn-secondary, .btn-danger { min-height: 37px; padding: 8px 14px; border-radius: 5px; font-weight: 650; }
.btn-secondary { color: var(--text); background: #fff; border: 1px solid var(--border); }
.btn-danger { color: #fff; background: var(--red); border: 1px solid var(--red); }

.toast-stack { position: fixed; right: 22px; bottom: 22px; z-index: 20; display: grid; gap: 9px; }
.toast { min-width: 260px; max-width: 420px; padding: 12px 14px; color: #fff; background: #26302e; border-radius: 5px; box-shadow: 0 8px 28px rgba(0,0,0,.2); font-size: 12px; animation: toast-in .2s ease; }
.toast.success { background: var(--primary-dark); }
.toast.error { background: #983640; }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } }

/* ---- 公告栏：悬浮在提交信息左侧的页边空隙里，不占布局 ---- */
.submit-panel label.at-label { color: var(--red); font-weight: 750; }
.at-red { color: var(--red); font-weight: 700; }
.at-hint { color: var(--red); font-weight: 650; }
.announce-card { position: absolute; top: 0; right: calc(100% + 12px); width: 186px; padding: 14px 15px; display: flex; flex-direction: column; background: var(--paper); border: 1px solid var(--border); border-left: 3px solid var(--amber); border-radius: 7px; box-shadow: 0 4px 16px rgba(23,32,30,.025); }
.announce-head { display: flex; align-items: center; gap: 7px; color: var(--text); font-size: 15px; font-weight: 700; flex: 0 0 auto; }
.announce-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 3px rgba(167,101,11,.16); flex: 0 0 auto; }
.announce-body { margin-top: 11px; flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.announce-body p { margin: 0 0 9px; color: var(--muted); font-size: 13.5px; line-height: 1.75; }
.announce-body p:last-child { margin-bottom: 0; }
.announce-body::-webkit-scrollbar { width: 4px; }
.announce-body::-webkit-scrollbar-thumb { background: #c3ccc9; border-radius: 2px; }
/* 空隙放不下（视口 < 1745px）时隐藏，布局完全不受影响；JS 会精确测量填满可用空隙 */
@media (max-width: 1745px) { .announce-card { display: none; } }

/* ---- 技术看盘 ---- */
.tech-board { margin-bottom: 18px; padding: 16px 18px 18px; background: var(--paper); border: 1px solid var(--border); border-left: 3px solid var(--primary); border-radius: 7px; box-shadow: 0 4px 16px rgba(23,32,30,.025); }
.tech-board-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tech-board-title { font-size: 13px; font-weight: 700; letter-spacing: .04em; color: var(--text); }
.tech-board-live { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11px; }
.tech-board-live i { width: 6px; height: 6px; border-radius: 50%; background: var(--primary); animation: board-pulse 1.6s ease-in-out infinite; }
@keyframes board-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .28; } }
.tech-board-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 14px; }
.tech-metric { display: flex; flex-direction: column; gap: 5px; padding: 12px 14px; background: #f7faf9; border: 1px solid var(--border); border-radius: 6px; }
.tech-metric-label { color: var(--muted); font-size: 11.5px; }
.tech-metric-value { font-size: 23px; font-weight: 760; font-variant-numeric: tabular-nums; }
.tech-metric-value.success { color: var(--primary); }
.tech-metric-value.rate { color: var(--amber); }
.tech-metric-value.countdown { color: var(--text); }

/* ---- 倒计时单元格 ---- */
.countdown-cell { display: inline-block; min-width: 52px; padding: 2px 7px; color: var(--primary); background: var(--primary-soft); border-radius: 4px; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.countdown-cell.expired, .tech-metric-value.countdown.expired { color: var(--muted); background: #f0f2f1; }

@media (max-width: 900px) {
  .scan-app { grid-template-columns: 1fr; }
  .sidebar { position: static; width: 100%; height: auto; padding: 14px 18px; flex-direction: row; align-items: center; }
  .sidebar-brand { padding: 0; border: none; }
  .side-note { display: none; }
  .announce-card { display: none; }
  .side-nav { display: block; margin: 0 0 0 auto; }
  .side-nav a { display: none; }
  .side-nav .purchase-nav:not(.hidden) { display: flex; min-height: 36px; margin: 0; }
  .account-link { margin-left: 8px; }
  .topbar { padding: 0 20px; }
  .topbar-actions { gap: 8px; }
  .language-select { max-width: 118px; }
  .content { padding: 20px; }
  .submit-layout { grid-template-columns: 1fr; }
  .summary-stack { grid-template-columns: repeat(3, 1fr); }
  .tech-board-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .sidebar-brand small, .account-link span { display: none; }
  .account-link { display: none; }
  .topbar { height: auto; min-height: 76px; gap: 12px; }
  .topbar p { display: none; }
  .topbar-actions { margin-left: auto; }
  .language-select { max-width: 72px; padding: 0 6px; font-size: 11px; }
  .service-status span { display: none; }
  .content { padding: 14px 12px 30px; }
  .intro-card { align-items: flex-start; padding: 19px; }
  .intro-card h2 { font-size: 18px; }
  .worker-count { min-width: 86px; padding: 9px; }
  .worker-count span { display: none; }
  .submit-panel, .records-panel { padding: 18px 15px; }
  .summary-stack { grid-template-columns: 1fr 1fr; }
  .summary-card.steps { grid-column: 1 / -1; }
  .submit-actions { align-items: flex-start; flex-direction: column; }
  .btn-primary { width: 100%; }
  .field-meta span { max-width: 72%; }
  .panel-head { align-items: flex-start; }
  .records-panel .panel-head { flex-direction: column; }
  .toast-stack { left: 12px; right: 12px; bottom: 12px; }
  .toast { min-width: 0; max-width: none; }
}
/* 顶部官方社群引导条（TG 群 / QQ 群） */
.contact-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--paper);
  font-size: 12.5px;
}
.contact-strip-label {
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.02em;
}
.contact-strip-item {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
  word-break: break-all;
}
a.contact-strip-item:hover { text-decoration: underline; }
.contact-strip-sep {
  width: 1px;
  height: 12px;
  background: var(--border);
}
