:root {
  --blue: #0b63f6;
  --blue-2: #0f7cf7;
  --red: #e60012;
  --ink: #12213f;
  --muted: #6b7894;
  --line: #dfe7f4;
  --soft: #f5f8fd;
  --panel: #ffffff;
  --green: #10a66a;
  --orange: #f58a1f;
  --shadow: 0 14px 42px rgba(17, 42, 92, 0.09);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(11, 99, 246, 0.11), transparent 34rem),
    linear-gradient(180deg, #fbfdff 0%, #f3f7fc 100%);
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
  font-size: 14px;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition:
    transform 0.14s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease,
    background-color 0.18s ease,
    color 0.18s ease,
    opacity 0.18s ease;
}

button:disabled {
  cursor: wait;
  opacity: 0.78;
}

button:not(:disabled):active {
  transform: translateY(1px) scale(0.985);
}

.hidden {
  display: none !important;
}

.boot-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    repeating-linear-gradient(90deg, rgba(11, 99, 246, 0.045) 0 1px, transparent 1px 96px),
    repeating-linear-gradient(0deg, rgba(11, 99, 246, 0.04) 0 1px, transparent 1px 96px),
    linear-gradient(145deg, #eef6ff 0%, #ffffff 48%, #f5f8fd 100%);
}

.boot-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  color: var(--ink);
}

.boot-card strong,
.boot-card span {
  display: block;
}

.boot-card strong {
  font-size: 18px;
}

.boot-card span {
  margin-top: 4px;
  color: var(--muted);
}

.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  background:
    linear-gradient(115deg, transparent 0 18%, rgba(11, 99, 246, 0.08) 18.2% 18.7%, transparent 18.9% 100%),
    repeating-linear-gradient(90deg, rgba(11, 99, 246, 0.055) 0 1px, transparent 1px 96px),
    repeating-linear-gradient(0deg, rgba(11, 99, 246, 0.045) 0 1px, transparent 1px 96px),
    linear-gradient(135deg, rgba(230, 0, 18, 0.07), transparent 24rem),
    linear-gradient(145deg, #eef6ff 0%, #ffffff 48%, #f5f8fd 100%);
  position: relative;
  overflow: hidden;
}

.login-page::before,
.login-page::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.login-page::before {
  left: 7vw;
  bottom: 12vh;
  width: 38vw;
  height: 28vh;
  border-left: 1px solid rgba(11, 99, 246, 0.22);
  border-bottom: 1px solid rgba(11, 99, 246, 0.18);
  transform: skewX(-18deg);
}

.login-page::after {
  right: 9vw;
  top: 13vh;
  width: 18vw;
  height: 18vw;
  border: 1px solid rgba(11, 99, 246, 0.13);
  transform: rotate(45deg);
}

.login-brand {
  position: relative;
  z-index: 1;
  padding: 72px 8vw;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.brand-row,
.top-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  font-weight: 800;
  color: var(--blue);
  letter-spacing: 0;
}

.telecom-mark {
  width: 58px;
  height: 42px;
  flex: 0 0 auto;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 1px;
  border: 1px solid rgba(11, 99, 246, 0.14);
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(230, 0, 18, 0.08), transparent 42%),
    linear-gradient(145deg, #ffffff 0%, #eef7ff 100%);
  box-shadow: 0 10px 26px rgba(11, 99, 246, 0.14);
}

.telecom-mark span {
  color: var(--red);
  font-size: 21px;
  font-weight: 950;
  line-height: 1;
  letter-spacing: 0;
}

.telecom-mark small {
  color: var(--blue);
  font-size: 8px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
}

.brand-logo {
  width: 58px;
  height: 42px;
  flex: 0 0 auto;
  display: block;
  object-fit: contain;
  padding: 5px;
  border: 1px solid rgba(11, 99, 246, 0.14);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(11, 99, 246, 0.14);
}

.brand-logo-large {
  width: 74px;
  height: 54px;
  padding: 6px;
}

.login-brand h1 {
  margin: 42px 0 18px;
  font-size: 46px;
  line-height: 1.18;
  letter-spacing: 0;
}

.login-brand p {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.8;
}

.login-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 44px;
  max-width: 620px;
}

.login-metrics span {
  display: block;
  color: var(--muted);
  margin-bottom: 8px;
}

.login-metrics strong {
  font-size: 28px;
}

.login-card {
  position: relative;
  z-index: 1;
  align-self: center;
  justify-self: center;
  width: min(440px, calc(100% - 32px));
  padding: 34px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(214, 225, 242, 0.9);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.login-card h2 {
  margin: 0 0 8px;
  font-size: 26px;
}

.login-card .hint {
  margin: 0 0 28px;
  color: var(--muted);
}

.login-status {
  min-height: 20px;
  margin: -2px 0 6px;
  color: var(--blue);
  font-weight: 800;
  text-align: center;
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.field label {
  color: #40506f;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #d7e1f0;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 11px 12px;
  outline: none;
  transition: border 0.18s, box-shadow 0.18s;
}

textarea {
  min-height: 96px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(11, 99, 246, 0.11);
}

.primary-btn,
.ghost-btn,
.danger-btn,
.text-btn {
  border: 0;
  border-radius: 8px;
  padding: 10px 15px;
  font-weight: 800;
  white-space: nowrap;
}

.primary-btn,
.ghost-btn,
.danger-btn,
.nav button,
.table-tabs button,
.action-switch button {
  position: relative;
  overflow: hidden;
}

.click-ripple {
  position: absolute;
  pointer-events: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.42);
  transform: scale(0);
  animation: ripple-pop 520ms ease-out forwards;
}

.ghost-btn .click-ripple,
.nav button .click-ripple,
.table-tabs button .click-ripple,
.action-switch button .click-ripple {
  background: rgba(11, 99, 246, 0.16);
}

.danger-btn .click-ripple {
  background: rgba(255, 255, 255, 0.36);
}

.primary-btn {
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--blue-2));
  box-shadow: 0 10px 22px rgba(11, 99, 246, 0.18);
}

.primary-btn:disabled {
  background: linear-gradient(135deg, #3b82f6, #60a5fa);
  box-shadow: 0 8px 18px rgba(11, 99, 246, 0.12);
}

.ghost-btn {
  color: var(--ink);
  background: #fff;
  border: 1px solid #d7e1f0;
}

.danger-btn {
  color: #fff;
  background: var(--red);
}

.text-btn {
  color: var(--blue);
  background: transparent;
  padding-inline: 8px;
}

.login-card .primary-btn {
  width: 100%;
  margin-top: 8px;
}

.error {
  color: var(--red);
  min-height: 20px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(18, 33, 63, 0.28);
}

.copy-modal {
  width: min(820px, 100%);
  max-height: calc(100svh - 36px);
  padding: 20px;
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.modal-head,
.modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-head h3 {
  margin: 0;
  font-size: 18px;
}

.copy-modal textarea {
  width: 100%;
  min-height: min(58svh, 480px);
  margin: 16px 0 12px;
  resize: vertical;
  line-height: 1.6;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

.chain-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
  margin-top: 14px;
}

.chain-form .field {
  margin-bottom: 0;
}

.chain-action-buttons {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  min-width: min(360px, 100%);
}

.chain-action-buttons .primary-btn,
.chain-action-buttons .ghost-btn {
  width: 100%;
  min-height: 42px;
}

.export-modal {
  width: min(640px, 100%);
}

.export-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
  margin: 16px 0 14px;
}

.export-action-buttons {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  min-width: min(300px, 100%);
}

.export-action-buttons .primary-btn,
.export-action-buttons .ghost-btn {
  width: 100%;
  min-height: 42px;
}

.copy-chain-btn {
  border: 1px solid rgba(230, 0, 18, 0.18);
  background: linear-gradient(135deg, var(--red), #ff4f5e);
  box-shadow: 0 12px 24px rgba(230, 0, 18, 0.2);
}

.copy-chain-btn:disabled {
  border-color: rgba(11, 99, 246, 0.12);
  background: linear-gradient(135deg, #3b82f6, #60a5fa);
  box-shadow: 0 8px 18px rgba(11, 99, 246, 0.12);
}

.image-modal-backdrop {
  z-index: 40;
  background: rgba(8, 16, 32, 0.72);
}

.image-modal {
  width: min(1100px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.26);
}

.image-modal .modal-head {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.image-modal-body {
  min-height: 220px;
  padding: 12px;
  display: grid;
  place-items: center;
  overflow: auto;
  background: #0c1322;
}

.image-modal-body img {
  max-width: 100%;
  max-height: calc(100vh - 120px);
  object-fit: contain;
  border-radius: 6px;
}

.copy-status {
  min-height: 20px;
  color: var(--green);
  font-weight: 800;
}

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: 66px;
  padding: 0 max(26px, calc((100vw - 1440px) / 2 + 26px));
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.top-brand {
  min-width: 238px;
  color: var(--ink);
}

.top-brand .telecom-mark {
  width: 48px;
  height: 34px;
  border-radius: 8px;
  box-shadow: 0 8px 18px rgba(11, 99, 246, 0.13);
}

.top-brand .brand-logo,
.brand-logo-compact {
  width: 48px;
  height: 34px;
  padding: 4px;
  border-radius: 8px;
  box-shadow: 0 8px 18px rgba(11, 99, 246, 0.13);
}

.top-brand .telecom-mark span {
  font-size: 17px;
}

.top-brand .telecom-mark small {
  font-size: 7px;
}

.nav {
  display: flex;
  align-items: stretch;
  align-self: stretch;
  gap: 8px;
}

.nav button,
.nav a {
  display: flex;
  align-items: center;
  border: 0;
  background: transparent;
  color: #40506f;
  padding: 0 14px;
  border-bottom: 3px solid transparent;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.nav button.active {
  color: var(--blue);
  border-bottom-color: var(--blue);
}

.userbox {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), #55b6ff);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 900;
}

.workspace {
  width: min(100%, 1440px);
  margin: 0 auto;
  padding: 18px 22px 28px;
  flex: 1;
  animation: page-in 180ms ease-out both;
}

.site-footer {
  padding: 14px 18px 18px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.login-footer {
  position: absolute;
  z-index: 1;
  right: 0;
  bottom: 12px;
  left: 0;
  padding: 0 18px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.dashboard-head {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(11, 99, 246, 0.08), transparent 44%),
    rgba(255, 255, 255, 0.86);
  box-shadow: 0 10px 30px rgba(20, 50, 90, 0.04);
}

.section-subtitle {
  margin: 6px 0 0 14px;
  color: var(--muted);
}

.title-mark {
  display: flex;
  align-items: center;
  gap: 10px;
}

.title-mark::before {
  content: "";
  width: 4px;
  height: 20px;
  border-radius: 4px;
  background: var(--blue);
}

h2,
h3 {
  margin: 0;
  letter-spacing: 0;
}

.toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.date-toolbar label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.toolbar select,
.toolbar input {
  width: auto;
  min-width: 138px;
}

.opportunity-search {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 520px;
  margin-bottom: 12px;
}

.opportunity-search input {
  flex: 1;
  min-width: 220px;
}

.opportunity-search .primary-btn {
  flex: 0 0 auto;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.kpi-card,
.trend-chart-panel,
.rank-panel,
.table-panel,
.form-panel,
.account-panel,
.detail-page {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(20, 50, 90, 0.05);
}

.kpi-card {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 92px;
  padding: 16px;
}

.kpi-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: #fff;
  background: rgba(11, 99, 246, 0.1);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.kpi-icon svg {
  width: 22px;
  height: 22px;
  stroke: var(--blue);
  stroke-width: 1.9;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.kpi-card:nth-child(3) .kpi-icon {
  background: rgba(16, 166, 106, 0.11);
}

.kpi-card:nth-child(3) .kpi-icon svg {
  stroke: var(--green);
}

.kpi-card:nth-child(4) .kpi-icon {
  background: rgba(245, 138, 31, 0.12);
}

.kpi-card:nth-child(4) .kpi-icon svg {
  stroke: var(--orange);
}

.kpi-card:nth-child(5) .kpi-icon {
  background: rgba(123, 92, 255, 0.11);
}

.kpi-card:nth-child(5) .kpi-icon svg {
  stroke: #7b5cff;
}

.kpi-label {
  color: var(--muted);
  font-weight: 700;
}

.kpi-value {
  margin-top: 6px;
  font-size: 28px;
  line-height: 1.05;
  font-weight: 900;
}

.trend {
  margin-top: 5px;
  color: var(--red);
  font-size: 12px;
}

.trend-chart-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
  align-items: start;
}

.trend-chart-panel {
  padding: 12px;
}

.panel-note {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.trend-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  padding: 12px 0 10px;
}

.trend-chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-weight: 800;
  white-space: nowrap;
}

.trend-chart-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.trend-chart-dot.total {
  background: var(--blue);
}

.trend-chart-dot.high {
  background: var(--red);
}

.trend-chart-dot.new {
  background: var(--green);
}

.trend-chart-dot.existing {
  background: var(--orange);
}

.trend-chart {
  width: 100%;
  height: auto;
  min-height: 180px;
  display: block;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.trend-chart line {
  stroke: #e8eef8;
  stroke-width: 1;
}

.trend-chart polyline {
  fill: none;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.trend-chart text {
  fill: var(--muted);
  font-size: 11px;
}

.trend-chart .data-label {
  font-size: 12px;
  font-weight: 800;
}

.trend-chart .x-label {
  font-weight: 800;
}

.dashboard-main {
  display: grid;
  gap: 12px;
}

.rank-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 0;
}

.rank-panel {
  padding: 12px;
  box-shadow: none;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--line);
}

.rank-row,
.table-row {
  display: grid;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  border-bottom: 1px solid #edf2f8;
}

.rank-row {
  grid-template-columns: 44px 1fr 120px;
}

.rank-row:last-child,
.table-row:last-child {
  border-bottom: 0;
}

.rank-row.header,
.table-row.header {
  min-height: 38px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.rank-row:not(.header),
.table-row:not(.header) {
  font-weight: 400;
}

.rank-row strong,
.table-row strong {
  font-weight: 500;
}

.rank-row.summary {
  margin-top: 4px;
  color: var(--ink);
  background: var(--soft);
  border-top: 1px solid var(--line);
  border-bottom: 0;
  font-weight: 700;
}

.medal {
  display: inline-grid;
  place-items: center;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: #edf3fb;
  color: #64748b;
  font-size: 12px;
  font-weight: 900;
}

.medal.top {
  color: #fff;
  background: linear-gradient(135deg, #ffb020, #f58a1f);
}

.bar-track {
  height: 5px;
  border-radius: 6px;
  background: #edf2f8;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--blue), #1ba3ff);
}

.table-panel {
  overflow: hidden;
  box-shadow: none;
}

.visit-ledger-panel {
  border-color: #dbe6f5;
}

.visit-ledger-panel .table-top {
  min-height: 46px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.visit-ledger-panel .table-tabs:empty {
  display: none;
}

.visit-ledger-panel .table-actions {
  margin-left: auto;
}

.visit-ledger-panel .table-scroll {
  scrollbar-width: thin;
  scrollbar-color: #b7c7de #f2f6fb;
}

.table-tabs {
  display: flex;
  gap: 8px;
  padding: 8px 10px;
  flex-wrap: wrap;
}

.table-tabs button {
  height: 32px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #40506f;
  padding: 0 12px;
  font-weight: 800;
}

.table-tabs button.active {
  color: var(--blue);
  border-color: #cfe0ff;
  background: #edf5ff;
}

.table-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.table-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 10px;
  border-bottom: 1px solid var(--line);
}

.op-table {
  min-width: 1280px;
}

.recycle-table {
  min-width: 980px;
}

.visit-table {
  min-width: 1300px;
}

.table-scroll {
  overflow: auto;
}

.table-row {
  grid-template-columns: 1.22fr 0.68fr 0.88fr 0.62fr 0.76fr 0.92fr 0.74fr 0.66fr 0.76fr 0.76fr 1.24fr;
  padding: 0 14px;
  color: #33405c;
}

.recycle-table .table-row {
  grid-template-columns: 1.25fr 0.78fr 0.96fr 0.78fr 0.72fr 0.86fr 0.96fr 0.72fr;
}

.visit-table .table-row {
  grid-template-columns: minmax(170px, 1.35fr) minmax(96px, 0.72fr) minmax(120px, 0.9fr) minmax(108px, 0.82fr) minmax(86px, 0.66fr) minmax(104px, 0.72fr) minmax(114px, 0.74fr) minmax(106px, 0.72fr) minmax(128px, 0.82fr) minmax(188px, 1fr);
}

.visit-table .table-row.header {
  background: #f7faff;
  color: #53627c;
  letter-spacing: 0;
}

.visit-table .table-row:not(.header) {
  background: #fff;
}

.visit-table .table-row:not(.header):hover {
  background: #fbfdff;
}

.visit-table .table-row > * {
  min-width: 0;
}

.visit-table .table-row strong,
.visit-table .table-row span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.visit-table .table-row strong {
  color: var(--ink);
  font-weight: 700;
}

.visit-table .table-row:not(.header) span:nth-child(7) {
  color: #23314f;
  font-variant-numeric: tabular-nums;
  text-align: left;
}

.visit-table .table-row:not(.header) .visit-action {
  justify-self: start;
  max-width: 100%;
  padding: 4px 8px;
  border-radius: 999px;
  background: #edf5ff;
  font-size: 12px;
  font-weight: 800;
}

.visit-table .table-row:not(.header) .visit-action-walk {
  color: var(--blue);
}

.visit-table .table-row:not(.header) .visit-action-catering {
  color: #7b5cff;
}

.visit-table .table-row span:nth-child(9) {
  color: #4f5d78;
  font-variant-numeric: tabular-nums;
}

.status {
  display: inline-flex;
  justify-content: center;
  min-width: 62px;
  padding: 5px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 900;
}

.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.pager {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status.following {
  color: var(--blue);
  background: #eaf3ff;
}

.status.success {
  color: var(--green);
  background: #e7f8ef;
}

.status.failed {
  color: var(--red);
  background: #fff0f1;
}

.management-grid {
  display: grid;
  grid-template-columns: 400px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.form-panel,
.account-panel {
  padding: 20px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.form-grid .span-2 {
  grid-column: span 2;
}

.form-section-title {
  margin: 18px 0 12px;
  padding-bottom: 8px;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  font-size: 15px;
  font-weight: 900;
}

.form-section-title:first-child {
  margin-top: 0;
}

.visit-form {
  padding: 16px;
}

.visit-form .form-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px 12px;
}

.visit-form .field {
  gap: 5px;
  margin-bottom: 8px;
}

.visit-form .field label {
  font-size: 13px;
}

.visit-form input,
.visit-form select {
  min-height: 38px;
  padding: 8px 10px;
}

.visit-form .form-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0 8px;
  padding: 7px 10px;
  border: 0;
  border-left: 4px solid #2f6ff5;
  border-radius: 8px;
  background: #f4f8ff;
  color: #1d55c8;
  line-height: 1.2;
}

.visit-form .form-section-title:first-child {
  margin-top: 0;
}

.visit-form .form-section-title::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
}

.visit-form .visit-section-profile {
  border-left-color: #129164;
  background: #f0fbf6;
  color: #08784f;
}

.visit-form .visit-section-recommend {
  border-left-color: #b77905;
  background: #fff8e8;
  color: #9a6200;
}

.visit-form .visit-section-images {
  border-left-color: #8b5cf6;
  background: #f6f2ff;
  color: #6d3fd8;
}

.visit-form .span-2 {
  grid-column: span 2;
}

.visit-upload-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.upload-tile {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px dashed #b9c9e4;
  border-radius: 8px;
  background: #f8fbff;
}

.upload-tile span {
  font-weight: 900;
}

.upload-tile small {
  color: var(--muted);
  line-height: 1.5;
}

.visit-form .visit-upload-grid {
  gap: 10px;
  margin-bottom: 12px;
}

.visit-form .upload-tile {
  gap: 6px;
  padding: 10px;
}

.visit-form .upload-tile input {
  min-height: 34px;
  padding: 6px 0;
}

.detail-page {
  padding: 18px;
}

.detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.detail-head h2 {
  margin-top: 12px;
  margin-bottom: 6px;
  line-height: 1.2;
}

.visit-detail-title {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.visit-detail-title h2 {
  margin-bottom: 0;
}

.visit-detail-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
  gap: 12px;
  align-items: start;
}

.detail-main-stack,
.detail-section-layout {
  display: grid;
  gap: 10px;
}

.detail-section-layout {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.detail-section-layout .detail-section:last-child {
  grid-column: 1 / -1;
}

.detail-section {
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.detail-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e9eff7;
}

.detail-section-head h3 {
  margin: 0;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.25;
  font-weight: 900;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
}

.detail-item {
  min-width: 0;
  padding: 2px 0;
}

.detail-item span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.3;
  margin-bottom: 4px;
  font-weight: 800;
}

.detail-item strong {
  display: block;
  color: #1d2b4a;
  font-size: 16px;
  line-height: 1.38;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.detail-item.wide {
  grid-column: 1 / -1;
}

.detail-item.accent strong {
  color: var(--blue);
  font-size: 17px;
  font-weight: 900;
}

.detail-notice {
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fff;
}

.visit-images-panel {
  margin-top: 10px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.visit-images-panel h3 {
  margin: 0 0 10px;
  font-size: 16px;
}

.visit-image-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.visit-image-grid figure {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.visit-image-grid img,
.image-placeholder {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.image-preview-btn {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.image-placeholder {
  display: grid;
  place-items: center;
  color: var(--muted);
}

.visit-image-grid figcaption {
  padding: 9px 10px;
  font-weight: 900;
  background: #fff;
}

.action-switch {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 10px 0 12px;
}

.action-panel {
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.action-panel h3 {
  margin-bottom: 8px;
  font-size: 16px;
}

.action-panel .field {
  margin-bottom: 10px;
}

.action-panel textarea {
  min-height: 76px;
}

.action-switch button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 10px 8px;
  font-weight: 900;
  color: #40506f;
}

.action-switch button.active {
  color: #fff;
  border-color: var(--blue);
  background: var(--blue);
}

.action-switch button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.timeline {
  display: grid;
  gap: 8px;
}

.timeline-item {
  border-left: 3px solid var(--blue);
  padding: 3px 0 3px 10px;
}

.timeline-item strong {
  display: block;
}

.timeline-item span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  line-height: 1.45;
}

.empty {
  padding: 38px;
  text-align: center;
  color: var(--muted);
}

.accounts-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.account-row {
  display: grid;
  grid-template-columns: 1fr 110px 120px 150px 120px;
  gap: 12px;
  align-items: center;
  padding: 12px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.table-op-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.table-op-actions .text-btn {
  min-height: 28px;
  padding: 4px 7px;
  border-radius: 6px;
  line-height: 1.2;
}

.visit-table .table-op-actions {
  justify-content: flex-end;
  gap: 6px;
}

.visit-table .table-op-actions .text-btn {
  background: #f5f8fd;
}

.visit-table .table-op-actions .text-btn:hover {
  background: #edf5ff;
}

.visit-table .table-op-actions .danger-text {
  background: #fff1f2;
}

.danger-text {
  color: var(--red);
}

.pill {
  display: inline-flex;
  width: fit-content;
  padding: 5px 8px;
  border-radius: 999px;
  color: #40506f;
  background: #edf3fb;
  font-size: 12px;
  font-weight: 900;
}

@media (max-width: 1100px) {
  .rank-grid,
  .management-grid {
    grid-template-columns: 1fr;
  }

  .detail-page {
    padding: 16px;
  }

  .detail-layout {
    grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
    gap: 10px;
  }

  .detail-section-layout {
    gap: 10px;
  }

  .detail-section {
    padding: 12px;
  }

  .detail-grid {
    gap: 9px 12px;
  }

  .detail-item strong {
    font-size: 15px;
  }

  .detail-item.accent strong {
    font-size: 16px;
  }

  .visit-form .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .rank-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .topbar {
    height: auto;
    align-items: stretch;
    flex-direction: column;
    padding: 14px 16px 0;
  }

  .nav {
    overflow-x: auto;
  }

  .userbox {
    position: absolute;
    right: 16px;
    top: 14px;
  }
}

@media (max-width: 720px) {
  body {
    font-size: 13px;
  }

  input,
  select,
  textarea {
    font-size: 16px;
  }

  .login-page {
    grid-template-columns: 1fr;
    align-content: start;
    min-height: 100svh;
  }

  .login-brand {
    padding: 28px 22px 8px;
    justify-content: flex-start;
  }

  .login-brand h1 {
    font-size: 28px;
    margin: 20px 0 0;
    line-height: 1.16;
  }

  .login-metrics {
    grid-template-columns: 1fr;
  }

  .login-card {
    align-self: start;
    margin: 8px 0 28px;
    padding: 24px;
  }

  .login-card h2 {
    font-size: 24px;
  }

  .login-card .hint {
    margin-bottom: 20px;
  }

  .login-footer {
    position: static;
    grid-column: 1;
    padding: 0 16px 18px;
  }

  .workspace {
    padding: 8px 8px 16px;
  }

  .section-head,
  .table-top {
    align-items: stretch;
    flex-direction: column;
  }

  .section-head {
    gap: 8px;
    margin-bottom: 8px;
  }

  .section-head .toolbar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    width: 100%;
  }

  .section-head .toolbar .primary-btn,
  .section-head .toolbar .ghost-btn {
    min-width: 0;
    min-height: 36px;
    padding: 8px 6px;
    font-size: 12px;
  }

  .dashboard-head {
    padding: 12px;
    gap: 10px;
  }

  .section-subtitle {
    margin-left: 14px;
    font-size: 12px;
  }

  .date-toolbar {
    display: grid;
    grid-template-columns: repeat(2, minmax(118px, 138px));
    gap: 6px;
    width: fit-content;
    max-width: 100%;
    align-self: flex-start;
  }

  .toolbar select,
  .toolbar input,
  .toolbar .primary-btn,
  .toolbar .ghost-btn,
  .table-actions,
  .table-actions button,
  .table-actions input,
  .table-actions select {
    width: 100%;
  }

  .date-toolbar input {
    min-width: 0;
    height: 36px;
    padding: 6px 7px;
  }

  .date-toolbar label {
    gap: 3px;
  }

  .opportunity-search {
    max-width: none;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 72px;
    gap: 6px;
    margin-bottom: 8px;
  }

  .opportunity-search input {
    width: 100%;
    min-width: 0;
    height: 38px;
    padding: 8px 10px;
  }

  .opportunity-search .primary-btn {
    min-width: 0;
    height: 38px;
    padding: 8px 10px;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .kpi-card {
    min-height: 82px;
    padding: 12px;
    gap: 10px;
  }

  .kpi-icon {
    width: 34px;
    height: 34px;
  }

  .kpi-icon svg {
    width: 18px;
    height: 18px;
  }

  .kpi-label {
    font-size: 12px;
  }

  .kpi-value {
    font-size: 22px;
  }

  .trend-chart-layout {
    grid-template-columns: 1fr;
  }

  .trend-chart-panel {
    padding: 10px;
  }

  .trend-chart-legend {
    gap: 8px 10px;
  }

  .trend-chart-legend span {
    font-size: 12px;
  }

  .trend-chart {
    min-height: 190px;
  }

  .rank-row {
    grid-template-columns: 34px 1fr 96px;
    gap: 8px;
  }

  .rank-panel {
    padding: 10px;
  }

  .rank-grid {
    grid-template-columns: 1fr;
  }

  .table-tabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
    padding: 6px 0 0;
  }

  .table-tabs button {
    height: 30px;
    padding: 0 6px;
    font-size: 12px;
  }

  .table-actions {
    padding-bottom: 6px;
  }

  .table-top {
    gap: 6px;
    padding: 0 8px;
  }

  .table-scroll {
    border-top: 1px solid var(--line);
  }

  .op-table {
    min-width: 980px;
  }

  .visit-table {
    min-width: 1020px;
  }

  .table-row {
    grid-template-columns: 1.02fr 0.58fr 0.78fr 0.5fr 0.58fr 0.72fr 0.66fr 0.54fr 0.66fr 0.66fr 0.82fr;
    min-height: 38px;
    gap: 6px;
    padding: 0 8px;
    font-size: 12px;
    line-height: 1.25;
  }

  .table-row.header {
    font-size: 11px;
  }

  .visit-table .table-row {
    grid-template-columns: minmax(132px, 1.25fr) minmax(78px, 0.7fr) minmax(96px, 0.86fr) minmax(82px, 0.72fr) minmax(68px, 0.58fr) minmax(82px, 0.68fr) minmax(92px, 0.64fr) minmax(84px, 0.66fr) minmax(96px, 0.72fr) minmax(154px, 0.95fr);
  }

  .visit-table .table-row:not(.header) .visit-action {
    padding: 3px 6px;
    font-size: 11px;
  }

  .table-row strong,
  .table-row span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .table-op-actions {
    gap: 0;
  }

  .table-op-actions .text-btn {
    padding-inline: 3px;
    font-size: 12px;
  }

  .visit-table .table-op-actions {
    gap: 4px;
  }

  .visit-table .table-op-actions .text-btn {
    min-height: 26px;
    padding: 3px 5px;
  }

  .status {
    min-width: 0;
    padding: 4px 5px;
    font-size: 11px;
  }

  .pill {
    padding: 4px 7px;
    font-size: 11px;
  }

  .pagination-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .pager {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }

  .pager .ghost-btn {
    width: 100%;
    min-width: 0;
    padding-left: 6px;
    padding-right: 6px;
  }

  .pager .pill {
    grid-column: 1 / -1;
    grid-row: 1;
    justify-self: center;
  }

  .pager .ghost-btn {
    grid-row: 2;
  }

  .form-grid,
  .detail-grid,
  .detail-section-layout {
    grid-template-columns: 1fr;
  }

  .detail-section {
    padding: 14px;
  }

  .detail-section-head h3 {
    font-size: 16px;
  }

  .detail-item span {
    font-size: 12px;
  }

  .detail-item strong,
  .detail-item.accent strong {
    font-size: 15px;
  }

  .copy-modal {
    width: min(100%, 540px);
    max-height: calc(100svh - 20px);
    padding: 14px;
  }

  .opportunity-chain-modal {
    display: flex;
    flex-direction: column;
    height: calc(100svh - 20px);
    overflow: hidden;
  }

  .opportunity-chain-modal .modal-head {
    flex: 0 0 auto;
  }

  .copy-modal textarea {
    min-height: min(56svh, 520px);
    margin: 12px 0 10px;
  }

  .opportunity-chain-modal textarea {
    flex: 1 1 auto;
    min-height: 44svh;
    margin: 10px 0;
    overflow: auto;
  }

  .chain-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    flex: 0 0 auto;
    margin-top: 10px;
  }

  .export-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .export-form .field:last-child {
    grid-column: 1 / -1;
  }

  .chain-form .field {
    gap: 5px;
  }

  .chain-form label {
    font-size: 12px;
  }

  .chain-form input,
  .chain-form select {
    min-width: 0;
    min-height: 40px;
    padding: 8px 7px;
  }

  .export-modal-backdrop {
    padding: 10px;
    align-items: center;
  }

  .export-modal {
    width: min(100%, 380px);
    max-height: calc(100svh - 20px);
    padding: 12px;
    overflow: auto;
  }

  .export-modal .modal-head {
    gap: 8px;
  }

  .export-modal .modal-head h3 {
    font-size: 16px;
  }

  .export-modal .text-btn {
    min-height: 30px;
    padding: 4px 6px;
    font-size: 13px;
  }

  .export-form {
    margin: 12px 0 10px;
  }

  .export-form .field {
    gap: 4px;
  }

  .export-form label {
    font-size: 12px;
  }

  .export-form input,
  .export-form select {
    min-width: 0;
    min-height: 34px;
    padding: 6px 8px;
    font-size: 13px;
  }

  .opportunity-chain-modal .modal-actions,
  .export-modal .modal-actions {
    flex: 0 0 auto;
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--line);
    background: #fff;
  }

  .export-modal .modal-actions {
    gap: 6px;
    padding-top: 6px;
  }

  .export-modal .copy-status {
    min-height: 16px;
    font-size: 12px;
    line-height: 1.3;
    text-align: center;
  }

  .opportunity-chain-modal .copy-status {
    min-height: 18px;
    font-size: 12px;
    text-align: center;
  }

  .chain-action-buttons,
  .export-action-buttons {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    flex: 1;
    min-width: 0;
    gap: 8px;
  }

  .export-action-buttons {
    gap: 6px;
  }

  .chain-action-buttons .primary-btn,
  .chain-action-buttons .ghost-btn {
    min-height: 46px;
    padding: 10px 8px;
  }

  .export-action-buttons .primary-btn,
  .export-action-buttons .ghost-btn {
    min-height: 36px;
    padding: 7px 8px;
    font-size: 13px;
  }

  .copy-chain-btn {
    font-size: 16px;
    box-shadow: 0 14px 28px rgba(230, 0, 18, 0.24);
  }

  .visit-form .form-grid {
    grid-template-columns: 1fr;
  }

  .visit-upload-grid,
  .visit-image-grid {
    grid-template-columns: 1fr;
  }

  .form-grid .span-2 {
    grid-column: auto;
  }

  .detail-page {
    padding: 14px;
  }

  .detail-head {
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
  }

  .detail-head .danger-btn {
    width: 100%;
  }

  .detail-layout {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .action-switch {
    grid-template-columns: 1fr;
  }

  .account-row {
    grid-template-columns: 1fr;
  }

  .row-actions {
    justify-content: flex-start;
  }
}

@keyframes ripple-pop {
  to {
    opacity: 0;
    transform: scale(1);
  }
}

@keyframes page-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
