/* === 全局重置 === */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --pink: #ff6b9d;
  --pink-light: #ff8db8;
  --pink-dark: #e55587;
  --cyan: #00d4aa;
  --cyan-light: #33e0c0;
  --cyan-dark: #00b894;
  --bg-main: #f7f3ea;
  --bg-card: #fdfcf8;
  --bg-card-hover: #f6f2e8;
  --text-primary: #2e2e3e;
  --text-secondary: #6e6e8e;
  --text-muted: #9e9ebe;
  --border: #ece6dc;
  --shadow: rgba(255, 107, 157, 0.06);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

/* === 滚动条 === */
::-webkit-scrollbar {
  width: 4px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--pink);
  border-radius: 2px;
}

/* === Header === */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-icon {
  font-size: 24px;
  color: var(--pink);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.logo-text {
  font-size: 20px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--pink), var(--cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo-sub {
  font-size: 12px;
  color: var(--text-secondary);
  margin-left: 4px;
  -webkit-text-fill-color: var(--text-secondary);
}

/* === Main Content === */
main {
  max-width: 600px;
  margin: 0 auto;
  padding: 0 16px 80px;
}

/* === Welcome Card === */
.welcome-card {
  text-align: center;
  padding: 40px 20px 32px;
}

.welcome-card h1 {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 12px;
  background: linear-gradient(135deg, var(--pink), var(--cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.welcome-card p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 20px;
  line-height: 1.7;
}

.progress-summary {
  display: flex;
  justify-content: center;
  gap: 16px;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.progress-summary strong {
  color: var(--pink);
}

/* === Buttons === */
.btn-primary {
  display: inline-block;
  background: linear-gradient(135deg, var(--pink), var(--pink-dark));
  color: #fff;
  padding: 12px 28px;
  border-radius: 25px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(255, 107, 157, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 107, 157, 0.4);
}

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

.btn-secondary {
  display: inline-block;
  background: transparent;
  color: var(--cyan);
  padding: 8px 20px;
  border-radius: 20px;
  font-size: 13px;
  border: 1.5px solid var(--cyan);
  cursor: pointer;
  transition: all 0.3s;
}

.btn-secondary:hover {
  background: rgba(0, 212, 170, 0.1);
}

/* === Section === */
.section-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text-primary);
}

/* === Stage Cards === */
.stage-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  margin-bottom: 12px;
  overflow: hidden;
  transition: all 0.3s;
}

.stage-card:hover {
  border-color: rgba(255, 107, 157, 0.3);
}

.stage-card.active {
  border-color: rgba(255, 107, 157, 0.5);
}

.stage-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  cursor: pointer;
  user-select: none;
  transition: background 0.2s;
}

.stage-header:active {
  background: var(--bg-card-hover);
}

.stage-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.stage-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 10px;
}

.stage-badge.stage-1 { background: rgba(255, 107, 157, 0.2); color: var(--pink); }
.stage-badge.stage-2 { background: rgba(0, 212, 170, 0.2); color: var(--cyan); }
.stage-badge.stage-3 { background: rgba(255, 107, 157, 0.15); color: var(--pink-light); }
.stage-badge.stage-4 { background: rgba(255, 107, 157, 0.3); color: var(--pink); }
.stage-badge.stage-5 { background: rgba(0, 212, 170, 0.15); color: var(--cyan-light); }
.stage-badge.stage-6 { background: linear-gradient(135deg, rgba(255,107,157,0.2), rgba(0,212,170,0.2)); color: var(--cyan); }

.stage-name {
  font-size: 15px;
  font-weight: 600;
}

.stage-toggle {
  font-size: 18px;
  color: var(--text-muted);
  font-weight: 700;
  transition: transform 0.3s;
}

.stage-body {
  padding: 0 16px 16px;
}

.stage-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 12px;
  padding: 8px 12px;
  background: rgba(0, 212, 170, 0.05);
  border-radius: 8px;
  border-left: 3px solid var(--cyan);
}

/* === Lesson List === */
.lesson-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.lesson-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  background: rgba(255, 255, 255, 0.02);
}

.lesson-item:hover {
  background: var(--bg-card-hover);
}

.lesson-item:active {
  transform: scale(0.98);
}

.lesson-num {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  min-width: 24px;
}

.lesson-name {
  flex: 1;
  font-size: 13px;
  color: var(--text-primary);
}

.lesson-status {
  font-size: 14px;
}

.lesson-status.done { color: var(--cyan); }
.lesson-status.pending { color: var(--text-muted); }

/* === Daily Section === */
.daily-card {
  background: linear-gradient(135deg, var(--bg-card), rgba(255, 107, 157, 0.08));
  border: 1px solid rgba(255, 107, 157, 0.2);
  border-radius: 16px;
  padding: 20px;
  text-align: center;
}

.daily-tip {
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.daily-tip p {
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.8;
}

.daily-card .btn-secondary {
  margin-top: 16px;
}

/* === Tools === */
.tools-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}

.tool-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 10px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
}

.tool-card:hover {
  border-color: var(--cyan);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 212, 170, 0.15);
}

.tool-card:active {
  transform: scale(0.96);
}

.tool-icon {
  font-size: 28px;
  margin-bottom: 6px;
}

.tool-name {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
}

.tool-desc {
  font-size: 11px;
  color: var(--text-muted);
}

/* === Community === */
.community-card {
  background: linear-gradient(135deg, var(--bg-card), rgba(0, 212, 170, 0.06));
  border: 1px solid rgba(0, 212, 170, 0.2);
  border-radius: 16px;
  padding: 20px;
  text-align: center;
}

.community-card p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.7;
}

.telegram-btn {
  background: linear-gradient(135deg, #0088cc, #006699);
  box-shadow: 0 4px 15px rgba(0, 136, 204, 0.3);
  margin-bottom: 12px;
}

.telegram-btn:hover {
  box-shadow: 0 6px 20px rgba(0, 136, 204, 0.4);
}

.gate-link {
  margin-top: 12px;
}

.gate-link a {
  font-size: 13px;
  color: var(--pink);
  text-decoration: none;
  border-bottom: 1px dashed var(--pink);
  transition: all 0.2s;
}

.gate-link a:hover {
  color: var(--cyan);
  border-bottom-color: var(--cyan);
}

/* === 课程详情弹窗 === */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 1000;
  justify-content: center;
  align-items: flex-start;
  padding: 40px 16px;
  overflow-y: auto;
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  background: rgba(247, 243, 234, 0.85);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px 20px 24px;
  max-width: 600px;
  width: 100%;
  position: relative;
  margin-top: 20px;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  transition: all 0.2s;
}

.modal-close:hover {
  color: var(--pink);
  background: rgba(255, 107, 157, 0.1);
}

.modal-content h2 {
  font-size: 20px;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.modal-content .lesson-modal-stage {
  font-size: 12px;
  color: var(--pink);
  margin-bottom: 16px;
}

.modal-content .lesson-body {
  font-size: 15px;
  line-height: 1.8;
  color: var(--text-primary);
}

.modal-content .lesson-body h3 {
  font-size: 17px;
  margin: 24px 0 12px;
  color: var(--cyan);
}

.modal-content .lesson-body p {
  margin-bottom: 14px;
}

.modal-content .lesson-body ul {
  margin: 12px 0;
  padding-left: 20px;
}

.modal-content .lesson-body li {
  margin-bottom: 8px;
  color: var(--text-secondary);
}

.modal-content .lesson-body strong {
  color: var(--pink);
}

.modal-content .lesson-body blockquote {
  border-left: 3px solid var(--cyan);
  padding: 10px 14px;
  margin: 16px 0;
  background: rgba(0, 212, 170, 0.05);
  border-radius: 0 8px 8px 0;
  color: var(--text-secondary);
  font-size: 14px;
}

/* === 计算器 === */
.calc-form label {
  display: block;
  margin-bottom: 14px;
  font-size: 13px;
  color: var(--text-secondary);
}

.calc-form input {
  width: 100%;
  padding: 10px 14px;
  margin-top: 6px;
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
}

.calc-form input:focus {
  border-color: var(--pink);
}

.calc-form .btn-primary {
  width: 100%;
  margin-top: 4px;
}

.calc-result {
  margin-top: 16px;
  padding: 14px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  text-align: center;
  display: none;
}

.calc-result.show {
  display: block;
}

.calc-result.profit {
  background: rgba(0, 212, 170, 0.1);
  color: var(--cyan);
  border: 1px solid rgba(0, 212, 170, 0.3);
}

.calc-result.loss {
  background: rgba(255, 107, 157, 0.1);
  color: var(--pink);
  border: 1px solid rgba(255, 107, 157, 0.3);
}

/* === Footer === */
.footer {
  text-align: center;
  padding: 32px 16px;
  border-top: 1px solid var(--border);
  margin-top: 16px;
}

.footer p {
  font-size: 13px;
  color: var(--text-secondary);
}

.footer-small {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
}

/* === 响应式 === */
@media (min-width: 768px) {
  main {
    padding: 0 24px 80px;
  }
  .welcome-card h1 {
    font-size: 36px;
  }
  .tools-grid {
    gap: 14px;
  }
}
