:root {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-strong: #f9fbff;
  --text: #1f2937;
  --muted: #6b7280;
  --line: #d7deea;
  --blue: #2f6fed;
  --blue-dark: #1d4ed8;
  --green: #1f9d61;
  --green-dark: #15803d;
  --shadow: 0 18px 45px rgba(31, 41, 55, 0.12);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 12px;
  --max-width: 440px;
  --font-stack: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-stack);
  color: var(--text);
  background:
    radial-gradient(circle at top, rgba(47, 111, 237, 0.18), transparent 28%),
    linear-gradient(180deg, #f8fbff 0%, var(--bg) 100%);
}

button,
input,
a {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  border: 0;
  cursor: pointer;
}

.view {
  display: none;
}

.view.active {
  display: flex;
}

.centered-view {
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px 24px 84px;
}

.panel {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.help-shell {
  min-height: 100vh;
  padding: 24px 16px 40px;
}

.help-container {
  width: min(100%, 880px);
  margin: 0 auto;
}

.help-hero {
  padding: 28px;
}

.help-subtitle {
  margin-top: 12px;
  max-width: 720px;
  line-height: 1.8;
}

.help-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

.help-toc-link {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid rgba(47, 111, 237, 0.14);
  border-radius: 999px;
  color: var(--blue-dark);
  font-weight: 700;
  background: rgba(47, 111, 237, 0.08);
}

.help-content {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.help-section {
  padding: 24px;
}

.help-section-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.help-step-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  color: #fff;
  font-weight: 800;
  background: linear-gradient(135deg, var(--blue) 0%, #4f8cff 100%);
  box-shadow: 0 10px 24px rgba(47, 111, 237, 0.22);
}

.help-list {
  margin: 0;
  padding-left: 22px;
  color: #374151;
  line-height: 1.9;
}

.help-note {
  margin: 16px 0 0;
  padding: 14px 16px;
  border-radius: 14px;
  color: #475569;
  line-height: 1.7;
  background: rgba(15, 118, 110, 0.08);
}

.faq-list {
  display: grid;
  gap: 14px;
}

.faq-item {
  padding: 18px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
}

.faq-question,
.faq-answer {
  margin: 0;
}

.faq-question {
  font-size: 1rem;
  font-weight: 700;
}

.faq-answer {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.8;
}

.help-footer-actions {
  margin-top: 18px;
}

.help-entry-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.auth-panel {
  width: min(100%, var(--max-width));
  padding: 32px 28px;
}

.binding-panel {
  position: relative;
  overflow: hidden;
  margin: 0 0 22px;
  padding: 26px;
  border: 1px solid rgba(47, 111, 237, 0.12);
  background:
    radial-gradient(circle at top right, rgba(47, 111, 237, 0.14), transparent 34%),
    radial-gradient(circle at bottom left, rgba(16, 185, 129, 0.1), transparent 26%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(243, 248, 255, 0.98));
}

.binding-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(240px, 0.9fr);
  gap: 22px;
  align-items: start;
}

.binding-copy-block {
  min-width: 0;
}

.binding-title {
  margin: 0;
  font-size: 1.55rem;
  font-weight: 800;
  line-height: 1.25;
}

.binding-copy {
  margin: 12px 0 0;
  color: #4b5563;
  line-height: 1.75;
}

.binding-steps {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.binding-step {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 14px 16px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
}

.binding-step-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  color: #fff;
  font-size: 0.98rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--blue) 0%, #4f8cff 100%);
  box-shadow: 0 10px 24px rgba(47, 111, 237, 0.22);
}

.binding-step-title,
.binding-step-copy,
.binding-qr-title,
.binding-qr-copy,
.binding-form-kicker,
.binding-form-title,
.binding-form-tip {
  margin: 0;
}

.binding-step-title {
  font-size: 1rem;
  font-weight: 700;
}

.binding-step-copy {
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.6;
}

.binding-side-card {
  position: relative;
  padding: 18px;
  border: 1px solid rgba(47, 111, 237, 0.14);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 16px 36px rgba(31, 41, 55, 0.08);
}

.binding-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--blue-dark);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(47, 111, 237, 0.1);
}

.binding-code-wrap {
  margin: 18px 0 14px;
}

.binding-qr-title {
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
}

.binding-qr-copy {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
  text-align: center;
}

.binding-form-card {
  margin-top: 20px;
  padding: 18px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.86);
}

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

.binding-form-kicker {
  color: var(--blue);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.binding-form-title {
  margin-top: 6px;
  font-size: 1.1rem;
  font-weight: 800;
}

.binding-form-tip {
  max-width: 260px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
  text-align: right;
}

.brand-title,
.section-title,
.page-title,
.modal-title {
  margin: 0;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.brand-title {
  margin-bottom: 28px;
  font-size: 2rem;
  text-align: center;
}

.section-title {
  margin-bottom: 24px;
  font-size: 1.65rem;
  text-align: center;
}

.page-head {
  margin-bottom: 20px;
}

.page-title {
  font-size: 1.8rem;
}

.page-subtitle {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.auth-copy,
.action-copy,
.modal-tip,
.status-text,
.section-kicker {
  margin: 0;
}

.auth-copy {
  margin-bottom: 24px;
  color: var(--muted);
  line-height: 1.6;
}

.form-stack {
  display: grid;
  gap: 16px;
}

.field-label {
  display: block;
  margin-bottom: 8px;
  color: #374151;
  font-size: 0.92rem;
  font-weight: 600;
}

.field-input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-strong);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.field-input:focus {
  outline: none;
  border-color: var(--blue);
  background: var(--surface);
  box-shadow: 0 0 0 4px rgba(47, 111, 237, 0.12);
}

.field-input-mono {
  font-family: "Consolas", "SFMono-Regular", "Courier New", monospace;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-weight: 700;
  transition: transform 0.15s ease, background 0.2s ease, color 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active,
.card-hover:active {
  transform: scale(0.98);
}

.btn-block {
  width: 100%;
  margin-top: 6px;
}

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-dark) 100%);
}

.btn-success {
  color: #fff;
  background: linear-gradient(135deg, var(--green) 0%, var(--green-dark) 100%);
}

.btn-muted {
  color: #374151;
  background: #e5e7eb;
}

.code-wrap {
  display: flex;
  justify-content: center;
}

.code-image {
  width: 200px;
  max-width: 100%;
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.16);
}

.app-shell {
  flex-direction: column;
  min-height: 100vh;
}

.screen-content {
  display: none;
  flex: 1;
  width: min(100%, 760px);
  margin: 0 auto;
  padding: 28px 20px 158px;
}

.screen-content.active-tab {
  display: block;
}

.metric-card {
  width: 100%;
  padding: 24px;
  text-align: left;
}

.metric-card.is-disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.action-card {
  margin-top: 18px;
  padding: 20px 24px;
}

.announcement-card {
  margin-bottom: 18px;
  padding: 22px 24px;
  border: 1px solid rgba(47, 111, 237, 0.14);
  background:
    radial-gradient(circle at top right, rgba(47, 111, 237, 0.12), transparent 36%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 248, 255, 0.98));
}

.announcement-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.announcement-title {
  margin: 0;
  font-size: 1.2rem;
}

.announcement-updated {
  color: var(--muted);
  font-size: 0.82rem;
  white-space: nowrap;
}

.announcement-image {
  width: 100%;
  margin-top: 16px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(47, 111, 237, 0.08);
  object-fit: cover;
  max-height: 240px;
  background: #edf4ff;
}

.announcement-content {
  margin: 14px 0 0;
  color: #334155;
  line-height: 1.7;
  white-space: pre-wrap;
}

.action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.section-kicker {
  margin-bottom: 6px;
  color: var(--blue);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.action-copy {
  color: var(--muted);
  line-height: 1.6;
}

.metric-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.metric-label,
.metric-hint,
.profile-role,
.meta-label {
  color: var(--muted);
}

.metric-label {
  margin: 0 0 6px;
  font-size: 0.95rem;
}

.metric-value {
  margin: 0;
  color: var(--blue);
  font-size: 2rem;
  font-weight: 800;
}

.metric-icon {
  font-size: 2.6rem;
}

.metric-hint {
  margin: 18px 0 0;
  font-size: 0.82rem;
}

.profile-card {
  padding: 24px;
}

.profile-top {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid #edf1f7;
}

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 999px;
  color: #fff;
  font-size: 1.8rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--blue) 0%, #4f8cff 100%);
}

.profile-name {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
}

.profile-role {
  margin: 6px 0 0;
  font-size: 0.92rem;
}

.profile-meta {
  display: grid;
  gap: 12px;
  padding-top: 14px;
}

.profile-actions {
  margin-top: 20px;
}

.meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
}

.meta-value {
  font-weight: 700;
  color: var(--text);
  text-align: right;
}

.bottom-nav {
  position: fixed;
  right: 0;
  bottom: calc(38px + env(safe-area-inset-bottom));
  left: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid #e5e7eb;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  box-shadow: 0 -10px 30px rgba(15, 23, 42, 0.08);
}

.site-beian {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 30;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 14px;
  min-height: calc(38px + env(safe-area-inset-bottom));
  padding: 8px 16px calc(8px + env(safe-area-inset-bottom));
  color: #666;
  font-size: 13px;
  line-height: 1.35;
  text-align: center;
  background: rgba(255, 255, 255, 0.94);
  border-top: 1px solid rgba(229, 231, 235, 0.92);
  backdrop-filter: blur(12px);
}

.site-beian a {
  color: #666;
}

.site-beian a:hover {
  color: var(--blue-dark);
}

.tab-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 10px 8px;
  color: #97a3b6;
  background: transparent;
}

.tab-btn.active {
  color: var(--blue);
}

.tab-icon {
  font-size: 1.5rem;
}

.tab-text {
  font-size: 0.82rem;
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.44);
}

.modal.active {
  display: flex;
}

.modal-card {
  width: min(100%, 420px);
  padding: 24px;
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.2);
}

.modal-body {
  margin: 20px 0 24px;
}

.announcement-modal-card {
  width: min(100%, 520px);
}

.login-prompt-modal-card {
  border: 1px solid rgba(47, 111, 237, 0.16);
  background:
    radial-gradient(circle at top right, rgba(47, 111, 237, 0.12), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(244, 248, 255, 0.98));
}

.announcement-head-modal {
  margin-bottom: 8px;
}

.announcement-modal-body {
  margin-top: 12px;
}

.announcement-modal-content {
  font-size: 0.95rem;
}

.announcement-modal-actions {
  grid-template-columns: 1fr 1fr;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  color: var(--muted);
  background: rgba(229, 231, 235, 0.8);
  font-size: 1.4rem;
  line-height: 1;
}

.hidden {
  display: none !important;
}

.modal-tip {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.86rem;
}

.modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.status-text {
  min-height: 22px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.status-inline {
  margin-top: 12px;
}

.status-text.is-error {
  color: #c2410c;
}

.status-text.is-success {
  color: var(--green-dark);
}

@media (max-width: 640px) {
  .centered-view {
    padding: 18px 18px 96px;
  }

  .auth-panel,
  .modal-card,
  .metric-card,
  .profile-card,
  .binding-panel {
    padding: 20px;
  }

  .brand-title,
  .section-title,
  .page-title {
    font-size: 1.6rem;
  }

  .metric-value {
    font-size: 1.6rem;
  }

  .action-row {
    align-items: stretch;
    flex-direction: column;
  }

  .announcement-head {
    flex-direction: column;
  }

  .binding-hero {
    grid-template-columns: 1fr;
  }

  .binding-form-head {
    flex-direction: column;
  }

  .binding-form-tip {
    max-width: none;
    text-align: left;
  }

  .binding-step {
    grid-template-columns: 34px minmax(0, 1fr);
    padding: 12px 14px;
  }

  .binding-step-index {
    width: 34px;
    height: 34px;
    font-size: 0.9rem;
  }

  .announcement-updated {
    white-space: normal;
  }
}
