/* Shared page shell and palette from the 点酷网 quiz and analysis pages. */
.dkes-page-main {
  min-height: 55vh;
  padding: 1px 0 44px;
  background:
    radial-gradient(circle at 21px 21px, rgba(85,136,245,.07) 0 2px, transparent 3px) 0 0 / 42px 42px,
    linear-gradient(#fff9ed 0%, #fffdf8 54%, #f5fbff 100%);
}
:where(.dkes-page-container) {
  box-sizing: border-box;
  max-width: 1200px;
  margin: .5rem auto 0;
  padding: 0 16px;
}
@media (min-width: 576px) {
  :where(.dkes-page-container) { margin-top: 1.5rem; }
}
.dkes-page-container { width: 100%; }
.dkes-app {
  /* RiPro pads every section. Only the theme container should space this page from the navigation. */
  margin: 0;
  padding: 0;
  --ink: #292b4a;
  --muted: #666880;
  --line: #e5dacb;
  --blue: #3764d2;
  --blue-soft: #eaf1ff;
  min-width: 0;
  width: 100%;
  color: var(--ink);
  font: 16px/1.65 Nunito,"PingFang SC","Microsoft YaHei",system-ui,sans-serif;
  text-align: left;
}
.dkes-app, .dkes-app *, .dkes-app *::before, .dkes-app *::after { box-sizing: border-box; }
.dkes-app [hidden] { display: none !important; }
.dkes-app :is(h1,h2,h3,p) {
  padding: 0;
  margin: 0;
  color: inherit;
  font-family: inherit;
}
.dkes-app :is(button,input,a) { color: inherit; font: inherit; text-transform: none; letter-spacing: normal; }
.dkes-app button { cursor: pointer; line-height: 1.4; }
.dkes-app button:disabled { cursor: default; }
.dkes-app button, .dkes-app a { touch-action: manipulation; }
.dkes-app a { text-decoration: none; }
.dkes-app :is(button,a,input):focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.dkes-app svg { width: 18px; height: 18px; flex-shrink: 0; vertical-align: middle; }
.dkes-sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

.dkes-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 167px;
  padding: 19px clamp(24px,3.3vw,38px);
  border: 3px solid var(--ink);
  border-radius: 23px;
  box-shadow: 5px 6px 0 #292b4a16;
  background:
    radial-gradient(circle at 30px 30px, rgba(255,255,255,.86) 0 3px, transparent 4px) 0 0 / 54px 54px,
    linear-gradient(135deg, #f4f7ff 0%, #eaf1ff 52%, #e0f8f0 100%);
}
.dkes-hero::before, .dkes-hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  width: 230px;
  height: 230px;
  border-radius: 50%;
  pointer-events: none;
}
.dkes-hero::before { top: -172px; left: -100px; background: #ffe4a5; }
.dkes-hero::after { bottom: -178px; right: -68px; background: #d5d2f4; }
.dkes-hero-copy { width: min(460px,60%); min-width: 0; }
.dkes-app .dkes-hero h1 { margin: 0 0 14px; font-size: clamp(26px,3vw,34px); font-weight: 950; line-height: 1.2; letter-spacing: -.032em; }
.dkes-hero-art { display: block; width: min(31%,270px); height: 126px; object-fit: contain; }
.dkes-search {
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: 410px;
  margin: 0;
  padding: 3px 3px 3px 12px;
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 13px;
  box-shadow: 3px 3px 0 #292b4a17;
}
.dkes-search > svg { color: var(--muted); }
.dkes-app .dkes-search input {
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: 0;
  height: 31px;
  line-height: 31px;
  font-size: 14px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.dkes-search input::placeholder { color: #77798a; }
.dkes-app .dkes-search input:focus-visible { outline: none; }
.dkes-search:focus-within { outline: 2px solid #7298eb; outline-offset: 2px; }
.dkes-app .dkes-search button { padding: 6px 17px; border: 0; border-radius: 8px; background: var(--blue); color: #fff; font-size: 14px; font-weight: 750; white-space: nowrap; }

/* The category panel is separate from the results so changes of scope stay visible. */
.dkes-app .dkes-categories {
  display: block;
  margin: 17px 0 0;
  padding: 17px 23px 19px;
  border: 2px solid var(--ink);
  border-radius: 19px;
  background: #fff;
  box-shadow: 4px 5px 0 #292b4a12;
}
.dkes-directory-heading, .dkes-results-head, .dkes-result-title, .dkes-card-info {
  display: flex; align-items: center; flex-wrap: wrap; gap: 13px;
}
.dkes-app .dkes-directory-heading h2, .dkes-app .dkes-results-head h2 {
  margin: 0; font-size: 20px; line-height: 1.65; font-weight: 850; letter-spacing: -.03em; color: var(--ink);
}
.dkes-app .dkes-all-category {
  display: inline-flex; align-items: center; gap: 7px;
  max-width: 100%; margin: 0; padding: 4px 6px 4px 11px;
  color: #535e7b; background: #fff;
  border: 1px solid #d9dfef; border-radius: 18px; box-shadow: none;
  font-size: 13px; font-weight: 700;
}
.dkes-app .dkes-all-category[aria-pressed="true"] { color: #fff; background: var(--blue); border-color: var(--blue); }
.dkes-app .dkes-filter-label { min-width: 0; overflow-wrap: anywhere; }
.dkes-app .dkes-filter-count {
  display: inline-flex; flex: none; align-items: center; justify-content: center;
  min-width: 22px; min-height: 20px; padding: 1px 6px;
  border-radius: 999px; background: #edf1f7; color: #52627c;
  font-size: 11px; font-weight: 760; line-height: 1.2;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.dkes-app .dkes-all-category[aria-pressed="true"] .dkes-filter-count { background: #fff; color: #294ea2; }

.dkes-majors { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: 8px; margin-top: 13px; }
.dkes-app .dkes-major {
  display: flex; align-items: center; justify-content: flex-start; gap: 5px;
  min-height: 39px; min-width: 0; margin: 0; padding: 6px;
  color: #293149; background: #fff;
  border: 1px solid #dfe3ee; border-radius: 10px; box-shadow: none;
  font-size: clamp(13px,1.1vw,14px); font-weight: 720; line-height: 1.4; text-align: left;
  overflow-wrap: anywhere;
}
.dkes-app .dkes-major .dkes-filter-label { text-wrap: balance; }
.dkes-app .dkes-major .dkes-filter-count { min-width: 20px; margin-inline-start: auto; padding-inline: 4px; }
.dkes-app .dkes-major[aria-pressed="true"] .dkes-filter-count,
.dkes-app .dkes-subcategory[aria-pressed="true"] .dkes-filter-count { background: #d5e2ff; color: #244b9b; }
.dkes-app .dkes-major:hover, .dkes-app .dkes-all-category:not([aria-pressed="true"]):hover {
  border-color: #93aee5; background: #f6f8fd;
}
.dkes-app .dkes-major[aria-pressed="true"] {
  border: 2px solid #396bd6; padding: 5px; color: #254fae; background: #eef3ff;
}
.dkes-major-icon {
  display: grid; flex: none; place-items: center; width: 23px; height: 23px;
  border-radius: 7px; background: #eaf0ff; color: #4265ac;
}
.dkes-major-icon svg { width: 17px; height: 17px; }
.dkes-major:nth-child(4n+2) .dkes-major-icon { background: #ebf5ed; color: #34795b; }
.dkes-major:nth-child(4n+3) .dkes-major-icon { background: #f2ecf9; color: #80529e; }
.dkes-major:nth-child(4n+4) .dkes-major-icon { background: #fdf0e7; color: #a0653a; }

.dkes-subcategories {
  display: flex; align-items: center; flex-wrap: wrap; gap: 5px;
  margin-top: 11px; padding: 9px 10px; border: 1px solid #dae4fb; border-radius: 10px;
  background: #f3f6fd;
}
.dkes-app .dkes-subcategory {
  display: inline-flex; align-items: center; gap: 5px;
  margin: 0; padding: 4px 7px; max-width: 100%;
  color: #495575; background: transparent;
  border: 0; border-radius: 6px; box-shadow: none;
  font-size: 13px; overflow-wrap: anywhere;
}
.dkes-app .dkes-subcategory .dkes-filter-count {
  min-width: 18px; min-height: 17px; padding-inline: 4px; background: #e4ebf7; color: #566582;
}
.dkes-app .dkes-subcategory:hover { color: var(--blue); background: #eaf0fc; }
.dkes-app .dkes-subcategory[aria-pressed="true"] { background: #e0e9ff; color: #2455b1; font-weight: 780; }

.dkes-results-head { margin: 20px 0 10px; scroll-margin-top: 96px; }
.dkes-results-head:focus { outline: none; }
.dkes-result-title { min-width: 0; overflow-wrap: anywhere; }
.dkes-count { color: #65718a; font-size: 13px; }
.dkes-card-info { justify-content: space-between; gap: 3px 10px; }
.dkes-app .dkes-quiet {
  min-width: 0; max-width: 100%; margin: 0; padding: 7px 15px;
  color: var(--ink); font-size: 14px; font-weight: 680; overflow-wrap: anywhere;
  border: 1.5px solid var(--line); border-radius: 11px; background: #fff;
}
.dkes-app .dkes-quiet:hover { background: var(--blue-soft); }
.dkes-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 13px; }
.dkes-card { min-width: 0; overflow: hidden; display: flex; flex-direction: column; background: #fff; border: 1.4px solid #d9ddea; border-radius: 13px; }
.dkes-app .dkes-card-visual {
  width: 100%;
  display: grid;
  place-items: center;
  position: relative;
  aspect-ratio: 1.7;
  padding: 8px;
  border: 0;
  border-bottom: 1px solid #e3e6ed;
  border-radius: 0;
}
/* Only preview surfaces get the original 8px squares; the asset remains transparent. */
.dkes-app .dkes-card-visual, .dkes-app .dkes-preview-canvas {
  background-color: #fafbfe;
  background-image:
    linear-gradient(45deg, #f1f3f7 25%, transparent 25%),
    linear-gradient(-45deg, #f1f3f7 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #f1f3f7 75%),
    linear-gradient(-45deg, transparent 75%, #f1f3f7 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}
.dkes-app .dkes-card-visual:focus-visible { outline-offset: -4px; }
.dkes-card-visual img { position: absolute; inset: 0; width: 100%; height: 100%; padding: 5px; object-fit: contain; transition: transform .16s; }
.dkes-card-visual:hover img { transform: scale(1.035); }
.dkes-card-content { display: flex; flex: 1; flex-direction: column; justify-content: space-between; gap: 7px; padding: 10px; }
.dkes-app .dkes-card-info h3 { font-size: 15px; line-height: 1.45; font-weight: 820; overflow-wrap: anywhere; }
.dkes-card-info > span { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.dkes-app .dkes-download, .dkes-app .dkes-primary {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-height: 36px;
  padding: 7px 8px;
  border: 1.5px solid var(--ink);
  border-radius: 10px;
  box-shadow: 2px 3px 0 #292b4a1c;
  color: #fff;
  background: var(--blue);
  font-size: 13px;
  font-weight: 780;
  line-height: 1.4;
  text-align: center;
  overflow-wrap: anywhere;
}
.dkes-app .dkes-card .dkes-download {
  min-height: 30px; padding: 4px 8px; color: #345dbc; background: #f0f4ff;
  border: 1px solid #cfdbf5; border-radius: 7px; box-shadow: none;
  font-size: 12px; font-weight: 700;
}
.dkes-app .dkes-download:disabled:not([aria-busy]) {
  color: #65718b; background: #f3f5f9; border-color: #dce2eb; box-shadow: none; opacity: 1;
}
.dkes-app .dkes-card .dkes-download:enabled:hover { color: #254fae; background: #e4ebff; }
.dkes-app .dkes-download:not(:disabled):hover, .dkes-app .dkes-primary:hover, .dkes-app .dkes-search button:hover { color: #fff; background: #2b53b6; }
.dkes-download > span:first-child { display: inline-flex; align-items: center; }
.dkes-download svg { width: 14px; height: 14px; }
.dkes-app .dkes-pagination {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px 16px;
  margin: 24px 0 0; padding: 0; color: var(--muted); font-size: 13px;
}
.dkes-app .dkes-page-stepper, .dkes-app .dkes-page-jump {
  display: flex; align-items: center; justify-content: center; max-width: 100%; gap: 7px;
}
.dkes-app .dkes-page-jump { margin: 0; padding: 0 0 0 16px; border-inline-start: 1px solid #d9dfec; }
.dkes-app .dkes-page-field { display: inline-flex; margin: 0; }
.dkes-app .dkes-pagination button, .dkes-app .dkes-page-input {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  height: 36px; margin: 0; padding: 0 11px; box-shadow: none;
  border: 1px solid #cbd5e8; border-radius: 9px;
  background: #fff; color: #34435f; font-size: 13px; line-height: 1.35; font-weight: 700;
}
.dkes-app .dkes-pagination button:enabled:hover { border-color: #8ba6df; background: var(--blue-soft); color: #244d9f; }
.dkes-app .dkes-pagination button:disabled { border-color: #dfe3ec; background: #f7f8fb; color: #7c8596; opacity: 1; }
.dkes-app .dkes-page-status {
  min-width: 6ch; text-align: center; color: #475671; font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.dkes-app .dkes-page-input {
  display: block; width: 65px; padding: 0 5px; color: var(--ink); text-align: center;
  font-variant-numeric: tabular-nums; appearance: textfield;
}
.dkes-app .dkes-page-input::placeholder { color: #6c778c; font-weight: 500; opacity: 1; }
.dkes-app .dkes-page-input::-webkit-inner-spin-button,
.dkes-app .dkes-page-input::-webkit-outer-spin-button { margin: 0; appearance: none; }
.dkes-app .dkes-pagination .dkes-page-submit { border-color: var(--blue); background: var(--blue); color: #fff; }
.dkes-app .dkes-pagination .dkes-page-submit:enabled:hover { border-color: #2b53b6; background: #2b53b6; color: #fff; }
.dkes-app .dkes-pagination :is(button,input):focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.dkes-app .dkes-pagination svg { width: 14px; height: 14px; }
.dkes-feedback { padding: 38px 14px; text-align: center; }
.dkes-feedback strong { display: block; margin-bottom: 12px; font-size: 16px; }
.dkes-feedback strong:last-child { margin: 0; }
.dkes-skeleton { aspect-ratio: 1.05; border-radius: 16px; background: #f4efe8; }
.dkes-image-error::after { content: '预览暂不可用'; font-size: 13px; color: var(--muted); }

.dkes-app .dkes-dialog {
  position: fixed;
  inset: 0;
  width: 400px;
  max-width: calc(100vw - 32px);
  height: fit-content;
  max-height: calc(100vh - 40px);
  max-height: calc(100dvh - 40px);
  padding: 0;
  margin: auto;
  color: var(--ink);
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 22px;
  box-shadow: 6px 7px 0 #292b4a33;
  overflow: auto;
}
.dkes-dialog::backdrop { background: rgba(36,42,66,.38); }
.dkes-dialog-content { padding: 28px; }
.dkes-app .dkes-dialog-close { position: absolute; z-index: 2; right: 11px; top: 11px; display: grid; place-items: center; width: 31px; height: 31px; padding: 5px; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 50%; }
.dkes-app .dkes-dialog h2 { margin: 0; font-size: 23px; line-height: 1.4; font-weight: 850; overflow-wrap: anywhere; }
.dkes-dialog h2:focus { outline: 0; }
.dkes-preview-modal { text-align: left; }
.dkes-preview-canvas { display: grid; place-items: center; height: 245px; border: 1px solid var(--line); border-radius: 15px; margin-bottom: 18px; }
.dkes-preview-canvas img { width: min(100%,245px); height: auto; aspect-ratio: 1; object-fit: contain; }
.dkes-app .dkes-preview-spec { margin: 7px 0 18px; font-size: 13px; color: #646d83; }
.dkes-app .dkes-download-large { min-height: 37px; margin-top: 10px; padding: 4px 8px; border: 1px solid #315bc5; border-radius: 7px; box-shadow: none; font-size: 12px; font-weight: 700; }
.dkes-app .dkes-primary { min-height: 42px; font-size: 15px; }
.dkes-gate h2 { padding-right: 25px; }
.dkes-app .dkes-gate-note { margin: 12px 0 22px; color: var(--muted); }
.dkes-toast { position: fixed; bottom: 24px; left: 50%; z-index: 10000; transform: translateX(-50%); width: max-content; max-width: calc(100vw - 24px); border-radius: 10px; padding: 11px 16px; background: var(--ink); color: white; font-size: 14px; }
.dkes-dialog-status { padding: 0 24px 18px; text-align: center; color: #a34d40; font-size: 13px; }

@media (max-width: 1050px) {
  .dkes-majors { grid-template-columns: repeat(4,minmax(0,1fr)); }
}
@media (min-width: 641px) and (max-width: 1199px) {
  .dkes-app .dkes-major { gap: 4px; padding-inline: 6px; font-size: 13px; }
  .dkes-app .dkes-major[aria-pressed="true"] { padding-inline: 5px; }
  .dkes-app .dkes-major-icon { width: 22px; height: 22px; }
  .dkes-app .dkes-major .dkes-filter-count { min-width: 19px; padding-inline: 4px; }
}
@media (max-width: 900px) {
  .dkes-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .dkes-hero { min-height: 165px; }
}
@media (min-width: 641px) and (max-width: 767px) {
  .dkes-app .dkes-majors { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media (max-width: 640px) {
  .dkes-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
  .dkes-hero { gap: 7px; min-height: 145px; padding: 20px 17px; border-radius: 22px; }
  .dkes-hero-copy { width: 67%; flex-grow: 1; }
  .dkes-hero-art { width: 27%; }
  .dkes-app .dkes-hero h1 { margin-bottom: 12px; font-size: clamp(21px,5.4vw,30px); }
  .dkes-app .dkes-search button { padding: 6px 8px; font-size: 12px; }
  .dkes-search { gap: 4px; padding-left: 7px; }
  .dkes-search > svg { width: 14px; }
  .dkes-app .dkes-categories { margin-top: 14px; padding: 13px 12px; border-radius: 16px; }
  .dkes-majors { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px; margin-top: 10px; }
  .dkes-app .dkes-major { min-height: 38px; gap: 5px; font-size: 13px; }
  .dkes-app .dkes-major-icon { width: 22px; height: 22px; }
  .dkes-app .dkes-major .dkes-filter-count { min-width: 19px; padding-inline: 4px; }
  .dkes-directory-heading, .dkes-result-title { gap: 8px; }
  .dkes-app .dkes-directory-heading h2, .dkes-app .dkes-results-head h2 { font-size: 17px; }
  .dkes-subcategories { padding: 7px; gap: 3px; }
  .dkes-app .dkes-subcategory { min-height: 30px; }
  .dkes-results-head { margin: 14px 0 8px; }
  .dkes-card { border-radius: 12px; }
  .dkes-card-visual img { padding: 4px; }
  .dkes-card-content { padding: 9px; gap: 8px; }
  .dkes-app .dkes-card-info h3 { font-size: 14px; }
  .dkes-card-info > span { font-size: 11px; }
  .dkes-app .dkes-card .dkes-download { gap: 3px; min-height: 32px; padding: 6px 2px; font-size: 12px; }
  .dkes-card .dkes-download svg { width: 12px; }
  .dkes-dialog-content { padding: 22px; }
}
@media (max-width: 480px) {
  .dkes-app .dkes-pagination { flex-direction: column; gap: 10px; margin-top: 20px; }
  .dkes-app .dkes-page-jump { padding: 0; border: 0; }
  .dkes-app .dkes-pagination button, .dkes-app .dkes-page-input { height: 38px; }
}
@media (max-width: 360px) {
  .dkes-grid { gap: 7px; }
  .dkes-app .dkes-categories { padding-inline: 9px; }
  .dkes-app .dkes-major { padding-inline: 5px; gap: 4px; }
  .dkes-app .dkes-major[aria-pressed="true"] { padding-inline: 4px; }
  .dkes-card-content { padding-inline: 6px; }
  .dkes-card .dkes-download > span:first-child { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .dkes-card-visual img { transition: none; }
}
