/* ============================================
   Modern Psychology Palette
   Indigo #6366F1  — trust, calm, creativity
   Rose   #F43F5E  — energy, warmth, action
   Sky    #0EA5E9  — clarity, focus
   Background: soft lavender mist gradient
   Glass morphism + smooth animations
   ============================================ */

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box
}

:root {
  --primary: #6366F1;
  --primary-hover: #4F46E5;
  --primary-light: #818CF8;
  --primary-soft: rgba(99, 102, 241, 0.08);
  --secondary: #F43F5E;
  --secondary-hover: #E11D48;
  --secondary-soft: rgba(244, 63, 94, 0.08);
  --accent: #0EA5E9;
  --accent-soft: rgba(14, 165, 233, 0.08);
  --bg: #F1F0FB;
  --bg-card: rgba(255, 255, 255, 0.72);
  --text: #1E1B4B;
  --text-light: #4338CA;
  --text-muted: #9CA3AF;
  --border: rgba(99, 102, 241, 0.12);
  --border-solid: #E0E7FF;
  --error: #EF4444;
  --error-bg: #FEF2F2;
  --success: #10B981;
  --success-bg: #ECFDF5;
  --shadow-sm: 0 1px 3px rgba(99, 102, 241, 0.06);
  --shadow: 0 4px 16px rgba(99, 102, 241, 0.08), 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 8px 28px rgba(99, 102, 241, 0.12), 0 2px 6px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 16px 48px rgba(99, 102, 241, 0.16), 0 4px 12px rgba(0, 0, 0, 0.06);
  --glass-bg: rgba(255, 255, 255, 0.55);
  --glass-border: rgba(255, 255, 255, 0.6);
  --glass-blur: 20px;
  --radius: 18px;
  --radius-sm: 12px;
  --radius-xs: 8px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --gradient-primary: linear-gradient(135deg, #6366F1 0%, #8B5CF6 50%, #A78BFA 100%);
  --gradient-secondary: linear-gradient(135deg, #F43F5E 0%, #FB7185 100%);
  --gradient-bg: linear-gradient(135deg, #E8E6FF 0%, #F1F0FB 30%, #FCE7F3 60%, #E0F2FE 100%);
  --gradient-card: linear-gradient(135deg, rgba(255, 255, 255, 0.8) 0%, rgba(241, 240, 251, 0.6) 100%);
}

html {
  font-size: 16px;
  scroll-behavior: smooth
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
    'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  background: var(--gradient-bg);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ===== Floating ambient orbs ===== */
body::before,
body::after {
  content: '';
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.35;
  z-index: -1;
  animation: floatOrb 20s ease-in-out infinite alternate;
}

body::before {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, #C4B5FD 0%, transparent 70%);
  top: -100px;
  left: -100px;
}

body::after {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, #FBCFE8 0%, transparent 70%);
  bottom: -80px;
  right: -80px;
  animation-delay: -10s;
  animation-direction: alternate-reverse;
}

@keyframes floatOrb {
  0% {
    transform: translate(0, 0) scale(1);
  }

  50% {
    transform: translate(60px, 40px) scale(1.1);
  }

  100% {
    transform: translate(-30px, 80px) scale(0.95);
  }
}

/* ===== Page entrance ===== */
.container {
  max-width: 680px;
  margin: 0 auto;
  padding: 24px 20px 48px;
  animation: pageIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes pageIn {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ===== Auth ===== */
.auth-overlay {
  position: fixed;
  inset: 0;
  background: var(--gradient-bg);
  background-attachment: fixed;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}

.auth-overlay::before {
  content: '';
  position: fixed;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.35;
  background: radial-gradient(circle, #C4B5FD 0%, transparent 70%);
  top: -100px;
  left: -100px;
  z-index: -1;
  animation: floatOrb 20s ease-in-out infinite alternate;
}

.auth-overlay::after {
  content: '';
  position: fixed;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.35;
  background: radial-gradient(circle, #FBCFE8 0%, transparent 70%);
  bottom: -80px;
  right: -80px;
  z-index: -1;
  animation: floatOrb 20s ease-in-out infinite alternate-reverse;
}

.auth-card {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border-radius: 24px;
  box-shadow: var(--shadow-lg), inset 0 1px 0 var(--glass-border);
  padding: 44px 32px;
  width: 100%;
  max-width: 400px;
  border: 1px solid var(--glass-border);
  text-align: center;
  animation: authIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.1s both;
}

@keyframes authIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.auth-card .form-group input {
  text-align: center;
  font-size: 1.1rem;
  letter-spacing: 3px;
  font-weight: 600;
}

.auth-tip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  margin-bottom: 18px;
  background: linear-gradient(135deg, rgba(7, 193, 96, 0.08), rgba(14, 165, 233, 0.08));
  border-radius: var(--radius-xs);
  border: 1px solid rgba(7, 193, 96, 0.15);
  font-size: 0.82rem;
  color: var(--text);
  line-height: 1.5;
}

.auth-tip svg {
  width: 24px;
  height: 24px;
  fill: #07C160;
  flex-shrink: 0;
}

.auth-tip strong {
  background: linear-gradient(135deg, #07C160, #0EA5E9);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
}

/* ===== Header ===== */
.header {
  text-align: center;
  padding: 40px 0 28px
}

.header-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  background: var(--gradient-primary);
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.3);
  animation: iconBounce 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 0.3s both;
  transition: var(--transition);
}

.header-icon:hover {
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 12px 32px rgba(99, 102, 241, 0.4);
}

@keyframes iconBounce {
  from {
    opacity: 0;
    transform: scale(0.5) translateY(20px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.header-icon svg {
  width: 32px;
  height: 32px;
  fill: white
}

.header h1 {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 4px;
  letter-spacing: -0.02em;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header p {
  font-size: 0.9rem;
  color: var(--text-muted);
  animation: fadeUp 0.6s 0.4s both;
}

/* ===== Features grid ===== */
.features-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 18px;
  animation: fadeUp 0.5s 0.25s both;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px;
  background: var(--bg-card);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.feature-item:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.feature-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.feature-icon svg {
  width: 20px;
  height: 20px;
  fill: white;
}

.feature-icon-blue {
  background: linear-gradient(135deg, #0EA5E9, #6366F1)
}

.feature-icon-green {
  background: linear-gradient(135deg, #10B981, #059669)
}

.feature-icon-rose {
  background: linear-gradient(135deg, #F43F5E, #E11D48)
}

.feature-icon-purple {
  background: linear-gradient(135deg, #8B5CF6, #6366F1)
}

.feature-text {
  flex: 1;
  min-width: 0;
}

.feature-text strong {
  display: block;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}

.feature-text p {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ===== Tutorial ===== */
.tutorial-card {
  margin-bottom: 16px;
  background: var(--bg-card);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border-radius: var(--radius);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: var(--transition);
  animation: fadeUp 0.5s 0.15s both;
}

.tutorial-card[open] {
  box-shadow: var(--shadow);
}

.tutorial-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  cursor: pointer;
  user-select: none;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text);
  transition: var(--transition);
  list-style: none;
}

.tutorial-header::-webkit-details-marker {
  display: none
}

.tutorial-header:hover {
  color: var(--primary);
}

.tutorial-icon {
  width: 32px;
  height: 32px;
  background: var(--gradient-primary);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tutorial-icon svg {
  width: 18px;
  height: 18px;
  fill: white;
}

.tutorial-header .fold-arrow {
  width: 18px;
  height: 18px;
  fill: var(--text-muted);
  margin-left: auto;
  flex-shrink: 0;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tutorial-card[open] .tutorial-header .fold-arrow {
  transform: rotate(90deg);
}

.tutorial-body {
  padding: 4px 20px 20px;
  animation: foldIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.tutorial-step {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-light);
}

.tutorial-step:last-of-type {
  border-bottom: none;
}

.step-badge {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--gradient-primary);
  color: white;
  font-size: 0.78rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25);
}

.step-content {
  flex: 1;
}

.step-content strong {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.step-content p {
  font-size: 0.82rem;
  color: var(--text-light);
  line-height: 1.6;
}

.step-content em {
  font-style: normal;
  color: var(--primary);
  font-weight: 600;
}

.tutorial-tip {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 10px 14px;
  background: var(--secondary-soft);
  border-radius: var(--radius-xs);
  border: 1px solid rgba(244, 63, 94, 0.1);
}

.tutorial-tip svg {
  width: 16px;
  height: 16px;
  fill: var(--secondary);
  flex-shrink: 0;
}

.tutorial-tip span {
  font-size: 0.78rem;
  color: var(--secondary-hover);
  font-weight: 500;
  line-height: 1.5;
}

/* ===== FAQ ===== */
.faq-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
}

.faq-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
}

.faq-title svg {
  width: 18px;
  height: 18px;
  fill: var(--accent);
  flex-shrink: 0;
}

.faq-item {
  padding: 10px 0;
  border-bottom: 1px dashed var(--border-light);
}

.faq-item:last-child {
  border-bottom: none;
}

.faq-q {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.faq-a {
  font-size: 0.8rem;
  color: var(--text-light);
  line-height: 1.6;
  padding-left: 14px;
  border-left: 2px solid var(--primary-light);
}

.faq-a em {
  font-style: normal;
  color: var(--primary);
  font-weight: 600;
}

.faq-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
  margin: 12px 0;
}

/* ===== Tips ===== */
.tips {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  background: var(--primary-soft);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  border: 1px solid var(--border);
  animation: fadeUp 0.5s 0.2s both;
}

.tips svg {
  width: 18px;
  height: 18px;
  fill: var(--primary);
  flex-shrink: 0;
  margin-top: 1px
}

.tips p {
  font-size: 0.82rem;
  color: var(--text);
  line-height: 1.6
}

.tips a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none
}

.tips a:hover {
  text-decoration: underline;
  color: var(--primary-hover)
}

/* ===== Card (glass) ===== */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border-radius: var(--radius);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  padding: 28px;
  margin-bottom: 20px;
  border: 1px solid var(--glass-border);
  transition: var(--transition);
  animation: cardIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.card:nth-child(2) {
  animation-delay: 0.1s
}

.card:nth-child(3) {
  animation-delay: 0.2s
}

@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(24px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card:hover {
  box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255, 255, 255, 0.6);
  transform: translateY(-2px);
}

.card-title {
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-title svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  fill: var(--primary);
}

/* ===== Foldable card (details) ===== */
.foldable-card {
  cursor: default;
  overflow: hidden;
  padding: 0;
}

.foldable-card summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
  padding: 16px 20px;
  margin: 0;
  transition: var(--transition);
}

.foldable-card summary::-webkit-details-marker {
  display: none
}

.foldable-card summary:hover {
  color: var(--primary);
}

.fold-arrow {
  width: 18px;
  height: 18px;
  fill: var(--text-muted);
  margin-left: auto;
  flex-shrink: 0;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.foldable-card[open] .fold-arrow {
  transform: rotate(90deg);
}

.foldable-card[open] summary {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0;
}

.card-body {
  padding: 0 20px 20px;
  animation: foldIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes foldIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== Form ===== */
.form-group {
  margin-bottom: 18px
}

.form-group label {
  display: block;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 7px
}

.form-group .hint {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-top: 5px;
  line-height: 1.5
}

input[type="text"],
input[type="password"],
input[type="number"] {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.93rem;
  color: var(--text);
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: var(--transition);
  outline: none;
  font-family: inherit;
}

input:focus {
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 0 3px var(--primary-soft), 0 4px 12px rgba(99, 102, 241, 0.08);
}

input::placeholder {
  color: var(--text-muted)
}

.input-wrapper {
  position: relative
}

.input-wrapper input {
  padding-right: 44px
}

.toggle-password {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  border-radius: 6px;
  transition: var(--transition);
}

.toggle-password:hover {
  color: var(--primary);
  background: var(--primary-soft)
}

.toggle-password svg {
  width: 18px;
  height: 18px;
  fill: currentColor
}

/* ===== Step range ===== */
.range-group {
  display: flex;
  align-items: center;
  gap: 12px
}

.range-group input[type="number"] {
  width: 110px;
  flex-shrink: 0;
  text-align: center;
  padding: 10px 8px;
}

.range-group .range-sep {
  color: var(--text-muted);
  font-weight: 500
}

.range-slider {
  flex: 1;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 12px 0;
  position: relative;
}

.range-slider input[type="range"] {
  position: absolute;
  top: -8px;
  width: 100%;
  height: 20px;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  pointer-events: none;
  outline: none;
}

.range-slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--gradient-primary);
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.35);
  transition: transform 0.2s ease;
}

.range-slider input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2)
}

.range-slider input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--gradient-primary);
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.35);
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  letter-spacing: 0.01em;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.3s;
}

.btn:hover::before {
  opacity: 1
}

/* Primary — gradient indigo */
.btn-primary {
  background: var(--gradient-primary);
  color: white;
  width: 100%;
  padding: 14px 28px;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3);
  font-size: 1rem;
}

.btn-primary:hover:not(:disabled) {
  box-shadow: 0 8px 28px rgba(99, 102, 241, 0.4);
  transform: translateY(-2px);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none
}

.btn-primary .spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.btn-primary.loading .spinner {
  display: block
}

.btn-primary.loading .btn-text {
  display: none
}

/* Secondary — gradient rose */
.btn-secondary {
  background: var(--gradient-secondary);
  color: white;
  padding: 10px 20px;
  font-size: 0.88rem;
  flex: 0 0 auto;
  box-shadow: 0 4px 12px rgba(244, 63, 94, 0.25);
}

.btn-secondary:hover {
  box-shadow: 0 8px 20px rgba(244, 63, 94, 0.35);
  transform: translateY(-2px);
}

.btn-secondary:active {
  transform: translateY(0)
}

/* Outline — glass */
.btn-outline {
  background: var(--glass-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--primary);
  border: 1.5px solid var(--border);
  padding: 8px 16px;
  font-size: 0.82rem;
}

.btn-outline:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.1);
}

.btn-outline:active {
  transform: translateY(1px)
}

@keyframes spin {
  to {
    transform: rotate(360deg)
  }
}

/* ===== Step preview ===== */
.step-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 18px;
  background: var(--gradient-card);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: var(--radius-sm);
  margin-top: 14px;
  border: 1px dashed var(--border);
}

.step-number {
  font-size: 2rem;
  font-weight: 800;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.03em;
}

.step-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500
}

/* ===== Results ===== */
.result-area {
  display: none
}

.result-area.show {
  display: block;
  animation: fadeUp 0.4s both
}

.result-summary {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.result-summary.success {
  background: var(--success-bg);
  color: #065F46;
  border: 1px solid #A7F3D0
}

.result-summary.error {
  background: var(--error-bg);
  color: #991B1B;
  border: 1px solid #FECACA
}

.result-item {
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 12px;
  border: 1px solid var(--glass-border);
}

.result-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px
}

.result-user {
  font-weight: 700;
  font-size: 0.92rem
}

.badge {
  display: inline-flex;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700
}

.badge-success {
  background: var(--success-bg);
  color: #065F46
}

.badge-error {
  background: var(--error-bg);
  color: #991B1B
}

.result-msg {
  font-size: 0.83rem;
  color: var(--text);
  margin-bottom: 8px;
  line-height: 1.5
}

.result-logs {
  background: rgba(30, 27, 75, 0.92);
  border-radius: var(--radius-xs);
  padding: 12px;
  max-height: 180px;
  overflow-y: auto;
}

.result-logs pre {
  font-family: 'Cascadia Code', 'Fira Code', Consolas, monospace;
  font-size: 0.76rem;
  line-height: 1.7;
  color: #C7D2FE;
  white-space: pre-wrap;
  word-break: break-all;
}

/* ===== Code blocks ===== */
.code-block {
  background: rgba(30, 27, 75, 0.92);
  border-radius: var(--radius-xs);
  padding: 12px;
  font-family: 'Cascadia Code', 'Fira Code', Consolas, monospace;
  font-size: 0.78rem;
  color: #A5B4FC;
  word-break: break-all;
  margin-bottom: 10px;
  line-height: 1.6;
}

/* ===== Extra section (more services + wechat) ===== */
.extra-section {
  margin-top: 6px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: fadeUp 0.5s 0.3s both;
}

.btn-gradient {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 28px;
  background: linear-gradient(135deg, #0EA5E9 0%, #6366F1 50%, #8B5CF6 100%);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 4px 20px rgba(14, 165, 233, 0.25), 0 2px 8px rgba(99, 102, 241, 0.15);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.btn-gradient svg {
  width: 20px;
  height: 20px;
  fill: white;
  flex-shrink: 0;
}

.btn-gradient::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.3s;
}

.btn-gradient:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(14, 165, 233, 0.35), 0 4px 12px rgba(99, 102, 241, 0.2);
}

.btn-gradient:hover::before {
  opacity: 1
}

.btn-gradient:active {
  transform: translateY(0);
}

.wechat-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  background: var(--bg-card);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.wechat-banner:hover {
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.wechat-banner svg {
  width: 36px;
  height: 36px;
  fill: #07C160;
  flex-shrink: 0;
}

.wechat-banner>div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.3;
}

.wechat-label {
  font-size: 0.76rem;
  color: var(--text-muted);
  font-weight: 500;
}

.wechat-name {
  font-size: 1rem;
  font-weight: 700;
  background: linear-gradient(135deg, #07C160, #0EA5E9);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.wechat-desc {
  font-size: 0.8rem;
  color: var(--text-light);
  font-weight: 500;
}

/* ===== Disclaimer ===== */
.disclaimer {
  margin-bottom: 8px;
  border-radius: var(--radius);
  background: var(--bg-card);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
}

.disclaimer-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
}

.disclaimer-header svg {
  width: 18px;
  height: 18px;
  fill: var(--primary);
  flex-shrink: 0;
}

.disclaimer-highlight {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  margin-bottom: 16px;
  background: linear-gradient(135deg, rgba(244, 63, 94, 0.06), rgba(217, 119, 6, 0.06));
  border-radius: var(--radius-xs);
  border: 1px solid rgba(244, 63, 94, 0.12);
}

.disclaimer-highlight svg {
  width: 20px;
  height: 20px;
  fill: var(--secondary);
  flex-shrink: 0;
}

.disclaimer-highlight span {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--secondary-hover);
  line-height: 1.5;
}

.disclaimer-items {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.disclaimer-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.disclaimer-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.68rem;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

.disclaimer-item p {
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ===== Notify tabs ===== */
.notify-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.notify-tab {
  padding: 8px 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.notify-tab:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft);
}

.notify-tab.active {
  border-color: var(--primary);
  background: var(--primary);
  color: white;
}

.notify-panel {
  display: none;
}

.notify-panel.active {
  display: block;
  animation: fadeUp 0.25s both;
}

/* ===== Footer ===== */
.footer {
  text-align: center;
  padding: 28px 0 8px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.footer a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
}

.footer a:hover {
  color: var(--primary-hover);
  text-shadow: 0 0 12px rgba(99, 102, 241, 0.3);
}

/* ===== Utilities ===== */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== Checkbox accent ===== */
input[type="checkbox"] {
  accent-color: var(--primary);
}

/* ===== Button row ===== */
.btn-row {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.btn-row .btn-primary {
  flex: 1
}

/* ===== Checkbox row ===== */
.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.checkbox-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
}

.checkbox-row label {
  margin: 0;
  cursor: pointer;
  font-size: 0.85rem;
}

/* ===== Code block copy buttons ===== */
.btn-outline[onclick] {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* ===== Responsive ===== */

/* Tablet: 768px and below */
@media (max-width: 768px) {
  .container {
    padding: 20px 16px 40px
  }

  .header {
    padding: 32px 0 24px
  }

  .card {
    padding: 24px
  }

  .foldable-card summary {
    padding: 14px 18px
  }

  .card-body {
    padding: 0 18px 18px
  }

  .tutorial-header {
    padding: 14px 18px
  }

  .tutorial-body {
    padding: 4px 18px 18px
  }

  body::before {
    width: 350px;
    height: 350px;
    filter: blur(60px)
  }

  body::after {
    width: 280px;
    height: 280px;
    filter: blur(60px)
  }
}

/* Small phone: 480px and below */
@media (max-width: 480px) {
  .container {
    padding: 16px 14px 36px
  }

  .header {
    padding: 28px 0 20px
  }

  .header-icon {
    width: 54px;
    height: 54px;
    border-radius: 14px
  }

  .header-icon svg {
    width: 28px;
    height: 28px
  }

  .header h1 {
    font-size: 1.4rem
  }

  .header p {
    font-size: 0.84rem
  }

  .card {
    padding: 20px;
    border-radius: 16px
  }

  .foldable-card {
    padding: 0
  }

  .foldable-card summary {
    padding: 14px 16px
  }

  .card-body {
    padding: 0 16px 16px
  }

  .tutorial-header {
    padding: 14px 16px
  }

  .tutorial-body {
    padding: 4px 16px 16px
  }

  .card-title {
    font-size: 0.95rem;
    margin-bottom: 16px
  }

  input[type="text"],
  input[type="password"],
  input[type="number"] {
    padding: 10px 12px;
    font-size: 0.88rem
  }

  .range-group input[type="number"] {
    width: 90px;
    padding: 9px 6px;
    font-size: 0.85rem
  }

  .btn-primary {
    padding: 12px 22px;
    font-size: 0.95rem
  }

  .btn-secondary {
    padding: 9px 16px;
    font-size: 0.82rem
  }

  .step-number {
    font-size: 1.6rem
  }

  .auth-card {
    padding: 30px 22px;
    border-radius: 20px
  }

  .auth-card .form-group input {
    font-size: 1rem;
    letter-spacing: 2px
  }

  .tips {
    padding: 12px 14px;
    gap: 8px
  }

  .tips p {
    font-size: 0.8rem
  }

  .result-item {
    padding: 14px
  }

  .result-logs {
    padding: 10px;
    max-height: 150px
  }

  .result-logs pre {
    font-size: 0.72rem
  }

  .code-block {
    padding: 10px;
    font-size: 0.72rem
  }

  body::before {
    width: 250px;
    height: 250px;
    filter: blur(50px);
    opacity: 0.25
  }

  body::after {
    width: 200px;
    height: 200px;
    filter: blur(50px);
    opacity: 0.25
  }

  .btn-row {
    flex-direction: column;
    gap: 8px
  }

  .extra-section {
    gap: 10px
  }

  .btn-gradient {
    padding: 12px 22px;
    font-size: 0.95rem
  }

  .wechat-banner {
    padding: 14px 16px;
    gap: 12px
  }

  .wechat-banner svg {
    width: 32px;
    height: 32px
  }

  .wechat-name {
    font-size: 0.92rem
  }

  .notify-tabs {
    gap: 4px
  }

  .notify-tab {
    padding: 7px 10px;
    font-size: 0.78rem
  }

  .features-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px
  }

  .feature-item {
    padding: 12px
  }

  .feature-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px
  }

  .feature-icon svg {
    width: 18px;
    height: 18px
  }

  .feature-text strong {
    font-size: 0.82rem
  }

  .feature-text p {
    font-size: 0.7rem
  }

  .tutorial-header {
    padding: 14px 16px;
    font-size: 0.86rem
  }

  .tutorial-body {
    padding: 4px 16px 16px
  }

  .tutorial-step {
    gap: 10px;
    padding: 12px 0
  }

  .step-badge {
    width: 24px;
    height: 24px;
    font-size: 0.72rem
  }

  .step-content strong {
    font-size: 0.85rem
  }

  .step-content p {
    font-size: 0.78rem
  }

  .disclaimer {
    padding: 16px 18px
  }

  .disclaimer-header {
    font-size: 0.82rem
  }

  .disclaimer-highlight {
    padding: 10px 14px
  }

  .disclaimer-highlight span {
    font-size: 0.8rem
  }

  .disclaimer-item p {
    font-size: 0.74rem
  }

  .footer {
    padding: 20px 0 6px;
    font-size: 0.74rem
  }
}

/* Tiny phone: 360px and below */
@media (max-width: 360px) {
  .container {
    padding: 12px 10px 32px
  }

  .header {
    padding: 24px 0 16px
  }

  .header-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px
  }

  .header-icon svg {
    width: 24px;
    height: 24px
  }

  .header h1 {
    font-size: 1.25rem
  }

  .card {
    padding: 16px;
    border-radius: 14px
  }

  .foldable-card {
    padding: 0
  }

  .foldable-card summary {
    padding: 12px 14px
  }

  .card-body {
    padding: 0 14px 14px
  }

  .tutorial-header {
    padding: 12px 14px
  }

  .tutorial-body {
    padding: 4px 14px 14px
  }

  .card-title {
    font-size: 0.9rem;
    margin-bottom: 14px;
    gap: 7px
  }

  .card-title svg {
    width: 17px;
    height: 17px
  }

  input[type="text"],
  input[type="password"],
  input[type="number"] {
    padding: 9px 10px;
    font-size: 0.84rem;
    border-radius: 10px
  }

  .form-group {
    margin-bottom: 14px
  }

  .form-group label {
    font-size: 0.8rem;
    margin-bottom: 5px
  }

  .range-group input[type="number"] {
    width: 78px;
    padding: 8px 4px;
    font-size: 0.82rem
  }

  .range-group {
    gap: 8px
  }

  .btn-primary {
    padding: 11px 18px;
    font-size: 0.9rem;
    border-radius: 10px
  }

  .btn-secondary {
    padding: 8px 14px;
    font-size: 0.8rem
  }

  .btn-outline {
    padding: 6px 12px;
    font-size: 0.78rem
  }

  .btn {
    gap: 6px;
    border-radius: 10px
  }

  .step-preview {
    padding: 14px;
    gap: 8px
  }

  .step-number {
    font-size: 1.4rem
  }

  .step-label {
    font-size: 0.75rem
  }

  .auth-card {
    padding: 24px 18px;
    border-radius: 18px;
    max-width: 320px
  }

  .auth-card h2 {
    font-size: 1.05rem
  }

  .result-item {
    padding: 12px
  }

  .result-user {
    font-size: 0.84rem
  }

  .badge {
    font-size: 0.68rem;
    padding: 2px 8px
  }

  .result-msg {
    font-size: 0.78rem
  }

  .extra-section {
    gap: 8px
  }

  .features-grid {
    grid-template-columns: 1fr;
    gap: 6px
  }

  .feature-item {
    padding: 10px;
    gap: 8px
  }

  .feature-icon {
    width: 28px;
    height: 28px;
    border-radius: 7px
  }

  .feature-icon svg {
    width: 16px;
    height: 16px
  }

  .feature-text strong {
    font-size: 0.78rem
  }

  .feature-text p {
    font-size: 0.68rem
  }

  .tutorial-header {
    padding: 12px 14px;
    font-size: 0.82rem;
    gap: 8px
  }

  .tutorial-icon {
    width: 28px;
    height: 28px;
    border-radius: 7px
  }

  .tutorial-icon svg {
    width: 15px;
    height: 15px
  }

  .tutorial-body {
    padding: 4px 14px 14px
  }

  .tutorial-step {
    gap: 8px;
    padding: 10px 0
  }

  .step-badge {
    width: 22px;
    height: 22px;
    font-size: 0.68rem
  }

  .step-content strong {
    font-size: 0.8rem
  }

  .step-content p {
    font-size: 0.74rem
  }

  .tutorial-tip {
    padding: 8px 10px;
    gap: 6px
  }

  .tutorial-tip span {
    font-size: 0.72rem
  }

  .faq-title {
    font-size: 0.84rem;
    gap: 7px
  }

  .faq-q {
    font-size: 0.78rem
  }

  .faq-a {
    font-size: 0.76rem;
    padding-left: 12px
  }

  .btn-gradient {
    padding: 11px 18px;
    font-size: 0.88rem
  }

  .wechat-banner {
    padding: 12px 14px;
    gap: 10px
  }

  .wechat-banner svg {
    width: 28px;
    height: 28px
  }

  .wechat-name {
    font-size: 0.86rem
  }

  .wechat-label {
    font-size: 0.7rem
  }

  .wechat-desc {
    font-size: 0.74rem
  }

  .disclaimer {
    padding: 14px 14px
  }

  .disclaimer-header {
    font-size: 0.78rem;
    margin-bottom: 10px
  }

  .disclaimer-highlight {
    padding: 10px 12px;
    gap: 8px;
    margin-bottom: 12px
  }

  .disclaimer-highlight svg {
    width: 18px;
    height: 18px
  }

  .disclaimer-highlight span {
    font-size: 0.76rem
  }

  .disclaimer-num {
    width: 20px;
    height: 20px;
    font-size: 0.64rem
  }

  .disclaimer-item p {
    font-size: 0.7rem
  }

  .disclaimer-items {
    gap: 8px
  }

  .notify-tab {
    padding: 6px 8px;
    font-size: 0.74rem
  }

  .footer {
    padding: 16px 0 4px;
    font-size: 0.7rem
  }
}

/* Landscape phone optimization */
@media (max-height: 500px) and (orientation: landscape) {
  .auth-overlay {
    padding: 10px
  }

  .auth-card {
    padding: 20px 28px
  }

  .auth-card .header-icon {
    margin-bottom: 8px
  }

  .auth-card h2 {
    margin-bottom: 4px
  }

  .header {
    padding: 16px 0 12px
  }

  .header-icon {
    width: 44px;
    height: 44px;
    margin-bottom: 8px
  }

  .header h1 {
    font-size: 1.2rem
  }
}

/* Large screen: center content with max-width */
@media (min-width: 769px) {
  .container {
    max-width: 720px
  }
}

/* Touch device: bigger tap targets */
@media (pointer: coarse) {
  .btn {
    min-height: 44px
  }

  .btn-secondary {
    min-height: 40px
  }

  .btn-outline {
    min-height: 38px
  }

  input[type="text"],
  input[type="password"],
  input[type="number"] {
    min-height: 44px
  }

  .toggle-password {
    min-width: 44px;
    min-height: 44px
  }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Dark mode hint (system preference) */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0F0D1A;
    --bg-card: rgba(30, 27, 75, 0.6);
    --text: #E8E6FF;
    --text-light: #C4B5FD;
    --text-muted: #6B7280;
    --border: rgba(99, 102, 241, 0.15);
    --glass-bg: rgba(30, 27, 75, 0.55);
    --glass-border: rgba(99, 102, 241, 0.2);
    --primary-soft: rgba(99, 102, 241, 0.12);
    --secondary-soft: rgba(244, 63, 94, 0.12);
    --success-bg: rgba(16, 185, 129, 0.12);
    --error-bg: rgba(239, 68, 68, 0.12);
  }

  body {
    background: linear-gradient(135deg, #0F0D1A 0%, #1E1040 50%, #0F172A 100%)
  }

  .auth-overlay {
    background: linear-gradient(135deg, #0F0D1A 0%, #1E1040 50%, #0F172A 100%)
  }

  .result-logs {
    background: rgba(15, 13, 26, 0.95)
  }

  .code-block {
    background: rgba(15, 13, 26, 0.95)
  }

  input[type="text"],
  input[type="password"],
  input[type="number"] {
    background: rgba(30, 27, 75, 0.4)
  }

  input:focus {
    background: rgba(30, 27, 75, 0.7)
  }

  .result-item {
    background: rgba(30, 27, 75, 0.4)
  }

  .card:hover {
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(99, 102, 241, 0.15)
  }
}