:root {
  --bg: #edf3f7;
  --panel: #ffffff;
  --panel-soft: #f8fbff;
  --text: #121a2b;
  --muted: #697386;
  --line: #dbe4ef;
  --line-soft: #edf2f7;
  --primary: #0f5f8f;
  --primary-dark: #0a4569;
  --accent: #b7791f;
  --soft: #e5f2f8;
  --success: #10805a;
  --warning: #a15c0a;
  --shadow-sm: 0 10px 28px rgba(16, 42, 67, 0.07);
  --shadow-md: 0 22px 58px rgba(16, 42, 67, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #f3f5f9;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.55;
}

a {
  color: var(--primary);
  text-decoration: none;
}

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

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

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(20, 86, 196, 0.55);
  box-shadow: 0 0 0 4px rgba(20, 86, 196, 0.1);
}

textarea {
  resize: vertical;
}

button,
.button {
  border: 0;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  padding: 11px 18px;
  cursor: pointer;
  white-space: nowrap;
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(15, 95, 143, 0.18);
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

button:hover,
.button:hover {
  background: var(--primary-dark);
  box-shadow: 0 12px 26px rgba(15, 95, 143, 0.24);
  transform: translateY(-1px);
}

.button.light {
  background: #eef3fb;
  color: var(--primary);
}

.button.danger {
  background: #fff1f0;
  color: #b42318;
  box-shadow: none;
}

.button.danger:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.call-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border-radius: 8px;
  background: var(--success);
  color: #fff;
  padding: 7px 12px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.call-button:hover {
  background: #0f6b4a;
  color: #fff;
}

.call-button.compact {
  min-height: 30px;
  padding: 6px 10px;
  font-size: 12px;
}

.copy-phone-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border: 1px solid #cdd9ea;
  border-radius: 8px;
  background: #f7fbff;
  color: #25537f;
  padding: 7px 12px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.copy-phone-button:hover {
  background: #eaf3ff;
}

.copy-phone-button.compact {
  min-height: 30px;
  padding: 6px 10px;
  font-size: 12px;
}

.copy-phone-button.copied {
  border-color: rgba(16, 128, 90, 0.38);
  background: #e5f7ee;
  color: #12613d;
}

.phone-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

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

.phone-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 9px 12px;
  align-items: center;
  background: #fff;
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  padding: 12px;
}

.phone-card.saving {
  opacity: 0.72;
}

.phone-card.saved {
  border-color: rgba(16, 128, 90, 0.45);
  box-shadow: 0 0 0 3px rgba(16, 128, 90, 0.08);
}

.phone-status-select {
  position: absolute;
  top: 10px;
  right: 10px;
  width: auto;
  max-width: 118px;
  min-height: 30px;
  border-radius: 999px;
  padding: 4px 26px 4px 9px;
  color: #775115;
  background-color: #fff8e8;
  border-color: #edd49f;
  font-size: 12px;
  font-weight: 800;
  box-shadow: none;
}

.phone-card .call-button {
  margin-top: 28px;
}

.phone-card-main {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding-right: 126px;
}

.phone-card-main span,
.phone-card-meta {
  color: var(--muted);
}

.phone-card-main strong {
  font-size: 18px;
  overflow-wrap: anywhere;
}

.phone-card-meta {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12px;
}

.phone-card-meta span {
  background: #f7fbff;
  border: 1px solid #dce9f7;
  border-radius: 999px;
  padding: 3px 8px;
}

.back-to-top,
.back-to-bottom {
  display: none;
}

.floating-actions {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 30;
  display: grid;
  gap: 10px;
  justify-items: end;
}

.back-to-top,
.back-to-bottom,
.float-action {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #0f5f8f;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.78);
  box-shadow: 0 14px 32px rgba(15, 95, 143, 0.28);
  padding: 0;
  font-size: 25px;
  line-height: 1;
}

.float-action {
  width: 62px;
  border-radius: 999px;
  background: #ffffff;
  color: var(--primary);
  border-color: #d8e7f2;
  font-size: 13px;
  font-weight: 900;
  box-shadow: 0 12px 28px rgba(18, 34, 62, 0.16);
}

.back-to-top:hover,
.back-to-bottom:hover,
.float-action:hover {
  background: #0a4569;
  color: #fff;
  transform: none;
}

.action-dialog {
  width: min(520px, calc(100vw - 32px));
  border: 0;
  border-radius: 14px;
  padding: 0;
  color: var(--text);
  background: var(--panel);
  box-shadow: 0 30px 80px rgba(18, 34, 62, 0.28);
}

.action-dialog::backdrop {
  background: rgba(12, 21, 34, 0.42);
  backdrop-filter: blur(2px);
}

.dialog-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line-soft);
  background: linear-gradient(180deg, #ffffff, #f8fbff);
}

.dialog-head h2 {
  margin: 0;
  font-size: 18px;
}

.dialog-close {
  width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  border-radius: 50%;
  background: #eef3fb;
  color: var(--primary);
  box-shadow: none;
  font-size: 20px;
  line-height: 1;
}

.dialog-close:hover {
  background: #dce9f7;
  color: var(--primary-dark);
  transform: none;
  box-shadow: none;
}

.action-dialog .annotation-form {
  padding: 18px 20px 20px;
}

.app-shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
  background: #f3f5f9;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: #fff;
  border-right: 1px solid #e6ebf2;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.brand {
  color: var(--text);
  font-size: 28px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), #16805d);
  box-shadow: 0 10px 24px rgba(15, 95, 143, 0.24);
  font-size: 17px;
}

.side-nav {
  display: grid;
  gap: 8px;
}

.side-nav a,
.side-bottom a,
.side-logout {
  color: #34405a;
  padding: 12px;
  border-radius: 8px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
}

.side-nav a:hover,
.side-nav a.active,
.side-bottom a:hover,
.side-bottom a.active {
  color: var(--primary);
  background: #eef5ff;
}

.side-nav span,
.side-bottom span {
  width: 22px;
  text-align: center;
  color: var(--primary);
}

.side-bottom {
  margin-top: auto;
  display: grid;
  gap: 8px;
}

.side-logout {
  color: var(--muted);
}

.main-shell {
  min-width: 0;
  background:
    linear-gradient(180deg, #f7f9fc 0, #f3f5f9 240px),
    #f3f5f9;
}

.page {
  width: min(1180px, calc(100vw - 276px));
  margin: 0;
  padding: 24px 28px 46px 8px;
}

.search-top {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #e4eaf2;
  border-radius: 8px;
  background: #fff;
  margin: 0 0 14px;
  padding: 16px 18px;
  box-shadow: 0 14px 36px rgba(18, 34, 62, 0.06);
}

.search-top input {
  width: min(760px, 100%);
  height: 46px;
  border: 1px solid #3b6eea;
  border-radius: 5px 0 0 5px;
  font-size: 16px;
  padding: 0 16px;
}

.search-top button {
  height: 46px;
  min-width: 86px;
  border-radius: 0 5px 5px 0;
  box-shadow: none;
}

.result-toolbar {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  background: #fff;
  border: 1px solid #e4eaf2;
  border-bottom: 1px solid #e6ebf2;
  border-radius: 8px 8px 0 0;
  margin: 0;
  padding: 14px 20px;
}

.result-count {
  font-size: 16px;
  font-weight: 800;
}

.result-count strong {
  color: #4e75ff;
  font-size: 18px;
}

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

.toolbar-actions select {
  width: 132px;
  height: 40px;
  border-radius: 6px;
  padding: 0 12px;
}

.toolbar-actions form {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mini-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  background: #fff;
  border-left: 1px solid #e4eaf2;
  border-right: 1px solid #e4eaf2;
  border-bottom: 1px solid #e6ebf2;
  margin: 0;
  padding: 10px 20px 14px;
}

.mini-stats span {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  border-radius: 999px;
  background: #f1f5fb;
  color: var(--muted);
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 700;
}

.mini-stats strong {
  color: var(--text);
}

.company-results {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 0;
  padding: 14px;
  background: #fff;
  border: 1px solid #e4eaf2;
  border-top: 0;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 16px 40px rgba(18, 34, 62, 0.06);
}

.company-result-card {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 16px;
  min-width: 0;
  padding: 20px 18px 22px;
  border: 1px solid #e7edf5;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(18, 34, 62, 0.04);
}

.company-avatar {
  width: 58px;
  height: 58px;
  border-radius: 6px;
  border: 1px solid #edf0f4;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, #8ca4ce, #6d88bb);
  font-size: 20px;
  font-weight: 900;
  line-height: 1.1;
  text-align: center;
  overflow: hidden;
}

.company-result-main {
  min-width: 0;
}

.company-result-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.result-company-name {
  color: var(--text);
  font-size: 20px;
  font-weight: 800;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.result-company-name:hover {
  color: #4e75ff;
}

.result-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.result-tags span {
  border-radius: 5px;
  background: #edf2ff;
  color: #4e75ff;
  padding: 4px 11px;
  font-weight: 700;
  font-size: 13px;
}

.result-tags span.pink {
  background: #ffeaf1;
  color: #ff5571;
}

.result-tags span.green {
  background: #e9f8df;
  color: #38a143;
}

.result-tags span.suspend-open {
  background: #e7f7ee;
  color: #16834a;
}

.result-tags span.suspend-stopped {
  background: #ffe9e9;
  color: #c93434;
}

.result-tags span.suspend-unknown {
  background: #eef1f5;
  color: #687386;
}

.result-actions {
  display: flex;
  gap: 10px;
  margin-top: 2px;
}

.result-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 16px;
  margin-top: 16px;
  color: #5d6678;
}

.result-info-grid strong {
  color: #1d2738;
}

.result-info-grid .negative {
  color: #b42318;
}

.result-address {
  color: #5d6678;
  margin: 12px 0 0;
  overflow-wrap: anywhere;
}

.result-links {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  margin-top: 14px;
}

.result-links a {
  color: #1d2738;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.hero,
.detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
  padding: 28px 30px;
  border: 1px solid rgba(213, 225, 239, 0.9);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(237, 248, 249, 0.92) 52%, rgba(255, 248, 235, 0.9)),
    #fff;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.hero::before,
.detail-head::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: linear-gradient(180deg, var(--primary), var(--accent));
}

.hero > *,
.detail-head > * {
  position: relative;
}

.hero h1,
.detail-head h1 {
  margin: 0 0 8px;
  font-size: 32px;
  line-height: 1.2;
  letter-spacing: 0;
}

.hero p,
.detail-head p {
  margin: 0;
  color: var(--muted);
}

.hero-actions {
  align-self: center;
}

.hero-scoreboard {
  display: grid;
  grid-template-columns: repeat(2, minmax(112px, 1fr));
  gap: 10px;
}

.hero-scoreboard div {
  min-width: 112px;
  border: 1px solid rgba(207, 224, 232, 0.9);
  border-radius: 10px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 10px 22px rgba(16, 42, 67, 0.06);
}

.hero-scoreboard span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.hero-scoreboard strong {
  display: block;
  color: #0d2f49;
  font-size: 26px;
  line-height: 1.1;
  margin-top: 5px;
}

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

.stat {
  display: grid;
  gap: 8px;
  background: var(--panel);
  border: 1px solid rgba(219, 228, 239, 0.9);
  border-radius: 12px;
  padding: 15px 16px;
  color: var(--text);
  box-shadow: var(--shadow-sm);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.stat:hover {
  border-color: rgba(20, 86, 196, 0.32);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

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

.stat strong {
  font-size: 26px;
  line-height: 1;
  color: #0f2747;
}

.filters {
  display: grid;
  grid-template-columns: minmax(360px, 2fr) 150px 170px 150px 130px auto;
  gap: 12px;
  align-items: end;
  background: var(--panel);
  border: 1px solid rgba(219, 228, 239, 0.95);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}

.filters label,
.filter-main {
  display: grid;
  gap: 6px;
}

.filters label span,
.filter-main label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.filters button {
  min-height: 43px;
}

.table-wrap,
.panel {
  background: var(--panel);
  border: 1px solid rgba(219, 228, 239, 0.95);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}

.mobile-company-list {
  display: none;
}

.table-wrap {
  overflow-x: auto;
  overflow-y: hidden;
}

.table-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line-soft);
  background: linear-gradient(180deg, #ffffff, #f8fbff);
}

.table-head h2 {
  margin: 0 0 3px;
  font-size: 18px;
  line-height: 1.2;
}

.table-head p {
  margin: 0;
  color: var(--muted);
}

.table-head > span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-radius: 999px;
  padding: 5px 11px;
  color: #0f6b4a;
  background: #eaf7f1;
  border: 1px solid #cceadd;
  font-weight: 800;
  white-space: nowrap;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1180px;
}

th,
td {
  text-align: left;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
}

th {
  color: #526071;
  background: #f6f9fd;
  font-size: 12px;
  font-weight: 800;
}

tbody tr {
  transition: background 0.14s ease;
}

tbody tr:hover {
  background: #fbfdff;
}

td small {
  display: block;
  color: var(--muted);
  margin-top: 4px;
}

.muted {
  color: var(--muted);
}

.phones-preview {
  min-width: 210px;
}

.amount-cell {
  color: #172033;
  font-weight: 800;
  white-space: nowrap;
}

.amount-cell[title^="-"] {
  color: #b42318;
}

.phone-count-cell {
  white-space: nowrap;
}

.phone-count-cell strong {
  color: #0f6b4a;
  font-size: 18px;
  line-height: 1;
}

.phone-count-cell span {
  margin-left: 3px;
  color: var(--muted);
  font-weight: 700;
}

.phones-preview .call-button {
  margin-top: 8px;
}

tr:last-child td {
  border-bottom: 0;
}

.company-link {
  color: var(--text);
  font-weight: 800;
}

.company-link:hover {
  color: var(--primary);
}

.mono {
  font-family: Consolas, "SFMono-Regular", monospace;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 4px 10px;
  color: var(--success);
  background: #e9f7f1;
  border: 1px solid #c9ebdc;
  font-weight: 700;
  font-size: 12px;
}

.badge.big {
  font-size: 14px;
  padding: 8px 14px;
}

.source-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.source-pill.profile {
  color: #2457a6;
  background: #edf5ff;
  border: 1px solid #cde1fb;
}

.source-pill.xiaoke {
  color: #83540d;
  background: #fff7e8;
  border: 1px solid #f0d7a9;
}

.pager {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 20px 0;
  color: var(--muted);
}

.pager-pages {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.pager a,
.pager-number,
.pager-total {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-weight: 700;
}

.pager-number {
  min-width: 36px;
  padding: 0 10px;
}

.pager-total {
  color: var(--muted);
  background: transparent;
  border-color: transparent;
}

.pager-number.active {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 8px 18px rgba(15, 95, 143, 0.18);
}

.pager a:hover {
  color: #fff;
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}

.panel h2 {
  margin: 0 0 14px;
  font-size: 18px;
  letter-spacing: 0;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 18px;
}

.panel {
  padding: 20px;
  margin-bottom: 18px;
  min-width: 0;
}

.relation-panel {
  border-color: rgba(158, 194, 232, 0.9);
  background:
    linear-gradient(180deg, #ffffff, #f9fcff),
    var(--panel);
}

.shareholder-panel {
  border-color: rgba(183, 121, 31, 0.3);
  background:
    linear-gradient(180deg, #ffffff, #fffdf7),
    var(--panel);
}

.key-person-panel {
  border-color: rgba(45, 91, 139, 0.18);
  background:
    linear-gradient(180deg, #ffffff, #f8fbfd),
    var(--panel);
}

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

.section-head h2 {
  margin-bottom: 4px;
}

.inline-count {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  margin-left: 10px;
  border-radius: 999px;
  padding: 2px 9px;
  color: #8a570f;
  background: #fff5df;
  border: 1px solid #ecd09b;
  font-size: 13px;
  font-weight: 800;
  vertical-align: middle;
}

.section-head p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.compact-head {
  align-items: center;
  margin-bottom: 12px;
}

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

.metric-row span {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  color: var(--muted);
  background: #f7fbff;
  border: 1px solid #dce9f7;
  border-radius: 999px;
  padding: 6px 10px;
  white-space: nowrap;
}

.metric-row strong {
  color: var(--text);
}

.recommendation-panel {
  border-color: rgba(16, 128, 90, 0.24);
  background:
    linear-gradient(180deg, #ffffff, #f8fffb),
    var(--panel);
}

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

.recommendation-card {
  display: grid;
  gap: 10px;
  background: #fff;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  padding: 14px;
  box-shadow: 0 8px 20px rgba(18, 34, 62, 0.04);
}

.recommendation-card.strong,
.recommendation-card.high {
  border-color: rgba(16, 128, 90, 0.38);
}

.recommendation-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.recommendation-top > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

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

.recommendation-top strong {
  font-size: 22px;
  overflow-wrap: anywhere;
}

.recommendation-top .recommendation-statuses {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
}

.recommendation-card .phone-status-select {
  position: static;
  flex: 0 0 auto;
  max-width: 124px;
}

.recommendation-card .review-status-select {
  max-width: 154px;
  color: #174c79;
  background-color: #eef6ff;
  border-color: #bfd6ef;
}

.recommendation-score,
.recommendation-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.recommendation-score span,
.recommendation-meta span {
  color: var(--muted);
  background: #f7fbff;
  border: 1px solid #dce9f7;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 12px;
  line-height: 1.4;
}

.score-pill {
  font-weight: 900;
}

.score-pill.strong,
.score-pill.high {
  color: #12613d;
  background: #e5f7ee;
  border-color: #bde8d2;
}

.score-pill.medium {
  color: #7a4a13;
  background: #fff6e8;
  border-color: #f1d5ad;
}

.score-pill.low,
.score-pill.none {
  color: #5f6673;
  background: #eef1f5;
  border-color: #d8dee8;
}

.recommendation-label {
  margin: 0;
  font-weight: 800;
  line-height: 1.5;
}

.recommendation-evidence {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.recommendation-actions {
  display: flex;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 8px;
}

.relation-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.relation-card {
  background: #fff;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  padding: 16px;
  box-shadow: 0 8px 20px rgba(18, 34, 62, 0.04);
}

.relation-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 10px;
}

.relation-card h3 {
  margin: 0 0 4px;
  font-size: 18px;
}

.relation-card p {
  margin: 0;
  color: var(--muted);
}

.confidence {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.confidence.high {
  color: #12613d;
  background: #e5f7ee;
  border: 1px solid #bde8d2;
}

.confidence.medium {
  color: #7a4a13;
  background: #fff6e8;
  border: 1px solid #f1d5ad;
}

.confidence.low,
.confidence.none {
  color: #5f6673;
  background: #eef1f5;
  border: 1px solid #d8dee8;
}

.relation-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.relation-facts span {
  color: var(--muted);
  background: #f8fbff;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  padding: 4px 8px;
}

.relation-preview {
  display: grid;
  gap: 4px;
  margin-top: 10px;
}

.relation-preview span {
  color: var(--muted);
}

.relation-preview strong {
  overflow-wrap: anywhere;
}

.notice {
  color: #775115;
  background: #fff8e8;
  border: 1px solid #eed9aa;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 14px;
  line-height: 1.6;
}

.annotation-form {
  display: grid;
  gap: 12px;
}

.annotation-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
}

.annotation-note {
  min-height: 82px;
  max-height: 126px;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
}

.info-grid div {
  min-height: 70px;
  background: var(--panel-soft);
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  padding: 12px;
}

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

.info-grid strong {
  font-weight: 700;
  overflow-wrap: anywhere;
}

.shareholder-summary-line,
.shareholder-compact-list {
  display: grid;
  gap: 8px;
}

.shareholder-summary-line {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  margin-bottom: 10px;
}

.shareholder-summary-item,
.shareholder-chip {
  background: #fff;
  border: 1px solid rgba(236, 208, 155, 0.78);
  border-radius: 8px;
}

.shareholder-summary-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  padding: 9px 10px;
}

.shareholder-compact-list {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.shareholder-chip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 3px 8px;
  align-items: center;
  padding: 8px 9px;
  min-width: 0;
}

.shareholder-summary-item span,
.shareholder-chip span {
  color: #775115;
  font-weight: 800;
}

.shareholder-summary-item strong,
.shareholder-chip strong {
  font-weight: 700;
  overflow-wrap: anywhere;
}

.shareholder-chip em {
  grid-column: 2;
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

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

.person-card {
  min-width: 0;
  display: grid;
  gap: 7px;
  align-items: start;
  padding: 9px 10px;
  border: 1px solid rgba(45, 91, 139, 0.14);
  border-radius: 8px;
  background: #fff;
}

.person-card-main,
.person-card-meta {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.person-card-main strong {
  color: var(--text);
  font-size: 15px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.person-card-main span {
  color: #0f5f8f;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.person-card-main em,
.person-card-meta span {
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.person-table th:nth-child(1),
.person-table td:nth-child(1) {
  width: 17%;
}

.person-table th:nth-child(2),
.person-table td:nth-child(2) {
  width: 26%;
}

.person-table th:nth-child(3),
.person-table td:nth-child(3) {
  width: 22%;
}

.person-table td em {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
}

.mini-table {
  min-width: 0;
  table-layout: fixed;
}

.mini-table th,
.mini-table td {
  overflow-wrap: anywhere;
}

.source-box,
.text-block {
  color: var(--muted);
  line-height: 1.75;
}

.source-box strong,
.text-block strong {
  color: var(--text);
}

.source-line-panel {
  margin-bottom: 78px;
}

.source-line-panel h2 {
  margin-bottom: 8px;
}

.source-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  color: var(--muted);
  line-height: 1.6;
}

.source-line strong {
  color: var(--text);
}

.source-line a {
  font-weight: 800;
}

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

.timeline article {
  border-left: 3px solid var(--primary);
  padding: 8px 0 8px 14px;
  background: #fbfdff;
  border-radius: 0 8px 8px 0;
}

.timeline time {
  color: var(--muted);
  font-size: 13px;
}

.timeline p {
  margin: 6px 0 0;
  white-space: pre-wrap;
}

.user-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.user-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 700;
}

.user-list {
  display: grid;
  gap: 10px;
}

.user-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(280px, 1.4fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  background: var(--panel-soft);
}

.user-row strong {
  display: block;
  font-size: 16px;
}

.user-row span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.user-actions {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) auto;
  gap: 8px;
}

.log-filter-form {
  display: grid;
  grid-template-columns: minmax(150px, 0.8fr) minmax(160px, 0.8fr) minmax(260px, 1.5fr) auto;
  gap: 12px;
  align-items: end;
  margin-top: 16px;
}

.log-filter-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.log-filter-form button {
  min-height: 43px;
}

.log-panel {
  overflow: hidden;
}

.log-table-wrap {
  border: 0;
  border-radius: 12px;
  box-shadow: none;
}

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

.log-table th:nth-child(1),
.log-table td:nth-child(1) {
  width: 150px;
  white-space: nowrap;
}

.log-table th:nth-child(2),
.log-table td:nth-child(2),
.log-table th:nth-child(3),
.log-table td:nth-child(3),
.log-table th:nth-child(6),
.log-table td:nth-child(6) {
  width: 120px;
  white-space: nowrap;
}

.log-table td:nth-child(5) {
  color: #3b4656;
  line-height: 1.65;
}

.back {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--muted);
  font-weight: 700;
}

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

.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 0, rgba(20, 86, 196, 0.12), transparent 34%),
    #eef3fb;
}

.login-box {
  width: min(420px, calc(100vw - 32px));
  display: grid;
  gap: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 32px;
  box-shadow: var(--shadow-md);
}

.login-box h1 {
  margin: 0;
  font-size: 30px;
}

.login-box p {
  margin: -8px 0 10px;
  color: var(--muted);
}

.login-box label {
  display: grid;
  gap: 6px;
  color: var(--muted);
}

.alert {
  background: #fff1f0;
  color: #b42318;
  border: 1px solid #ffd1cc;
  border-radius: 6px;
  padding: 10px 12px;
}

@media (max-width: 980px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: static;
    height: auto;
    padding: 14px 16px;
    border-right: 0;
    border-bottom: 1px solid #e6ebf2;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
  }

  .brand {
    font-size: 22px;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 9px;
  }

  .side-nav {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .side-nav::-webkit-scrollbar {
    display: none;
  }

  .side-nav a,
  .side-bottom a,
  .side-logout {
    flex: 0 0 auto;
    padding: 9px 10px;
    font-size: 13px;
  }

  .side-bottom {
    margin-top: 0;
    display: flex;
    gap: 6px;
  }

  .page {
    width: min(100%, 1080px);
    padding: 18px 16px 34px;
  }

  .search-top,
  .result-toolbar,
  .mini-stats,
  .company-results {
    margin-left: 0;
    margin-right: 0;
  }

  .company-results {
    grid-template-columns: 1fr;
    padding: 0;
    gap: 0;
    overflow: hidden;
  }

  .company-result-card {
    border: 0;
    border-bottom: 1px solid #edf0f4;
    border-radius: 0;
    box-shadow: none;
  }

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

  .hero,
  .detail-head,
  .detail-grid {
    grid-template-columns: 1fr;
    display: grid;
  }

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

  .filter-main {
    grid-column: 1 / -1;
  }

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

  .section-head {
    display: grid;
  }

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

@media (max-width: 640px) {
  body {
    font-size: 13px;
    background:
      linear-gradient(180deg, #f6fbfd 0, #eef4f6 320px),
      #eef4f6;
  }

  .sidebar {
    grid-template-columns: 1fr auto;
    padding: 10px;
    gap: 10px;
  }

  .brand {
    font-size: 18px;
  }

  .brand-mark {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    font-size: 14px;
  }

  .side-nav {
    grid-column: 1 / -1;
    order: 3;
  }

  .side-nav a {
    padding: 8px 9px;
    border-radius: 7px;
  }

  .side-nav span,
  .side-bottom span {
    width: 18px;
  }

  .side-logout {
    padding: 8px 9px;
    font-size: 12px;
    justify-self: end;
  }

  .page {
    width: 100%;
    margin: 0 auto 28px;
    padding: 10px;
  }

  .search-top {
    min-height: auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 76px;
    align-items: stretch;
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 8px;
  }

  .search-top input,
  .search-top button {
    width: 100%;
    height: 42px;
    min-width: 0;
  }

  .search-top input {
    font-size: 14px;
    padding: 0 10px;
  }

  .result-toolbar {
    display: grid;
    gap: 10px;
    min-height: 0;
    padding: 12px;
  }

  .result-count {
    font-size: 15px;
  }

  .toolbar-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

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

  .toolbar-actions select {
    width: 100%;
    height: 38px;
    padding: 0 8px;
  }

  .toolbar-actions .button {
    width: 100%;
    height: 38px;
    padding: 0 12px;
  }

  .mini-stats {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 9px 12px 11px;
    scrollbar-width: none;
  }

  .mini-stats::-webkit-scrollbar {
    display: none;
  }

  .mini-stats span {
    flex: 0 0 auto;
  }

  .company-result-card {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 12px;
    padding: 15px 12px 17px;
  }

  .company-avatar {
    width: 44px;
    height: 44px;
    border-radius: 6px;
    font-size: 16px;
  }

  .company-result-head {
    display: grid;
    gap: 10px;
  }

  .result-company-name {
    font-size: 16px;
    line-height: 1.45;
  }

  .result-tags {
    gap: 6px;
    margin-top: 8px;
  }

  .result-tags span {
    padding: 3px 8px;
    font-size: 12px;
  }

  .result-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    width: 100%;
  }

  .result-actions .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 8px 10px;
  }

  .result-info-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 10px;
  }

  .result-info-grid span {
    min-height: 54px;
    display: grid;
    gap: 3px;
    padding: 8px;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    background: #f8fbff;
  }

  .result-info-grid strong {
    font-size: 15px;
  }

  .result-address {
    margin-top: 10px;
    line-height: 1.6;
  }

  .result-links {
    gap: 8px 16px;
    margin-top: 10px;
  }

  .pager {
    gap: 12px;
    align-items: center;
    margin-top: 14px;
  }

  .pager a,
  .pager span {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
  }

  .filters {
    grid-template-columns: 1fr;
    padding: 12px;
    gap: 10px;
    margin: 0 0 12px;
    border-radius: 12px;
  }

  .filter-main {
    grid-column: auto;
  }

  .hero h1,
  .detail-head h1 {
    font-size: 22px;
    line-height: 1.3;
  }

  .hero,
  .detail-head {
    gap: 12px;
    margin-bottom: 12px;
    padding: 16px;
    border-radius: 14px;
    box-shadow: var(--shadow-sm);
  }

  .hero-actions {
    display: none;
  }

  .detail-head p {
    line-height: 1.6;
    overflow-wrap: anywhere;
  }

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

  .stat {
    padding: 11px 10px;
    display: grid;
    gap: 4px;
    border-radius: 12px;
    min-height: 70px;
  }

  .stat strong {
    font-size: 20px;
  }

  .stat span {
    font-size: 11px;
  }

  .panel {
    padding: 12px;
    margin-bottom: 12px;
  }

  .panel h2 {
    font-size: 16px;
    margin-bottom: 10px;
  }

  .detail-grid {
    gap: 0;
    margin-bottom: 0;
  }

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

  .inline-count {
    margin-left: 8px;
    font-size: 12px;
    min-height: 22px;
    padding: 1px 8px;
  }

  .metric-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .metric-row span {
    justify-content: space-between;
    border-radius: 7px;
    padding: 8px;
  }

  .relation-cards {
    grid-template-columns: 1fr;
  }

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

  .recommendation-card {
    padding: 12px;
  }

  .recommendation-top {
    flex-wrap: wrap;
    gap: 8px;
  }

  .recommendation-top .recommendation-statuses {
    justify-content: flex-start;
    width: 100%;
  }

  .recommendation-card .phone-status-select,
  .recommendation-card .review-status-select {
    flex: 1 1 128px;
    max-width: none;
  }

  .recommendation-top strong {
    font-size: 19px;
  }

  .recommendation-evidence {
    -webkit-line-clamp: 4;
  }

  .relation-card {
    padding: 12px;
  }

  .relation-card-head {
    display: grid;
    gap: 8px;
  }

  .relation-facts {
    gap: 6px;
  }

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

  .info-grid div {
    min-height: 0;
    padding: 9px;
    border-radius: 8px;
  }

  .info-grid span {
    margin-bottom: 5px;
    font-size: 12px;
  }

  .info-grid strong {
    font-size: 13px;
    line-height: 1.35;
  }

  .shareholder-summary-line,
  .shareholder-compact-list {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .shareholder-summary-item,
  .shareholder-chip {
    padding: 8px;
  }

  .shareholder-summary-item span,
  .shareholder-summary-item strong,
  .shareholder-chip span,
  .shareholder-chip strong {
    font-size: 13px;
    line-height: 1.4;
  }

  .shareholder-chip em {
    grid-column: 2;
    white-space: normal;
    font-size: 12px;
  }

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

  .person-card {
    padding: 8px;
  }

  .annotation-form {
    gap: 10px;
  }

  .user-form,
  .user-row,
  .user-actions,
  .log-filter-form {
    grid-template-columns: 1fr;
  }

  .user-row {
    align-items: stretch;
  }

  .panel table,
  .panel thead,
  .panel tbody,
  .panel tr,
  .panel td {
    display: block;
    width: 100%;
  }

  .panel table {
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0;
  }

  .panel thead {
    display: none;
  }

  .panel tr {
    background: #f8fafd;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 10px;
    margin-bottom: 10px;
  }

  .panel td {
    display: grid;
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 10px;
    border-bottom: 0;
    padding: 7px 0;
    min-height: 34px;
    overflow-wrap: anywhere;
  }

  .panel td::before {
    content: attr(data-label);
    color: var(--muted);
    font-weight: 800;
  }

  .panel td.empty,
  .empty {
    display: block;
    padding: 18px 10px;
  }

  .panel td.empty::before {
    content: "";
  }

  .call-button {
    min-height: 40px;
    padding: 10px 14px;
  }

  .call-button.compact {
    min-height: 36px;
    font-size: 13px;
  }

  .phone-actions {
    gap: 6px;
  }

  .phone-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .phone-card {
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 10px;
  }

  .phone-status-select {
    top: 8px;
    right: 8px;
    max-width: 106px;
    min-height: 28px;
    font-size: 11px;
    padding: 3px 23px 3px 8px;
  }

  .phone-card-main strong {
    font-size: 16px;
  }

  .phone-card-main {
    padding-right: 112px;
  }

  .phone-card-meta {
    gap: 5px;
  }

  .source-line-panel {
    margin-bottom: 72px;
  }

  .source-line {
    display: grid;
    gap: 4px;
  }

  .detail-head {
    margin-top: 0;
  }

  .floating-actions {
    right: 14px;
    bottom: calc(96px + env(safe-area-inset-bottom, 0px));
    gap: 8px;
  }

  .back-to-top,
  .back-to-bottom,
  .float-action {
    width: 46px;
    height: 46px;
    box-shadow: 0 12px 28px rgba(15, 95, 143, 0.28);
  }

  .back-to-top,
  .back-to-bottom {
    font-size: 24px;
  }

  .float-action {
    width: 54px;
    height: 40px;
    font-size: 12px;
  }

  .action-dialog {
    width: calc(100vw - 20px);
    max-height: calc(100vh - 34px);
    overflow: auto;
    border-radius: 12px;
  }

  .dialog-head,
  .action-dialog .annotation-form {
    padding-left: 14px;
    padding-right: 14px;
  }

}
