/* ============================================================================
   服务条款 · 隐私政策 · 商业使用 (对齐 FreeAI 页面排版与个人中心入口卡片)
   ============================================================================ */

#page.legal-public-page {
  min-height: 100dvh;
  background: var(--bg, #07080d);
  color: var(--text, #f3f4f8);
}

.ld-public-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 24px;
  background: color-mix(in srgb, var(--bg, #07080d) 84%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line, rgba(255, 255, 255, 0.1));
}

.ld-public-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
  font-size: 16px;
  font-weight: 700;
}

.ld-public-brand .qj-mascot {
  width: 30px;
  height: 30px;
  border-radius: 8px;
}

.ld-public-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.ld-shell {
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px 24px 56px;
}

.ld-tabs-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line, rgba(255, 255, 255, 0.1));
  margin-bottom: 28px;
}

.ld-tabs {
  display: flex;
  align-items: center;
  gap: 28px;
  overflow-x: auto;
  scrollbar-width: none;
}

.ld-tabs::-webkit-scrollbar {
  display: none;
}

.ld-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 12px 2px 14px;
  color: var(--muted, rgba(255, 255, 255, 0.62));
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.16s ease;
}

.ld-tab:hover {
  color: var(--text, #f5f6fa);
}

.ld-tab.is-active {
  color: var(--text, #ffffff);
  font-weight: 650;
}

.ld-tab.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  border-radius: 9999px;
  background: var(--accent, #7c3aed);
}

.ld-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line, rgba(255, 255, 255, 0.1));
}

.ld-header-main {
  min-width: 0;
  flex: 1 1 480px;
}

.ld-category {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  margin-bottom: 12px;
  border-radius: 9999px;
  background: var(--surface-2, rgba(255, 255, 255, 0.06));
  border: 1px solid var(--line, rgba(255, 255, 255, 0.1));
  font-size: 12px;
  font-weight: 600;
  color: var(--muted, rgba(255, 255, 255, 0.72));
}

.ld-title {
  margin: 0 0 14px;
  font-size: clamp(26px, 3vw, 34px);
  line-height: 1.25;
  font-weight: 750;
  letter-spacing: -0.02em;
}

.ld-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 18px;
  font-size: 13px;
  color: var(--muted, rgba(255, 255, 255, 0.65));
}

.ld-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 10px;
  border-radius: 9999px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.28);
  color: #34d399;
  font-size: 12px;
  font-weight: 600;
}

:is([data-theme="light"], [data-theme="day"]) .ld-status-pill {
  color: #047857;
  background: rgba(16, 185, 129, 0.1);
}

.ld-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.ld-pdf-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 18px;
  border: 0;
  border-radius: 10px;
  background: #7c3aed;
  color: #ffffff;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.16s ease, transform 0.12s ease;
}

.ld-pdf-btn:hover {
  background: #6d28d9;
}

.ld-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}

.ld-toc {
  position: sticky;
  top: 80px;
  padding: 18px 16px;
  border-radius: 16px;
  background: var(--surface, rgba(255, 255, 255, 0.03));
  border: 1px solid var(--line, rgba(255, 255, 255, 0.1));
}

.ld-toc-title {
  margin: 0 0 12px;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--muted, rgba(255, 255, 255, 0.56));
}

.ld-toc-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.ld-toc-item {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted, rgba(255, 255, 255, 0.68));
  font-size: 13px;
  line-height: 1.45;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.14s ease, color 0.14s ease;
}

.ld-toc-item:hover {
  background: var(--surface-2, rgba(255, 255, 255, 0.06));
  color: var(--text, #ffffff);
}

.ld-toc-item.is-active {
  background: color-mix(in srgb, #7c3aed 16%, transparent);
  color: var(--text, #ffffff);
  font-weight: 600;
}

.ld-article {
  min-width: 0;
  padding: 28px 32px;
  border-radius: 18px;
  background: var(--surface, rgba(255, 255, 255, 0.02));
  border: 1px solid var(--line, rgba(255, 255, 255, 0.1));
}

.ld-section {
  scroll-margin-top: 86px;
}

.ld-section + .ld-section {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--line, rgba(255, 255, 255, 0.08));
}

.ld-section h2 {
  margin: 0 0 12px;
  font-size: 18px;
  line-height: 1.45;
  font-weight: 700;
  color: var(--text, #ffffff);
}

.ld-section p {
  margin: 0 0 10px;
  font-size: 14.5px;
  line-height: 1.85;
  color: var(--text-2, var(--muted, rgba(255, 255, 255, 0.78)));
}

.ld-section p:last-child {
  margin-bottom: 0;
}

.ld-section ul {
  margin: 8px 0 12px;
  padding-left: 20px;
}

.ld-section li {
  margin: 6px 0;
  font-size: 14.5px;
  line-height: 1.8;
  color: var(--text-2, var(--muted, rgba(255, 255, 255, 0.78)));
}

.ld-inline-link {
  padding: 0;
  border: 0;
  background: transparent;
  color: #a78bfa;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

:is([data-theme="light"], [data-theme="day"]) .ld-inline-link {
  color: #6d28d9;
}

.ld-effective {
  margin-top: 32px;
  padding: 18px 20px;
  border-radius: 12px;
  background: var(--surface-2, rgba(255, 255, 255, 0.04));
  border: 1px solid var(--line, rgba(255, 255, 255, 0.1));
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--muted, rgba(255, 255, 255, 0.72));
}

.ld-footer {
  margin-top: 36px;
  padding-top: 22px;
  border-top: 1px solid var(--line, rgba(255, 255, 255, 0.1));
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 12.5px;
  color: var(--muted, rgba(255, 255, 255, 0.56));
}

.ld-footer-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px;
}

.ld-footer-links a {
  color: var(--muted, rgba(255, 255, 255, 0.72));
  text-decoration: none;
}

.ld-footer-links a:hover {
  color: var(--text, #ffffff);
  text-decoration: underline;
}

/* ---------- 个人中心 (#/account) 「法律与政策」分组卡片 (对齐 FreeAI /me) ---------- */
.ld-account-section {
  padding-top: 10px;
}

.ld-policy-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  overflow: hidden;
}

.ld-policy-row {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 54px;
  padding: 14px 18px;
  color: var(--text);
  text-decoration: none;
  font-size: 14.5px;
  font-weight: 500;
  transition: background-color 0.15s ease;
}

.ld-policy-row + .ld-policy-row {
  border-top: 1px solid var(--line);
}

.ld-policy-row:hover {
  background: var(--surface-2);
}

.ld-policy-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--muted);
  flex: none;
}

.ld-policy-name {
  flex: 1;
  min-width: 0;
}

.ld-policy-row > svg:last-child {
  color: var(--muted);
  flex: none;
}

@media (max-width: 860px) {
  .ld-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }
  .ld-toc {
    position: static;
  }
  .ld-toc-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px 8px;
  }
}

@media (max-width: 600px) {
  .ld-public-bar {
    padding: 10px 16px;
  }
  .ld-shell {
    padding: 18px 16px 40px;
  }
  .ld-article {
    padding: 20px 18px;
  }
  .ld-toc-list {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media print {
  .topbar,
  .sidebar,
  .ld-public-bar,
  .ld-tabs-bar,
  .ld-pdf-btn,
  .ld-toc,
  .ld-footer {
    display: none !important;
  }
  .workspace {
    margin: 0 !important;
    padding: 0 !important;
  }
  .ld-layout {
    display: block !important;
  }
  .ld-article {
    border: 0 !important;
    padding: 0 !important;
    background: transparent !important;
  }
  body,
  .ld-article,
  .ld-section p,
  .ld-section li,
  .ld-section h2,
  .ld-title {
    color: #000000 !important;
    background: #ffffff !important;
  }
}
