/* 星签报 StarCheck Daily
   设计方向：考勤台账（详见 .dev/design-plan.md）
   纸白 + 墨黑 + 印章红；三线表；数字等宽；主按钮墨黑实心。
   全站唯一的彩色只留给「出问题」的状态。 */

@font-face {
  font-family: "Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/plex-mono-latin-400.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122, U+2212;
}

@font-face {
  font-family: "Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/assets/fonts/plex-mono-latin-500.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122, U+2212;
}

@font-face {
  font-family: "Plex Mono";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/fonts/plex-mono-latin-600.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122, U+2212;
}

:root {
  --paper: #f7f8f9;
  --sheet: #ffffff;

  --rule: #dde1e6;
  --rule-2: #eceef1;
  --rule-strong: #b6bdc5;

  --ink: #15181c;
  --ink-2: #565e68;
  --ink-3: #868e98;
  --ink-4: #aeb5bd;

  --stamp: #a8281d;
  --stamp-soft: #fbeeec;
  --stamp-line: #e6c8c4;

  --mark: #f7ec86;
  --mark-soft: #fdfbe9;

  --radius: 2px;

  --shadow-paper: 4px 4px 0 rgba(21, 24, 28, 0.07);
  --shadow-paper-lg: 7px 7px 0 rgba(21, 24, 28, 0.09);

  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI",
    "Helvetica Neue", sans-serif;
  --font-num: "Plex Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}

body.has-dialog {
  overflow: hidden;
}

h1,
h2,
h3,
p,
ul,
ol,
dl,
dd,
figure {
  margin: 0;
}

ul,
ol {
  padding-left: 18px;
}

a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--rule-strong);
  padding-bottom: 1px;
}

a:hover {
  border-bottom-color: var(--ink);
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

::selection {
  background: var(--mark);
  color: var(--ink);
}

/* ---------- 骨架 ---------- */

.shell {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 32px 88px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 56px;
  padding: 10px 0;
  background: var(--paper);
  border-bottom: 1px solid var(--rule-strong);
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  border-bottom: 0;
}

.brand:hover {
  border-bottom: 0;
}

/* 品牌做成一个签章：正方形细框 + 中间的字，比圆点更贴合台账 */
.brand-mark {
  width: 24px;
  height: 24px;
  border: 1.5px solid var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  flex: 0 0 auto;
  line-height: 1;
  padding-bottom: 1px;
}

.brand-text {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.brand-sub {
  font-family: var(--font-num);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding-left: 10px;
  border-left: 1px solid var(--rule);
  line-height: 1.4;
}

.nav {
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 13px;
  flex-wrap: wrap;
}

.nav a,
.nav-button {
  color: var(--ink-2);
  border: 0;
  border-bottom: 0;
  padding: 2px 0;
  background: none;
  cursor: pointer;
  font-size: 13px;
}

.nav a:hover,
.nav-button:hover {
  color: var(--ink);
  border-bottom: 0;
}

.nav a[aria-current="page"] {
  color: var(--ink);
  font-weight: 600;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 3px;
}

.nav-button {
  color: var(--ink-3);
}

.nav-button:hover {
  color: var(--stamp);
}

.view {
  padding-top: 26px;
  min-height: 46vh;
}

/* ---------- 页面头：标题 + 墨线 + 元信息 ---------- */

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding-bottom: 13px;
  border-bottom: 1.5px solid var(--ink);
  margin-bottom: 22px;
}

.page-head-main {
  min-width: 0;
  flex: 1 1 420px;
}

.page-title {
  font-size: 25px;
  line-height: 1.24;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.page-desc {
  margin-top: 6px;
  color: var(--ink-2);
  font-size: 12.5px;
  max-width: 72ch;
}

.page-meta {
  margin-top: 8px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--ink-3);
}

.page-meta .num {
  color: var(--ink-2);
}

.page-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  padding-bottom: 2px;
}

/* ---------- 分区：用两级横线代替卡片 ---------- */

.stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 28px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px 24px;
}

.page-head + .section {
  border-top: 0;
  padding-top: 2px;
}

.section {
  background: transparent;
  border: 0;
  border-top: 1px solid var(--rule-strong);
  padding: 16px 0 0;
  min-width: 0;
}

.section-flush {
  padding-bottom: 0;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  min-height: 24px;
}

.section-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.section-title-wrap svg {
  color: var(--ink-3);
  flex: 0 0 auto;
}

.section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.01em;
}

.section-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  flex: 1 1 auto;
  justify-content: flex-end;
}

.section-note {
  font-size: 11.5px;
  color: var(--ink-3);
}

.section-body {
  margin-top: 12px;
  min-width: 0;
}

.section-flush .section-body {
  margin-top: 12px;
  margin-bottom: -1px;
}

.panel {
  border: 1px solid var(--rule);
  border-top: 0;
  background: var(--sheet);
  padding: 20px;
}

/* 表单纸：全站唯一的强元素（细边 + 硬投影，像一张压在桌上的表单） */
.panel-flat {
  border: 1px solid var(--ink);
  background: var(--sheet);
  padding: 22px;
  box-shadow: var(--shadow-paper);
}

.spacer {
  flex: 1;
}

/* ---------- 文本 ---------- */

.muted {
  color: var(--ink-3);
}

.secondary {
  color: var(--ink-2);
}

.note {
  font-size: 11.5px;
  color: var(--ink-3);
  line-height: 1.7;
}

.num {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  font-size: 12.5px;
  letter-spacing: -0.01em;
}

.mono {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

/* ---------- 表单 ---------- */

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.field-label-row {
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 17px;
}

.field-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-2);
}

.field-required {
  color: var(--stamp);
  font-size: 12px;
  line-height: 1;
}

.field-extra {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
}

.field-hint {
  font-size: 11px;
  color: var(--ink-3);
  line-height: 1.5;
}

.field-error {
  font-size: 11.5px;
  color: var(--stamp);
}

.field-invalid .input,
.field-invalid .select,
.field-invalid .textarea {
  border-color: var(--stamp);
  background: var(--stamp-soft);
}

.input,
.select,
.textarea {
  width: 100%;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  background: var(--sheet);
  padding: 7px 9px;
  font-size: 13.5px;
  line-height: 1.5;
  min-height: 36px;
  transition: border-color 120ms ease, box-shadow 120ms ease;
  appearance: none;
}

.textarea {
  min-height: 88px;
  resize: vertical;
}

.input:hover,
.select:hover,
.textarea:hover {
  border-color: var(--ink-3);
}

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--ink);
}

.input::placeholder,
.textarea::placeholder {
  color: var(--ink-4);
}

.input:disabled,
.select:disabled,
.textarea:disabled {
  background: var(--paper);
  color: var(--ink-3);
  cursor: not-allowed;
}

.input[readonly] {
  background: var(--paper);
}

.select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23868e98' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9.5l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 7px center;
  background-size: 14px;
  padding-right: 28px;
}

.input-mono {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  font-size: 13px;
}

.input-search {
  padding-left: 30px;
}

.search-field {
  position: relative;
  flex: 1 1 220px;
  min-width: 0;
  display: flex;
  align-items: center;
}

.search-field svg {
  position: absolute;
  left: 9px;
  color: var(--ink-3);
  pointer-events: none;
}

.section-tools .search-field,
.filter-row .search-field {
  flex: 0 1 280px;
  min-width: 190px;
}

.search-clear {
  position: absolute;
  right: 4px;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.search-clear:hover {
  background: var(--rule-2);
  color: var(--ink);
}

.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: var(--ink-2);
  cursor: pointer;
  user-select: none;
}

.checkbox input {
  width: 14px;
  height: 14px;
  accent-color: var(--ink);
  cursor: pointer;
  margin: 0;
}

.captcha-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.captcha-row .input {
  flex: 1 1 auto;
  min-width: 0;
}

.captcha-row .btn {
  flex: 0 0 auto;
}

.captcha-img {
  width: 112px;
  height: 36px;
  border: 1px solid var(--rule-strong);
  background: var(--paper);
  flex: 0 0 auto;
  cursor: pointer;
}

/* ---------- 按钮 ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  padding: 6px 13px;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  background: var(--sheet);
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 110ms ease, border-color 110ms ease, color 110ms ease;
  white-space: nowrap;
  user-select: none;
}

.btn svg {
  flex: 0 0 auto;
}

.btn:hover {
  border-color: var(--ink-2);
  background: var(--paper);
}

.btn:active {
  background: var(--rule-2);
}

.btn:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn[aria-busy="true"] {
  cursor: progress;
  opacity: 0.7;
}

.btn-primary {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.btn-primary:hover {
  background: #000;
  border-color: #000;
  color: #fff;
}

.btn-danger {
  color: var(--stamp);
  border-color: var(--stamp-line);
  background: var(--sheet);
}

.btn-danger:hover {
  background: var(--stamp-soft);
  border-color: var(--stamp);
  color: var(--stamp);
}

.btn-quiet,
.btn-ghost {
  border-color: transparent;
  background: transparent;
  color: var(--ink-2);
}

.btn-quiet:hover,
.btn-ghost:hover {
  background: var(--rule-2);
  border-color: transparent;
  color: var(--ink);
}

.btn-sm {
  min-height: 28px;
  padding: 3px 9px;
  font-size: 12px;
}

.btn-icon {
  padding: 6px;
  width: 30px;
  min-height: 30px;
}

.btn-sm.btn-icon {
  width: 26px;
  min-height: 26px;
  padding: 4px;
}

.btn-block {
  width: 100%;
}

/* ---------- 状态印章 ---------- */

.dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  font-size: 12.5px;
  color: var(--ink-2);
}

.dot::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--ink-4);
  flex: 0 0 auto;
}

.dot-ok::before {
  background: var(--ink);
}

.dot-warn::before,
.dot-danger::before {
  background: var(--stamp);
}

.dot-info::before {
  background: var(--ink-2);
}

.dot-idle::before {
  background: var(--ink-4);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 1px 6px 2px;
  border: 1px solid currentColor;
  border-radius: var(--radius);
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.5;
  white-space: nowrap;
  background: transparent;
  color: var(--ink);
}

.badge-dot {
  display: none;
}

.badge-ok {
  color: var(--ink);
}

.badge-warn,
.badge-danger {
  color: var(--stamp);
}

.badge-info {
  color: var(--ink-2);
}

.badge-idle {
  color: var(--ink-3);
  border-style: dashed;
}

/* ---------- 三线表 ---------- */

.table-wrap {
  background: transparent;
  overflow-x: auto;
  border-top: 1.5px solid var(--ink);
  border-bottom: 1.5px solid var(--ink);
}

.section-flush .table-wrap {
  border-top: 1.5px solid var(--ink);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.table th {
  text-align: left;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--ink-3);
  padding: 8px 14px;
  border-bottom: 1px solid var(--rule-strong);
  background: transparent;
  white-space: nowrap;
}

.table td {
  height: 46px;
  padding: 7px 14px;
  border-bottom: 1px solid var(--rule-2);
  vertical-align: middle;
}

.table tbody tr:last-child td {
  border-bottom: 0;
}

.table tbody tr {
  transition: background-color 100ms ease;
}

.table tbody tr:hover {
  background: var(--mark-soft);
}

.table tbody tr.is-clickable {
  cursor: pointer;
}

.table td.align-right,
.table th.align-right {
  text-align: right;
}

.table td.shrink,
.table th.shrink {
  width: 1%;
  white-space: nowrap;
}

.table-empty {
  padding: 0;
}

.cell-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.cell-actions .btn-quiet {
  color: var(--ink-3);
}

.cell-actions .btn-quiet:hover {
  color: var(--ink);
  background: var(--rule-2);
}

.cell-primary {
  font-weight: 500;
}

.cell-sub {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  color: var(--ink-3);
}

.table .num {
  font-size: 12.5px;
  white-space: nowrap;
}

.table .badge {
  white-space: nowrap;
}

/* ---------- 工具条 ---------- */

.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.toolbar .input {
  flex: 1 1 240px;
  min-width: 0;
}

.toolbar .select {
  flex: 0 1 180px;
  width: auto;
  min-width: 130px;
}

.toolbar .btn {
  flex: 0 0 auto;
}

/* 分段筛选：表格上方的一排标签，选中项加下划线 */
.segmented {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  border: 0;
  padding: 0;
  background: transparent;
}

.segment {
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--ink-3);
  font-size: 12.5px;
  padding: 3px 0 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: color 110ms ease, border-color 110ms ease;
  white-space: nowrap;
}

.segment:hover {
  color: var(--ink);
}

.segment.is-active {
  color: var(--ink);
  font-weight: 600;
  border-bottom-color: var(--ink);
}

.segment-count {
  font-family: var(--font-num);
  font-size: 10.5px;
  color: var(--ink-3);
}

/* ---------- 批量操作条 ---------- */

.selection-bar {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  z-index: 35;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  max-width: calc(100vw - 32px);
  padding: 9px 10px 9px 14px;
  background: var(--ink);
  color: #fff;
  border-radius: var(--radius);
  box-shadow: 6px 6px 0 rgba(21, 24, 28, 0.16);
}

.selection-bar .note,
.selection-bar .checkbox {
  color: rgba(255, 255, 255, 0.7);
}

.selection-bar .select {
  background-color: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.28);
  color: #fff;
  min-height: 30px;
  padding-top: 2px;
  padding-bottom: 2px;
}

.selection-bar .select option {
  color: var(--ink);
}

.selection-bar .btn-quiet {
  color: rgba(255, 255, 255, 0.72);
}

.selection-bar .btn-quiet:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.selection-bar .btn-primary {
  background: #fff;
  border-color: #fff;
  color: var(--ink);
}

.selection-bar .btn-primary:hover {
  background: var(--mark);
  border-color: var(--mark);
  color: var(--ink);
}

.selection-count {
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}

.selection-divider {
  width: 1px;
  height: 18px;
  background: rgba(255, 255, 255, 0.2);
}

/* ---------- 分页 ---------- */

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0 0;
  font-size: 12px;
  color: var(--ink-3);
  flex-wrap: wrap;
}

.pager-info {
  display: inline-flex;
  gap: 14px;
  align-items: baseline;
  font-size: 11.5px;
  color: var(--ink-3);
}

.pager-info strong {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  color: var(--ink-2);
}

.filter-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 0 0 10px;
}

.pager-actions {
  display: flex;
  gap: 6px;
}

/* ---------- 提示 / 空态 / 骨架 ---------- */

.notice {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  border: 1px solid var(--rule-strong);
  border-left-width: 3px;
  padding: 9px 12px;
  font-size: 12.5px;
  background: var(--sheet);
  color: var(--ink-2);
  line-height: 1.6;
}

.notice svg {
  flex: 0 0 auto;
  margin-top: 2px;
  color: var(--ink-3);
}

.notice-text {
  min-width: 0;
  overflow-wrap: anywhere;
}

.notice-error {
  background: var(--stamp-soft);
  border-color: var(--stamp-line);
  border-left-color: var(--stamp);
  color: #7a1f16;
}

.notice-error svg {
  color: var(--stamp);
}

.notice-ok {
  background: var(--sheet);
  border-left-color: var(--ink);
  color: var(--ink);
}

.notice-ok svg {
  color: var(--ink);
}

.notice-warn {
  background: var(--sheet);
  border-left-color: var(--stamp);
  color: #7a1f16;
}

.notice-warn svg {
  color: var(--stamp);
}

.notice-info svg {
  color: var(--ink-2);
}

.empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--ink-3);
  font-size: 12.5px;
}

.empty-icon {
  display: none;
}

.empty-title {
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
}

.empty-desc {
  max-width: 46ch;
  margin: 0 auto;
  line-height: 1.7;
}

.empty-action {
  margin-top: 14px;
  display: flex;
  justify-content: center;
  gap: 8px;
}

.skeleton {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
}

.skeleton-line {
  height: 12px;
  background: var(--rule-2);
  animation: shimmer 1.4s ease infinite;
}

@keyframes shimmer {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.55;
  }
}

/* ---------- 浮层提示 ---------- */

.notice-layer {
  position: fixed;
  right: 22px;
  bottom: 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 60;
  max-width: min(360px, calc(100vw - 40px));
  pointer-events: none;
}

.notice-float {
  pointer-events: auto;
  background: var(--sheet);
  border: 1px solid var(--ink);
  border-left-width: 4px;
  padding: 10px 32px 10px 12px;
  position: relative;
  box-shadow: var(--shadow-paper);
  animation: toast-in 160ms ease-out;
}

.notice-float.is-leaving {
  opacity: 0;
  transition: opacity 150ms ease;
}

.notice-close {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 20px;
  height: 20px;
  border: 0;
  background: transparent;
  color: var(--ink-3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.notice-close:hover {
  color: var(--ink);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- 弹层 ---------- */

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(21, 24, 28, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 20px;
  z-index: 50;
  overflow-y: auto;
}

.dialog {
  width: 100%;
  max-width: 540px;
  max-height: calc(100vh - 56px);
  display: flex;
  flex-direction: column;
  background: var(--sheet);
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow-paper-lg);
  outline: none;
}

.dialog-wide {
  max-width: 820px;
}

.dialog-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 18px 20px 12px;
  border-bottom: 1px solid var(--ink);
}

.dialog-head-text {
  min-width: 0;
  flex: 1;
}

.dialog-title {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.01em;
}

.dialog-desc {
  margin-top: 4px;
  font-size: 12px;
  color: var(--ink-3);
  line-height: 1.65;
}

.dialog-close {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink-3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.dialog-close:hover {
  background: var(--rule-2);
  color: var(--ink);
}

.dialog-body {
  padding: 18px 20px 20px;
  overflow-y: auto;
  min-height: 0;
}

/* 内容超长时，底部留一道白色渐隐，说明「下面还有」（地图这类不透明内容会盖住背景阴影，只能用浮层） */
.dialog-body::after {
  content: "";
  position: sticky;
  bottom: 0;
  z-index: 900;
  display: block;
  height: 26px;
  margin: 0 -20px -20px;
  background: linear-gradient(rgba(255, 255, 255, 0), var(--sheet) 82%);
  pointer-events: none;
}

.dialog-error:empty {
  display: none;
}

.dialog-error {
  padding: 0 20px 12px;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  padding: 12px 20px;
  border-top: 1px solid var(--rule-strong);
  background: var(--sheet);
}

/* ---------- 定义列表 ---------- */

.defs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 32px;
}

.def {
  min-width: 0;
}

.def dt {
  font-size: 11px;
  color: var(--ink-3);
  margin-bottom: 2px;
}

.def dd {
  font-size: 13.5px;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.def dd.mono {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  font-size: 12.5px;
  color: var(--ink-2);
}

/* ---------- 结果块 ---------- */

.result {
  border: 1px solid var(--rule-strong);
  background: var(--sheet);
  overflow: hidden;
}

.result-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--rule-2);
  flex-wrap: wrap;
}

.result-row:last-child {
  border-bottom: 0;
}

.result-label {
  font-size: 12px;
  color: var(--ink-3);
}

.result-value {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  font-size: 13px;
}

.result-foot {
  padding: 9px 14px;
  border-top: 1px solid var(--rule-strong);
  font-size: 11px;
  color: var(--ink-3);
}

/* ---------- 代码片段 ---------- */

.snippet {
  margin: 0;
  padding: 10px 12px;
  background: var(--paper);
  border: 1px solid var(--rule);
  font-family: var(--font-num);
  font-size: 11px;
  line-height: 1.65;
  color: var(--ink-2);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 240px;
  overflow-y: auto;
}

details.disclosure summary {
  cursor: pointer;
  color: var(--ink-3);
  font-size: 11.5px;
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  user-select: none;
  border-bottom: 1px dotted var(--rule-strong);
}

details.disclosure summary::-webkit-details-marker {
  display: none;
}

details.disclosure summary:hover {
  color: var(--ink);
}

details.disclosure[open] summary {
  margin-bottom: 8px;
}

/* ---------- 统计条（批次详情） ---------- */

.stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border-top: 1.5px solid var(--ink);
  border-bottom: 1.5px solid var(--ink);
}

.stat {
  padding: 12px 16px 12px 0;
  border-right: 1px solid var(--rule);
}

.stat:last-child {
  border-right: 0;
}

.stat-label {
  font-size: 11px;
  color: var(--ink-3);
}

.stat-value {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  font-size: 24px;
  line-height: 1.25;
  margin-top: 2px;
  letter-spacing: -0.02em;
  color: var(--ink);
}

/* ---------- 可复制值 ---------- */

.copyable {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.copy-button {
  border: 0;
  background: transparent;
  color: var(--ink-4);
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 110ms ease, color 110ms ease;
}

.copyable:hover .copy-button,
.copy-button:focus-visible {
  opacity: 1;
}

.copy-button:hover {
  color: var(--ink);
}

.copy-buffer {
  position: fixed;
  left: -9999px;
  top: 0;
  opacity: 0;
}

/* ---------- 页脚 ---------- */

.footer {
  margin-top: 56px;
  padding-top: 14px;
  border-top: 1px solid var(--rule-strong);
  font-size: 11px;
  color: var(--ink-3);
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.footer-dot {
  display: none;
}

/* ---------- 列表单元格 ---------- */

.user-cell {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}

.user-cell-text {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}

.auth-cell {
  display: flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1.35;
}

/* ---------- 表单分组 ---------- */

.form-stack {
  gap: 18px;
}

.form-group {
  border-top: 1px solid var(--rule);
  padding-top: 15px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-group:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.form-group-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.form-group-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.02em;
}

.input-with-actions {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-actions .input {
  padding-right: 60px;
}

.input-action {
  position: absolute;
  width: 24px;
  height: 24px;
  border: 0;
  background: transparent;
  color: var(--ink-3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.input-action:hover {
  color: var(--ink);
}

.input-with-actions .input-action:nth-of-type(1) {
  right: 30px;
}

.input-with-actions .input-action:nth-of-type(2) {
  right: 4px;
}

.checkbox-card {
  min-height: 36px;
  padding: 0 9px;
  border: 1px solid var(--rule);
  background: var(--paper);
}

.inline-form {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* 授权顺延行：标签不参与压缩，按钮组自己换行 */
.extend-row {
  display: flex;
  align-items: center;
  gap: 10px 14px;
  flex-wrap: wrap;
}

.extend-label {
  flex: 0 0 auto;
  white-space: nowrap;
}

.extend-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1 1 auto;
  flex-wrap: wrap;
}

.inline-form .select {
  width: auto;
  min-width: 110px;
}

.inline-form .input {
  width: auto;
  max-width: 90px;
}

/* ---------- 授权卡片 ---------- */

.auth-card {
  border: 1px solid var(--rule-strong);
  padding: 12px 14px;
  background: var(--sheet);
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.auth-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.auth-date {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  font-size: 19px;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.auth-date.is-empty {
  color: var(--ink-4);
  font-size: 14px;
  font-family: var(--font-sans);
}

/* ---------- 返回与危险操作 ---------- */

.back-link {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 0;
  border-bottom: 1px dotted var(--rule-strong);
  background: transparent;
  color: var(--ink-3);
  font-size: 12px;
  padding: 0;
  cursor: pointer;
}

.back-link svg {
  transform: rotate(90deg);
}

.back-link:hover {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

.section-danger {
  border-top-color: var(--stamp-line);
}

.section-danger .section-title-wrap {
  color: var(--stamp);
}

.section-danger .section-title-wrap svg {
  color: var(--stamp);
}

.danger-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 12px 14px;
  border: 1px solid var(--stamp-line);
  background: var(--stamp-soft);
}

/* ---------- 登录 / 公开查询 ---------- */

.auth-wrap {
  max-width: 420px;
  margin: 18px auto 0;
}

.auth-wrap-wide {
  max-width: 500px;
}

.auth-foot {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--rule);
}

.auth-wrap-wide .auth-foot {
  justify-content: flex-start;
}

.lookup-result {
  border-top: 1.5px solid var(--ink);
  border-bottom: 1.5px solid var(--ink);
}

.lookup-head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 0;
  border-bottom: 1px solid var(--rule-strong);
  font-size: 11.5px;
  color: var(--ink-3);
}

.lookup-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--rule-2);
}

.lookup-row:last-child {
  border-bottom: 0;
}

.lookup-label {
  font-size: 12.5px;
  color: var(--ink-3);
  width: 64px;
  flex: 0 0 auto;
}

.lookup-value {
  flex: 0 0 auto;
}

.lookup-date {
  margin-left: auto;
  color: var(--ink-2);
}

input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
}

/* ---------- 地图选点 ---------- */

.map-picker {
  border: 1px solid var(--rule-strong);
  background: var(--sheet);
}

.map-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px;
  border-bottom: 1px solid var(--rule);
  flex-wrap: wrap;
}

.map-search-input {
  flex: 1 1 200px;
  min-width: 0;
  min-height: 30px;
  font-size: 12.5px;
}

.map-search-button {
  flex: 0 0 auto;
}

.map-stage {
  position: relative;
  background: var(--paper);
}

.map-canvas {
  position: relative;
  width: 100%;
  z-index: 0;
  /* 百度的版权条与 logo 都在左下角；容器必须裁切，否则窄屏下版权文字会溢出到地图外 */
  overflow: hidden;
  background: var(--paper);
}

/* 百度的版权声明必须保留（合规），但可以压小，别让它抢走地图的注意力 */
.map-canvas .BMap_cpyCtrl {
  font-size: 9px !important;
  line-height: 1.5 !important;
  opacity: 0.75;
}

.map-canvas .anchorBL {
  transform: scale(0.8);
  transform-origin: left bottom;
  opacity: 0.85;
}

.map-hint {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--ink);
  color: var(--ink);
  font-size: 11.5px;
  line-height: 1.6;
  pointer-events: none;
  transition: opacity 220ms ease;
  max-width: calc(100% - 20px);
}

.map-hint svg {
  flex: 0 0 auto;
  color: var(--stamp);
}

.map-hint.is-hidden {
  opacity: 0;
}

.map-zoom {
  position: absolute;
  right: 10px;
  top: 10px;
  z-index: 500;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--ink);
  background: var(--sheet);
}

.map-zoom-btn {
  width: 30px;
  height: 30px;
  border: 0;
  background: var(--sheet);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.map-zoom-btn + .map-zoom-btn {
  border-top: 1px solid var(--rule);
}

.map-zoom-btn:hover {
  background: var(--paper);
}

.map-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 10px;
  border-top: 1px solid var(--rule);
  flex-wrap: wrap;
}

.map-foot-main {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
  flex-wrap: wrap;
}

.map-coords {
  font-size: 11.5px;
  color: var(--ink);
}

.map-address {
  font-size: 11px;
  color: var(--ink-3);
  overflow-wrap: anywhere;
}

.map-address.is-ok {
  color: var(--ink-2);
}

.map-address.is-warn {
  color: var(--stamp);
}

.map-address.is-muted {
  color: var(--ink-4);
}

.map-foot-actions {
  display: flex;
  gap: 2px;
  margin-left: auto;
}

.map-results {
  position: absolute;
  top: 0;
  left: 7px;
  right: 7px;
  z-index: 600;
  background: var(--sheet);
  border: 1px solid var(--ink);
  box-shadow: var(--shadow-paper);
  max-height: 220px;
  overflow-y: auto;
  display: none;
}

.map-results.is-open {
  display: block;
}

.map-result {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px solid var(--rule-2);
  background: transparent;
  padding: 8px 11px;
  cursor: pointer;
}

.map-result:last-child {
  border-bottom: 0;
}

.map-result:hover {
  background: var(--mark-soft);
}

.map-result-name {
  display: block;
  font-size: 12.5px;
  color: var(--ink);
}

.map-result-address {
  display: block;
  font-size: 11px;
  color: var(--ink-3);
  margin-top: 1px;
}

.map-result-note {
  padding: 11px;
  font-size: 11.5px;
  color: var(--ink-3);
}

.map-fallback {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 100%;
  min-height: 180px;
  padding: 24px;
  text-align: center;
  color: var(--ink-3);
  font-size: 12.5px;
}

/* Leaflet 覆盖 */
.leaflet-container {
  font-family: var(--font-sans);
  background: #e8eaec;
  outline: none;
}

.leaflet-container a {
  border-bottom: 0;
}

/* ---------- 响应式 ---------- */

@media (max-width: 880px) {
  .grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .stat:nth-child(3n) {
    border-right: 0;
  }

  .stat:nth-child(n + 4) {
    border-top: 1px solid var(--rule);
  }
}

@media (max-width: 720px) {
  .shell {
    padding: 0 16px 72px;
  }

  .view {
    padding-top: 18px;
  }

  .topbar {
    min-height: 52px;
    padding: 8px 0;
    gap: 8px;
  }

  .brand-sub {
    display: none;
  }

  .nav {
    gap: 16px;
    font-size: 12.5px;
  }

  .page-title {
    font-size: 21px;
  }

  .page-head {
    margin-bottom: 18px;
    gap: 12px;
    align-items: flex-start;
  }

  .page-actions {
    width: 100%;
  }

  .page-actions .btn {
    flex: 1 1 auto;
  }

  .grid-2,
  .grid-3,
  .defs {
    grid-template-columns: minmax(0, 1fr);
  }

  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stat:nth-child(2n) {
    border-right: 0;
  }

  .stat:nth-child(n + 3) {
    border-top: 1px solid var(--rule);
  }

  /* 5 个指标落在两列时，最后一个独占一行，避免右侧留半格 */
  .stat:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    border-right: 0;
  }

  .overlay {
    padding: 0;
    align-items: flex-end;
  }

  .dialog {
    max-width: none;
    max-height: 92vh;
    border-width: 1px 0 0 0;
    box-shadow: none;
  }

  .dialog-wide {
    max-width: none;
  }

  .dialog-actions {
    position: sticky;
    bottom: 0;
    background: var(--sheet);
  }

  .table {
    min-width: 640px;
  }

  .table th:first-child,
  .table td:first-child {
    position: sticky;
    left: 0;
    background: var(--paper);
    z-index: 1;
  }

  /* 手机上不靠横滚找列：只留能一眼判断的，其余进详情页 */
  .table th,
  .table td {
    padding-left: 10px;
    padding-right: 10px;
  }

  .table-users,
  .table-runs {
    min-width: 0;
  }

  .table th:nth-child(2) {
    padding-left: 10px;
  }

  .table-users th:nth-child(n + 3):nth-child(-n + 5),
  .table-users td:nth-child(n + 3):nth-child(-n + 5) {
    display: none;
  }

  .table-runs th:nth-child(3),
  .table-runs td:nth-child(3),
  .table-runs th:nth-child(n + 7),
  .table-runs td:nth-child(n + 7) {
    display: none;
  }

  .table-runs th:nth-child(2),
  .table-runs td:nth-child(2),
  .table-runs th:nth-child(5),
  .table-runs td:nth-child(5) {
    white-space: nowrap;
  }

  .notice-layer {
    left: 14px;
    right: 14px;
    max-width: none;
    bottom: 14px;
  }

  .selection-bar {
    left: 12px;
    right: 12px;
    bottom: 12px;
    transform: none;
    max-width: none;
  }

  .map-bar .btn .btn-label {
    display: none;
  }

  .map-bar .btn {
    padding: 5px 7px;
  }

  .map-foot {
    flex-direction: column;
    align-items: flex-start;
  }

  .map-foot-actions {
    margin-left: 0;
    width: 100%;
  }

  .section-tools {
    justify-content: flex-start;
  }

  .section-tools .search-field {
    flex: 1 1 100%;
  }

  .filter-row {
    gap: 10px;
  }

  .filter-row .search-field {
    flex: 1 1 100%;
    min-width: 0;
  }

  .extend-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .extend-actions {
    width: 100%;
  }

  .extend-actions .spacer {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}
