/*
 * 星途AI 官网统一字体系统
 * 目标：正文清晰、层级稳定、中文舒适阅读；不改变业务布局和交互逻辑。
 */
:root {
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC",
    "Noto Sans CJK SC", sans-serif;
  --type-display: clamp(40px, 5vw, 64px);
  --type-page-title: clamp(36px, 4vw, 52px);
  --type-section-title: clamp(28px, 3vw, 40px);
  --type-card-title: clamp(18px, 2vw, 24px);
  --type-body: 16px;
  --type-note: 14px;
  --type-label: 13px;
  --type-decorative: 12px;
  --leading-tight: 1.35;
  --leading-normal: 1.65;
  --leading-relaxed: 1.8;
  --text-readable: #b8c6d9;
  --text-secondary-readable: #9fb0c6;
  --text-tertiary-readable: #8fa2bb;
  --text-teal-readable: #a9cecb;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body,
button,
input,
select,
textarea {
  font-family: var(--font-sans);
}

body {
  font-size: var(--type-body);
  line-height: var(--leading-normal);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

p,
li,
dd {
  line-height: var(--leading-normal);
}

button,
input,
select,
textarea {
  font-size: var(--type-note);
}

.button,
.primary-action,
.secondary-action,
.light-action,
.panel-wide-action,
.auth-submit,
.auth-download,
.official-support-action,
.table-action,
.danger-action,
.share-link-row button,
.support-form button,
.enterprise-card button,
.setting-card a,
.setting-card button,
.dialog-card button,
.cookie-banner button {
  min-height: 44px;
  font-size: var(--type-note);
  line-height: 1.35;
}

/* 官网与下载页 */
.header-login,
.feature-card p,
.feature-wide > a,
.workflow-grid p,
.download-card li,
.tutorial-file,
.tutorial-steps strong,
.install-grid p,
.system-note p,
.system-note strong,
.system-note > a,
.proof-grid p,
.faq-list p,
.enterprise-strip p {
  font-size: var(--type-note);
}

.eyebrow,
.trust-row,
.section-kicker,
.feature-number,
.platform-pills span,
.product-badge,
.product-type,
.download-meta small,
.download-note,
.file-type,
.tutorial-jump,
.tutorial-recommend span,
.tutorial-recommend small,
.tutorial-card-head small,
.tutorial-card-head > b,
.tutorial-steps li > span,
.tutorial-steps p,
.tutorial-tip p,
.tutorial-tip strong,
.bridge-use-flow,
.install-grid article > b,
.official-service-float small,
.proof-grid span {
  font-size: var(--type-label);
}

.window-top,
.window-avatar,
.card-tag,
.agent-head small,
.floating-chip small,
.floating-chip strong,
.workflow-grid article > span {
  font-size: var(--type-decorative);
}

.prompt-visual,
.prompt-visual b {
  font-size: var(--type-decorative);
}

.agent-head strong {
  font-size: var(--type-label);
}

.canvas-card p,
.agent-panel p {
  font-size: var(--type-note);
  line-height: var(--leading-normal);
}

.tool-rail b,
.agent-icon,
.stat-grid span,
.download-meta strong,
.tutorial-recommend strong,
.bridge-use-flow > strong,
.official-service-icon,
.official-service-float strong,
.cookie-banner strong,
.faq-list summary {
  font-size: var(--type-note);
}

.footer p {
  font-size: var(--type-note);
}

.footer small,
.footer > div {
  font-size: var(--type-label);
}

.cookie-banner p {
  color: var(--text-readable);
  font-size: var(--type-note);
  line-height: var(--leading-normal);
}

.download-page p,
.download-page li,
.download-page .download-note,
.download-page .tutorial-recommend small {
  font-size: var(--type-note);
  line-height: var(--leading-normal);
}

/* 用户中心：导航、卡片和操作 */
.portal-public-nav,
.account-identity,
.account-card strong,
.page-heading p {
  font-size: var(--type-note);
}

.preview-badge,
.account-card small,
.account-nav p,
.account-nav-item > span,
.account-nav-item > i,
.sidebar-download span,
.sidebar-download small,
.page-kicker,
.metric-head b,
.panel-heading span,
.panel-tag,
.activity-icon,
.safe-chip,
.security-score span,
.membership-hero span,
.product-card > span,
.status-pill,
.share-state,
.enterprise-card > span,
.setting-icon,
.official-support-badge,
.official-support-meta span,
.preview-entry,
.table-action,
.payment-method-note {
  font-size: var(--type-decorative);
}

.account-nav p,
.page-kicker,
.panel-heading span,
.membership-hero span,
.product-card > span,
.enterprise-card > span {
  letter-spacing: 0.08em;
}

.account-nav-item {
  min-height: 48px;
  height: auto;
  padding-block: 8px;
  color: var(--text-secondary-readable);
  font-size: var(--type-note);
}

.account-nav-item > span {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
}

.account-nav-item > i {
  padding: 4px 7px;
}

/* 指标卡片使用正常内容流，避免说明文字与底部操作因字号增大而重叠。 */
.metric-card {
  display: flex;
  min-width: 0;
  min-height: 220px;
  flex-direction: column;
}

.metric-card > .metric-head,
.metric-card > strong,
.metric-card > p,
.metric-card > button {
  position: relative;
  z-index: 1;
}

.metric-card > button {
  left: auto;
  bottom: auto;
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  min-height: 44px;
  margin-top: auto;
}

.metric-card > p {
  margin-bottom: 8px;
}

.account-card small,
.sidebar-download small,
.metric-card > p,
.quick-actions small,
.activity-row small,
.wallet-summary-grid small,
.ticket-row small,
.ticket-message small,
.official-support-copy > small,
.phase-lock-note,
.payment-method-note {
  color: var(--text-tertiary-readable);
  font-size: var(--type-note);
  line-height: var(--leading-normal);
}

.sidebar-download strong,
.primary-action,
.secondary-action,
.status-strip,
.metric-head,
.metric-card > button,
.panel-heading > button,
.quick-icon,
.quick-actions strong,
.referral-highlight p,
.light-action,
.activity-row strong,
.activity-amount,
.security-summary li,
.panel-wide-action,
.empty-state,
.membership-hero p,
.product-price small,
.product-card li,
.wallet-summary-grid span,
.support-form label,
.form-message,
.enterprise-card p,
.enterprise-card li,
.enterprise-card button,
.ticket-row strong,
.setting-card p,
.setting-card a,
.setting-card button,
.setting-state,
.auth-gate-card > p,
.auth-gate-card > span,
.official-support-copy > p,
.official-support-action,
.portal-notice,
.dialog-description,
.dialog-card label,
.payment-qr-panel > p,
.ticket-message strong,
.ticket-message p,
.danger-action {
  font-size: var(--type-note);
}

.metric-card > p,
.referral-highlight p,
.membership-hero p,
.product-card li,
.enterprise-card p,
.enterprise-card li,
.setting-card p,
.official-support-copy > p,
.portal-notice,
.dialog-description,
.payment-qr-panel > p,
.ticket-message p {
  color: var(--text-secondary-readable);
  line-height: var(--leading-normal);
}

.activity-row small,
.ticket-row small,
.ticket-message small {
  white-space: normal;
}

/* 用户中心：钱包、订单和推广奖励 */
.data-table {
  font-size: var(--type-note);
  font-variant-numeric: tabular-nums;
}

.data-table th {
  color: var(--text-tertiary-readable);
  font-size: var(--type-label);
  letter-spacing: 0.02em;
}

.data-table td {
  color: var(--text-readable);
  line-height: 1.55;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding-inline: 9px;
}

.referral-share-card {
  min-height: 340px;
}

.referral-share-card > p {
  color: var(--text-teal-readable);
  font-size: 15px;
  line-height: var(--leading-normal);
}

.share-link-row input {
  min-height: 46px;
  font-size: var(--type-body);
}

.share-link-row button {
  min-height: 46px;
}

.referral-share-card > small {
  position: static;
  display: block;
  max-width: 720px;
  margin-top: 20px;
  color: #96b9b6;
  font-size: var(--type-note);
  line-height: var(--leading-normal);
}

.referral-metrics span {
  color: var(--text-secondary-readable);
  font-size: var(--type-label);
}

.referral-metrics strong,
.wallet-summary-grid strong,
.product-price,
.activity-amount {
  font-variant-numeric: tabular-nums;
}

.referral-rule-summary {
  color: var(--text-teal-readable);
  font-size: 15px;
  line-height: var(--leading-normal);
}

.referral-rule-grid span {
  color: var(--text-tertiary-readable);
  font-size: var(--type-label);
}

.referral-rule-grid strong {
  font-size: 18px;
  line-height: var(--leading-tight);
}

.referral-rule-notes {
  color: var(--text-teal-readable);
  font-size: var(--type-note);
  line-height: var(--leading-relaxed);
}

.referral-rule-notes li + li {
  margin-top: 8px;
}

/* 登录与注册 */
.auth-header nav,
.auth-story > p {
  font-size: var(--type-note);
}

.auth-kicker,
.auth-benefits b,
.auth-benefits small,
.auth-trust,
.auth-panel-head > span,
.auth-divider span {
  font-size: var(--type-decorative);
}

.auth-benefits strong,
.auth-panel-head p,
.auth-form label,
.auth-form-meta button,
.auth-back,
.auth-submit,
.auth-message,
.auth-download,
.auth-legal,
.auth-code-row button {
  font-size: var(--type-note);
}

.auth-benefits small {
  font-size: var(--type-note);
}

.auth-panel-head p,
.auth-benefits small,
.auth-trust,
.auth-legal {
  color: var(--text-secondary-readable);
  line-height: var(--leading-normal);
}

.auth-form input,
.auth-code-row button {
  min-height: 48px;
}

/* 邀请落地页 */
.invite-state,
.invite-visual span,
.rule-grid b {
  font-size: var(--type-decorative);
}

.invite-copy > small,
.rule-grid p {
  color: var(--text-readable);
  font-size: var(--type-note);
  line-height: var(--leading-relaxed);
}

.rule-grid h3 {
  font-size: 18px;
  line-height: var(--leading-tight);
}

/* 价格页 */
.pricing-status,
.price-card .type,
.provider-chip {
  font-size: var(--type-label);
}

.price small,
.price-card li,
.pricing-note {
  font-size: var(--type-note);
  line-height: var(--leading-normal);
}

/* 协议与规则页 */
.legal-nav span {
  font-size: var(--type-decorative);
}

.legal-nav a,
.document-cards span,
.document-cards small,
.contact-card span {
  font-size: var(--type-label);
}

.legal-content p,
.legal-content li,
.contact-card strong {
  color: var(--text-readable);
  font-size: var(--type-note);
  line-height: var(--leading-relaxed);
}

/* 窄屏：保持字号，仅调整容易因文字变大而拥挤的布局。 */
@media (max-width: 1100px) {
  .referral-rule-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .account-nav-item {
    justify-content: center;
    padding-inline: 8px;
  }

  .account-nav-item > i {
    position: absolute;
    top: 3px;
    right: 3px;
  }

  .referral-share-card {
    min-height: auto;
  }
}

@media (max-width: 560px) {
  :root {
    --type-body: 16px;
  }

  .referral-share-card {
    padding: 24px 20px;
  }

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

  .referral-rule-summary,
  .referral-rule-notes,
  .referral-rule-grid {
    margin-inline: 16px;
  }

  .referral-rule-grid {
    grid-template-columns: 1fr;
  }

  .data-table th,
  .data-table td {
    padding: 14px 15px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
