:root {
  --cd-brand: #0c7a52;
  --cd-brand-dark: #06382a;
  --cd-brand-light: #16b877;
  --cd-ink: #0f1a15;
  --cd-text: #405148;
  --cd-muted: #708078;
  --cd-line: #e1e9e3;
  --cd-bg: #f3f7f4;
  --cd-phys: #2563eb;
  --cd-chem: #7c3aed;
  --cd-bio: #0c7a52;
  --cd-geo: #d97706;
  --cd-shadow: 0 22px 55px -30px rgba(12, 52, 34, .35);
  --cd-font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; color: var(--cd-text); background: var(--cd-bg); font: 15px/1.65 var(--cd-font); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
img { display: block; max-width: 100%; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { color: var(--cd-ink); line-height: 1.25; letter-spacing: -.025em; }
:focus-visible { outline: 3px solid rgba(22, 184, 119, .4); outline-offset: 3px; }
.cd-skip { position: fixed; top: -60px; left: 16px; z-index: 100; padding: 10px 16px; border-radius: 8px; color: #fff; background: var(--cd-brand); }
.cd-skip:focus { top: 12px; }
.cd-container { width: min(1240px, calc(100% - 40px)); margin-inline: auto; }

.cd-header { position: sticky; top: 0; z-index: 20; border-bottom: 1px solid rgba(225, 233, 227, .9); background: rgba(255, 255, 255, .94); backdrop-filter: blur(14px); }
.cd-header__inner { min-height: 68px; display: flex; align-items: center; gap: 24px; }
.cd-brand { display: flex; align-items: center; gap: 12px; flex: none; }
.cd-brand img { width: 131px; height: 33px; object-fit: contain; }
.cd-brand__divider { width: 1px; height: 22px; background: var(--cd-line); }
.cd-brand__name { color: var(--cd-brand); font-weight: 800; white-space: nowrap; }
.cd-nav { display: flex; align-items: center; gap: 5px; margin-left: auto; }
.cd-nav a { padding: 8px 13px; border-radius: 999px; color: var(--cd-muted); font-size: 13px; font-weight: 700; white-space: nowrap; }
.cd-nav a:hover { color: var(--cd-brand); background: #f1faf5; }
.cd-nav a[aria-current="page"] { color: var(--cd-brand-dark); background: #e5f6ed; }

.cd-hero { position: relative; overflow: hidden; padding: 58px 0 46px; color: #fff; background: radial-gradient(circle at 82% 18%, rgba(62, 215, 148, .26), transparent 26%), radial-gradient(circle at 8% 100%, rgba(37, 99, 235, .18), transparent 30%), linear-gradient(125deg, #06382a, #0a5c40 58%, #0c7a52); }
.cd-hero::before { content: ""; position: absolute; inset: 0; opacity: .13; background-image: linear-gradient(rgba(255,255,255,.3) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.3) 1px, transparent 1px); background-size: 44px 44px; mask-image: linear-gradient(to right, transparent, #000 45%, #000); }
.cd-hero__inner { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(260px, .65fr); align-items: end; gap: 60px; }
.cd-eyebrow { display: inline-flex; align-items: center; gap: 9px; margin-bottom: 15px; color: #9ce8c4; font-size: 11px; font-weight: 800; letter-spacing: .18em; }
.cd-eyebrow::before { content: ""; width: 28px; height: 2px; background: #55d69a; }
.cd-hero h1 { color: #fff; font-size: clamp(38px, 5vw, 58px); line-height: 1.12; }
.cd-hero h1 em { color: #8ff0bf; font-style: normal; }
.cd-hero__desc { max-width: 700px; margin-top: 18px; color: rgba(255, 255, 255, .75); font-size: 16px; line-height: 1.85; }
.cd-hero__search { position: relative; max-width: 720px; margin-top: 27px; }
.cd-hero__search svg { position: absolute; top: 50%; left: 18px; width: 21px; height: 21px; color: #789086; transform: translateY(-50%); pointer-events: none; }
.cd-hero__search input { width: 100%; height: 56px; padding: 0 56px; border: 1px solid rgba(255, 255, 255, .5); border-radius: 14px; color: var(--cd-ink); background: #fff; box-shadow: 0 18px 35px rgba(0, 0, 0, .16); outline: none; }
.cd-hero__search input:focus { box-shadow: 0 0 0 4px rgba(139, 239, 191, .28), 0 18px 35px rgba(0, 0, 0, .16); }
.cd-hero__search input::placeholder { color: #8c9b93; }
.cd-hero__clear { position: absolute; top: 50%; right: 12px; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; color: #6d7f75; background: #f0f5f1; transform: translateY(-50%); }
.cd-hero__clear[hidden] { display: none; }
.cd-hero__panel { padding: 23px; border: 1px solid rgba(255, 255, 255, .17); border-radius: 18px; background: rgba(255, 255, 255, .09); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08); backdrop-filter: blur(8px); }
.cd-hero__panel-label { color: #a5e9c5; font-size: 11px; font-weight: 800; letter-spacing: .14em; }
.cd-hero__panel strong { display: block; margin: 6px 0 2px; color: #fff; font-size: 42px; line-height: 1.15; }
.cd-hero__panel p { color: rgba(255, 255, 255, .7); font-size: 12px; }
.cd-hero__random { width: 100%; min-height: 43px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; margin-top: 18px; border: 1px solid rgba(255, 255, 255, .3); border-radius: 10px; color: #fff; background: rgba(255, 255, 255, .12); font-weight: 800; }
.cd-hero__random:hover { background: rgba(255, 255, 255, .2); }
.cd-hero__random svg { width: 17px; height: 17px; }

.cd-main { padding: 34px 0 62px; }
.cd-subject-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 30px; }
.cd-subject-card { position: relative; overflow: hidden; min-height: 104px; display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; padding: 16px; border: 1px solid var(--cd-line); border-radius: 14px; color: var(--cd-text); background: #fff; text-align: left; box-shadow: 0 4px 16px rgba(15, 45, 29, .025); transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.cd-subject-card::after { content: ""; position: absolute; right: -24px; bottom: -34px; width: 86px; height: 86px; border-radius: 50%; background: var(--subject-color, var(--cd-brand)); opacity: .07; }
.cd-subject-card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--subject-color, var(--cd-brand)) 38%, white); box-shadow: var(--cd-shadow); }
.cd-subject-card[aria-pressed="true"] { border-color: var(--subject-color, var(--cd-brand)); box-shadow: inset 0 0 0 1px var(--subject-color, var(--cd-brand)), var(--cd-shadow); }
.cd-subject-card__top { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cd-subject-card__icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; color: var(--subject-color, var(--cd-brand)); background: color-mix(in srgb, var(--subject-color, var(--cd-brand)) 11%, white); font-weight: 900; }
.cd-subject-card__count { color: var(--cd-muted); font-size: 12px; font-weight: 800; }
.cd-subject-card__name { display: block; color: var(--cd-ink); font-size: 16px; font-weight: 900; }
.cd-subject-card__desc { display: block; margin-top: 2px; color: var(--cd-muted); font-size: 11px; }

.cd-section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.cd-section-head h2 { font-size: 27px; }
.cd-section-head p { margin-top: 6px; color: var(--cd-muted); font-size: 13px; }
.cd-section-head__link { color: var(--cd-brand); font-size: 13px; font-weight: 800; white-space: nowrap; }
.cd-toolbar { display: grid; grid-template-columns: minmax(220px, 1fr) 220px 200px; gap: 12px; margin-bottom: 15px; }
.cd-toolbar--compact { grid-template-columns: 220px 200px; }
.cd-field { position: relative; }
.cd-field svg { position: absolute; top: 50%; left: 14px; width: 18px; height: 18px; color: #819087; transform: translateY(-50%); pointer-events: none; }
.cd-input, .cd-select { width: 100%; height: 46px; border: 1px solid var(--cd-line); border-radius: 10px; color: var(--cd-text); background: #fff; outline: none; }
.cd-input { padding: 0 42px; }
.cd-input:focus, .cd-select:focus { border-color: #55bd8c; box-shadow: 0 0 0 3px rgba(22, 184, 119, .1); }
.cd-select { padding: 0 34px 0 13px; }
.cd-clear { position: absolute; top: 50%; right: 10px; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%; color: #6d7f75; background: transparent; transform: translateY(-50%); }
.cd-clear:hover { background: var(--cd-bg); }
.cd-clear[hidden] { display: none; }
.cd-results { min-height: 34px; display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 15px; color: var(--cd-muted); font-size: 13px; }
.cd-results strong { color: var(--cd-brand); }
.cd-reset { padding: 4px 0; border: 0; color: var(--cd-brand); background: none; font-weight: 800; }
.cd-reset[hidden] { display: none; }

.cd-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.cd-card { min-width: 0; overflow: hidden; display: flex; flex-direction: column; border: 1px solid var(--cd-line); border-radius: 17px; background: #fff; box-shadow: 0 2px 5px rgba(15, 45, 29, .025); transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.cd-card:hover { transform: translateY(-5px); border-color: #b8dfc9; box-shadow: var(--cd-shadow); }
.cd-card__cover { position: relative; aspect-ratio: 16 / 9; overflow: hidden; display: grid; place-items: center; color: rgba(255,255,255,.85); background: linear-gradient(135deg, var(--subject-color, var(--cd-brand)), var(--cd-brand-dark)); }
.cd-card__cover::after { content: "3D"; position: absolute; font-size: 44px; font-weight: 900; opacity: .25; }
.cd-card__cover img { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.cd-card:hover .cd-card__cover img { transform: scale(1.04); }
.cd-card__badges { position: absolute; z-index: 2; top: 12px; left: 12px; right: 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; pointer-events: none; }
.cd-badge { padding: 4px 9px; border-radius: 999px; background: rgba(255,255,255,.94); box-shadow: 0 3px 10px rgba(15,26,21,.12); font-size: 11px; font-weight: 800; }
.cd-badge--subject { color: var(--subject-color, var(--cd-brand)); }
.cd-badge--type { color: #5f7067; }
.cd-card__body { flex: 1; display: flex; flex-direction: column; padding: 18px 19px 16px; }
.cd-card h3 { font-size: 18px; line-height: 1.45; }
.cd-card__question { display: -webkit-box; overflow: hidden; min-height: 46px; margin-top: 9px; color: var(--cd-text); font-size: 13px; line-height: 1.75; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.cd-card__textbook { display: flex; gap: 7px; margin-top: 14px; color: var(--cd-muted); font-size: 12px; line-height: 1.6; }
.cd-card__textbook svg { width: 15px; height: 15px; margin-top: 2px; flex: none; }
.cd-card__textbook span { display: -webkit-box; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.cd-card__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--cd-line); }
.cd-card__steps { color: var(--cd-muted); font-size: 12px; }
.cd-card__open { display: inline-flex; align-items: center; gap: 6px; color: var(--cd-brand); font-size: 13px; font-weight: 900; }
.cd-card__open svg { width: 16px; height: 16px; transition: transform .16s ease; }
.cd-card:hover .cd-card__open svg { transform: translateX(3px); }
.cd-empty { grid-column: 1 / -1; padding: 70px 20px; border: 1px dashed #cddbd2; border-radius: 17px; background: rgba(255,255,255,.7); text-align: center; }
.cd-empty h3 { font-size: 20px; }
.cd-empty p { margin-top: 8px; color: var(--cd-muted); }
.cd-empty button, .cd-empty__button { margin-top: 20px; padding: 10px 18px; border: 0; border-radius: 9px; color: #fff; background: var(--cd-brand); font-weight: 800; }
.cd-skeleton { min-height: 390px; border: 1px solid var(--cd-line); border-radius: 17px; background: linear-gradient(100deg, #fff 20%, #f2f6f3 40%, #fff 60%); background-size: 200% 100%; animation: cd-shimmer 1.4s infinite; }
@keyframes cd-shimmer { to { background-position-x: -200%; } }

.cd-footer { padding: 28px 0; border-top: 1px solid var(--cd-line); background: #fff; }
.cd-footer__inner { display: flex; align-items: flex-start; justify-content: space-between; gap: 28px; }
.cd-footer p { max-width: 760px; color: var(--cd-muted); font-size: 12px; }
.cd-footer a { color: var(--cd-brand); font-weight: 800; }
.cd-footer__links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 16px; font-size: 12px; white-space: nowrap; }
.cd-toast { position: fixed; z-index: 30; left: 50%; bottom: 28px; max-width: calc(100% - 32px); padding: 11px 18px; border-radius: 10px; color: #fff; background: var(--cd-ink); box-shadow: var(--cd-shadow); opacity: 0; transform: translate(-50%, 12px); transition: opacity .2s ease, transform .2s ease; pointer-events: none; }
.cd-toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 1023px) {
  .cd-hero__inner { gap: 30px; }
  .cd-subject-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cd-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cd-toolbar, .cd-toolbar--compact { grid-template-columns: 1fr 1fr; }
  .cd-field--search { grid-column: 1 / -1; }
}
@media (max-width: 719px) {
  .cd-container { width: min(100% - 28px, 1240px); }
  .cd-header__inner { min-height: 60px; gap: 12px; }
  .cd-brand { gap: 9px; }
  .cd-brand img { width: 112px; height: 29px; }
  .cd-brand__divider, .cd-brand__name { display: none; }
  .cd-nav a { padding: 7px 9px; font-size: 12px; }
  .cd-nav a:first-child { display: none; }
  .cd-hero { padding: 40px 0 34px; }
  .cd-hero__inner { grid-template-columns: 1fr; gap: 24px; }
  .cd-hero h1 { font-size: clamp(34px, 10vw, 46px); }
  .cd-hero__desc { font-size: 14px; }
  .cd-hero__search input { height: 52px; }
  .cd-hero__panel { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 16px; padding: 16px 18px; }
  .cd-hero__panel strong { font-size: 32px; }
  .cd-hero__random { width: auto; margin-top: 0; padding-inline: 15px; }
  .cd-main { padding: 25px 0 44px; }
  .cd-subject-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-bottom: 25px; }
  .cd-subject-card { min-height: 94px; padding: 13px; }
  .cd-section-head { align-items: flex-start; flex-direction: column; gap: 7px; }
  .cd-section-head h2 { font-size: 24px; }
  .cd-toolbar, .cd-toolbar--compact { grid-template-columns: 1fr; }
  .cd-field--search { grid-column: auto; }
  .cd-grid { grid-template-columns: 1fr; gap: 16px; }
  .cd-card__question { min-height: auto; }
  .cd-footer__inner { flex-direction: column; }
  .cd-footer__links { justify-content: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
