/* ===== Home hero ===== */
.home-hero {
  text-align: center;
  padding: var(--space-3xl) var(--space-xl) var(--space-2xl);
}

.home-hero-title {
  font-family: var(--font-cn);
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: var(--space-md);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.home-hero-title span { color: var(--navy); }

.home-hero-subtitle {
  font-family: var(--font-cn);
  font-size: 0.95rem;
  color: var(--muted);
  max-width: 440px;
  margin: 0 auto var(--space-md);
}

.home-hero-tip {
  font-family: var(--font-cn);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--primary-hover);
  background: var(--primary-pale);
  border: 1.5px solid var(--primary-light);
  border-radius: var(--radius-full);
  padding: 5px 16px;
  display: inline-block;
  margin-bottom: var(--space-xl);
}

.home-tips {
  display: flex;
  justify-content: center;
  gap: var(--space-xl);
  flex-wrap: wrap;
  margin-bottom: var(--space-2xl);
}

.home-tip-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
  min-width: 80px;
}

.home-tip-icon { font-size: 1.6rem; }

.home-tip-label {
  font-family: var(--font-cn);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--muted);
}

/* ===== Word sets section ===== */
.word-sets-section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 var(--space-xl) var(--space-3xl);
}

/* ── Toggle button ── */
.sets-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  background: none;
  border: none;
  padding: var(--space-lg) 0 var(--space-md);
  cursor: pointer;
  text-align: left;
}

.sets-toggle-label {
  font-family: var(--font-cn);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  flex: 1;
  transition: color var(--transition-fast);
}

.sets-toggle:hover .sets-toggle-label { color: var(--ink); }

.sets-toggle-chevron {
  color: var(--muted);
  flex-shrink: 0;
  transition: transform 0.28s ease, color var(--transition-fast);
}

.sets-toggle:hover .sets-toggle-chevron { color: var(--ink); }

.sets-toggle.is-open .sets-toggle-chevron {
  transform: rotate(90deg);
}

/* ── Collapsible grid ── */
.sets-collapse {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

.sets-collapse.is-open {
  max-height: 4000px;
}

.section-title { display: none; } /* legacy — replaced by sets-toggle */

.word-sets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-sm);
  background: transparent;
  border: none;
  border-radius: 0;
  overflow: visible;
}

/* ===== Word set card ===== */
.word-set-card {
  position: relative;
  padding: var(--space-xl);
  background: var(--card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  transition: background var(--transition-fast);
}

.word-set-card::before { display: none; }

.word-set-card.is-empty {
  opacity: 0.45;
  cursor: default;
}

.word-set-card.is-empty:hover {
  transform: none;
  background: var(--card);
}

.word-set-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-sm);
}

.word-set-name {
  font-family: var(--font-cn);
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
}

.word-set-description {
  font-family: var(--font-body);
  font-size: 0.83rem;
  color: var(--muted);
  margin-bottom: var(--space-lg);
  line-height: 1.55;
}

.word-set-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.word-set-count {
  font-family: var(--font-cn);
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 500;
}

/* ===== Continue learning section ===== */
.continue-section {
  max-width: 900px;
  margin: 0 auto;
  padding: var(--space-2xl) var(--space-xl) 0;
}

.continue-card {
  background: var(--card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-ink);
  padding: var(--space-xl) var(--space-2xl);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2xl);
  flex-wrap: wrap;
}

.continue-info { flex: 1; min-width: 0; }

.continue-subtitle {
  font-family: var(--font-cn);
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: var(--space-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.continue-title {
  font-family: var(--font-cn);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: var(--space-md);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.continue-progress-bar {
  width: 100%;
  height: 3px;
  background: var(--color-border);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: var(--space-sm);
}

.continue-progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: var(--radius-full);
  transition: width 0.6s ease;
}

.continue-progress-text {
  font-family: var(--font-cn);
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 500;
}

.continue-btn {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
  flex-shrink: 0;
  white-space: nowrap;
}

.continue-btn:hover {
  background: var(--navy-hover);
  border-color: var(--navy-hover);
}

/* ===== Today's daily progress (inside continue-card) ===== */
.continue-daily {
  width: 100%;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  padding-top: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.continue-daily-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.continue-daily-label {
  font-family: var(--font-cn);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  width: 48px;
  flex-shrink: 0;
}

.continue-daily-bar {
  flex: 1;
  height: 6px;
  background: rgba(0, 0, 0, 0.1);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.continue-daily-fill {
  height: 100%;
  background: var(--navy);
  border-radius: var(--radius-full);
  transition: width 0.5s ease;
}

.continue-daily-count {
  font-family: var(--font-en);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--color-text-secondary);
  min-width: 36px;
  text-align: right;
  flex-shrink: 0;
}

/* ===== Review card ===== */
.review-card-wrap {
  max-width: 900px;
  margin: var(--space-xl) auto 0;
  padding: 0 var(--space-xl);
}

.review-card-inner {
  background: var(--card);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--navy);
  border-radius: var(--radius-lg);
  padding: var(--space-md) var(--space-lg);
}

.review-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-sm);
}

.review-card-title {
  font-family: var(--font-cn);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink);
}

.review-card-btn {
  font-family: var(--font-cn);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--navy);
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--transition-fast);
}

.review-card-btn:hover { color: var(--navy-hover); }

.review-card-bar-track {
  height: 4px;
  background: var(--paper-alt);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: var(--space-xs);
}

.review-card-bar-fill {
  height: 100%;
  background: var(--navy);
  border-radius: var(--radius-full);
  width: 0%;
  transition: width 0.6s ease;
}

.review-card-meta {
  font-family: var(--font-cn);
  font-size: 0.72rem;
  color: var(--muted);
}

/* ===== Nav mode tabs ===== */
.nav-mode-tabs {
  display: flex;
  gap: 0;
  flex-shrink: 0;
}

.nav-mode-tab {
  padding: 6px 16px;
  border: none;
  background: transparent;
  font-family: var(--font-cn);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  position: relative;
  transition: color var(--transition-fast);
  white-space: nowrap;
}

.nav-mode-tab::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0; right: 0;
  height: 2px;
  background: var(--navy);
  transform: scaleX(0);
  transition: transform var(--transition-fast);
}

.nav-mode-tab.is-active {
  color: var(--navy);
  font-weight: 700;
}

.nav-mode-tab.is-active::after { transform: scaleX(1); }

.nav-mode-tab:not(.is-active):hover { color: var(--ink); }

/* ===== Mode switcher ===== */
.mode-switcher {
  max-width: 900px;
  margin: var(--space-xl) auto 0;
  padding: 0 var(--space-xl);
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--color-border);
}

.mode-tab {
  padding: 10px var(--space-lg);
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-cn);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  position: relative;
  transition: color var(--transition-fast);
}

.mode-tab::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0; right: 0;
  height: 2px;
  background: var(--navy);
  transform: scaleX(0);
  transition: transform var(--transition-fast);
}

.mode-tab.is-active {
  color: var(--navy);
  font-weight: 700;
}

.mode-tab.is-active::after { transform: scaleX(1); }

.mode-tab:not(.is-active):hover { color: var(--ink); }

/* ===== Header actions (more button + errorbook) ===== */
.header-actions {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  justify-self: end;
}

.more-btn {
  background: none;
  border: none;
  padding: 3px 6px;
  font-size: 0.6rem;
  letter-spacing: 2px;
  color: var(--muted);
  cursor: pointer;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  transform: rotate(0deg);
  transition: color var(--transition-fast), transform 0.3s ease;
}

.more-btn:hover { color: var(--navy); }

.more-btn.is-open {
  color: var(--navy);
  transform: rotate(90deg);
}

/* ===== More dropdown ===== */
.more-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  background: var(--card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-ink-lg);
  z-index: 200;
  overflow: hidden;
}

.more-dropdown.is-open { display: block; }

.more-dropdown-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  font-family: var(--font-cn);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--color-border);
  transition: background var(--transition-fast);
}

.more-dropdown-link:last-child { border-bottom: none; }

.more-dropdown-link:hover { background: var(--paper); color: var(--navy); }

.more-chevron {
  color: var(--muted);
  font-size: 0.85rem;
  flex-shrink: 0;
}

/* ===== Tips card ===== */
.tips-section {
  max-width: 900px;
  margin: var(--space-lg) auto 0;
  padding: 0 var(--space-xl);
}

.tips-card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius-lg);
  padding: var(--space-lg) var(--space-xl) var(--space-md);
}

.tips-close-btn {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.8rem;
  cursor: pointer;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.tips-close-btn:hover { background: var(--paper-alt); color: var(--ink); }

.tips-title {
  font-family: var(--font-cn);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: var(--space-sm);
  padding-right: 28px;
}

.tips-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: var(--space-md);
}

.tips-list li {
  font-family: var(--font-cn);
  font-size: 0.82rem;
  color: var(--color-text-secondary);
  padding-left: 14px;
  position: relative;
  line-height: 1.5;
}

.tips-list li::before {
  content: '·';
  position: absolute;
  left: 3px;
  color: var(--primary);
  font-weight: 700;
}

.tips-footer {
  border-top: 1px solid var(--color-border);
  padding-top: var(--space-sm);
}

.tips-no-show-btn {
  background: none;
  border: none;
  font-family: var(--font-cn);
  font-size: 0.75rem;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  transition: color var(--transition-fast);
}

.tips-no-show-btn:hover { color: var(--ink); }

.tips-no-show-btn.is-active { color: var(--primary); font-weight: 600; }

/* ===== Drawer tips (使用小贴士) ===== */
.drawer-tips-mode-label {
  font-family: var(--font-cn);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 6px;
  margin-top: var(--space-md);
}

.drawer-tips-mode-label:first-child { margin-top: 0; }

.drawer-tips-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: var(--space-xs);
}

.drawer-tips-list li {
  font-family: var(--font-cn);
  font-size: 0.78rem;
  color: var(--color-text-secondary);
  padding-left: 14px;
  position: relative;
  line-height: 1.5;
}

.drawer-tips-list li::before {
  content: '·';
  position: absolute;
  left: 2px;
  color: var(--primary);
  font-weight: 700;
}

/* ===== 分享底部弹窗 ===== */
.share-sheet-mask {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 300;
}
.share-sheet-mask.is-open { display: block; }

.share-sheet {
  position: fixed;
  bottom: -100%;
  left: 0; right: 0;
  background: var(--card);
  border-radius: 20px 20px 0 0;
  padding: var(--space-lg) var(--space-xl);
  padding-bottom: max(var(--space-xl), env(safe-area-inset-bottom, 20px));
  z-index: 301;
  transition: bottom 0.32s cubic-bezier(0.32, 0, 0.67, 0);
}
.share-sheet.is-open {
  bottom: 0;
  transition: bottom 0.32s cubic-bezier(0.33, 1, 0.68, 1);
}

.share-sheet-title {
  font-family: var(--font-cn);
  font-size: 0.78rem;
  color: var(--muted);
  text-align: center;
  margin-bottom: var(--space-lg);
}

.share-sheet-actions {
  display: flex;
  justify-content: center;
  gap: var(--space-2xl);
  margin-bottom: var(--space-xl);
}

.share-sheet-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.share-sheet-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.4rem;
}
.ss-green   { background: #07c160; }
.ss-blue    { background: #4a90e2; }
.ss-gray    { background: #8e8e93; }
.ss-moments { background: linear-gradient(135deg,#f7a034,#e74c3c); font-size: 1.3rem; line-height: 52px; }

.share-sheet-label {
  font-family: var(--font-cn);
  font-size: 0.72rem;
  color: var(--ink);
}

.share-sheet-tip {
  font-family: var(--font-cn);
  font-size: 0.72rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.5;
  padding: 0 var(--space-md);
  margin-bottom: var(--space-md);
}

.share-sheet-cancel {
  width: 100%;
  padding: 13px;
  background: var(--paper-alt);
  border: none;
  border-radius: var(--radius-lg);
  font-family: var(--font-cn);
  font-size: 0.95rem;
  color: var(--ink);
  font-weight: 500;
  cursor: pointer;
}
.share-sheet-cancel:active { opacity: 0.7; }

/* ===== 朋友圈分享海报 ===== */
.poster-mask {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 400;
  align-items: center;
  justify-content: center;
}
.poster-mask.is-open { display: flex; }

.poster-modal {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-lg);
  padding: var(--space-lg);
  width: 100%;
  max-width: 360px;
}

.poster-close {
  align-self: flex-end;
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  font-size: 1rem;
  width: 32px; height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}

.poster-card {
  width: 100%;
  background: var(--paper);
  border-radius: 20px;
  padding: var(--space-2xl) var(--space-xl);
  text-align: center;
  box-shadow: 0 8px 40px rgba(0,0,0,0.3);
}

.poster-logo {
  width: 64px;
  height: 64px;
  object-fit: contain;
  margin-bottom: var(--space-md);
}

.poster-title {
  font-family: var(--font-cn);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: var(--space-xs);
}

.poster-sub {
  font-family: var(--font-cn);
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: var(--space-lg);
}

.poster-divider {
  width: 40px;
  height: 2px;
  background: var(--color-border);
  margin: 0 auto var(--space-lg);
  border-radius: 2px;
}

.poster-qr {
  width: 140px;
  height: 140px;
  border-radius: var(--radius-md);
  display: block;
  margin: 0 auto var(--space-sm);
}

.poster-qr-tip {
  font-family: var(--font-cn);
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 4px;
}

.poster-url {
  font-family: var(--font-en);
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.poster-hint {
  font-family: var(--font-cn);
  font-size: 0.85rem;
  color: rgba(255,255,255,0.85);
  font-weight: 500;
}

/* ===== Footer ===== */
.home-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  text-align: center;
  padding: var(--space-md);
  border-top: 1px solid var(--color-border);
  background: var(--color-bg);
  font-family: var(--font-cn);
  font-size: 0.8rem;
  color: var(--muted);
  z-index: 10;
}
