* { box-sizing: border-box; }
:root {
  --bg: #f4f7fb;
  --panel: #ffffff;
  --line: #dbe5f0;
  --text: #16304f;
  --muted: #6f859f;
  --primary: #2f6fed;
  --primary-weak: #eaf1ff;
  --success: #16a34a;
  --warning: #b7791f;
}
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: linear-gradient(180deg, #f8fbff 0%, var(--bg) 100%);
  color: var(--text);
}
.page-shell {
  max-width: 1680px;
  margin: 0 auto;
  padding: 20px;
}
.topbar {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}
.brand {
  display: grid;
  gap: 4px;
}
.brand-title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0.5px;
}
.brand-subtitle {
  font-size: 13px;
  color: var(--muted);
}
.topbar-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
}
.signal-chip {
  display: inline-flex;
  align-items: center;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(47, 111, 237, 0.12);
  color: var(--primary);
  border: 1px solid rgba(47, 111, 237, 0.22);
  font-size: 12px;
  letter-spacing: 1px;
}
.signal-chip-soft {
  background: rgba(22, 163, 74, 0.10);
  color: #15803d;
  border-color: rgba(22, 163, 74, 0.22);
}
.sync-form { margin: 0; }
.btn {
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-primary {
  background: linear-gradient(135deg, #2f6fed, #4f8bff);
  color: #fff;
  box-shadow: 0 8px 18px rgba(47, 111, 237, 0.22);
}
.btn-tech {
  position: relative;
  overflow: hidden;
}
.btn-tech::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,0.35), transparent);
  transform: translateX(-120%);
}
.btn-tech:hover::after {
  animation: sweep 1s ease;
}
.btn-ghost { background: #fff; color: var(--text); border-color: var(--line); }
.btn-save { background: #f8fbff; color: var(--primary); border-color: #cfe0ff; min-width: 72px; }
.flash-list { display: grid; gap: 10px; margin-bottom: 16px; }
.flash {
  background: #fff;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
}
.panel {
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,251,255,0.96));
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(27, 52, 96, 0.06);
  position: relative;
}
.panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, rgba(47,111,237,0), rgba(47,111,237,0.75), rgba(22,163,74,0.65), rgba(47,111,237,0));
}
.panel-head {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line);
}
.panel-head h2 { margin: 0; font-size: 18px; }
.panel-head p { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.panel-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.filter-bar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 0 20px 10px;
  border-bottom: 1px solid var(--line);
}
.filter-bar.is-collapsed { display: none; }
.filter-group {
  display: grid;
  gap: 4px;
}
.filter-group label {
  font-size: 11px;
  color: var(--muted);
}
.filter-group select,
.filter-group input[type="date"] {
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 8px;
  color: var(--text);
  background: #fff;
  font-size: 12px;
}
.filter-group select option[value=""],
.small-select option[value=""] {
  color: #94a3b8;
}
.small-select option:empty {
  font-size: 0;
}
.small-select {
  min-width: 0;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
}
.small-filter { max-width: 220px; }
.date-filter-group { max-width: 220px; }
.date-box { position: relative; }
.date-box input {
  width: 100%;
  cursor: pointer;
}
.panel-stat {
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--primary-weak);
  color: var(--primary);
  font-weight: 700;
  font-size: 13px;
}
.panel-stat-soft {
  background: #f4fff7;
  color: #15803d;
  border: 1px solid #d8f3e0;
}
.tool-btn {
  border: 1px solid #cfe0ff;
  background: #f7fbff;
  color: #2f6fed;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 12px;
  letter-spacing: 0.5px;
}
.tool-btn-soft {
  border-color: #d8f3e0;
  background: #f4fff7;
  color: #15803d;
}
.table-wrap { overflow-x: auto; }
.record-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  min-width: 1420px;
}
.col-index { width: 72px; }
.col-message { width: auto; min-width: 880px; }
.col-store { width: 96px; }
.col-date { width: 168px; }
.col-auth { width: 112px; }
.col-remark { width: 124px; }
.col-action { width: 112px; }
.record-table thead th {
  background: #f8fbff;
  color: #4b6480;
  text-align: left;
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  white-space: nowrap;
}
.record-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  background: #fff;
  height: 58px;
}
.record-row:hover td { background: #fbfdff; }
.record-row.is-viewed td { background: #fbfffc; }
.record-row.has-status td { color: #7f1d1d; }
.record-row.has-status td .message-title,
.record-row.has-status td .mono,
.record-row.has-status td .check-wrap,
.record-row.has-status td .small-select {
  color: #7f1d1d;
}
.record-row.has-status td .small-select {
  border-color: #fca5a5;
  background: #fff5f5;
}
.record-row.has-status td .index-badge {
  background: #fee2e2;
  color: #991b1b;
}
.record-row.has-status td:nth-child(2) { padding-right: 24px; }
.record-table th:nth-child(5), .record-table td:nth-child(5) { padding-left: 8px; padding-right: 8px; }
.record-table th:nth-child(6), .record-table td:nth-child(6) { padding-left: 8px; padding-right: 8px; }
.record-table th:nth-child(7), .record-table td:nth-child(7) { padding-left: 8px; padding-right: 8px; }
.center { text-align: center; }
.index-badge {
  display: inline-flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #eef4ff;
  color: var(--primary);
  font-weight: 700;
}
.title-stack { display: grid; gap: 8px; width: 100%; }
.copyable-cell { cursor: pointer; }
.copyable-cell:hover { opacity: 0.92; }
.message-title {
  font-size: 14px;
  line-height: 1.3;
  height: 18px;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-all;
  color: #24415f;
}
.mono {
  font-variant-numeric: tabular-nums;
  color: #38506d;
  white-space: nowrap;
}
.inline-form {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 6px;
  align-items: center;
  margin: 0;
}
.combined-controls { grid-template-columns: 1fr 1fr auto; }
.compact-controls { max-width: none; width: 100%; }
.small-select {
  min-width: 0;
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
}
.field-auth-status { width: 100%; min-width: 104px; }
.field-remark { width: 100%; min-width: 104px; }
.op-group {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  min-height: 32px;
}
.compact-op { white-space: nowrap; }
.check-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 13px;
  white-space: nowrap;
}
.check-wrap input { width: 16px; height: 16px; margin: 0; }
.tech-check {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  width: 40px;
  height: 22px;
  padding: 2px;
  border-radius: 999px;
  border: 1px solid #cfe0ff;
  background: #e5eefc;
  position: relative;
  cursor: pointer;
}
.tech-check input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}
.toggle-track {
  width: 100%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(180deg, #dbeafe, #eff6ff);
  position: relative;
  transition: background 0.2s ease;
}
.toggle-thumb {
  position: absolute;
  top: 1px;
  left: 1px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 8px rgba(47,111,237,0.25);
  transition: transform 0.2s ease, background 0.2s ease;
}
.tech-check:has(input:checked) {
  background: #dbeafe;
  border-color: #7ca7ff;
}
.tech-check:has(input:checked) .toggle-track {
  background: linear-gradient(180deg, #4f8bff, #2f6fed);
}
.tech-check:has(input:checked) .toggle-thumb {
  transform: translateX(18px);
}
.record-table tbody tr { height: 58px; }
.record-table tbody tr td { height: 58px; }
.copy-toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.92);
  color: #fff;
  font-size: 13px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.22);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 9999;
}
.copy-toast.is-show {
  opacity: 1;
  transform: translateY(0);
}
.empty-state {
  padding: 30px 18px;
  text-align: center;
  color: var(--muted);
}
.hint {
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}
@keyframes sweep {
  from { transform: translateX(-120%); }
  to { transform: translateX(120%); }
}
@media (max-width: 980px) {
  .topbar, .panel-head { grid-template-columns: 1fr; }
  .topbar-actions { justify-content: flex-start; }
}
@media (max-width: 760px) {
  .page-shell { padding: 12px; }
  .record-table { min-width: 0; }
  .record-table thead { display: none; }
  .record-table, .record-table tbody, .record-table tr, .record-table td { display: block; width: 100%; }
  .record-row { border-bottom: 1px solid var(--line); }
  .record-table td { border-bottom: 0; }
  .record-table td + td { padding-top: 0; }
  .record-table td { padding: 10px 14px; }
  .record-table tr { padding: 8px 0; }
  .inline-form, .compact-controls { grid-template-columns: 1fr; max-width: none; }
  .inline-form select, .btn { width: 100%; }
  .op-group { justify-content: space-between; }
  .panel-head { padding: 14px 14px 12px; }
}
