*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif; background: #f7f8fa; color: #2c3e50; line-height: 1.7; }

/* Lock screen */
#lock-screen { position: fixed; inset: 0; background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%); display: flex; align-items: center; justify-content: center; z-index: 9999; }
.lock-box { background: rgba(255,255,255,0.07); backdrop-filter: blur(20px); border: 1px solid rgba(255,255,255,0.12); border-radius: 20px; padding: 48px 40px; text-align: center; width: 360px; max-width: 90vw; }
.lock-icon { font-size: 48px; margin-bottom: 16px; }
.lock-box h2 { color: #fff; font-size: 1.4rem; margin-bottom: 8px; }
.lock-hint { color: rgba(255,255,255,0.5); font-size: 0.9rem; margin-bottom: 24px; }
.lock-box input { width: 100%; padding: 12px 16px; border-radius: 10px; border: 1px solid rgba(255,255,255,0.2); background: rgba(255,255,255,0.1); color: #fff; font-size: 1rem; outline: none; margin-bottom: 12px; }
.lock-box input::placeholder { color: rgba(255,255,255,0.4); }
.lock-box input:focus { border-color: #4ecdc4; box-shadow: 0 0 0 3px rgba(78,205,196,0.2); }
.lock-box button { width: 100%; padding: 12px; border-radius: 10px; border: none; background: linear-gradient(135deg, #4ecdc4, #44a08d); color: #fff; font-size: 1rem; font-weight: 600; cursor: pointer; transition: opacity .2s; }
.lock-box button:hover { opacity: 0.85; }
.pwd-error { color: #ff6b6b; font-size: 0.875rem; margin-top: 8px; }

/* Hero */
.hero { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: #fff; padding: 64px 20px; text-align: center; }
.hero-inner { max-width: 700px; margin: 0 auto; }
.hero-title { font-size: 2.2rem; font-weight: 700; margin-bottom: 12px; }
.hero-sub { font-size: 1.05rem; opacity: 0.85; margin-bottom: 28px; }
.hero-actions { display: flex; gap: 20px; justify-content: center; flex-wrap: wrap; margin-top: 32px; }
.action-btn { padding: 0; border: none; border-radius: 0; background: none; color: rgba(255,255,255,0.7); font-size: 0.88rem; font-weight: 400; cursor: pointer; transition: color .2s; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(255,255,255,0.4); }
.action-btn:hover { color: #fff; text-decoration-color: rgba(255,255,255,0.8); }

/* TOC */
.toc-container { max-width: 1100px; margin: 0 auto; padding: 40px 20px 60px; }
.toc-heading { font-size: 1.4rem; color: #2c3e50; margin-bottom: 28px; border-left: 4px solid #667eea; padding-left: 12px; }
.toc-grid { display: flex; flex-direction: column; gap: 24px; }

/* Phase group */
.phase-group { background: #fff; border-radius: 16px; padding: 24px; box-shadow: 0 2px 12px rgba(0,0,0,.06); }
.phase-header { display: flex; align-items: baseline; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.phase-num { font-size: 0.8rem; font-weight: 800; color: #667eea; background: #f0f4ff; padding: 3px 12px; border-radius: 6px; letter-spacing: .04em; white-space: nowrap; }
.phase-name { font-size: 1rem; font-weight: 600; color: #34495e; }
.phase-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }

/* Day card (方案B) */
.day-card { display: flex; flex-direction: column; padding: 12px 14px; background: #f7f8fa; border-radius: 10px; text-decoration: none; color: inherit; transition: all .18s; border: 1px solid #eee; }
.day-card:hover { background: #667eea; color: #fff; transform: translateY(-2px); box-shadow: 0 4px 16px rgba(102,126,234,.3); }
.day-num { font-size: 0.72rem; font-weight: 700; color: #667eea; margin-bottom: 4px; letter-spacing: .04em; }
.day-card:hover .day-num { color: rgba(255,255,255,.75); }
.day-topic { font-size: 0.85rem; font-weight: 500; line-height: 1.35; }

/* Modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: none; align-items: center; justify-content: center; z-index: 10000; padding: 20px; }
.modal-box { background: #fff; border-radius: 20px; padding: 36px 32px 28px; max-width: 600px; width: 100%; max-height: 80vh; overflow-y: auto; position: relative; box-shadow: 0 20px 60px rgba(0,0,0,.2); }
.modal-close { position: absolute; top: 16px; right: 20px; background: none; border: none; font-size: 1.6rem; color: #999; cursor: pointer; line-height: 1; padding: 4px 8px; border-radius: 6px; transition: all .15s; }
.modal-close:hover { background: #f0f0f0; color: #333; }
.modal-title { font-size: 1.3rem; font-weight: 700; color: #2c3e50; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 2px solid #f0f0f0; }
.modal-text { font-size: 0.95rem; color: #555; line-height: 1.8; }
.modal-text p { margin-bottom: 12px; }
.download-link { display: inline-block; padding: 10px 24px; background: linear-gradient(135deg, #667eea, #764ba2); color: #fff; text-decoration: none; border-radius: 10px; font-weight: 600; transition: opacity .2s; }
.download-link:hover { opacity: 0.85; }

/* Article header */
.site-header { position: sticky; top: 0; background: rgba(255,255,255,0.95); backdrop-filter: blur(8px); border-bottom: 1px solid #eee; padding: 12px 20px; display: flex; align-items: center; gap: 16px; z-index: 100; }
.back-home { color: #667eea; text-decoration: none; font-size: 0.9rem; }
.back-home:hover { text-decoration: underline; }
.site-title { font-size: 0.88rem; color: #aaa; margin-left: auto; }

/* Article content */
.page-container { max-width: 760px; margin: 0 auto; padding: 32px 20px 64px; }
.page-header { margin-bottom: 32px; padding-bottom: 20px; border-bottom: 2px solid #f0f0f0; }
.day-badge { display: inline-block; background: linear-gradient(135deg, #667eea, #764ba2); color: #fff; padding: 3px 14px; border-radius: 20px; font-size: 0.78rem; font-weight: 700; margin-bottom: 10px; }
.page-title { font-size: 1.55rem; font-weight: 700; color: #1a202c; line-height: 1.3; }
.content h1 { font-size: 1.35rem; margin: 28px 0 10px; color: #2c3e50; }
.content h2 { font-size: 1.15rem; margin: 28px 0 10px; color: #34495e; padding-left: 10px; border-left: 3px solid #667eea; }
.content h3 { font-size: 0.97rem; margin: 18px 0 8px; color: #667eea; font-weight: 700; }
.content p { margin: 10px 0; font-size: 1rem; color: #444; }
.content ul { margin: 8px 0 16px 22px; }
.content li { margin: 6px 0; font-size: 0.95rem; color: #555; }
.content strong { color: #2c3e50; font-weight: 700; }

/* Audio player */
.audio-wrap { background: linear-gradient(135deg, #f0f4ff, #e8f4fd); border-radius: 12px; padding: 14px 16px; margin: 12px 0; border: 1px solid #dae4ff; }
.audio-label { display: block; font-size: 0.85rem; font-weight: 600; color: #667eea; margin-bottom: 8px; }
.audio-wrap audio { width: 100%; height: 36px; border-radius: 6px; }

/* Images */
.img-wrap { margin: 16px 0; text-align: center; }
.img-wrap img { max-width: 100%; max-height: 200px; border-radius: 10px; box-shadow: 0 4px 20px rgba(0,0,0,.1); }

/* Page nav */
.page-nav { display: flex; gap: 10px; justify-content: space-between; align-items: center; margin-top: 48px; padding-top: 24px; border-top: 1px solid #eee; flex-wrap: wrap; }
.nav-btn { padding: 10px 20px; background: #667eea; color: #fff; text-decoration: none; border-radius: 8px; font-size: 0.88rem; font-weight: 500; transition: background .18s; white-space: nowrap; }
.nav-btn:hover { background: #5568d6; }
.nav-btn.home-btn { background: #f0f4ff; color: #667eea; border: 1px solid #dae4ff; }
.nav-btn.home-btn:hover { background: #e0e8ff; }
.nav-btn.disabled { background: #f0f0f0; color: #bbb; cursor: default; pointer-events: none; }

/* Footer */
.site-footer { text-align: center; padding: 24px; font-size: 0.82rem; color: #bbb; border-top: 1px solid #f0f0f0; background: #fff; margin-top: 48px; }

/* Responsive */
@media (max-width: 600px) {
  .hero-title { font-size: 1.6rem; }
  .hero-actions { gap: 16px; }
  .phase-items { grid-template-columns: repeat(2, 1fr); }
  .page-nav { flex-direction: column; align-items: stretch; }
  .nav-btn { text-align: center; }
  .modal-box { padding: 28px 20px 24px; }
}

/* Progress tracking */
.progress-section { margin-top: 24px; padding: 20px; background: rgba(255,255,255,0.12); border-radius: 14px; backdrop-filter: blur(6px); border: 1px solid rgba(255,255,255,0.15); }
.progress-info { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.progress-label { font-size: 0.88rem; font-weight: 600; color: rgba(255,255,255,0.9); }
.progress-count { font-size: 0.88rem; font-weight: 700; color: #fff; }
.progress-bar-wrap { width: 100%; height: 8px; background: rgba(255,255,255,0.2); border-radius: 4px; overflow: hidden; margin-bottom: 14px; }
.progress-bar { height: 100%; background: linear-gradient(90deg, #4ecdc4, #44a08d); border-radius: 4px; transition: width 0.5s ease; }
.continue-btn { display: inline-block; padding: 10px 24px; background: rgba(255,255,255,0.2); border: 2px solid rgba(255,255,255,0.5); border-radius: 25px; color: #fff; font-size: 0.92rem; font-weight: 600; cursor: pointer; transition: all .2s; margin-right: 10px; }
.continue-btn:hover { background: rgba(255,255,255,0.3); border-color: #fff; transform: translateY(-1px); }
.reset-btn { background: none; border: 1px solid rgba(255,255,255,0.25); border-radius: 6px; color: rgba(255,255,255,0.6); font-size: 0.78rem; padding: 6px 14px; cursor: pointer; transition: all .15s; margin-top: 6px; }
.reset-btn:hover { border-color: rgba(255,255,255,0.5); color: rgba(255,255,255,0.9); }

/* Day card completed state */
.day-card { position: relative; }
.day-card.card-completed { border-color: #44a08d; background: #f0faf8; }
.day-card.card-completed:hover { background: #44a08d; }
.day-done { display: none; position: absolute; top: 6px; right: 8px; width: 20px; height: 20px; background: #44a08d; color: #fff; border-radius: 50%; font-size: 0.65rem; font-weight: 700; line-height: 20px; text-align: center; }
.day-card.card-completed .day-done { display: inline-block; }

/* Mark complete button (article page) */
.mark-complete-wrap { text-align: center; margin-top: 36px; }
.mark-complete-btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 32px; border-radius: 25px; border: 2px solid #667eea; background: transparent; color: #667eea; font-size: 0.95rem; font-weight: 600; cursor: pointer; transition: all .25s; }
.mark-complete-btn:hover { background: #667eea; color: #fff; transform: translateY(-2px); box-shadow: 0 4px 16px rgba(102,126,234,.3); }
.mark-complete-btn.btn-completed { background: #44a08d; border-color: #44a08d; color: #fff; }
.mark-complete-btn.btn-completed:hover { background: #3d9588; border-color: #3d9588; }
.check-icon { font-size: 1.1rem; font-weight: 700; }
