/* 学霸乐园 theme and layout: green/orange palette on cream paper, a left sidebar on desktop,
   a reversed hero and vertical tool cards. Loaded after styles.css and only overrides it. */

:root {
  --blue: #1f9d7a;
  --blue-dark: #14806a;
  --accent: #ff8a3d;
  --accent-dark: #e86f22;
  --ink: #1f3530;
  --muted: #6f7f78;
  --line: #ebe5d6;
  --pale: #f7f4ec;
  --surface-subtle: #f8fbf9;
  --surface-tint: #e9f6f0;
  --surface-hover: #eef7f2;
  --line-panel: #e6dfcf;
  --line-row: #eee8da;
  --line-hover: #b9dccb;
  --field-focus: #3fb68e;
  --field-glow: #1f9d7a14;
  --focus-ring: #ff9a3d;
  --shadow: 0 10px 30px #3a32200d;
  --shadow-shell: 0 14px 44px #3a322010;
  --shadow-hover: 0 14px 28px #2a4a3c1a;
  --sidebar: 248px;
}

body {
  background-color: var(--pale);
  background-image: radial-gradient(#e5dcc6 1.2px, transparent 1.4px);
  background-size: 22px 22px;
}

.button.outline { --btn-hover-bg: #eaf7f1; }
.button.white { --btn-color: #14806a; }
.breadcrumb a:hover, .header-back:hover { color: var(--blue); }
.header-back { color: #2f6f5d; }

/* ---- header (all widths) ------------------------------------------------------------------ */
.main-nav a:hover, .main-nav a.active { color: var(--blue); }
.main-nav a.active::after { background: var(--accent); }
.message-bell { border-color: #dbe9e2; color: #24493f; }
.user-chip img { background: var(--surface-tint); }

/* ---- desktop: left sidebar ---------------------------------------------------------------- */
@media (min-width: 1101px) {
  .shell:has(> .header .main-nav) {
    display: grid;
    grid-template-columns: var(--sidebar) minmax(0, 1fr);
    grid-template-rows: 1fr auto;
    max-width: none;
    min-height: 100vh;
    margin: 0;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .shell:has(> .header .main-nav) > .header {
    position: sticky;
    top: 0;
    z-index: 30;
    grid-row: 1 / span 2;
    grid-column: 1;
    align-self: start;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 8px;
    height: 100vh;
    min-height: 0;
    padding: 20px 16px 18px;
    border: 0;
    background:
      radial-gradient(circle at 20% 0%, #ffffff14, transparent 40%),
      linear-gradient(180deg, #145244, #0e3a31);
    color: #d9eee5;
  }

  .shell:has(> .header .main-nav) > :not(.header) { grid-column: 2; }

  .shell:has(> .header .main-nav) .brand {
    justify-content: center;
    padding: 8px 10px;
    border-radius: 18px;
    background: #fffdf6;
    box-shadow: 0 6px 16px #0006;
  }
  .shell:has(> .header .main-nav) .brand img { width: 196px; height: 62px; object-position: center; }

  .shell:has(> .header .main-nav) .header-back {
    justify-content: center;
    margin: 4px 0 0;
    border-color: #ffffff2e;
    background: #ffffff12;
    color: #d9eee5;
  }
  .shell:has(> .header .main-nav) .header-back:hover { background: #ffffff22; color: #fff; }

  .shell:has(> .header .main-nav) .main-nav {
    flex: 1;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    justify-content: flex-start;
    gap: 4px;
    margin-top: 14px;
    font-size: 15px;
  }
  .shell:has(> .header .main-nav) .main-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    border-radius: 14px;
    color: #cfe5db;
    white-space: nowrap;
    transition: background .18s, color .18s, transform .18s;
  }
  .shell:has(> .header .main-nav) .main-nav a::before {
    content: "🏠";
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 10px;
    background: #ffffff14;
    font-size: 16px;
  }
  .shell:has(> .header .main-nav) .main-nav a:nth-child(2)::before { content: "🎯"; }
  .shell:has(> .header .main-nav) .main-nav a:nth-child(3)::before { content: "🗂️"; }
  .shell:has(> .header .main-nav) .main-nav a:nth-child(4)::before { content: "📦"; }
  .shell:has(> .header .main-nav) .main-nav a:nth-child(5)::before { content: "💡"; }
  .shell:has(> .header .main-nav) .main-nav a:nth-child(6)::before { content: "🤝"; }
  .shell:has(> .header .main-nav) .main-nav a:hover { background: #ffffff12; color: #fff; transform: translateX(3px); }
  .shell:has(> .header .main-nav) .main-nav a.active { background: #fffdf6; color: #0f5e4d; font-weight: 800; }
  .shell:has(> .header .main-nav) .main-nav a.active::before { background: #ffe3cc; }
  .shell:has(> .header .main-nav) .main-nav a.active::after { content: none; }

  .shell:has(> .header .main-nav) .header-actions {
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 12px;
    border-radius: 18px;
    background: #ffffff10;
  }
  .shell:has(> .header .main-nav) .user-chip { flex: 1 1 100%; order: -1; color: #fff; font-weight: 700; }
  .shell:has(> .header .main-nav) .user-chip:hover { background: #ffffff14; }
  .shell:has(> .header .main-nav) .message-bell { border-color: #ffffff30; background: #ffffff14; color: #fff; }
  .shell:has(> .header .main-nav) .logout { flex: 1; border-color: #ffffff30; color: #cfe5db; }
  .shell:has(> .header .main-nav) .logout:hover { background: #ffffff14; color: #fff; }

  .shell:has(> .header .main-nav) .message-popover {
    position: fixed;
    top: auto;
    right: auto;
    bottom: 24px;
    left: calc(var(--sidebar) + 12px);
    color: var(--ink);
  }

  /* inner pages sit on a white sheet; the hall uses separate section cards */
  .shell:has(> .header .main-nav) > main:not(.home-main) {
    margin: 24px 28px 0;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: #fff;
    box-shadow: var(--shadow-shell);
  }
  .shell:has(> .header .main-nav) > .footer { margin: 0 28px; }
}

/* ---- home: reversed hero (carousel | copy) ------------------------------------------------ */
.home-main { padding: 24px 28px 8px; }

.hero-with-carousel {
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 28px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background:
    radial-gradient(circle at 92% 12%, #ffe2c7 0, transparent 28%),
    radial-gradient(circle at 70% 100%, #d6f2e4 0, transparent 40%),
    #fffdf6;
  box-shadow: var(--shadow-shell);
  color: var(--ink);
}
.hero-with-carousel::before { content: none; }
.hero-carousel { order: -1; border: 0; border-radius: 20px; background: #eef7f2; box-shadow: 0 10px 24px #2a4a3c22; transform: none; }
.carousel-window { border-radius: 20px; }
.carousel-arrow { color: var(--blue); }
.hero-carousel button:focus-visible { outline-color: var(--accent); }

.hero-copy { padding: 8px 24px 8px 0; }
.hero-copy::before {
  content: "📚 学霸乐园 · 老师的百宝箱";
  display: inline-block;
  margin-bottom: 14px;
  padding: 5px 14px;
  border-radius: 99px;
  background: #e6f6ee;
  color: #14806a;
  font-size: 13px;
  font-weight: 800;
}
.hero-copy h1 { color: #173f36; font-family: var(--font-display); font-size: clamp(34px, 3.2vw, 50px); text-shadow: none; }
.hero-copy p { color: var(--muted); font-size: 16px; text-shadow: none; }
.hero-actions .button.white {
  --btn-bg: var(--accent);
  --btn-border: var(--accent);
  --btn-color: #fff;
  --btn-hover-bg: var(--accent-dark);
  --btn-hover-border: var(--accent-dark);
  box-shadow: 0 6px 0 #d4621c;
}

/* ---- home: pill tabs and section cards ---------------------------------------------------- */
.catalog-tabs { justify-content: flex-start; gap: 10px; margin: 22px 0 16px; padding: 0; border: 0; background: transparent; }
.catalog-tabs a { flex: none; min-height: 40px; padding: 6px 20px; border: 1px solid var(--line); border-radius: 99px; background: #fff; color: #4b6058; }
.catalog-tabs a:hover { background: #eef7f2; color: var(--blue); }
.catalog-tabs a[aria-current]:not([aria-current="false"]) { border-color: var(--blue); background: var(--blue); color: #fff; }

.home-main .section,
.home-main .management-section,
.home-main .resources-section {
  margin-bottom: 18px;
  padding: 20px 22px 22px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #fff;
  box-shadow: var(--shadow);
}
.section-symbol { border-radius: 50%; background: #e6f6ee; color: var(--blue); }
.home-main .section-head { padding-bottom: 12px; border-bottom: 2px dashed #eee6d4; margin-bottom: 16px; }
.section-head h2 { font-family: var(--font-display); font-size: 22px; }

/* ---- home: vertical tool cards ------------------------------------------------------------ */
.home-main .subject-grid,
.home-main .management-grid { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }

.home-main .matrix-card {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto 1fr auto;
  row-gap: 10px;
  padding: 10px 10px 12px;
  border-radius: 20px;
  border-color: #ede7d8;
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.home-main .matrix-card:hover { border-color: #bfe2d1; box-shadow: var(--shadow-hover); transform: translateY(-4px); }
.home-main .matrix-cover {
  width: 100%;
  height: 132px;
  aspect-ratio: auto;
  border-radius: 14px;
  background: linear-gradient(160deg, #f1faf5, #fff6ec);
}
.home-main .matrix-cover > img { padding: 10px; }
.home-main .management-info { padding: 0 4px; }
.home-main .matrix-actions { display: flex; justify-content: flex-end; padding: 0 2px; }
.home-main .matrix-actions .button { width: auto; height: 36px; min-height: 36px; padding: 6px 16px; border-radius: 99px; }
.hall-access-pending > span { background: #dbe9e2; }

/* ---- home: co-create, start strip, footer ------------------------------------------------- */
.home-main .co-create-entry { border: 1px solid #f5dcc4; background: linear-gradient(110deg, #fff4e8, #fffdf6); }
.start-strip { margin: 0 0 30px; border-radius: 24px; background: linear-gradient(120deg, #145244, #1f9d7a); color: #fff; }
.start-item p { color: #cfe9de; }
.step-dot { background: var(--accent); color: #fff; }
.footer { border-top-color: var(--line); }

/* ---- account: retint the leftover blue accents ------------------------------------------ */
.account-heading { background: linear-gradient(120deg, #e8f6ef, #fff6ea); }
.personal-choice span { border-color: #dfe6df; }
.personal-choice label:hover span { border-color: #9fd3bb; }
.personal-choice input:checked + span { border-color: var(--blue); background: #e8f6ef; color: var(--blue-dark); }
.cocreator-badge { background: #fff1e4; color: var(--accent-dark); }
.achievement-stats dd, .account-leaderboard li > strong { color: var(--blue-dark); }

/* ---- account: activation code redemption ------------------------------------------------ */
.activation-panel { display: grid; gap: 14px; }
.activation-panel h2 { margin: 0 0 4px; font-size: 18px; }
.activation-panel p { margin: 0; color: var(--muted, #5b6b63); }
.activation-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.activation-label { grid-column: 1 / -1; font-weight: 600; font-size: 14px; }
.activation-form input { height: 44px; padding: 0 14px; border: 1px solid #cfdcd4; border-radius: 12px; font: inherit; letter-spacing: .06em; text-transform: uppercase; }
.activation-form input:focus { outline: 2px solid #9fd3bb; outline-offset: 1px; border-color: var(--blue); }
.activation-form .button { height: 44px; padding: 0 20px; border-radius: 99px; }
.activation-form .form-error { grid-column: 1 / -1; color: #c2410c; min-height: 1em; }

/* ---- account: password change; auth: activation hint and forgot-password help ---------- */
.password-form { display: grid; gap: 12px; max-width: 420px; margin-top: 12px; }
.password-form .field input { width: 100%; }
.password-form .button { justify-self: start; }
.password-form .form-error { margin: 0; color: #c2410c; min-height: 1em; }
.form-hint { margin: -4px 0 8px; color: var(--muted, #5b6b63); font-size: 13px; }
.reset-help ol { margin: 0 0 18px; padding-left: 20px; display: grid; gap: 8px; line-height: 1.6; }

/* ---- purchase dialog: buy in the Xiaohongshu shop, then redeem here ---------------------- */
.shop-view { display: grid; gap: 14px; text-align: left; }
.shop-view .shop-open { display: inline-flex; justify-content: center; align-items: center; text-decoration: none; background: #ff2442; color: #fff; }
.shop-view .shop-open:hover { background: #e01e3a; }
.shop-steps { margin: 0; padding-left: 20px; display: grid; gap: 6px; line-height: 1.6; color: var(--muted, #5b6b63); }
.shop-redeem { display: grid; gap: 8px; padding: 14px; border-radius: 14px; background: #f3faf6; }
.shop-redeem label { font-weight: 600; }
.shop-redeem-row { display: flex; flex-wrap: wrap; gap: 10px; }
.shop-redeem-row input { flex: 1; min-width: 180px; height: 44px; padding: 0 12px; border: 1px solid #cfdcd4; border-radius: 12px; font: inherit; text-transform: uppercase; letter-spacing: .05em; }
.shop-redeem-row .store-button { width: auto; padding: 0 18px; text-decoration: none; display: inline-flex; align-items: center; }

/* ---- contact dialog --------------------------------------------------------------------- */
.contact-list { display: grid; gap: 12px; margin: 12px 0 0; padding: 0; list-style: none; }
.contact-list li { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; background: #f3faf6; }
.contact-type { flex: none; min-width: 48px; padding: 3px 8px; border-radius: 99px; background: #fff1e4; color: var(--accent-dark); font-size: 13px; text-align: center; }
.contact-body { display: grid; gap: 4px; min-width: 0; overflow-wrap: anywhere; }
.contact-body a { color: var(--blue-dark); }
.contact-qr { width: 132px; height: 132px; margin-top: 6px; border-radius: 10px; background: #fff; object-fit: contain; }

/* ---- narrow screens: stack the hero and the section cards ------------------------------- */
@media (max-width: 800px) {
  .home-main { padding: 16px 14px 8px; }
  .hero-with-carousel { grid-template-columns: minmax(0, 1fr); gap: 18px; padding: 16px; border-radius: 22px; }
  .hero-copy { padding: 0 6px; }
  .hero-copy h1 { font-size: 32px; }
}
