:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --panel: #ffffff;
  --border: #e2e8f0;
  --text: #172033;
  --muted: #657186;
  --accent: #315bea;
  --accent-soft: #eef2ff;
  --ok: #047857;
  --danger: #dc2626;
  --pill: #e8ecf4;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, "Segoe UI", Roboto, "PingFang SC", sans-serif;
  background: var(--bg);
  color: var(--text);
}
body.pc-login-page .layout {
  min-height: 100vh;
}
body.pc-login-page nav.side {
  display: none;
}
body.pc-login-page main {
  max-width: 28rem;
  margin: 0 auto;
  padding-top: 3rem;
}
header.pc-top {
  min-height: 64px;
  padding: 0.8rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 40;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.02);
}
header.pc-top .brand b { font-size: 1.02rem; font-weight: 700; letter-spacing: -0.01em; }
header.pc-top .brand small {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.2rem;
  max-width: 46rem;
  line-height: 1.45;
}
header.pc-top .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}
.layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 0;
  width: 100%;
  min-height: calc(100vh - 72px);
}
@media (max-width: 880px) {
  .layout { grid-template-columns: 1fr; }
  nav.side {
    position: relative;
    top: 0;
    max-height: none;
    border-right: none;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.25rem;
    overflow-x: auto;
    padding: 0.55rem 0.75rem;
    scrollbar-width: thin;
  }
  nav.side .nav-title,
  nav.side details > summary { display: none; }
  nav.side details { display: contents; }
  nav.side .nav-l2 { display: flex; gap: 0.15rem; padding: 0; margin: 0; }
  nav.side a { flex: 0 0 auto; white-space: nowrap; margin: 0; }
}
nav.side {
  border-right: 1px solid var(--border);
  background: #f4f7fc;
  padding: 0.8rem 0.65rem 1.5rem;
  position: sticky;
  top: 72px;
  align-self: start;
  max-height: calc(100vh - 72px);
  overflow: auto;
}
nav.side .nav-title {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  padding: 0.25rem 0.55rem 0.6rem;
  font-weight: 600;
}
nav.side a,
nav.side summary {
  display: block;
  padding: 0.52rem 0.62rem;
  border-radius: 9px;
  font-size: 0.84rem;
  color: var(--text);
  text-decoration: none;
  margin-bottom: 0.08rem;
  cursor: pointer;
}
nav.side a:hover,
nav.side summary:hover {
  background: #e6efff;
  color: var(--accent);
}
nav.side a.active {
  background: #dce9ff;
  color: var(--accent);
  font-weight: 600;
  box-shadow: none;
}
nav.side details {
  margin-bottom: 0.35rem;
}
nav.side details > summary {
  list-style: none;
  font-weight: 600;
  position: relative;
  display: flex;
  align-items: center;
  min-height: 38px;
  padding: 0.5rem 1.9rem 0.5rem 2.25rem;
  color: #2457c5;
  font-size: 0.8rem;
  background: #e7f0ff;
}
nav.side details > summary::-webkit-details-marker { display: none; }
nav.side details > summary::before {
  content: "";
  position: absolute;
  left: 0.65rem;
  width: 18px;
  height: 18px;
  border-radius: 6px;
  background: #fff;
  box-shadow: inset 0 0 0 1px #d6e3ff;
}
nav.side details > summary::after {
  content: "›";
  position: absolute;
  right: 0.7rem;
  color: #6f8fc8;
  font-size: 0.9rem;
  transition: transform .18s ease;
}
nav.side details[open] > summary { background: #d8e8ff; color: #194db8; }
nav.side details[open] > summary::after { transform: rotate(90deg); }
nav.side details:nth-of-type(1) > summary::before { content: "▥"; color: #4776ed; display: grid; place-items: center; font-size: 10px; }
nav.side details:nth-of-type(2) > summary::before { content: "企"; color: #4776ed; display: grid; place-items: center; font-size: 9px; font-weight: 800; }
nav.side details:nth-of-type(3) > summary::before { content: "AI"; color: #7c55dc; display: grid; place-items: center; font-size: 7px; font-weight: 800; }
nav.side details:nth-of-type(4) > summary::before { content: "⌘"; color: #4776ed; display: grid; place-items: center; font-size: 10px; }
nav.side details:nth-of-type(5) > summary::before { content: "盾"; color: #16a085; display: grid; place-items: center; font-size: 8px; font-weight: 800; }
nav.side details:nth-of-type(6) > summary::before { content: "¥"; color: #e67e22; display: grid; place-items: center; font-size: 10px; font-weight: 800; }
nav.side .nav-l2 {
  padding: 0.35rem 0 0.1rem 0.5rem;
  margin-top: 0;
}
nav.side .nav-l2 a {
  position: relative;
  padding: 0.45rem 0.65rem 0.45rem 1.75rem;
  font-size: 0.79rem;
  font-weight: 400;
  color: var(--text);
}
nav.side .nav-l2 a::before { content: ""; position: absolute; left: 0.72rem; top: 50%; width: 5px; height: 5px; border-radius: 50%; background: #b8c5da; transform: translateY(-50%); }
nav.side .nav-l2 a.active::before { background: var(--accent); box-shadow: 0 0 0 3px #dbe7ff; }
nav.side > a:not([data-nav]) { color: #2457c5; background: #e7f0ff; font-weight: 600; }
main.pc-main {
  padding: 1.5rem clamp(1rem, 2.4vw, 2.25rem) 3rem;
  max-width: 100%;
  min-width: 0;
}
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.1rem 1.2rem;
  margin-bottom: 1rem;
}
.card h2 {
  font-size: 1rem;
  margin: 0 0 0.5rem;
  font-weight: 600;
}
.sub { color: var(--muted); font-size: 0.85rem; line-height: 1.5; margin: 0 0 0.75rem; }
label {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 0.3rem;
}
input[type="text"],
input[type="password"],
input[type="number"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: 0.5rem 0.6rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  font-size: 0.92rem;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.row { margin-bottom: 0.75rem; }
button {
  cursor: pointer;
  border: none;
  border-radius: 6px;
  padding: 0.5rem 0.95rem;
  font-size: 0.88rem;
  font-weight: 500;
  font-family: inherit;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { filter: brightness(1.06); }
.btn-danger { background: #d9534f; color: #fff; border: none; border-radius: 4px; padding: .35rem .9rem; cursor: pointer; font-size: .875rem; }
.btn-danger:hover { filter: brightness(1.08); }
.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover { color: var(--text); border-color: var(--muted); }
.err { color: var(--danger); font-size: 0.85rem; margin-top: 0.5rem; min-height: 1.1rem; }
.hidden { display: none !important; }
.pill {
  display: inline-block;
  padding: 0.12rem 0.42rem;
  border-radius: 4px;
  font-size: 0.72rem;
  background: var(--pill);
  color: var(--muted);
}
table.pc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}
table.pc-table th,
table.pc-table td {
  text-align: left;
  padding: 0.35rem 0.3rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
table.pc-table th { color: var(--muted); font-weight: 500; }
table.pc-table input.filter-input {
  width: 100%;
  font-size: 0.74rem;
  padding: 0.28rem 0.35rem;
}
.actions-row { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-top: 0.5rem; }

/* 平台工作台首页 */
.pc-home { max-width: 1240px; margin: 0 auto; }
.home-alert {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-height: 68px;
  padding: 0.85rem 1rem;
  margin-bottom: 1.25rem;
  color: #7c2d12;
  text-decoration: none;
  background: linear-gradient(100deg, #fff7ed, #fffbeb);
  border: 1px solid #fed7aa;
  border-radius: 12px;
  box-shadow: 0 7px 22px rgba(194, 65, 12, 0.07);
}
.home-alert:hover { border-color: #fb923c; transform: translateY(-1px); }
.home-alert-icon {
  display: grid;
  place-items: center;
  flex: 0 0 38px;
  height: 38px;
  border-radius: 50%;
  color: #fff;
  font-weight: 800;
  background: #f97316;
  box-shadow: 0 5px 12px rgba(249, 115, 22, 0.24);
}
.home-alert-copy { min-width: 0; flex: 1; }
.home-alert-copy strong, .home-alert-copy small { display: block; }
.home-alert-copy strong { font-size: 0.92rem; }
.home-alert-copy small { margin-top: 0.2rem; color: #9a4d1b; font-size: 0.78rem; }
.home-alert-action { color: #c2410c; font-size: 0.82rem; font-weight: 700; white-space: nowrap; }
.home-live {
  margin-bottom: 1.25rem;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.045);
}
.home-live-head { display: grid; grid-template-columns: minmax(220px, 1fr) auto auto; gap: 1rem; align-items: center; padding: 1rem 1.1rem 0.85rem; border-bottom: 1px solid var(--border); }
.home-live-head h2 { margin: 0; font-size: 1rem; }
.home-live-head > div:first-child > p:last-child { margin: 0.25rem 0 0; color: var(--muted); font-size: 0.72rem; }
.home-live-stats { display: flex; gap: 0.45rem; }
.home-live-stats > span { min-width: 74px; padding: 0.45rem 0.55rem; text-align: center; background: #f5f8fd; border-radius: 9px; }
.home-live-stats b, .home-live-stats small { display: block; }
.home-live-stats b { color: #1d4ed8; font-size: 1rem; }
.home-live-stats small { margin-top: 0.1rem; color: var(--muted); font-size: 0.62rem; }
.home-live-stats .risk { background: #fff1f2; }
.home-live-stats .risk b { color: #dc2626; }
.home-live-more { color: var(--accent); font-size: 0.76rem; font-weight: 600; text-decoration: none; white-space: nowrap; }
.home-visitor-table-wrap { overflow-x: auto; }
table.home-visitor-table { min-width: 760px; margin: 0; }
table.home-visitor-table th { padding: 0.55rem 0.75rem; color: var(--muted); background: #fbfcfe; font-size: 0.67rem; }
table.home-visitor-table td { padding: 0.62rem 0.75rem; font-size: 0.72rem; vertical-align: middle; }
.home-visitor-row strong, .home-visitor-row small { display: block; }
.home-visitor-row strong { color: var(--text); font-size: 0.75rem; }
.home-visitor-row small { margin-top: 0.15rem; color: var(--muted); font-size: 0.64rem; }
.home-visitor-row code { display: block; max-width: 250px; overflow: hidden; color: #4b5870; font-size: 0.65rem; text-overflow: ellipsis; white-space: nowrap; }
.home-visitor-row.is-suspicious { background: #fff8ed; box-shadow: inset 4px 0 0 #f97316; }
.home-visitor-row.is-crawler { background: #fff1f2; box-shadow: inset 4px 0 0 #e11d48; }
.home-identity, .home-online, .home-risk { display: inline-flex; align-items: center; min-height: 22px; padding: 0.18rem 0.45rem; border-radius: 999px; font-size: 0.65rem; font-weight: 650; white-space: nowrap; }
.home-identity.member { color: #1d4ed8; background: #dbeafe; }
.home-identity.guest { color: #5b21b6; background: #ede9fe; }
.home-identity.crawler { color: #be123c; background: #ffe4e6; }
.home-risk { color: #166534; background: #dcfce7; }
.home-risk.alert { color: #b91c1c; background: #fee2e2; }
.home-online.on { color: #166534; background: #dcfce7; }
.home-online.off { color: #64748b; background: #f1f5f9; }
.home-visitor-empty { padding: 1.5rem !important; color: var(--muted); text-align: center !important; }
.home-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 0.5rem 0 1.75rem;
}
.home-eyebrow { margin: 0 0 0.35rem; color: var(--accent); font-size: 0.67rem; font-weight: 800; letter-spacing: 0.14em; }
.home-hero h1 { margin: 0; color: var(--text); font-size: clamp(1.55rem, 2.5vw, 2.1rem); line-height: 1.25; letter-spacing: -0.035em; }
.home-hero > div > p:last-child { margin: 0.55rem 0 0; color: var(--muted); font-size: 0.88rem; }
.home-account { display: flex; align-items: center; gap: 0.65rem; padding: 0.65rem 0.8rem; background: #fff; border: 1px solid var(--border); border-radius: 12px; }
.home-account-avatar { display: grid; place-items: center; width: 36px; height: 36px; color: #fff; border-radius: 10px; background: linear-gradient(135deg, #315bea, #6b7ff2); font-size: 0.8rem; font-weight: 700; }
.home-account small, .home-account strong { display: block; }
.home-account small { color: var(--muted); font-size: 0.66rem; }
.home-account strong { margin-top: 0.12rem; font-size: 0.78rem; }
.home-section-head { display: flex; align-items: end; justify-content: space-between; margin: 0 0 0.75rem; }
.home-section-head h2 { margin: 0; font-size: 0.95rem; }
.home-section-head p { margin: 0.2rem 0 0; color: var(--muted); font-size: 0.72rem; }
.home-grid { display: grid; gap: 0.8rem; margin-bottom: 1.65rem; }
.home-grid-primary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.home-grid-secondary { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.home-module {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  min-width: 0;
  min-height: 98px;
  padding: 1rem;
  color: var(--text);
  text-decoration: none;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 5px 18px rgba(15, 23, 42, 0.035);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.home-module:hover { transform: translateY(-2px); border-color: #c5d0ee; box-shadow: 0 12px 28px rgba(15, 23, 42, 0.075); }
.home-module > span:nth-child(2) { min-width: 0; flex: 1; }
.home-module strong, .home-module small { display: block; }
.home-module strong { font-size: 0.9rem; }
.home-module small { margin-top: 0.3rem; color: var(--muted); font-size: 0.72rem; line-height: 1.4; }
.home-module-icon { display: grid; place-items: center; flex: 0 0 42px; height: 42px; border-radius: 12px; color: var(--accent); background: var(--accent-soft); font-size: 0.78rem; font-weight: 800; }
.home-module-enterprise .home-module-icon { color: #047857; background: #ecfdf5; }
.home-module-trial .home-module-icon { color: #c2410c; background: #fff7ed; }
.home-module-model .home-module-icon { color: #6d28d9; background: #f5f3ff; }
.home-module-arrow { color: #94a3b8; font-size: 1rem; }
.home-module-count { display: grid; place-items: center; min-width: 24px; height: 24px; padding: 0 0.35rem; color: #fff; background: #f97316; border-radius: 999px; font-size: 0.68rem; font-weight: 800; }
.home-module-compact { min-height: 82px; padding: 0.85rem; }
.home-module-compact .home-module-icon { flex-basis: 36px; height: 36px; border-radius: 10px; color: #53627c; background: #f1f5f9; }
.home-module-compact .home-module-arrow { display: none; }

@media (max-width: 1100px) {
  .home-grid-primary { grid-template-columns: 1fr; }
  .home-grid-secondary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  main.pc-main { padding: 1rem 0.75rem 2rem; }
  .home-alert { align-items: flex-start; }
  .home-alert-action { display: none; }
  .home-hero { align-items: flex-start; flex-direction: column; gap: 1rem; }
  .home-account { width: 100%; }
  .home-grid-secondary { grid-template-columns: 1fr; }
  .home-live-head { grid-template-columns: 1fr; }
  .home-live-stats { width: 100%; }
  .home-live-stats > span { flex: 1; }
  .home-live-more { justify-self: start; }
}

/* 试用申请企业归属审批 */
.approval-dialog {
  width: min(620px, 94vw);
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.35rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.2);
}
.approval-dialog h3 { margin: 0 0 0.3rem; font-size: 1.08rem; }
.approval-mode-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.65rem; margin: 1rem 0; }
.approval-mode-card {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  min-height: 82px;
  margin: 0;
  padding: 0.8rem;
  color: var(--text);
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
}
.approval-mode-card:hover { border-color: #b9c5e6; }
.approval-mode-card.active { background: var(--accent-soft); border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.approval-mode-card input { margin: 0.18rem 0 0; accent-color: var(--accent); }
.approval-mode-card span, .approval-mode-card strong, .approval-mode-card small { display: block; }
.approval-mode-card strong { font-size: 0.84rem; }
.approval-mode-card small { margin-top: 0.25rem; color: var(--muted); font-size: 0.71rem; line-height: 1.4; }
.approval-help { display: block; margin-top: 0.32rem; color: var(--muted); font-size: 0.7rem; line-height: 1.4; }
.approval-divider { height: 1px; margin: 0.9rem 0; background: var(--border); }
@media (max-width: 560px) {
  .approval-mode-grid { grid-template-columns: 1fr; }
  .approval-dialog { padding: 1rem; }
}

/* 导航窄屏规则放在文件末尾，确保覆盖桌面分组样式。 */
@media (max-width: 880px) {
  .layout { grid-template-columns: 1fr; }
  nav.side {
    position: relative;
    top: 0;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    max-height: none;
    overflow-x: auto;
    padding: 0.55rem 0.75rem;
    border-right: none;
    border-bottom: 1px solid var(--border);
    scrollbar-width: thin;
  }
  nav.side .nav-title,
  nav.side details > summary { display: none; }
  nav.side details { display: contents; margin: 0; }
  nav.side .nav-l2 { display: flex; gap: 0.15rem; padding: 0; margin: 0; }
  nav.side .nav-l2 a,
  nav.side > a { flex: 0 0 auto; padding: 0.48rem 0.7rem; white-space: nowrap; margin: 0; }
  nav.side .nav-l2 a::before { display: none; }
}
