/* Client portal + logged-in report / Star Page skin. Reuses /assets/css/styles.css tokens. */

html.auth-pending body { visibility: hidden; }

.client-shell { --audit-warn: #ffd66b; --audit-weak: #ff8b7a; --audit-ok: #64e39c; }

.dev-bypass-banner {
  margin: 0 0 16px;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(255, 214, 107, 0.12);
  border: 1px solid rgba(255, 214, 107, 0.38);
  color: #ffe7a8;
  font-size: 13px;
  line-height: 1.6;
}

.dev-bypass-banner code { color: var(--text); }

.auth-tab:disabled,
.auth-tab.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.client-note,
.sample-banner {
  margin-top: 14px;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(136, 245, 255, 0.06);
  border: 1px dashed rgba(136, 245, 255, 0.22);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.client-note code,
.sample-banner code {
  color: var(--text);
  font-size: 12px;
}

.client-login-wrap {
  min-height: calc(100vh - 220px);
  display: grid;
  align-content: start;
}

.client-login-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.95fr);
  gap: 22px;
  align-items: start;
}

.login-card {
  padding: 26px;
  max-width: 520px;
}

.login-card h1 {
  margin: 12px 0 8px;
  font-size: clamp(32px, 5vw, 44px);
  letter-spacing: -0.04em;
}

.login-card > p {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.7;
}

.auth-wechat-soon {
  margin-top: 8px;
  opacity: 0.55;
  cursor: not-allowed;
}

.auth-secondary {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.auth-secondary summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  list-style: none;
}

.auth-secondary summary::-webkit-details-marker { display: none; }

.auth-secondary summary::after {
  content: " ▾";
  color: var(--muted);
}

.auth-secondary[open] summary {
  margin-bottom: 12px;
}

.magic-sent {
  margin: 0 0 16px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(136, 245, 255, 0.06);
  border: 1px solid rgba(136, 245, 255, 0.22);
}

.magic-sent p { margin: 0 0 10px; color: var(--muted); line-height: 1.7; }
.magic-sent p:last-child { margin-bottom: 0; }

.auth-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.auth-tab {
  flex: 1;
  min-height: 42px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.auth-tab.active {
  color: var(--text);
  border-color: rgba(136, 245, 255, 0.3);
  background: linear-gradient(135deg, rgba(108, 188, 255, 0.16), rgba(136, 245, 255, 0.1));
}

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

.field-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.demo-box {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
}

.demo-box strong { display: block; margin-bottom: 6px; }
.demo-box p { margin: 0 0 12px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.demo-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.login-side { padding: 24px; }

.login-side h2 {
  margin: 0 0 10px;
  font-size: 22px;
  letter-spacing: -0.03em;
}

.login-side p {
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.7;
}

.client-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.client-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.client-meta strong { color: var(--text); font-weight: 600; }

.dash-score-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 28px;
  align-items: center;
}

.score-ring {
  --score: 48;
  --score-color: #ffd66b;
  --score-glow: rgba(255, 214, 107, 0.28);
  width: 168px;
  height: 168px;
  border-radius: 50%;
  background: conic-gradient(var(--score-color) calc(var(--score) * 1%), rgba(255, 255, 255, 0.08) 0);
  display: grid;
  place-items: center;
  box-shadow: 0 0 32px var(--score-glow);
}

.score-ring-inner {
  width: 128px;
  height: 128px;
  border-radius: 50%;
  background: #0b1730;
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: grid;
  place-items: center;
  text-align: center;
}

.score-ring-inner strong {
  font-size: 44px;
  letter-spacing: -0.05em;
  line-height: 1;
}

.score-ring-inner span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.audit-status,
.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid transparent;
}

.audit-status-weak,
.status-pill-weak {
  color: #ffd4ce;
  background: rgba(255, 139, 122, 0.12);
  border-color: rgba(255, 139, 122, 0.28);
}

.audit-status-mid,
.status-pill-mid {
  color: #ffe7a8;
  background: rgba(255, 214, 107, 0.12);
  border-color: rgba(255, 214, 107, 0.28);
}

.audit-status-ok,
.status-pill-ok {
  color: #d7f8e8;
  background: rgba(100, 227, 156, 0.12);
  border-color: rgba(100, 227, 156, 0.28);
}

.audit-finding { margin: 10px 0 0; color: var(--muted); line-height: 1.7; }

.audit-kv { display: grid; gap: 10px; margin-top: 16px; }

.audit-kv div {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.audit-kv dt,
.audit-section-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.audit-kv dd { margin: 0; color: var(--text); font-size: 15px; line-height: 1.5; }

.audit-priority,
.reco-list {
  counter-reset: audit-fix;
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
}

.audit-priority li,
.reco-list li {
  counter-increment: audit-fix;
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.audit-priority li:last-child,
.reco-list li:last-child { border-bottom: 0; }

.audit-priority li::before,
.reco-list li::before {
  content: counter(audit-fix);
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(108, 188, 255, 0.14);
  border: 1px solid rgba(136, 245, 255, 0.2);
  font-weight: 700;
}

.audit-priority strong,
.reco-list strong { display: block; margin-bottom: 4px; }

.audit-priority span,
.reco-list span { color: var(--muted); font-size: 14px; line-height: 1.6; }

.audit-peer {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.audit-peer strong { color: var(--text); }
.audit-peer span { color: var(--muted); font-size: 14px; line-height: 1.6; }

.dash-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 18px;
}

.timeline {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: grid;
  gap: 0;
}

.timeline li {
  position: relative;
  padding: 0 0 18px 28px;
}

.timeline li:last-child { padding-bottom: 0; }

.timeline li::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 8px;
  bottom: -4px;
  width: 1px;
  background: rgba(255, 255, 255, 0.12);
}

.timeline li:last-child::before { display: none; }

.timeline li::after {
  content: "";
  position: absolute;
  left: 1px;
  top: 6px;
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background: #64e39c;
  box-shadow: 0 0 12px rgba(100, 227, 156, 0.4);
}

.timeline li.is-next::after {
  background: #ffd66b;
  box-shadow: 0 0 12px rgba(255, 214, 107, 0.35);
}

.timeline time,
.timeline .when {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

.timeline strong { display: block; margin-bottom: 4px; }
.timeline span { color: var(--muted); font-size: 14px; line-height: 1.6; }

.report-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

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

.star-status-zh {
  margin-left: 6px;
  font-weight: 600;
  opacity: 0.88;
}

.star-readiness {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 214, 107, 0.1);
  border: 1px solid rgba(255, 214, 107, 0.28);
  color: #ffe7a8;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
}

.star-readiness.is-ready {
  background: rgba(100, 227, 156, 0.1);
  border-color: rgba(100, 227, 156, 0.28);
  color: #d7f8e8;
}

.star-checklist {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.star-checklist li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 13px;
}

.star-checklist li.is-ok strong { color: #d7f8e8; font-weight: 600; }
.star-checklist li.is-missing {
  border-color: rgba(255, 214, 107, 0.28);
  background: rgba(255, 214, 107, 0.06);
}
.star-checklist li.is-missing strong { color: #ffe7a8; }

.star-bilingual-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.star-flag {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 139, 122, 0.12);
  border: 1px solid rgba(255, 139, 122, 0.28);
  color: #ffd4ce;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
}

.star-url-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-top: 14px;
}

.star-url-row code { color: var(--text); }

.btn.is-disabled,
a.btn.is-disabled {
  opacity: 0.42;
  pointer-events: none;
  cursor: not-allowed;
}

.star-preview-chrome {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(8, 14, 28, 0.92);
  backdrop-filter: blur(12px);
}

.star-preview-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px 16px;
  padding: 12px 20px;
}

.star-preview-bar-meta,
.star-preview-bar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
}

.star-preview-bar-meta {
  color: var(--muted);
  font-size: 13px;
}

.star-preview-bar-meta strong,
.star-preview-bar-meta code { color: var(--text); }

.star-draft-banner {
  display: grid;
  gap: 4px;
  padding: 12px 20px 14px;
  background: rgba(255, 214, 107, 0.12);
  border-top: 1px solid rgba(255, 214, 107, 0.28);
  color: #ffe7a8;
  font-size: 13px;
  line-height: 1.55;
}

.star-draft-banner strong {
  color: #fff4c8;
  font-size: 14px;
}

.star-viewport-toggle {
  display: inline-flex;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.star-viewport-toggle button {
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.star-viewport-toggle button.is-active {
  background: rgba(136, 245, 255, 0.12);
  color: var(--text);
}

.star-preview-stage {
  transition: max-width 0.2s ease;
}

body.star-preview-mobile .star-preview-stage {
  max-width: 390px;
  margin: 0 auto;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.star-completeness {
  --completeness: 65;
  --completeness-color: #ffd66b;
  margin-top: 16px;
}

.star-completeness-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
}

.star-completeness-head strong { color: var(--text); }

.star-completeness-track {
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.star-completeness-fill {
  width: calc(var(--completeness) * 1%);
  height: 100%;
  border-radius: inherit;
  background: var(--completeness-color);
  box-shadow: 0 0 16px rgba(255, 214, 107, 0.28);
}

.audit-exec { min-height: calc(100vh - 200px); display: grid; align-content: center; }
.audit-exec-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 28px;
  align-items: center;
}

.form-error {
  display: none;
  color: #ffd4ce;
  font-size: 13px;
  line-height: 1.5;
}

.form-error.is-visible { display: block; }

.star-en-name {
  margin: 6px 0 10px;
  color: var(--text);
  font-size: clamp(20px, 3vw, 28px);
  letter-spacing: -0.03em;
}

.star-en {
  margin: 0 0 8px;
  color: var(--text);
  line-height: 1.7;
}

.star-zh {
  display: block;
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.star-kv dd .star-zh { margin-top: 4px; font-size: 14px; }

.star-placeholder {
  margin-top: 14px;
  min-height: 140px;
  padding: 18px 16px;
  border-radius: 16px;
  border: 1px dashed rgba(136, 245, 255, 0.28);
  background: rgba(136, 245, 255, 0.04);
  display: grid;
  align-content: center;
  gap: 6px;
}

.star-placeholder strong { color: var(--text); }
.star-placeholder span { color: var(--muted); font-size: 14px; line-height: 1.6; }

.star-contact-list {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.star-contact-list li {
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--muted);
  line-height: 1.6;
}

.star-contact-list strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text);
}

@media (max-width: 980px) {
  .client-login-grid,
  .dash-score-grid,
  .dash-grid,
  .audit-exec-grid { grid-template-columns: 1fr; }

  .dash-score-grid,
  .audit-exec-grid { justify-items: center; text-align: center; }

  .audit-exec { min-height: 0; }
  .login-card { max-width: none; }
  .code-row { grid-template-columns: 1fr; }

  .star-preview-bar,
  .star-preview-bar-actions { justify-content: stretch; }
  .star-preview-bar-actions .btn { flex: 1 1 auto; justify-content: center; }
}

@media print {
  :root { --text: #122033; --muted: #4b5d78; }
  body.client-shell {
    background: #fff;
    color: #122033;
  }
  .particles,
  .site-header,
  .site-footer,
  .lang-switch,
  .nav-actions,
  .no-print { display: none !important; }
  .panel,
  .card {
    background: #fff;
    border: 1px solid #d5deea;
    box-shadow: none;
    break-inside: avoid;
  }
  .score-ring-inner { background: #f4f7fb; border-color: #d5deea; }
  .audit-exec { min-height: 0; }
  a { color: #122033; text-decoration: none; }
  .btn { border-color: #c5d2e4; }
}
