:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --text: #1f2a44;
  --muted: #6b7384;
  --primary: #4ec7b9;
  --primary-strong: #2ca399;
  --border: #e3e7ee;
  --success: #7dd45b;
  --info: #5aa6ff;
  --warn: #f9b640;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Inter", "PingFang SC", system-ui, -apple-system, sans-serif;
  background: #f5f5f5;
  color: var(--text);
  padding-bottom: 80px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.app-shell {
  max-width: 414px;
  margin: 0 auto;
  padding: 0;
  background: #ffffff;
  min-height: 100vh;
  position: relative;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.1);
}

.hero {
  background: #ffffff;
  border: none;
  border-radius: 0;
  padding: 16px 20px;
  margin-bottom: 0;
}

.hero__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.hero__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.hero__chips {
  margin-top: 10px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.meta-time {
  color: var(--muted);
  margin: 0 0 8px;
  font-size: 14px;
}

h1 {
  font-size: 24px;
  font-weight: 600;
  margin: 0 0 4px;
}

.meta-desc {
  color: var(--muted);
  margin: 4px 0 0;
  font-size: 14px;
}

/* 页面视图系统 */
.page-content {
  min-height: calc(100vh - 70px);
  padding-bottom: 90px;
}

.page-header {
  background: #ffffff;
  padding: 16px 20px 12px;
  border-bottom: 1px solid #f0f0f0;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.page-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

.section {
  margin: 0;
  background: #ffffff;
  border: none;
  border-radius: 0;
  padding: 20px;
  box-shadow: none;
  border-top: 1px solid #f0f0f0;
}

.section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.head__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.eyebrow {
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 0 0 2px;
}

h1, h2, h3 {
  margin: 0;
  font-weight: 600;
}

h2 {
  font-size: 18px;
  margin-bottom: 12px;
}

h3 {
  font-size: 16px;
}

.grid.two {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.card {
  background: var(--card);
  border: none;
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  margin-bottom: 0;
}

.poster {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.poster__preview {
  position: relative;
  height: 240px;
  border-radius: 12px;
  padding: 16px;
  color: #ffffff;
  background: linear-gradient(145deg, #2f3f65, #1c2436);
  overflow: hidden;
}

.poster__meta {
  position: absolute;
  inset: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.poster__date {
  margin: 0 0 6px;
  opacity: 0.82;
}

.poster__title {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 6px;
}

.poster__quote {
  margin: 0;
  line-height: 1.5;
  max-width: 220px;
}

.poster__qr {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  align-self: flex-end;
  overflow: hidden;
}

.poster__qr svg {
  width: 100%;
  height: 100%;
}

.poster__controls {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mood-section {
  margin-bottom: 16px;
}

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

.mood-header h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
}

.mood-link {
  font-size: 12px;
  color: var(--primary);
  text-decoration: none;
}

.mood-row {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  flex-wrap: wrap;
}

.mood-circle {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 0;
  border-radius: 0;
  background: transparent;
  transition: all 0.2s;
  flex: 1;
}

.mood-emoji {
  font-size: 36px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f5f5f5;
  border: 3px solid transparent;
  transition: all 0.2s;
}

.mood-label {
  font-size: 12px;
  color: #666;
  font-weight: 500;
}

.mood-circle.active .mood-emoji {
  background: #fff;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(78, 199, 185, 0.2);
}

.mood-circle.active .mood-label {
  color: var(--primary);
  font-weight: 600;
}

.input-row {
  display: flex;
  gap: 8px;
  margin: 16px 0;
}

input, textarea, select {
  width: 100%;
  border-radius: 12px;
  border: 1px solid #e8e8e8;
  padding: 12px 16px;
  font-family: inherit;
  background: #f8f8f8;
  font-size: 14px;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  background: #fff;
}

.icon-btn {
  border: none;
  background: var(--primary);
  color: #fff;
  border-radius: 12px;
  padding: 0 20px;
  cursor: pointer;
  font-weight: 700;
  font-size: 14px;
  min-width: 48px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.icon-btn:hover {
  background: var(--primary-strong);
  transform: scale(1.05);
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin: 10px 0 6px;
}

.stat {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 12px;
  border: none;
}

.stat p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.stat strong {
  font-size: 18px;
}

.chip-group, .filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 12px 0;
  overflow-x: auto;
  padding: 4px 0;
  -webkit-overflow-scrolling: touch;
}

.chip-group::-webkit-scrollbar,
.filters::-webkit-scrollbar {
  display: none;
}

.pill {
  border-radius: 999px;
  border: 1px solid #e8e8e8;
  background: #fff;
  padding: 8px 16px;
  cursor: pointer;
  font-weight: 500;
  color: var(--text);
  font-size: 14px;
  transition: all 0.2s;
}

.pill:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.pill.small {
  padding: 6px 10px;
  font-size: 12px;
}

.pill.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.pill:not(.primary) {
  background: #fff;
  border-color: #e8e8e8;
  color: var(--text);
}

.pill.ghost {
  background: #f2f5fa;
}

.chip, .tag {
  padding: 6px 10px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 12px;
}

.chip.success { background: #e6f8ec; color: #2fa06c; }
.chip.info { background: #e7f0ff; color: #2e74ff; }
.chip.warn { background: #fff4e6; color: #d28c14; }
.chip.neutral { background: #f0f3f8; color: #60708f; }

.search {
  max-width: 260px;
}

.list {
  display: grid;
  gap: 10px;
}

.list .item {
  border: 1px solid #f0f0f0;
  border-radius: 16px;
  padding: 16px;
  background: #fff;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: all 0.2s;
}

.list .item:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.course-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.healing-card-main:hover,
.healing-card-small:hover {
  transform: scale(1.02);
}

.item__meta p {
  margin: 0;
  color: var(--muted);
}

.item__meta h4 {
  margin: 4px 0 6px;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
}

.item__badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.item button {
  align-self: center;
  height: fit-content;
}

.profile__info {
  display: flex;
  gap: 12px;
  align-items: center;
}

.avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 20px;
}

.profile__stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 8px;
  margin: 10px 0;
}

.profile__stats p {
  margin: 0;
  color: var(--muted);
}

.profile__links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 414px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
  background: #ffffff;
  border-top: 1px solid #f0f0f0;
  padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.04);
  z-index: 100;
  backdrop-filter: blur(10px);
}

.nav-btn {
  border: none;
  background: none;
  padding: 8px 4px 6px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  font-size: 0;
  color: #999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: all 0.2s;
  position: relative;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.nav-btn:hover {
  background: #f5f5f5;
}

.nav-btn.active {
  color: var(--primary);
  font-weight: 600;
}

.nav-btn.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 32px;
  height: 3px;
  background: var(--primary);
  border-radius: 0 0 3px 3px;
}

/* 当前页面高亮 */
.bottom-nav a[href*="index.html"].active,
.bottom-nav a[href="index.html"].active,
body[data-page="home"] .bottom-nav a[href="index.html"],
body[data-page="articles"] .bottom-nav a[href="articles.html"],
body[data-page="assess"] .bottom-nav a[href="assess.html"],
body[data-page="counselors"] .bottom-nav a[href="counselors.html"],
body[data-page="profile"] .bottom-nav a[href="profile.html"] {
  color: var(--primary);
  font-weight: 600;
}

body[data-page="home"] .bottom-nav a[href="index.html"]::before,
body[data-page="articles"] .bottom-nav a[href="articles.html"]::before,
body[data-page="assess"] .bottom-nav a[href="assess.html"]::before,
body[data-page="counselors"] .bottom-nav a[href="counselors.html"]::before,
body[data-page="profile"] .bottom-nav a[href="profile.html"]::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 32px;
  height: 3px;
  background: var(--primary);
  border-radius: 0 0 3px 3px;
}

.nav-icon {
  font-size: 22px;
  line-height: 1;
  transition: transform 0.2s;
}

.nav-btn.active .nav-icon {
  transform: scale(1.1);
}

.nav-label {
  font-size: 11px;
  white-space: nowrap;
}

.bottom-nav button {
  border: none;
  background: none;
  padding: 8px 4px;
  border-radius: 0;
  cursor: pointer;
  font-weight: 500;
  font-size: 12px;
  color: #999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.bottom-nav button::before {
  content: '';
  width: 22px;
  height: 22px;
  border-radius: 4px;
  background: #d0d0d0;
}

.bottom-nav button.primary {
  background: none;
  color: var(--primary);
  font-weight: 600;
}

.bottom-nav button.primary::before {
  background: var(--primary);
  opacity: 0.8;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(14, 23, 43, 0.46);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 1000;
}

.modal.show { display: flex; }

.modal__content {
  background: #fff;
  border-radius: 14px;
  padding: 20px;
  width: min(90%, 360px);
  max-width: 360px;
  box-shadow: 0 14px 24px rgba(0, 0, 0, 0.12);
  margin: 0 auto;
  position: relative;
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal__body {
  margin: 12px 0;
  color: var(--muted);
  line-height: 1.6;
}

.modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.hint {
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

.actions-end {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}

.record-item {
  padding: 12px;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.record-item:last-child {
  border-bottom: none;
}

.record-date {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 100px;
}

.record-date strong {
  font-size: 14px;
  color: var(--text);
}

.record-date span {
  font-size: 12px;
  color: var(--muted);
}

.record-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  margin-left: 12px;
  align-items: flex-end;
}

.record-mood {
  font-size: 12px;
  padding: 4px 8px;
  background: #e6fbf7;
  color: var(--primary);
  border-radius: 8px;
  font-weight: 600;
}

.record-note {
  font-size: 12px;
  color: var(--muted);
  text-align: right;
}

@media (max-width: 720px) {
  .hero__meta { flex-direction: column; align-items: flex-start; }
  .section { padding: 14px; }
  .list .item { grid-template-columns: 1fr; }
}

/* 移动端优化 */
@media (min-width: 415px) {
  .app-shell {
    margin-top: 20px;
    margin-bottom: 20px;
  }
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

