/* ============================================
   心理学配色方案：
   - 主色 #2563EB (蓝色) - 信任、可靠、冷静
   - 辅色 #10B981 (翠绿) - 健康、活力、生命
   - 强调色 #F59E0B (琥珀) - 能量、温暖、乐观
   - 背景 #F0F4F8 (浅灰蓝) - 安宁、舒适
   - 文字 #1E293B (深蓝灰) - 稳重、专业
   ============================================ */

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #2563EB;
  --primary-light: #3B82F6;
  --primary-dark: #1D4ED8;
  --secondary: #10B981;
  --secondary-light: #34D399;
  --accent: #F59E0B;
  --accent-light: #FBBF24;
  --bg: #F0F4F8;
  --bg-card: #FFFFFF;
  --text: #1E293B;
  --text-light: #64748B;
  --text-muted: #94A3B8;
  --border: #E2E8F0;
  --error: #EF4444;
  --error-light: #FEE2E2;
  --success: #10B981;
  --success-light: #D1FAE5;
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.04);
  --radius: 12px;
  --radius-sm: 8px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ===== 背景装饰 ===== */
body::before {
  content: '';
  position: fixed;
  top: -50%;
  right: -30%;
  width: 80%;
  height: 80%;
  background: radial-gradient(circle, rgba(37,99,235,0.06) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: '';
  position: fixed;
  bottom: -40%;
  left: -20%;
  width: 60%;
  height: 60%;
  background: radial-gradient(circle, rgba(16,185,129,0.05) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ===== 容器 ===== */
.container {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 20px 40px;
}

/* ===== 头部 ===== */
.header {
  text-align: center;
  padding: 32px 0 24px;
}

.header-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(37,99,235,0.25);
}

.header-icon svg {
  width: 36px;
  height: 36px;
  fill: white;
}

.header h1 {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}

.header p {
  font-size: 0.9rem;
  color: var(--text-light);
}

/* ===== 卡片 ===== */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
  margin-bottom: 20px;
  border: 1px solid var(--border);
  transition: var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-lg);
}

.card-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-title svg {
  width: 20px;
  height: 20px;
  fill: var(--primary);
  flex-shrink: 0;
}

/* ===== 表单 ===== */
.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.form-group .hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.5;
}

input[type="text"],
input[type="password"],
input[type="number"] {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  color: var(--text);
  background: var(--bg);
  transition: var(--transition);
  outline: none;
  font-family: inherit;
}

input:focus {
  border-color: var(--primary);
  background: white;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

input::placeholder {
  color: var(--text-muted);
}

/* ===== 滑块 ===== */
.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;
  font-size: 0.9rem;
}

.range-slider {
  flex: 1;
  position: relative;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  margin: 10px 0;
}

.range-slider input[type="range"] {
  position: absolute;
  top: -6px;
  width: 100%;
  height: 18px;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  pointer-events: none;
  outline: none;
}

.range-slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 2px 6px rgba(37,99,235,0.3);
  transition: transform 0.15s ease;
}

.range-slider input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.range-slider input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  pointer-events: auto;
  border: none;
  box-shadow: 0 2px 6px rgba(37,99,235,0.3);
}

/* ===== 按钮 ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  letter-spacing: 0.01em;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
  box-shadow: 0 4px 12px rgba(37,99,235,0.3);
  width: 100%;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(37,99,235,0.4);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary .spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.btn-primary.loading .spinner {
  display: block;
}

.btn-primary.loading .btn-text {
  display: none;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== 结果区域 ===== */
.result-area {
  display: none;
}

.result-area.show {
  display: block;
  animation: fadeSlideUp 0.4s ease;
}

@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.result-summary {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.result-summary.success {
  background: var(--success-light);
  color: #065F46;
  border: 1px solid #A7F3D0;
}

.result-summary.error {
  background: var(--error-light);
  color: #991B1B;
  border: 1px solid #FECACA;
}

.result-item {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
}

.result-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.result-user {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-success {
  background: var(--success-light);
  color: #065F46;
}

.badge-error {
  background: var(--error-light);
  color: #991B1B;
}

.result-msg {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 10px;
}

.result-logs {
  background: #1E293B;
  border-radius: 6px;
  padding: 12px;
  max-height: 200px;
  overflow-y: auto;
}

.result-logs pre {
  font-family: 'Cascadia Code', 'Fira Code', 'Consolas', monospace;
  font-size: 0.78rem;
  line-height: 1.7;
  color: #CBD5E1;
  white-space: pre-wrap;
  word-break: break-all;
}

/* ===== 步数预览 ===== */
.step-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 20px;
  background: linear-gradient(135deg, rgba(37,99,235,0.04), rgba(16,185,129,0.04));
  border-radius: var(--radius-sm);
  margin-top: 12px;
}

.step-number {
  font-size: 2.2rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.03em;
}

.step-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ===== 页脚 ===== */
.footer {
  text-align: center;
  padding: 24px 0 8px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.footer a {
  color: var(--primary);
  text-decoration: none;
}

.footer a:hover {
  text-decoration: underline;
}

/* ===== 提示框 ===== */
.tips {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px;
  background: rgba(245,158,11,0.06);
  border: 1px solid rgba(245,158,11,0.15);
  border-radius: var(--radius-sm);
  margin-bottom: 18px;
}

.tips svg {
  width: 18px;
  height: 18px;
  fill: var(--accent);
  flex-shrink: 0;
  margin-top: 1px;
}

.tips p {
  font-size: 0.82rem;
  color: var(--text-light);
  line-height: 1.6;
}

/* ===== 密码显示切换 ===== */
.input-wrapper {
  position: relative;
}

.input-wrapper input {
  padding-right: 42px;
}

.toggle-password {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toggle-password svg {
  width: 18px;
  height: 18px;
  fill: var(--text-muted);
  transition: fill 0.2s;
}

.toggle-password:hover svg {
  fill: var(--text-light);
}

/* ===== 响应式 ===== */
@media (max-width: 480px) {
  .container {
    padding: 16px 14px 32px;
  }

  .card {
    padding: 20px;
  }

  .header h1 {
    font-size: 1.35rem;
  }

  .header-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
  }

  .header-icon svg {
    width: 30px;
    height: 30px;
  }

  .step-number {
    font-size: 1.8rem;
  }

  .range-group {
    flex-wrap: wrap;
  }

  .range-group input[type="number"] {
    width: 100%;
  }

  .range-slider {
    width: 100%;
    margin: 6px 0 0;
  }
}

@media (min-width: 481px) and (max-width: 768px) {
  .container {
    padding: 20px 20px 36px;
  }
}

/* ===== 滚动条美化 ===== */
.result-logs::-webkit-scrollbar {
  width: 5px;
}

.result-logs::-webkit-scrollbar-track {
  background: transparent;
}

.result-logs::-webkit-scrollbar-thumb {
  background: rgba(148,163,184,0.3);
  border-radius: 3px;
}

.result-logs::-webkit-scrollbar-thumb:hover {
  background: rgba(148,163,184,0.5);
}
