/* MoodCare｜干净、克制、轻微温暖感 */

:root {
  --bg: #fbf9f6;
  --surface: #ffffff;
  --surface-soft: #f6f2ec;
  --border: #e7e0d8;
  --border-strong: #d8cfc4;
  --text: #2f2a26;
  --text-muted: #6f6862;
  --text-faint: #9a928a;
  --primary: #c07a55;
  --primary-hover: #a96644;
  --primary-soft: #fbf0e8;
  --danger: #b8503f;
  --danger-soft: #fcefec;
  --ok: #4d7a62;
  --ok-soft: #eef5f0;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(47, 42, 38, 0.04), 0 8px 24px rgba(47, 42, 38, 0.05);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ---------------------------------------------------------------- layout */

.wrap {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 0 20px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 20px;
  padding-bottom: 20px;
}

.brand {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text);
}

.brand:hover {
  text-decoration: none;
}

.brand-dot {
  color: var(--primary);
}

.nav {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 14px;
}

.nav a {
  color: var(--text-muted);
}

.nav a.active {
  color: var(--text);
  font-weight: 500;
}

.nav .who {
  color: var(--text-faint);
  font-size: 13px;
}

main {
  padding-bottom: 72px;
}

/* ---------------------------------------------------------------- hero */

.hero {
  padding: 8px 0 22px;
}

.hero h1 {
  margin: 0 0 10px;
  font-size: 26px;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.hero p {
  margin: 0 0 8px;
  color: var(--text-muted);
}

.boundary {
  display: inline-block;
  margin-top: 6px;
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--text-muted);
  font-size: 13px;
}

/* ---------------------------------------------------------------- card */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  margin-bottom: 20px;
}

.card h2 {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 600;
}

.card .hint {
  margin: 0 0 16px;
  color: var(--text-faint);
  font-size: 13px;
}

.field {
  margin-bottom: 20px;
}

.field:last-child {
  margin-bottom: 0;
}

.label {
  display: block;
  margin-bottom: 9px;
  font-size: 14px;
  font-weight: 500;
}

.label .opt {
  color: var(--text-faint);
  font-weight: 400;
  font-size: 13px;
}

/* ---------------------------------------------------------------- chips */

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

.chip {
  padding: 8px 15px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

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

.chip[aria-pressed="true"] {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary-hover);
  font-weight: 500;
}

/* ---------------------------------------------------------------- intensity */

.scale {
  display: flex;
  gap: 8px;
}

.scale button {
  flex: 1;
  min-width: 0;
  padding: 11px 0;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 15px;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

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

.scale button[aria-pressed="true"] {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary-hover);
  font-weight: 600;
}

.scale-legend {
  display: flex;
  justify-content: space-between;
  margin-top: 7px;
  color: var(--text-faint);
  font-size: 12px;
}

/* ---------------------------------------------------------------- textarea */

textarea,
input[type="text"],
input[type="password"] {
  display: block;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  line-height: 1.65;
  resize: vertical;
}

textarea {
  min-height: 132px;
}

textarea:focus,
input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.counter {
  margin-top: 6px;
  text-align: right;
  color: var(--text-faint);
  font-size: 12px;
}

.counter.over {
  color: var(--danger);
}

/* ---------------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 20px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, opacity 0.15s;
}

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

.btn.primary:hover:not(:disabled) {
  background: var(--primary-hover);
}

.btn.ghost {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--text-muted);
}

.btn.ghost:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
}

.btn.danger {
  background: var(--surface);
  border-color: #e6c8c2;
  color: var(--danger);
}

.btn.danger:hover:not(:disabled) {
  background: var(--danger-soft);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

/* ---------------------------------------------------------------- states */

.msg {
  margin: 14px 0 0;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
}

.msg.error {
  background: var(--danger-soft);
  border: 1px solid #efd3cd;
  color: var(--danger);
}

.msg.ok {
  background: var(--ok-soft);
  border: 1px solid #d5e5db;
  color: var(--ok);
}

.msg.info {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

@media (prefers-reduced-motion: reduce) {
  .spinner {
    animation-duration: 2s;
  }
}

.skeleton {
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, #f0ebe4, #f7f3ee, #f0ebe4);
  background-size: 200% 100%;
  animation: shimmer 1.3s ease-in-out infinite;
  margin-bottom: 10px;
}

@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}

/* ---------------------------------------------------------------- result */

.result h2 {
  margin-bottom: 14px;
}

.block {
  padding: 16px 0;
  border-top: 1px solid var(--border);
}

.block:first-of-type {
  border-top: none;
  padding-top: 0;
}

.block-title {
  margin: 0 0 8px;
  color: var(--text-faint);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.block p {
  margin: 0;
}

.block ul {
  margin: 0;
  padding-left: 20px;
}

.block li {
  margin-bottom: 6px;
}

.trigger {
  margin-bottom: 14px;
}

.trigger:last-child {
  margin-bottom: 0;
}

.trigger .t {
  font-weight: 500;
}

.trigger .b {
  color: var(--text-muted);
  font-size: 14px;
}

.self-report {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-soft);
  font-size: 13px;
  color: var(--text-muted);
}

.tag {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 7px;
  border-radius: 4px;
  background: var(--primary-soft);
  color: var(--primary-hover);
  font-size: 11px;
  vertical-align: 1px;
}

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

.action-item {
  display: flex;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}

.action-item .idx {
  flex: 0 0 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

.action-item .body {
  min-width: 0;
}

.action-item .title {
  font-weight: 600;
  margin-bottom: 2px;
}

.action-item .desc {
  color: var(--text-muted);
  font-size: 14px;
}

.action-item .mins {
  margin-top: 5px;
  color: var(--text-faint);
  font-size: 12px;
}

.disclaimer {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
  color: var(--text-faint);
  font-size: 12px;
}

/* ---------------------------------------------------------------- safety */

.safety-card {
  border: 1px solid #e8c9c0;
  background: #fdf6f4;
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 20px;
}

.safety-card h2 {
  margin: 0 0 12px;
  font-size: 17px;
  color: #8f4433;
}

.safety-card p {
  margin: 0 0 12px;
  white-space: pre-line;
}

.safety-card .hotline {
  padding: 12px 14px;
  border: 1px solid #e8c9c0;
  border-radius: var(--radius-sm);
  background: #fff;
  font-size: 14px;
  color: #7a3b2c;
}

.safety-card .hotline strong {
  font-weight: 600;
}

/* ---------------------------------------------------------------- list */

.list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.entry {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  margin-bottom: 12px;
  overflow: hidden;
}

.entry-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  cursor: pointer;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
  color: inherit;
}

.entry-head:hover {
  background: var(--surface-soft);
}

.entry-meta {
  min-width: 0;
}

.entry-date {
  color: var(--text-faint);
  font-size: 12px;
  margin-bottom: 5px;
}

.entry-mood {
  font-weight: 600;
  font-size: 15px;
}

.entry-summary {
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.intensity-badge {
  flex: 0 0 auto;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-hover);
  font-size: 12px;
  white-space: nowrap;
}

.entry-body {
  padding: 0 18px 18px;
  border-top: 1px solid var(--border);
}

.entry-body .full-text {
  margin: 14px 0 0;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 14px;
}

/* ---------------------------------------------------------------- empty */

.empty {
  padding: 52px 20px;
  text-align: center;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text-muted);
}

.empty .big {
  font-size: 30px;
  margin-bottom: 10px;
}

/* ---------------------------------------------------------------- auth page */

.auth-wrap {
  max-width: 400px;
  margin: 0 auto;
  padding: 40px 20px 80px;
}

.auth-head {
  text-align: center;
  margin-bottom: 26px;
}

.auth-head h1 {
  margin: 0 0 8px;
  font-size: 24px;
}

.auth-head p {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
}

.tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  margin-bottom: 20px;
}

.tabs button {
  flex: 1;
  padding: 9px 0;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.tabs button[aria-selected="true"] {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(47, 42, 38, 0.08);
}

/* ---------------------------------------------------------------- doc page */

.doc h2 {
  margin: 26px 0 10px;
  font-size: 17px;
}

.doc h2:first-child {
  margin-top: 0;
}

.doc ul {
  padding-left: 20px;
  color: var(--text-muted);
}

.doc li {
  margin-bottom: 7px;
}

.doc p {
  color: var(--text-muted);
}

.doc strong {
  color: var(--text);
}

/* ---------------------------------------------------------------- footer */

.footer {
  padding: 22px 0 40px;
  color: var(--text-faint);
  font-size: 12px;
  text-align: center;
}

/* ---------------------------------------------------------------- modal */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(47, 42, 38, 0.42);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 50;
}

.modal {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: 0 18px 50px rgba(47, 42, 38, 0.2);
}

.modal h3 {
  margin: 0 0 10px;
  font-size: 16px;
}

.modal p {
  margin: 0 0 18px;
  color: var(--text-muted);
  font-size: 14px;
}

/* ---------------------------------------------------------------- responsive */

@media (max-width: 560px) {
  .wrap {
    padding-left: 16px;
    padding-right: 16px;
  }

  .hero h1 {
    font-size: 22px;
  }

  .card {
    padding: 18px;
  }

  .topbar {
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 16px;
    padding-bottom: 16px;
  }

  .nav {
    gap: 12px;
    font-size: 13px;
  }

  .nav .who {
    display: none;
  }

  .scale button {
    padding: 12px 0;
  }

  .entry-head {
    padding: 14px 15px;
  }

  .entry-body {
    padding: 0 15px 15px;
  }
}
