/* =============================================
   Home Page - 百草堂入口
   国风水墨主题
   ============================================= */

/* ---------- Hero Section ---------- */
.home-hero {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  min-height: 200px;
  margin-bottom: 16px;
  background: linear-gradient(180deg, 
    rgba(44, 24, 16, 0.85) 0%, 
    rgba(44, 24, 16, 0.6) 40%, 
    rgba(44, 24, 16, 0.4) 100%
  );
}

.hero-bg {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(135deg, #1a0f0a 0%, #2C2C2C 30%, #3E2723 60%, #2C2C2C 100%);
  z-index: 0;
}

.hero-mountains {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60%;
  background: 
    radial-gradient(ellipse 120% 100% at 10% 100%, rgba(107, 142, 78, 0.25) 0%, transparent 70%),
    radial-gradient(ellipse 100% 100% at 50% 100%, rgba(107, 142, 78, 0.15) 0%, transparent 60%),
    radial-gradient(ellipse 80% 100% at 80% 100%, rgba(107, 142, 78, 0.2) 0%, transparent 65%);
}

.hero-clouds {
  position: absolute;
  top: 15%;
  left: 0;
  right: 0;
  height: 40%;
  background: 
    radial-gradient(ellipse 40% 60% at 20% 50%, rgba(201, 169, 110, 0.08) 0%, transparent 70%),
    radial-gradient(ellipse 30% 50% at 70% 40%, rgba(201, 169, 110, 0.06) 0%, transparent 70%);
  animation: cloudDrift 8s ease-in-out infinite alternate;
}

/* 水墨飞鸟（百草新增） */
.hero-birds {
  position: absolute;
  top: 8%;
  right: 15%;
  z-index: 1;
  font-size: 1.2rem;
  opacity: 0.2;
  animation: birdFlight 12s ease-in-out infinite;
  letter-spacing: 6px;
}

@keyframes birdFlight {
  0%, 100% { transform: translateX(0) translateY(0); opacity: 0.15; }
  25% { transform: translateX(-20px) translateY(-5px); opacity: 0.25; }
  50% { transform: translateX(-10px) translateY(-10px); opacity: 0.2; }
  75% { transform: translateX(-30px) translateY(-3px); opacity: 0.25; }
}

@keyframes cloudDrift {
  from { transform: translateX(-5px); }
  to { transform: translateX(5px); }
}

.hero-content {
  position: relative;
  z-index: 1;
  padding: 32px 20px;
  text-align: center;
}

.hero-seal {
  display: inline-block;
  padding: 6px 16px;
  border: 2px solid var(--cinnabar);
  color: var(--cinnabar);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 4px;
  border-radius: 2px;
  transform: rotate(-2deg);
  margin-bottom: 12px;
  text-shadow: 0 0 12px rgba(192, 57, 43, 0.3);
  background: rgba(245, 240, 232, 0.08);
}

.hero-subtitle {
  color: var(--gold-leaf-light);
  font-size: 0.9rem;
  letter-spacing: 3px;
  margin-bottom: 8px;
  opacity: 0.9;
}

.hero-desc {
  color: rgba(245, 240, 232, 0.7);
  font-size: 0.8rem;
  line-height: 1.8;
}

/* ---------- Action Buttons ---------- */
.home-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.home-btn {
  justify-content: flex-start;
  padding: 16px 20px;
  font-size: 1rem;
}

.btn-icon {
  font-size: 1.3rem;
}

/* ---------- Stats ---------- */
.home-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 16px 8px;
  text-align: center;
  border: 1px solid var(--border);
  box-shadow: 0 2px 8px var(--shadow);
}

.stat-number {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--cinnabar);
  line-height: 1;
}

.stat-label {
  font-size: 0.75rem;
  color: #B8B2A8;
  margin-top: 4px;
}

/* ---------- Daily Tip ---------- */
.daily-tip-card {
  background: linear-gradient(135deg, var(--bg-card), rgba(201, 169, 110, 0.08));
}

.tip-text {
  font-size: 0.85rem;
  color: #8B8B8B;
  line-height: 1.8;
  font-style: italic;
}

/* ===== 每日签到（百草新增） ===== */
.checkin-card {
  background: linear-gradient(135deg, var(--bg-card), rgba(107, 142, 78, 0.06));
  border: 1px solid rgba(107, 142, 78, 0.2);
  margin-bottom: 12px;
}

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

.checkin-title {
  font-size: 0.95rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.checkin-btn {
  font-size: 0.8rem;
  padding: 6px 16px;
  border-radius: 20px;
  border: 1px solid var(--herb-green);
  background: var(--herb-green);
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.checkin-btn:disabled {
  background: var(--ink-light);
  border-color: var(--ink-light);
  color: #B8B2A8;
  cursor: default;
}

.checkin-btn:not(:disabled):active {
  transform: scale(0.95);
}

.checkin-streak {
  display: flex;
  gap: 4px;
  justify-content: center;
  flex-wrap: wrap;
}

.checkin-day {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  border: 1px solid var(--ink-light);
  background: var(--ink-paper);
  color: #B8B2A8;
  position: relative;
}

.checkin-day.done {
  background: var(--herb-green);
  border-color: var(--herb-green);
  color: white;
  font-weight: 700;
}

.checkin-day.today {
  border-color: var(--gold-leaf);
  border-width: 2px;
  color: var(--gold-leaf);
  font-weight: 700;
}

.checkin-reward-text {
  font-size: 0.7rem;
  color: #B8B2A8;
  text-align: center;
  margin-top: 8px;
  font-style: italic;
}

/* ===== 药王试炼（百草新增） ===== */
.trial-card {
  background: linear-gradient(135deg, var(--bg-card), rgba(201, 169, 110, 0.06));
  border: 1px solid rgba(201, 169, 110, 0.2);
  margin-bottom: 12px;
}

.trial-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.trial-title {
  font-size: 0.95rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.trial-timer {
  font-size: 0.75rem;
  color: #B8B2A8;
}

.trial-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.trial-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--ink-paper);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 0.8rem;
}

.trial-item.done {
  opacity: 0.6;
  background: rgba(107, 142, 78, 0.08);
  border-color: var(--herb-green);
}

.trial-item .trial-check {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--ink-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  flex-shrink: 0;
}

.trial-item.done .trial-check {
  background: var(--herb-green);
  border-color: var(--herb-green);
  color: white;
}

.trial-item .trial-desc {
  flex: 1;
  color: var(--ink-black);
}

.trial-item .trial-progress {
  font-size: 0.7rem;
  color: var(--ink-gray);
  white-space: nowrap;
}

.trial-reward {
  font-size: 0.8rem;
  text-align: center;
  margin-top: 8px;
  padding: 6px;
  background: rgba(201, 169, 110, 0.1);
  border-radius: var(--radius-sm);
  color: var(--gold-leaf);
  font-weight: 600;
}

/* ===== 分享横幅 ===== */
.share-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  background: linear-gradient(135deg, rgba(192, 57, 43, 0.06), rgba(201, 169, 110, 0.06));
  border-radius: var(--radius-md);
  border: 1px dashed var(--cinnabar);
  margin-bottom: 12px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.85rem;
  color: var(--cinnabar);
}

.share-banner:active {
  transform: scale(0.97);
  background: rgba(192, 57, 43, 0.1);
}

/* ===== 引流入口：今天吃什么 ===== */
.food-entry-card {
  background: linear-gradient(135deg, rgba(192, 57, 43, 0.06), rgba(201, 169, 110, 0.10));
  border: 1px solid rgba(201, 169, 110, 0.3);
  cursor: pointer;
  transition: all 0.3s ease;
  margin-bottom: 16px;
  overflow: hidden;
}

.food-entry-card:active {
  transform: scale(0.98);
  border-color: var(--cinnabar);
}

.food-entry-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
}

.food-entry-icon {
  font-size: 2rem;
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(201, 169, 110, 0.12);
  border-radius: 12px;
}

.food-entry-text {
  flex: 1;
  min-width: 0;
}

.food-entry-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--cinnabar);
  letter-spacing: 1px;
  line-height: 1.4;
}

.food-entry-desc {
  font-size: 0.75rem;
  color: #8B8B8B;
  margin-top: 2px;
}

.food-entry-arrow {
  font-size: 1.2rem;
  color: var(--gold-leaf);
  flex-shrink: 0;
  transition: transform 0.3s ease;
  font-weight: 700;
}

.food-entry-card:active .food-entry-arrow {
  transform: translateX(4px);
}

.food-entry-bottom {
  display: flex;
  gap: 6px;
  padding: 0 16px 12px 16px;
  flex-wrap: wrap;
}

.food-entry-tag {
  font-size: 0.65rem;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(201, 169, 110, 0.1);
  color: #A09070;
  border: 1px solid rgba(201, 169, 110, 0.15);
  white-space: nowrap;
}

.ink-divider-thin {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201, 169, 110, 0.2), transparent);
  margin: 0 16px;
}

/* ===== 炼丹结果页引流入口 ===== */
.food-brew-entry {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 16px 4px;
  padding: 10px 12px;
  background: linear-gradient(135deg, rgba(192, 57, 43, 0.05), rgba(201, 169, 110, 0.08));
  border: 1px solid rgba(201, 169, 110, 0.2);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.food-brew-entry:active {
  background: rgba(192, 57, 43, 0.1);
  transform: scale(0.97);
}

.food-brew-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.food-brew-text {
  flex: 1;
  font-size: 0.8rem;
  color: var(--cinnabar);
  font-weight: 600;
}

.food-brew-arrow {
  font-size: 0.9rem;
  color: var(--gold-leaf);
  flex-shrink: 0;
  transition: transform 0.2s;
}

.food-brew-entry:active .food-brew-arrow {
  transform: translateX(3px);
}

/* ---------- Referral / Footer ---------- */
.home-footer {
  margin-top: 24px;
  margin-bottom: 16px;
}

.referral-card {
  background: linear-gradient(135deg, rgba(107, 142, 78, 0.08), var(--bg-card));
  border: 1px solid rgba(107, 142, 78, 0.2);
  text-align: center;
}

.referral-text {
  font-size: 0.9rem;
  color: #8B8B8B;
}

.footer-credit {
  text-align: center;
  font-size: 0.7rem;
  color: #B8B2A8;
  margin-top: 12px;
  letter-spacing: 2px;
}

/* ===== 回首页动画 ===== */
@keyframes scrollIndicator {
  0%, 100% { transform: translateY(0); opacity: 0.3; }
  50% { transform: translateY(4px); opacity: 0.6; }
}

/* ===== 每日任务 ===== */
.daily-task {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
}
.daily-task:last-child {
  border-bottom: none;
}
.daily-task.done {
  opacity: 0.6;
}
.task-icon {
  font-size: 1.4rem;
  width: 32px;
  text-align: center;
  flex-shrink: 0;
}
.task-info {
  flex: 1;
  min-width: 0;
}
.task-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-black);
  margin-bottom: 4px;
}
.task-progress {
  display: flex;
  align-items: center;
  gap: 6px;
}
.task-bar-bg {
  flex: 1;
  height: 6px;
  background: var(--ink-light);
  border-radius: 3px;
  overflow: hidden;
}
.task-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--herb-green), var(--herb-green-light));
  border-radius: 3px;
  transition: width 0.3s ease;
}
.task-count {
  font-size: 0.7rem;
  color: var(--ink-gray);
  white-space: nowrap;
  min-width: 36px;
  text-align: right;
}
.task-reward {
  font-size: 0.75rem;
  color: var(--gold-leaf);
  background: rgba(212, 167, 74, 0.1);
  padding: 3px 8px;
  border-radius: 10px;
  white-space: nowrap;
  flex-shrink: 0;
}
.daily-all-done {
  text-align: center;
  padding: 12px 0 4px;
  font-size: 0.9rem;
  color: var(--herb-green);
  font-weight: 600;
}

/* ===== 时令加成 ===== */
.season-bonus-inner {
  display: flex;
  align-items: center;
  gap: 12px;
}
.season-icon {
  font-size: 2rem;
  flex-shrink: 0;
}
.season-info {
  flex: 1;
}
.season-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--cinnabar);
  margin-bottom: 2px;
}
.season-desc {
  font-size: 0.8rem;
  color: var(--ink-gray);
}
.season-badge {
  font-size: 0.7rem;
  padding: 3px 10px;
  border-radius: 10px;
  background: var(--cinnabar);
  color: white;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ===== 成就 ===== */
.achieve-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.achieve-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  transition: all 0.2s;
}
.achieve-item.unlocked {
  border-color: var(--gold-leaf);
  background: rgba(212, 167, 74, 0.06);
}
.achieve-item.locked {
  opacity: 0.5;
}
.achieve-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
  width: 28px;
  text-align: center;
}
.achieve-info {
  flex: 1;
  min-width: 0;
}
.achieve-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-black);
}
.achieve-desc {
  font-size: 0.7rem;
  color: var(--ink-gray);
  margin-top: 1px;
}
.achieve-status {
  font-size: 1rem;
  flex-shrink: 0;
}

/* ===== 知识卡片 ===== */
.knowledge-card {
  margin-bottom: 12px;
  transition: all 0.4s ease;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
}
.knowledge-card.show {
  max-height: 300px;
  opacity: 1;
  margin-bottom: 12px;
}
.knowledge-card.hide {
  max-height: 0;
  opacity: 0;
  margin-bottom: 0;
}
.knowledge-inner {
  background: linear-gradient(135deg, rgba(107, 142, 78, 0.08), rgba(107, 142, 78, 0.03));
  border: 1px solid var(--herb-green);
  border-radius: var(--radius-md);
  padding: 16px;
  position: relative;
}
.knowledge-text {
  font-size: 0.85rem;
  line-height: 1.7;
  color: var(--ink-black);
}
.knowledge-source {
  font-size: 0.7rem;
  color: var(--ink-gray-light);
  margin-top: 8px;
  text-align: right;
  font-style: italic;
}

/* ===== 答题入口 ===== */
.quiz-entry-card {
  cursor: pointer;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.quiz-entry-card:active {
  transform: scale(0.97);
}
.quiz-entry-inner {
  display: flex;
  align-items: center;
  gap: 12px;
}
.quiz-entry-icon {
  font-size: 1.8rem;
  flex-shrink: 0;
}
.quiz-entry-text {
  flex: 1;
}
.quiz-entry-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink-black);
  margin-bottom: 2px;
}
.quiz-entry-desc {
  font-size: 0.8rem;
  color: var(--ink-gray);
}
.quiz-entry-arrow {
  font-size: 1.2rem;
  color: var(--ink-gray-light);
}

/* ===== 答题弹窗 ===== */
.quiz-overlay-card {
  max-width: 340px;
}
.quiz-content {
  min-height: 100px;
}
.quiz-card {
  text-align: center;
}
.quiz-question {
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink-black);
  margin-bottom: 16px;
  line-height: 1.5;
}
.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.quiz-opt {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  font-size: 0.9rem;
  color: var(--ink-black);
  cursor: pointer;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.quiz-opt:active {
  transform: scale(0.97);
}
.quiz-opt.correct {
  border-color: var(--herb-green);
  background: rgba(91, 140, 90, 0.15);
  color: var(--herb-green-dark);
}
.quiz-opt.wrong {
  border-color: var(--cinnabar);
  background: rgba(192, 57, 43, 0.1);
  color: var(--cinnabar);
}

/* =============================================
   New Home - 药剂师大厅
   ============================================= */

/* 药剂师令牌 */
.hero-rank-badge {
  display: inline-block;
  padding: 6px 16px;
  background: linear-gradient(135deg, #FFD54F, #FFB300);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  color: #4E342E;
  margin-bottom: 8px;
}

.hero-title {
  font-size: 28px;
  font-weight: 800;
  color: #FFF8E1;
  text-shadow: 0 2px 8px rgba(0,0,0,0.4);
  letter-spacing: 4px;
  margin-bottom: 10px;
}

.hero-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-bottom: 8px;
}

.hero-stat-label {
  font-size: 12px;
  color: rgba(255,248,225,0.7);
}

.hero-stat-num {
  font-size: 28px;
  font-weight: 800;
  color: #FFD54F;
}

.hero-bar-wrap {
  padding: 0 20px;
  margin-bottom: 6px;
}

.hero-bar {
  height: 6px;
  background: rgba(255,255,255,0.2);
  border-radius: 4px;
  overflow: hidden;
}

.hero-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #FFD54F, #FF8F00);
  border-radius: 4px;
  transition: width 0.5s ease;
}

/* 药方挑战入口卡片 */
.challenge-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: #FFF;
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 12px;
}

.challenge-card:active {
  transform: scale(0.97);
  box-shadow: 0 1px 4px rgba(0,0,0,0.12);
}

.challenge-card-icon {
  font-size: 32px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #FFF8E1, #FFECB3);
  border-radius: 12px;
}

.challenge-card-info {
  flex: 1;
}

.challenge-card-title {
  font-size: 16px;
  font-weight: 700;
  color: #4E342E;
}

.challenge-card-desc {
  font-size: 12px;
  color: #8D6E63;
  margin-top: 2px;
}

.challenge-card-arrow {
  font-size: 18px;
  color: #BCAAA4;
}

/* 分类成就区 */
.achieve-section {
  margin: 0 0 12px;
}

.section-title {
  font-size: 14px;
  font-weight: 600;
  color: #5D4037;
  margin-bottom: 8px;
  padding: 0 4px;
}

.achieve-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.achieve-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 4px;
  background: #FAFAF5;
  border: 2px solid #E8E0D4;
  border-radius: 12px;
  transition: all 0.3s;
}

.achieve-icon {
  font-size: 22px;
  line-height: 1;
}

.achieve-name {
  font-size: 11px;
  font-weight: 600;
  color: #5D4037;
}

.achieve-bar {
  width: 100%;
  height: 4px;
  background: #E8E0D4;
  border-radius: 2px;
  overflow: hidden;
}

.achieve-fill {
  height: 100%;
  background: #A5D6A7;
  border-radius: 2px;
  transition: width 0.5s ease;
}

.achieve-card[data-achieve] .achieve-fill {
  width: 0%;
}

.achieve-count {
  font-size: 10px;
  color: #8D6E63;
}

/* 英雄区点击改为cursor */
.home-hero {
  cursor: pointer;
  transition: transform 0.2s;
}

.home-hero:active {
  transform: scale(0.98);
}

/* 满成就样式 */
.achieve-card.done {
  background: #E8F5E9;
  border-color: #66BB6A;
}

.achieve-card.partial {
  background: #FFF8E1;
  border-color: #FFD54F;
}
