/* ===== AlMuslimPlus 风格 v3（实测配色 + 原版布局） ===== */
@font-face { font-family: "Nunito"; src: url("fonts/Nunito-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Nunito"; src: url("fonts/Nunito-Medium.ttf") format("truetype"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Nunito"; src: url("fonts/Nunito-SemiBold.ttf") format("truetype"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Nunito"; src: url("fonts/Nunito-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Nunito"; src: url("fonts/Nunito-ExtraBold.ttf") format("truetype"); font-weight: 800; font-display: swap; }

:root {
  --bg: #E6DFD2;
  --surface: #FDFAF4;
  --card: #FFFDFC;
  --primary: #234C2E;
  --primary-2: #275332;
  --sage: #D6E0D8;
  --sage-2: #E5EFE7;
  --gold: #CE9E4A;
  --gold-2: #E9C46A;
  --gold-soft: #FCEEC3;
  --orange: #9C4A0F;
  --purple: #6555C3;
  --mint: #AFC8B5;
  --mint-2: #89A389;
  --ink: #23211F;
  --muted: #8A8886;
  --line: #E7E1D6;
  --shadow: 0 12px 32px rgba(35,45,30,.14);
  --shadow-sm: 0 6px 18px rgba(35,45,30,.07);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  font-family: "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-tap-highlight-color: transparent;
  min-height: 100vh;
}

/* ===== 顶部条 ===== */
.app-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(230, 223, 210, .92);
  backdrop-filter: blur(10px);
  padding: 10px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mark { width: 40px; height: 40px; border-radius: 12px; object-fit: cover; flex: none; box-shadow: var(--shadow-sm); }
.brand h1 { margin: 0; font-size: 17px; font-weight: 800; color: var(--primary); line-height: 1.1; }
.brand p { margin: 1px 0 0; font-size: 11.5px; color: var(--muted); font-weight: 700; }
.lang-toggle {
  border: 1px solid var(--line); background: var(--surface); color: var(--primary);
  font-weight: 800; font-size: 12.5px; padding: 8px 12px; border-radius: 12px; cursor: pointer; font-family: inherit;
}

main { max-width: 520px; margin: 0 auto; padding: 12px 16px 118px; }

/* ===== 位置栏 ===== */
.location-bar {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 16px; padding: 8px 12px; margin-bottom: 12px; box-shadow: var(--shadow-sm);
}
.location-bar label { font-size: 12px; color: var(--muted); font-weight: 700; }
.location-bar select { flex: 1; min-width: 0; border: none; background: transparent; font-size: 15px; font-weight: 700; color: var(--ink); padding: 6px 4px; font-family: inherit; }
.location-bar button {
  border: none; background: var(--primary); color: #fff;
  font-weight: 700; font-size: 12.5px; padding: 9px 13px; border-radius: 11px; cursor: pointer; font-family: inherit;
}

/* ===== 首页问候 ===== */
.greeting { padding: 6px 4px 14px; }
.eyebrow { margin: 0; font-size: 14px; font-weight: 700; color: var(--primary); letter-spacing: .3px; }
.greeting-title { margin: 2px 0 0; font-size: 30px; font-weight: 800; color: var(--primary); letter-spacing: .2px; line-height: 1.08; }

/* ===== 深绿英雄卡 ===== */
.hero {
  border-radius: 28px;
  padding: 20px;
  background: linear-gradient(150deg, #214E2C 0%, #275332 100%);
  color: #fff;
  box-shadow: 0 14px 34px rgba(20,40,25,.28);
  margin-bottom: 14px;
}
.hero-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.hero-clock { font-size: 46px; font-weight: 800; color: var(--mint); line-height: 1; font-variant-numeric: tabular-nums; }
.hero-chip { font-size: 10.5px; font-weight: 800; color: var(--primary); background: var(--gold); padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.hero-app { margin: 8px 0 0; font-size: 17px; font-weight: 700; color: #fff; }
.hero-arabic { margin: 4px 0 0; font-size: 13px; color: var(--mint-2); font-weight: 600; }
.hero-next { display: flex; align-items: baseline; gap: 8px; margin-top: 14px; }
.hero-next-label { font-size: 11.5px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: #EEF7E8; }
.hero-next-name { font-size: 20px; font-weight: 800; color: #fff; }
.hero-next-time { font-size: 22px; font-weight: 800; color: var(--mint-2); font-variant-numeric: tabular-nums; }
.hero-count { margin: 4px 0 0; font-size: 15px; font-weight: 700; color: var(--mint); font-variant-numeric: tabular-nums; }
.hero-actions { margin-top: 14px; }
.hero-btn {
  border: none; background: var(--gold); color: #3F3512;
  font-weight: 800; font-size: 13px; padding: 10px 18px; border-radius: 999px; cursor: pointer; font-family: inherit;
}
.hero-fasting {
  margin-top: 14px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: #275032; border-radius: 16px; padding: 12px 14px;
  font-size: 12.5px; font-weight: 700; color: #A8BEAB;
}
.hero-fasting-cta {
  border: none; background: var(--gold-soft); color: #6B5420;
  font-weight: 800; font-size: 12px; padding: 7px 12px; border-radius: 999px; cursor: pointer; font-family: inherit; white-space: nowrap;
}
.ramadan-note { margin: 10px 2px 0; font-size: 12px; font-weight: 600; color: var(--mint); }

/* ===== 橙色学习卡 ===== */
.learn-card {
  border-radius: 24px; padding: 18px;
  background: linear-gradient(145deg, #A5500F, #8F430E);
  color: #F5DEBE; box-shadow: var(--shadow);
  margin-bottom: 14px;
}
.learn-card h2 { margin: 0; font-size: 22px; font-weight: 800; color: #F5DEBE; }
.learn-desc { margin: 6px 0 12px; font-size: 12.5px; font-weight: 700; color: #E3B583; }
.learn-stats { display: flex; gap: 18px; margin-bottom: 14px; }
.learn-stats span { display: flex; flex-direction: column; gap: 1px; }
.learn-stats b { font-size: 11.5px; font-weight: 800; color: #E3B583; text-transform: uppercase; letter-spacing: .4px; }
.learn-stats em { font-style: normal; font-size: 19px; font-weight: 800; color: #F5DEBE; }
.learn-btn {
  border: none; background: var(--gold-soft); color: #6B5420;
  font-weight: 800; font-size: 13px; padding: 10px 16px; border-radius: 999px; cursor: pointer; font-family: inherit;
}

/* ===== 快捷瓷砖 ===== */
.quick-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.quick-tiles button {
  border: none; border-radius: 18px; padding: 18px 6px 16px;
  font-size: 13px; font-weight: 800; color: #fff; cursor: pointer; font-family: inherit;
  box-shadow: var(--shadow-sm);
}
.quick-tiles button:nth-child(1) { background: linear-gradient(150deg, #1E4228, #275332); }
.quick-tiles button:nth-child(2) { background: linear-gradient(150deg, #2B5736, #386C43); }
.quick-tiles button:nth-child(3) { background: linear-gradient(150deg, #6555C3, #7B6BD6); }

/* ===== 分区标题 ===== */
.section-title { display: flex; align-items: baseline; justify-content: space-between; margin: 2px 4px 10px; }
.section-title h3 { margin: 0; font-size: 16px; font-weight: 800; color: var(--primary); }
.section-title span { font-size: 12px; color: var(--muted); font-weight: 700; }

/* ===== 祈祷列表 ===== */
.prayer-list {
  list-style: none; margin: 0; padding: 6px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 24px; box-shadow: var(--shadow-sm); overflow: hidden;
}
.prayer-list li {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 16px; border-radius: 16px;
}
.prayer-list li + li { margin-top: 2px; }
.prayer-list li.next { background: var(--sage-2); }
.p-name { display: flex; flex-direction: column; gap: 2px; }
.p-name strong { font-size: 15px; font-weight: 700; color: var(--ink); }
.p-name span { font-size: 11.5px; color: var(--muted); font-weight: 700; }
.p-time { display: flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--primary); }
.prayer-list li.next .p-name strong, .prayer-list li.next .p-time { color: var(--primary); }
.prayer-list li.next .p-time::after {
  content: "NEXT"; font-size: 10px; font-weight: 800; letter-spacing: .5px;
  color: var(--primary); background: var(--gold); padding: 3px 7px; border-radius: 999px;
}

/* ===== 底部胶囊导航 ===== */
.tabs {
  position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%);
  width: calc(100% - 32px); max-width: 460px; z-index: 40;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: #FFFFFF; border-radius: 999px;
  padding: 7px; gap: 2px;
  box-shadow: 0 12px 30px rgba(0,0,0,.12);
}
.tab {
  border: none; background: transparent;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 7px 2px; border-radius: 999px;
  font-size: 10px; font-weight: 700; color: #CAC8C6; cursor: pointer; font-family: inherit;
}
.tab .ico { font-size: 19px; line-height: 1; }
.tab.active { background: var(--sage); color: #566759; }
.tab.active .ico { transform: translateY(-1px); }

/* ===== Qibla ===== */
.qibla-wrap { text-align: center; padding-top: 4px; }
.qibla-wrap h3 { margin: 0 0 6px; font-size: 18px; font-weight: 800; color: var(--primary); }
.qibla-sub { margin: 0 0 18px; font-size: 12.5px; color: var(--muted); font-weight: 700; }
.compass {
  width: 240px; height: 240px; margin: 0 auto;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 40%, #FBF8EF, #EFE4C8);
  border: 12px solid #EFE4C8;
  box-shadow: inset 0 0 30px rgba(206,158,74,.28), var(--shadow);
  position: relative; overflow: hidden;
}
.compass-dial { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; opacity: .9; }
.compass-n { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); font-size: 12px; font-weight: 800; color: var(--primary); z-index: 2; }
.compass-needle {
  position: absolute; left: 50%; top: 50%; width: 6px; height: 92px; margin: -92px 0 0 -3px;
  border-radius: 6px; background: linear-gradient(#3672BB, #2E6FBD);
  transform-origin: 50% 92px; transition: transform .5s ease; z-index: 3;
}
.compass-needle::after {
  content: ""; position: absolute; left: -7px; top: -2px; width: 0; height: 0;
  border-left: 10px solid transparent; border-right: 10px solid transparent; border-top: 20px solid #3672BB;
}
.kaaba {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--primary); border: 3px solid #fff; box-shadow: 0 0 0 4px var(--gold); z-index: 4;
}
.qibla-deg { margin: 18px 0 4px; font-size: 26px; font-weight: 800; color: var(--primary); }
.qibla-deg small { font-size: 13px; color: var(--muted); font-weight: 700; }
.qibla-hint { margin: 0 auto; max-width: 290px; font-size: 12.5px; color: var(--muted); font-weight: 700; line-height: 1.5; }
.compass-btn {
  margin-top: 14px; border: none; background: var(--primary); color: #fff;
  font-weight: 700; padding: 12px 20px; border-radius: 14px; cursor: pointer; font-family: inherit;
  box-shadow: 0 6px 14px rgba(35,76,46,.25);
}
.compass-status { min-height: 18px; font-size: 12.5px; color: var(--muted); margin: 10px 0 0; font-weight: 700; }

/* ===== 日历 ===== */
.events-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 20px; padding: 14px 16px; margin-bottom: 14px; box-shadow: var(--shadow-sm);
}
.events-card h4 { margin: 0 0 8px; font-size: 14px; font-weight: 800; color: var(--primary); }
.events-list { list-style: none; margin: 0; padding: 0; }
.events-list li {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; font-weight: 700;
}
.events-list li:last-child { border-bottom: none; }
.events-list .ev-date { color: var(--muted); font-size: 12px; white-space: nowrap; font-weight: 700; }
.cal-nav {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 18px; padding: 8px; margin-bottom: 12px; box-shadow: var(--shadow-sm);
}
.cal-nav h3 { margin: 0; font-size: 15px; font-weight: 800; color: var(--primary); }
.cal-nav button {
  border: none; background: var(--sage); color: var(--primary);
  width: 38px; height: 38px; border-radius: 12px; font-size: 20px; cursor: pointer; font-family: inherit; font-weight: 800;
}
.week-days, .month-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.week-days { margin-bottom: 6px; }
.week-days span { text-align: center; font-size: 11.5px; color: var(--muted); font-weight: 800; text-transform: uppercase; }
.month-grid { margin-bottom: 14px; }
.day {
  border: 1px solid var(--line); background: var(--card);
  border-radius: 12px; aspect-ratio: 1; font-size: 14px; color: var(--ink);
  cursor: pointer; font-family: inherit; font-weight: 700;
}
.day.empty { background: transparent; border: none; cursor: default; }
.day.today { border-color: var(--gold); color: var(--primary); font-weight: 800; background: var(--gold-soft); }
.day.selected { background: var(--primary); color: #fff; border-color: var(--primary); font-weight: 800; }
.day-title { margin: 0 0 8px; font-size: 15px; font-weight: 800; color: var(--primary); }

/* ===== 设置 ===== */
.field {
  display: flex; flex-direction: column; gap: 8px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 18px; padding: 14px 16px; margin-bottom: 12px;
  font-size: 14px; font-weight: 700; box-shadow: var(--shadow-sm);
}
.field select {
  border: 1px solid var(--line); border-radius: 12px; padding: 11px;
  font-size: 15px; color: var(--ink); background: #fff; font-family: inherit; font-weight: 700;
}
.field.checkbox { flex-direction: row; align-items: center; gap: 10px; }
.field.checkbox input { width: 20px; height: 20px; accent-color: var(--primary); }
.hint { font-size: 12.5px; color: var(--muted); line-height: 1.5; margin: 4px 2px; font-weight: 700; }
.adhan-test {
  margin: -2px 0 12px; border: none; background: var(--gold); color: #3F3512;
  font-weight: 800; padding: 11px 18px; border-radius: 12px; cursor: pointer; font-family: inherit;
}

/* ===== Tasbih ===== */
.tasbih-head { margin: 4px 2px 14px; }
.tasbih-head h2 { margin: 0; font-size: 22px; font-weight: 800; color: var(--primary); }
.tasbih-head p { margin: 2px 0 0; font-size: 13px; color: var(--muted); font-weight: 700; }

.dhikr-chips {
  display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 14px;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.dhikr-chips::-webkit-scrollbar { display: none; }
.dhikr-chips .chip {
  flex: none; border: 1px solid var(--line); background: var(--card);
  color: var(--ink); font-weight: 700; font-size: 13px;
  padding: 9px 14px; border-radius: 999px; cursor: pointer; font-family: inherit; white-space: nowrap;
}
.dhikr-chips .chip.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.tasbih-stage { display: flex; justify-content: center; margin-bottom: 16px; }
.tasbih-btn {
  width: 220px; height: 220px; border-radius: 50%;
  border: 10px solid var(--gold-soft);
  background: radial-gradient(circle at 50% 38%, #2E5C3A, #214E2C);
  color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  box-shadow: 0 16px 40px rgba(20,40,25,.32), inset 0 0 0 4px rgba(255,255,255,.06);
  cursor: pointer; font-family: inherit;
  transition: transform .08s ease, box-shadow .2s ease;
}
.tasbih-btn:active { transform: scale(.96); box-shadow: 0 8px 20px rgba(20,40,25,.28); }
.tasbih-count { font-size: 64px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.tasbih-dhikr { font-size: 15px; font-weight: 700; color: var(--gold-2); }
.tasbih-goal-text { font-size: 12px; font-weight: 700; color: var(--mint); }
.tasbih-btn.done {
  background: radial-gradient(circle at 50% 38%, #B8892E, #8F691E);
  border-color: #FCEEC3;
}

.tasbih-goals { display: flex; justify-content: center; gap: 8px; margin-bottom: 12px; }
.tasbih-goals .goal {
  min-width: 56px; padding: 9px 12px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  font-weight: 800; font-size: 14px; cursor: pointer; font-family: inherit;
}
.tasbih-goals .goal.active { background: var(--gold); border-color: var(--gold); color: #3F3512; }
.tasbih-reset {
  display: block; margin: 0 auto 16px; border: none; background: var(--sage);
  color: var(--primary); font-weight: 800; padding: 10px 20px; border-radius: 12px; cursor: pointer; font-family: inherit;
}

/* ===== Dua / Hadith ===== */
.dua-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 22px; padding: 18px; box-shadow: var(--shadow-sm);
  text-align: center; margin-top: 8px;
}
.dua-card h3 { margin: 0 0 12px; font-size: 15px; font-weight: 800; color: var(--primary); }
.dua-arabic { margin: 0 0 10px; font-size: 22px; font-weight: 700; color: var(--primary); line-height: 1.6; direction: rtl; }
.dua-local { margin: 0 0 14px; font-size: 14px; color: var(--ink); font-weight: 600; line-height: 1.5; }
.dua-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-top: 1px solid var(--line); padding-top: 12px; }
.dua-source { font-size: 12px; color: var(--muted); font-weight: 700; }
.dua-next {
  border: none; background: var(--primary); color: #fff;
  font-weight: 700; padding: 8px 16px; border-radius: 999px; cursor: pointer; font-family: inherit; font-size: 12.5px;
}

.panel { display: none; }
.panel.active { display: block; animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

[dir="rtl"] .hero-top, [dir="rtl"] .hero-next, [dir="rtl"] .hero-fasting { flex-direction: row-reverse; }

/* ===== 首页插画 + 细节 v3.1 ===== */
.home-hero { position: relative; margin-bottom: 14px; }
.home-illus { width: 100%; height: 174px; object-fit: cover; border-radius: 22px; display: block; box-shadow: var(--shadow-sm); }
.greeting {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 12px 16px 14px;
}
.greeting .eyebrow { color: #4A4434; }
.greeting-title { color: #2E4734; font-size: 26px; text-shadow: 0 1px 0 rgba(255,255,255,.55); }

.hero { position: relative; }
.hero::before {
  content: ""; position: absolute; left: 22px; top: 0;
  width: 64px; height: 3px; border-radius: 0 0 6px 6px; background: var(--gold);
}
.hero::after {
  content: ""; position: absolute; right: -30px; bottom: -30px;
  width: 150px; height: 150px; border-radius: 50%;
  background: radial-gradient(circle, rgba(206,158,74,.25), transparent 65%);
  pointer-events: none;
}

.quick-tiles button { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 18px 6px 15px; }
.quick-tiles svg { width: 27px; height: 27px; }

.tab .ico { display: flex; align-items: center; justify-content: center; }
.tab .ico svg { width: 21px; height: 21px; }

