/* QCH5 visual system: calm medical blue, disciplined spacing, readable surfaces. */
:root {
  --qc-bg: #eef4fa;
  --qc-bg-soft: #f7faff;
  --qc-surface: #ffffff;
  --qc-text: #18283e;
  --qc-muted: #66768c;
  --qc-primary: #1264ee;
  --qc-primary-strong: #0b4fc7;
  --qc-border: #dfe8f3;
  --qc-border-soft: #ebf0f6;
  --qc-radius-sm: 10px;
  --qc-radius-md: 16px;
  --qc-radius-lg: 22px;
  --qc-shadow-sm: 0 6px 18px rgba(20, 54, 94, .055);
  --qc-shadow-md: 0 14px 36px rgba(20, 54, 94, .085);
  --qc-shadow-lg: 0 24px 64px rgba(15, 48, 90, .12);
  --qc-motion: 180ms ease;
  --blue: var(--qc-primary);
  --deep: #06346f;
  --ink: var(--qc-text);
  --muted: var(--qc-muted);
  --line: var(--qc-border);
  --soft: var(--qc-bg-soft);
  --card: var(--qc-surface);
  --shadow: var(--qc-shadow-md);
}

html {
  background: var(--qc-bg);
  color: var(--qc-text);
  font-family: "HarmonyOS Sans SC", "MiSans", "Alibaba PuHuiTi 3.0", "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
}

body {
  color: var(--qc-text);
  background:
    radial-gradient(circle at 18% -12%, rgba(29, 178, 211, .08), transparent 30rem),
    linear-gradient(180deg, #edf4fa 0%, #f5f8fc 100%);
}

button,
input,
select,
textarea {
  font-family: inherit;
}

::selection {
  color: #fff;
  background: rgba(18, 100, 238, .78);
}

:is(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 3px solid rgba(18, 100, 238, .28) !important;
  outline-offset: 3px !important;
}

:is(.phone-shell, .page, .app, .survey-app, .login-shell, .legal-shell) {
  color: var(--qc-text);
  border-color: var(--qc-border);
}

:is(.notice, .contact-band, .content-card, .card, .section-card, .mine-stat-card,
  .mine-learning-row, .mine-favorites-card, .learning-summary-card, .today-focus-card,
  .learning-trend-card, .calendar-card, .settings-profile, .settings-group-card,
  .settings-plain-group, .profile-edit-card, .login-panel, .survey-card, .survey-section,
  .article-panel, .comments-panel, .media-stage-shell, .contact-panel, .contact) {
  border-color: var(--qc-border);
  box-shadow: var(--qc-shadow-sm);
}

:is(.content-card, .card, .section-card, .mine-stat-card, .mine-learning-row,
  .mine-favorites-card, .learning-summary-card, .today-focus-card, .learning-trend-card,
  .calendar-card, .settings-profile, .settings-group-card, .settings-plain-group,
  .profile-edit-card, .survey-card, .survey-section, .article-panel, .comments-panel,
  .media-stage-shell, .contact-panel) {
  border-radius: var(--qc-radius-md);
}

:is(.pill-button, .primary, .survey-primary, .auth-submit, .login-btn, .report-btn) {
  background: linear-gradient(135deg, var(--qc-primary), var(--qc-primary-strong));
  box-shadow: 0 10px 22px rgba(18, 100, 238, .18);
}

:is(input:not([type="checkbox"]):not([type="radio"]), select, textarea) {
  border-color: #cfdbe9;
  border-radius: var(--qc-radius-sm);
  color: var(--qc-text);
  background: #fff;
  transition: border-color var(--qc-motion), box-shadow var(--qc-motion), background-color var(--qc-motion);
}

:is(input:not([type="checkbox"]):not([type="radio"]), select, textarea):focus {
  border-color: rgba(18, 100, 238, .68);
  box-shadow: 0 0 0 4px rgba(18, 100, 238, .10);
}

.search input,
.search input:focus {
  appearance: none;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.qc-overlay {
  background: rgba(15, 35, 62, .46);
  backdrop-filter: blur(8px);
}

.qc-dialog {
  border: 1px solid rgba(223, 232, 243, .96);
  border-radius: var(--qc-radius-lg);
  box-shadow: var(--qc-shadow-lg);
}

.qc-dialog button,
.qc-dialog a.qc-primary {
  border-radius: var(--qc-radius-sm);
  transition: color var(--qc-motion), background-color var(--qc-motion), box-shadow var(--qc-motion), transform var(--qc-motion);
}

.survey-question,
.legal-card p,
.legal-card li {
  color: #4e5f75;
  line-height: 1.75;
}

.article-sections {
  max-width: 46rem;
  margin-right: auto;
  margin-left: auto;
}

.bottom-nav {
  border-color: var(--qc-border);
  box-shadow: 0 -8px 28px rgba(24, 56, 96, .07);
}

@media (hover: hover) and (pointer: fine) {
  :is(.content-card, .card, .category-item, .section-card, .mine-learning-row,
    .settings-row, .settings-action, .survey-option, .search-result-card) {
    transition: border-color var(--qc-motion), box-shadow var(--qc-motion), transform var(--qc-motion), background-color var(--qc-motion);
  }

  :is(.content-card, .card, .category-item, .mine-learning-row,
    .settings-row, .settings-action, .survey-option, .search-result-card):hover {
    border-color: rgba(18, 100, 238, .24);
    box-shadow: var(--qc-shadow-md);
    transform: translateY(-2px);
  }

  :is(button, .pill-button, .primary, .more, .nav-item):not(:disabled):hover {
    filter: saturate(1.04);
  }
}

@media (min-width: 768px) {
  .phone-shell {
    width: min(calc(100vw - 40px), 920px);
    max-width: 920px;
    padding: 24px 28px 104px;
    border-right: 1px solid rgba(218, 228, 240, .8);
    border-left: 1px solid rgba(218, 228, 240, .8);
    box-shadow: 0 0 60px rgba(33, 69, 108, .07);
  }

  .phone-shell .hero-strip {
    margin: 24px 0;
    padding: 0;
    max-width: 100%;
  }

  .phone-shell .notice-window { white-space: normal; }
  .phone-shell .notice-track { display: block; min-width: 0; padding-left: 0; animation: none; }

  .phone-shell .hero-card {
    flex-basis: 280px;
    min-height: 154px;
    border-radius: var(--qc-radius-md);
  }

  .phone-shell .hero-content { min-height: 154px; padding: 20px; }
  .phone-shell .hero-content h2 { max-width: 240px; font-size: 23px; line-height: 1.18; }
  .phone-shell .hero-card p { max-width: 240px; font-size: 13px; }
  .phone-shell .search { width: min(100%, 680px); height: 48px; margin: 0 auto 32px; }
  .phone-shell .category-grid { width: min(100%, 680px); gap: 24px; margin: 8px auto 34px; }
  .phone-shell .contact-band { width: min(100%, 820px); margin: 0 auto 38px; padding: 16px 18px; }
  .phone-shell .section { margin-top: 42px; }
  .phone-shell .section-title { font-size: 26px; }
  .phone-shell .two-grid { gap: 20px; }
  .phone-shell .three-grid { gap: 16px; }
  .phone-shell .two-grid .content-card { aspect-ratio: 16 / 10; }
  .phone-shell .three-grid .content-card { aspect-ratio: 4 / 3; }
  .phone-shell .contact-panel { padding: 24px; border-radius: var(--qc-radius-md); }
  .phone-shell .bottom-nav,
  body > .bottom-nav {
    width: 340px;
    max-width: 340px;
    height: 58px;
    border: 1px solid rgba(215, 227, 240, .92);
    border-bottom: 0;
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -12px 34px rgba(20, 54, 94, .10);
  }

  body:not([data-requires-auth]):not([data-account-page]) > .page {
    width: min(calc(100vw - 40px), 1000px);
    max-width: 1000px;
    padding: 24px 32px 72px;
    border-right: 1px solid rgba(218, 228, 240, .76);
    border-left: 1px solid rgba(218, 228, 240, .76);
    box-shadow: 0 0 60px rgba(33, 69, 108, .07);
  }

  body:not([data-requires-auth]) > .page .hero {
    min-height: 230px;
    padding: 32px;
    border-radius: var(--qc-radius-lg);
  }

  body:not([data-requires-auth]) > .page .hero h1 { max-width: 34rem; font-size: 34px; }
  body:not([data-requires-auth]) > .page .hero p { max-width: 38rem; font-size: 15px; }
  body:not([data-requires-auth]) > .page .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
  body:not([data-requires-auth]) > .page .card { aspect-ratio: 4 / 3; }
  body.therapy-category-page > .page .grid { grid-template-columns: repeat(auto-fit, minmax(min(380px, 100%), 1fr)); }
  body.therapy-category-page > .page .therapy-list-card { height: 166px; }

  body[data-requires-auth] > .page {
    width: min(calc(100vw - 40px), 900px);
    max-width: 900px;
    padding-bottom: 104px;
    box-shadow: 0 0 60px rgba(33, 69, 108, .07);
  }

  body[data-requires-auth] .article-hero { min-height: 250px; padding: 32px; }
  body[data-requires-auth] .article-hero h1 { max-width: 36rem; font-size: 34px; line-height: 1.2; }
  body[data-requires-auth] .article-hero p { max-width: 38rem; font-size: 15px; }
  body[data-requires-auth] .article-panel { padding: 28px 32px; }
  body[data-requires-auth] .comment-bottom-bar { width: min(100vw, 900px); max-width: 900px; }

  body[data-account-page] > .app {
    width: min(calc(100vw - 40px), 820px);
    max-width: 820px;
    padding: 24px 28px 104px;
    border-right: 1px solid rgba(218, 228, 240, .76);
    border-left: 1px solid rgba(218, 228, 240, .76);
    box-shadow: 0 0 60px rgba(33, 69, 108, .07);
  }

  body[data-account-page="learning"] > .app { max-width: 960px; }
  body[data-account-page] .section-card { padding: 22px; }
  body[data-account-page] .account-hero { padding: 24px; }

  .login-shell { width: min(calc(100vw - 40px), 760px); max-width: 760px; padding: 28px 32px 64px; }
  .login-panel { width: min(100%, 480px); margin-right: auto; margin-left: auto; padding: 28px; }
  .survey-app { width: min(calc(100vw - 40px), 820px); max-width: 820px; box-shadow: 0 0 60px rgba(33, 69, 108, .07); }
  .survey-app [data-survey-root] { padding: 32px; }
  .survey-card, .survey-section { padding: 28px; }
  .legal-shell { width: min(calc(100vw - 40px), 800px); max-width: 800px; padding-right: 28px; padding-left: 28px; }
}

@media (min-width: 1200px) {
  .phone-shell {
    width: min(calc(100vw - 64px), 1160px);
    max-width: 1160px;
    padding-right: 36px;
    padding-left: 36px;
  }
  .phone-shell .hero-card { flex-basis: 320px; min-height: 170px; }
  .phone-shell .hero-content { min-height: 170px; }
  .phone-shell .two-grid .content-card { min-height: 260px; }
}

@media (max-width: 767px) {
  :is(.phone-shell, .page, .app, .survey-app, .login-shell, .legal-shell) { box-shadow: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
