/* Hallmark · pre-emit critique: P4 H4 E4 S5 R4 V4
 * genre: modern-minimal guofeng · macrostructure: app workbench · theme: custom stone-cyan
 */
:root {
  color-scheme: light;
  --bg: #eef6f4;
  --surface: #f9fcfa;
  --surface-2: #ffffff;
  --ink: #0f2e38;
  --muted: #61777b;
  --line: rgba(17, 92, 124, 0.16);
  --line-strong: rgba(17, 92, 124, 0.28);
  --accent: #115c7c;
  --green: #92cba6;
  --red: #bf4240;
  --orange: #ce7044;
  --shadow: 0 22px 70px rgba(17, 92, 124, 0.13);
  --radius: 14px;
  --font-display: "Songti SC", "STSong", "Noto Serif CJK SC", serif;
  --font-body: "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #061a22;
  --surface: #0b2631;
  --surface-2: #0f3442;
  --ink: #edf7f4;
  --muted: #a7bdba;
  --line: rgba(237, 247, 244, 0.13);
  --line-strong: rgba(237, 247, 244, 0.24);
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.32);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
  overflow-x: clip;
}

body {
  color: var(--ink);
  background: var(--bg);
  font-family: var(--font-body);
}

button,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  border: 0;
  cursor: pointer;
}

button:focus-visible,
a:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
}

.app-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 236px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  display: grid;
  height: 100vh;
  grid-template-rows: auto 1fr auto;
  gap: 22px;
  padding: 18px 12px;
  background: color-mix(in srgb, var(--surface-2) 82%, transparent);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.brand,
.profile-card {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 11px;
}

.brand-mark,
.avatar {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  color: #fff;
  background: var(--accent);
  border-radius: 12px;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 900;
  box-shadow: 0 12px 26px rgba(17, 92, 124, 0.22);
}

.brand strong,
.profile-card strong {
  display: block;
  font-size: 17px;
}

.brand span,
.profile-card small,
.nav-item small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.side-nav {
  display: grid;
  align-content: start;
  gap: 8px;
}

.nav-item,
.profile-card {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  min-width: 0;
  align-items: center;
  gap: 12px;
  padding: 12px 10px;
  color: var(--ink);
  text-align: left;
  background: transparent;
  border-radius: 12px;
}

.nav-item:hover,
.profile-card:hover {
  background: color-mix(in srgb, var(--ink) 7%, transparent);
}

.nav-item.active {
  color: #fff;
  background: #222;
}

.nav-item.active small {
  color: rgba(255, 255, 255, 0.72);
}

.nav-icon {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 9%, transparent);
  border: 1px solid var(--line);
  border-radius: 9px;
  font-weight: 900;
}

.nav-item.active .nav-icon {
  color: #222;
  background: #fff;
  border-color: #fff;
}

.profile-card {
  grid-template-columns: 42px minmax(0, 1fr);
  width: 100%;
  background: color-mix(in srgb, var(--accent) 6%, transparent);
  border: 1px solid var(--line);
}

.workspace {
  min-width: 0;
  padding: 0 28px 42px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  margin: 0 -28px 24px;
  padding: 14px 28px;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
}

.topbar h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 25px;
}

.theme-toggle,
.chat-entry {
  display: inline-grid;
  min-height: 42px;
  align-items: center;
  color: var(--ink);
  background: color-mix(in srgb, var(--surface-2) 84%, transparent);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.theme-toggle {
  grid-auto-flow: column;
  gap: 9px;
  padding: 0 14px;
  font-weight: 800;
}

.theme-dot {
  width: 18px;
  height: 18px;
  background: linear-gradient(135deg, var(--accent), var(--green));
  border-radius: 50%;
}

.chat-entry {
  width: 42px;
  place-items: center;
}

.chat-entry svg,
.send svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.main-area {
  width: min(1180px, 100%);
  margin-inline: auto;
}

.screen {
  display: none;
}

.screen.active {
  display: block;
}

.hero-carousel {
  position: relative;
  height: clamp(250px, 30vw, 340px);
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.slide {
  position: absolute;
  inset: 0;
  display: grid;
  align-items: end;
  padding: clamp(18px, 3vw, 32px);
  opacity: 0;
  pointer-events: none;
  background-image:
    linear-gradient(90deg, rgba(6, 26, 34, 0.6), rgba(6, 26, 34, 0.08) 58%, rgba(6, 26, 34, 0.32)),
    var(--image);
  background-position: center;
  background-size: cover;
  transition: opacity 360ms ease;
}

.slide.active {
  opacity: 1;
  pointer-events: auto;
}

.slide-copy {
  width: min(560px, 100%);
  color: #fff;
}

.slide-copy p {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 900;
}

.slide-copy h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(22px, 3.4vw, 42px);
  line-height: 1.08;
}

.slide-copy span,
.black-pill,
.content-card b {
  display: inline-flex;
  width: max-content;
  min-height: 32px;
  align-items: center;
  margin-top: 14px;
  padding: 0 12px;
  color: #fff;
  background: #222;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 900;
}

.carousel-controls {
  position: absolute;
  right: 18px;
  bottom: 14px;
  left: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.carousel-controls button,
.carousel-dot {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  color: #fff;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  backdrop-filter: blur(12px);
}

.carousel-dots {
  display: flex;
  gap: 7px;
}

.carousel-dot {
  width: 9px;
  height: 9px;
  padding: 0;
  color: transparent;
}

.carousel-dot.active {
  width: 28px;
  border-radius: 999px;
  background: #fff;
}

.home-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.insight-card,
.content-card,
.section-banner,
.prompt-box,
.chat-composer {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface-2) 94%, transparent), color-mix(in srgb, var(--surface) 76%, transparent));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 14px 40px rgba(17, 92, 124, 0.06);
}

.insight-card {
  min-height: 180px;
  padding: 22px;
}

.insight-card h3,
.section-title h2,
.section-banner h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(24px, 3vw, 38px);
  line-height: 1.12;
}

.insight-card p:last-child,
.plain-page-head p,
.section-banner p {
  color: var(--muted);
  line-height: 1.75;
}

.plain-page-head {
  margin-bottom: 18px;
}

.plain-page-head.center {
  display: grid;
  justify-items: center;
  text-align: center;
}

.plain-page-head h2 {
  max-width: 760px;
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.06;
}

.plain-page-head p {
  max-width: 680px;
}

.title-tabs {
  display: flex;
  gap: clamp(18px, 4vw, 42px);
  align-items: flex-end;
  margin: 2px 0 22px;
  padding-bottom: 14px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
}

.title-tabs button {
  position: relative;
  flex: 0 0 auto;
  padding: 0 0 10px;
  color: var(--muted);
  background: transparent;
  font-family: var(--font-display);
  font-size: clamp(26px, 4vw, 44px);
  font-weight: 900;
}

.title-tabs button.active {
  color: var(--ink);
}

.title-tabs button.active::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 4px;
  background: var(--accent);
  border-radius: 999px;
  content: "";
}

.xinx-panel[hidden] {
  display: none;
}

.section-title {
  margin-bottom: 12px;
}

.card-grid {
  display: grid;
  gap: 12px;
}

.card-grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.content-card {
  min-height: 220px;
  padding: 18px;
  color: var(--ink);
  text-align: left;
}

.content-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.content-card h3 {
  margin: 20px 0 12px;
  font-family: var(--font-display);
  font-size: 24px;
  line-height: 1.16;
}

.content-card p {
  color: var(--muted);
  line-height: 1.65;
}

.section-banner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  margin-bottom: 12px;
  padding: 24px;
}

.masonry-card {
  position: relative;
  min-height: 230px;
  overflow: hidden;
  color: var(--ink);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface-2) 94%, transparent), color-mix(in srgb, var(--surface) 76%, transparent));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 14px 40px rgba(17, 92, 124, 0.06);
}

.masonry-card span,
.masonry-card h3 {
  position: absolute;
  right: 18px;
  left: 18px;
}

.course-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.course-item {
  display: grid;
  min-height: 180px;
  padding: 18px;
  color: var(--ink);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface-2) 94%, transparent), color-mix(in srgb, var(--surface) 76%, transparent));
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.course-item h3 {
  align-self: end;
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 25px;
  line-height: 1.15;
}

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

.prompt-box {
  display: grid;
  min-height: 190px;
  margin: 18px auto 16px;
  padding: 24px;
}

textarea {
  width: 100%;
  min-height: 108px;
  resize: vertical;
  color: var(--ink);
  background: transparent;
  border: 0;
}

textarea::placeholder {
  color: var(--muted);
}

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

.prompt-actions button:not(.send) {
  color: var(--ink);
  background: transparent;
  font-weight: 900;
}

.send {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  color: #fff;
  background: var(--accent);
  border-radius: 50%;
}

.chip-row,
.suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 20px;
}

.chip-row button,
.suggestions button {
  min-height: 42px;
  padding: 0 16px;
  color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-weight: 900;
}

.chip-row button.active,
.suggestions button.active {
  color: #fff;
  background: #222;
  border-color: #222;
}

.masonry {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: 180px;
  gap: 12px;
}

.masonry-card.tall {
  grid-row: span 2;
}

.masonry-card.wide {
  grid-column: span 2;
}

.masonry-card span {
  top: 18px;
  font-size: 13px;
  font-weight: 900;
}

.masonry-card h3 {
  bottom: 18px;
  margin: 0;
  font-family: var(--font-display);
  font-size: 25px;
  line-height: 1.16;
}

.suggestions button {
  display: grid;
  gap: 3px;
  min-height: 58px;
  align-content: center;
  text-align: left;
}

.suggestions small {
  color: var(--muted);
  font-size: 12px;
}

.suggestions .active small {
  color: rgba(255, 255, 255, 0.72);
}

.chat-composer {
  position: relative;
  width: min(860px, 100%);
  min-height: 210px;
  margin: 0 auto;
  padding: 28px 88px 28px 28px;
}

.chat-composer .send {
  position: absolute;
  right: 24px;
  bottom: 24px;
}

.mobile-nav {
  display: none;
}

@media (max-width: 1060px) {
  .app-shell {
    grid-template-columns: 210px minmax(0, 1fr);
  }

  .card-grid.four,
  .course-list,
  .masonry {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    display: none;
  }

  .workspace {
    width: 100vw;
    max-width: 100vw;
    padding: 0 12px 96px;
  }

  .topbar {
    margin: 0 -12px 14px;
    padding: 12px;
  }

  .theme-toggle span:last-child {
    display: none;
  }

  .hero-carousel {
    height: 260px;
  }

  .home-grid,
  .card-grid.four,
  .course-list,
  .masonry {
    grid-template-columns: 1fr;
  }

  .section-banner {
    grid-template-columns: 1fr;
  }

  .masonry-card.wide {
    grid-column: span 1;
  }

  .mobile-nav {
    position: fixed;
    right: 10px;
    bottom: max(10px, env(safe-area-inset-bottom));
    left: 10px;
    z-index: 20;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    padding: 7px;
    background: rgba(34, 34, 34, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    backdrop-filter: blur(18px);
  }

  .mobile-nav button {
    min-height: 48px;
    color: rgba(255, 255, 255, 0.68);
    background: transparent;
    border-radius: 12px;
    font-weight: 900;
  }

  .mobile-nav button.active {
    color: #fff;
    background: var(--accent);
  }
}
