:root {
  color-scheme: light;
  --ink: #111111;
  --ink-soft: #333331;
  --muted: #74746f;
  --paper: #f5f5f2;
  --surface: #ffffff;
  --surface-muted: #ecece8;
  --line: #deded8;
  --line-strong: #bcbcb5;
  --danger: #781f1f;
  --danger-soft: #f5e8e7;
  --shadow: 0 18px 50px rgba(17, 17, 17, 0.07);
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 26px;
  --content-width: 1180px;
  --system-font: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC",
    "Source Han Sans SC", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--paper);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(rgba(17, 17, 17, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17, 17, 17, 0.025) 1px, transparent 1px),
    var(--paper);
  background-size: 48px 48px;
  font-family: var(--system-font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.dialog-open {
  overflow: hidden;
}

body.guest-mode #header-manage,
body.guest-mode #footer-manage {
  display: none;
}

button,
input,
textarea {
  color: inherit;
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

svg {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

a {
  color: inherit;
}

[hidden] {
  display: none !important;
}

::selection {
  color: var(--surface);
  background: var(--ink);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-shell {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
}

.site-header {
  position: relative;
  z-index: 10;
  display: flex;
  width: min(100% - 40px, var(--content-width));
  min-height: 84px;
  align-items: center;
  justify-content: space-between;
  margin: 0 auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 30px;
  height: 30px;
  padding: 6px;
  border-radius: 9px;
  background: var(--ink);
  grid-template-columns: repeat(2, 1fr);
  gap: 3px;
}

.brand-mark i {
  border-radius: 2px;
  background: var(--paper);
}

.brand-mark i:last-child {
  background: #858580;
}

.text-button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  gap: 7px;
}

.text-button:hover {
  color: var(--ink);
}

.text-button svg {
  width: 17px;
  height: 17px;
}

main {
  flex: 1;
}

.view {
  width: min(100% - 40px, var(--content-width));
  margin: 0 auto;
  animation: view-in 420ms cubic-bezier(0.2, 0.75, 0.25, 1) both;
}

.hero {
  padding: 72px 0 48px;
  text-align: center;
}

.eyebrow {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.hero h1,
.admin-heading h1 {
  margin: 0;
  font-size: clamp(36px, 6vw, 68px);
  font-weight: 650;
  letter-spacing: -0.065em;
  line-height: 1.05;
}

.hero-copy {
  margin: 20px auto 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}

.search-wrap {
  display: flex;
  width: min(100%, 720px);
  min-height: 62px;
  align-items: center;
  padding: 0 18px;
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 10px 32px rgba(17, 17, 17, 0.04);
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.search-wrap:focus-within {
  border-color: var(--ink);
  box-shadow: 0 13px 38px rgba(17, 17, 17, 0.08);
}

.search-icon {
  width: 21px;
  height: 21px;
  flex: 0 0 auto;
  color: var(--muted);
}

.search-wrap input {
  width: 100%;
  height: 60px;
  padding: 0 14px;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 15px;
}

.search-wrap input::placeholder {
  color: #979792;
}

.search-wrap input::-webkit-search-cancel-button {
  display: none;
}

.search-clear {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--surface-muted);
  color: var(--muted);
  opacity: 0;
  pointer-events: none;
  transform: scale(0.85);
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.search-wrap.has-value .search-clear {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

.search-clear:hover {
  color: var(--ink);
}

.search-clear svg {
  width: 15px;
  height: 15px;
}

kbd {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  margin-left: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--muted);
  font-family: inherit;
  font-size: 11px;
}

.category-bar {
  display: flex;
  min-height: 88px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.category-list {
  display: flex;
  min-width: 0;
  align-items: center;
  padding: 4px 0;
  overflow-x: auto;
  scrollbar-width: none;
  gap: 7px;
}

.category-list::-webkit-scrollbar {
  display: none;
}

.category-chip {
  min-height: 36px;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition:
    color 150ms ease,
    background 150ms ease,
    border-color 150ms ease;
}

.category-chip:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.65);
}

.category-chip[aria-pressed="true"] {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--surface);
}

.results-summary {
  flex: 0 0 auto;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.resource-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.resource-card {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 226px;
  flex-direction: column;
  align-items: center;
  padding: 24px 18px 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.84);
  transition:
    border-color 200ms ease,
    box-shadow 200ms ease,
    transform 200ms ease;
}

.resource-card::after {
  position: absolute;
  right: -50px;
  bottom: -75px;
  width: 140px;
  height: 140px;
  border: 1px solid rgba(17, 17, 17, 0.04);
  border-radius: 50%;
  content: "";
}

@media (hover: hover) {
  .resource-card:hover {
    border-color: var(--line-strong);
    box-shadow: var(--shadow);
    transform: translateY(-3px);
  }
}

.resource-icon {
  position: relative;
  display: grid;
  width: 76px;
  height: 76px;
  flex: 0 0 auto;
  place-items: center;
  margin-bottom: 18px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 22px;
  background: var(--ink);
  color: var(--surface);
  box-shadow:
    0 12px 24px rgba(17, 17, 17, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.resource-icon::after {
  position: absolute;
  inset: 1px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 20px;
  content: "";
  pointer-events: none;
}

.resource-icon svg {
  width: 35px;
  height: 35px;
  stroke-width: 1.55;
}

.resource-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.resource-icon.is-clickable {
  cursor: pointer;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease;
}

@media (hover: hover) {
  .resource-icon.is-clickable:hover {
    box-shadow:
      0 15px 32px rgba(17, 17, 17, 0.22),
      inset 0 1px 0 rgba(255, 255, 255, 0.14);
    transform: translateY(-2px) scale(1.02);
  }
}

.resource-name {
  display: -webkit-box;
  min-height: 45px;
  margin: 0 0 16px;
  overflow: hidden;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.018em;
  line-height: 1.45;
  text-align: center;
  text-overflow: ellipsis;
  word-break: break-word;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.download-actions {
  position: relative;
  z-index: 1;
  display: flex;
  width: 100%;
  margin-top: auto;
  gap: 6px;
}

.download-button {
  position: relative;
  z-index: 1;
  display: flex;
  width: 100%;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  margin-top: auto;
  border: 1px solid var(--ink);
  border-radius: 13px;
  background: var(--ink);
  color: var(--surface);
  font-size: 12px;
  font-weight: 650;
  gap: 7px;
  transition:
    background 160ms ease,
    color 160ms ease;
}

.download-actions .download-button {
  margin-top: 0;
}

.download-more {
  display: grid;
  width: 42px;
  min-width: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  color: var(--ink);
}

.download-more:hover {
  border-color: var(--line-strong);
  background: var(--surface-muted);
}

.download-more svg {
  width: 16px;
  height: 16px;
}

.download-button svg {
  width: 15px;
  height: 15px;
  transition: transform 160ms ease;
}

.download-button:hover:not(:disabled) {
  background: var(--ink-soft);
}

.download-button:hover:not(:disabled) svg {
  transform: translateY(2px);
}

.download-button:disabled {
  border-color: var(--line);
  background: var(--surface-muted);
  color: var(--muted);
}

.empty-state {
  width: min(100%, 470px);
  padding: 56px 24px 72px;
  margin: 0 auto;
  text-align: center;
}

.empty-state > svg {
  width: 48px;
  height: 48px;
  margin: 0 auto 20px;
  color: var(--muted);
}

.empty-state h2 {
  margin: 0 0 10px;
  font-size: 20px;
  letter-spacing: -0.035em;
}

.empty-state p {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 14px;
}

.primary-button,
.secondary-button,
.danger-button,
.upload-button,
.quiet-button,
.back-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
  gap: 8px;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease;
}

.primary-button svg,
.secondary-button svg,
.back-button svg {
  width: 16px;
  height: 16px;
}

.primary-button {
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--surface);
}

.primary-button:hover {
  background: var(--ink-soft);
}

.primary-button.compact {
  min-height: 38px;
  padding: 0 13px;
  border-radius: 10px;
  font-size: 12px;
}

.secondary-button {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
}

.secondary-button:hover {
  border-color: var(--line-strong);
  background: var(--surface);
}

.danger-button {
  border: 1px solid transparent;
  background: transparent;
  color: var(--danger);
}

.danger-button:hover {
  border-color: #e3c7c4;
  background: var(--danger-soft);
}

.quiet-button {
  min-height: 34px;
  padding: 0 5px;
  border: 0;
  background: transparent;
  color: var(--muted);
}

.quiet-button:hover {
  color: var(--ink);
}

.site-footer {
  display: flex;
  width: min(100% - 40px, var(--content-width));
  min-height: 108px;
  align-items: center;
  justify-content: space-between;
  margin: 44px auto 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.site-footer p {
  display: flex;
  align-items: center;
  margin: 0;
  gap: 8px;
}

.local-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #6d6d68;
  box-shadow: 0 0 0 4px rgba(109, 109, 104, 0.1);
}

/* Admin */
.admin-view {
  padding-bottom: 24px;
}

.admin-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 52px 0 32px;
  gap: 28px;
}

.admin-heading .back-button {
  min-height: 34px;
  padding: 0;
  margin-bottom: 28px;
  border: 0;
  background: transparent;
  color: var(--muted);
}

.admin-heading .back-button:hover {
  color: var(--ink);
}

.admin-heading h1 {
  font-size: clamp(38px, 5vw, 58px);
}

.admin-heading > div > p:last-child {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.admin-tools {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.admin-layout {
  display: grid;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: var(--shadow);
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 10px;
}

.admin-collection,
.editor-panel {
  border-radius: 22px;
  background: var(--surface);
}

.admin-collection {
  display: flex;
  min-height: 700px;
  flex-direction: column;
  padding: 20px 12px 12px;
  border: 1px solid #e9e9e4;
}

.collection-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px 14px;
}

.collection-top h2 {
  margin: 0 0 3px;
  font-size: 15px;
  letter-spacing: -0.02em;
}

.collection-top p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.admin-search {
  display: flex;
  min-height: 42px;
  align-items: center;
  padding: 0 11px;
  margin-bottom: 8px;
  border-radius: 11px;
  background: var(--paper);
}

.admin-search svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  color: var(--muted);
}

.admin-search input {
  width: 100%;
  height: 41px;
  padding: 0 9px;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 12px;
}

.admin-search input::-webkit-search-cancel-button {
  display: none;
}

.admin-list {
  min-height: 0;
  flex: 1;
  overflow: auto;
}

.admin-list-empty {
  padding: 44px 10px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.admin-row {
  display: flex;
  align-items: center;
  padding: 3px;
  border-radius: 13px;
  gap: 2px;
}

.admin-row[data-active="true"] {
  background: var(--surface-muted);
}

.admin-item {
  display: flex;
  min-width: 0;
  min-height: 56px;
  flex: 1;
  align-items: center;
  padding: 7px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  text-align: left;
  gap: 10px;
}

.admin-item:hover {
  background: rgba(17, 17, 17, 0.035);
}

.mini-icon {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  overflow: hidden;
  border-radius: 11px;
  background: var(--ink);
  color: var(--surface);
}

.mini-icon svg {
  width: 19px;
  height: 19px;
  stroke-width: 1.5;
}

.mini-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.admin-item-copy {
  min-width: 0;
}

.admin-item-copy strong,
.admin-item-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-item-copy strong {
  margin-bottom: 3px;
  font-size: 12px;
  font-weight: 650;
}

.admin-item-copy small {
  color: var(--muted);
  font-size: 10px;
}

.order-controls {
  display: flex;
  flex-direction: column;
  opacity: 0;
  transition: opacity 140ms ease;
}

.admin-row:hover .order-controls,
.admin-row:focus-within .order-controls {
  opacity: 1;
}

.order-controls button {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
}

.order-controls button:hover:not(:disabled) {
  background: var(--surface);
  color: var(--ink);
}

.order-controls button:disabled {
  opacity: 0.22;
}

.order-controls svg {
  width: 13px;
  height: 13px;
}

.reset-button {
  min-height: 36px;
  margin-top: 8px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
}

.reset-button:hover {
  color: var(--danger);
}

.editor-panel {
  padding: 28px 30px 24px;
  border: 1px solid #e9e9e4;
}

.editor-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.section-label {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.editor-top h2 {
  margin: 0;
  font-size: 24px;
  letter-spacing: -0.04em;
}

.draft-state {
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 10px;
}

.draft-state[data-dirty="true"] {
  border-color: #d0d0ca;
  background: var(--surface-muted);
  color: var(--ink);
}

.icon-editor {
  display: flex;
  align-items: center;
  padding: 24px 0;
  gap: 18px;
}

.editor-icon-preview {
  display: grid;
  width: 94px;
  height: 94px;
  flex: 0 0 auto;
  place-items: center;
  overflow: hidden;
  border-radius: 24px;
  background: var(--ink);
  color: var(--surface);
  box-shadow: 0 12px 30px rgba(17, 17, 17, 0.16);
}

.editor-icon-preview svg {
  width: 43px;
  height: 43px;
  stroke-width: 1.45;
}

.editor-icon-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.icon-editor-copy {
  min-width: 0;
}

.icon-editor-copy strong {
  display: block;
  margin-bottom: 5px;
  font-size: 13px;
}

.icon-editor-copy p {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.icon-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.upload-button {
  min-height: 32px;
  padding: 0 11px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 11px;
  cursor: pointer;
}

.upload-button:hover {
  border-color: var(--line-strong);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.field {
  min-width: 0;
  margin-bottom: 17px;
}

.field label {
  display: block;
  margin-bottom: 8px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 650;
}

.field input,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 11px;
  outline: 0;
  background: #fbfbf9;
  font-size: 13px;
  transition:
    border-color 150ms ease,
    background 150ms ease,
    box-shadow 150ms ease;
}

.field input {
  height: 46px;
  padding: 0 13px;
}

.field textarea {
  min-height: 92px;
  padding: 12px 13px;
  line-height: 1.6;
  resize: vertical;
}

.field input:focus,
.field textarea:focus {
  border-color: var(--ink);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(17, 17, 17, 0.06);
}

.field input[aria-invalid="true"] {
  border-color: var(--danger);
}

.field-hint,
.field-error {
  min-height: 0;
  margin: 5px 0 0;
  font-size: 10px;
  line-height: 1.4;
}

.field-hint {
  color: var(--muted);
}

.field-error {
  color: var(--danger);
}

.field-error:empty {
  display: none;
}

.editor-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 20px;
  margin-top: 1px;
  border-top: 1px solid var(--line);
  gap: 16px;
}

.editor-footer-actions {
  display: flex;
  margin-left: auto;
  gap: 8px;
}

.toast {
  position: fixed;
  z-index: 100;
  right: 24px;
  bottom: 24px;
  max-width: min(380px, calc(100vw - 32px));
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--ink);
  box-shadow: 0 15px 40px rgba(17, 17, 17, 0.2);
  color: var(--surface);
  font-size: 12px;
  line-height: 1.5;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast[data-tone="error"] {
  background: var(--danger);
}

.link-dialog {
  position: fixed;
  z-index: 200;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
}

.link-dialog-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  border: 0;
  background: rgba(17, 17, 17, 0.36);
  backdrop-filter: blur(5px);
}

.link-dialog-panel {
  position: relative;
  z-index: 1;
  width: min(100%, 430px);
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--paper);
  box-shadow: 0 28px 80px rgba(17, 17, 17, 0.22);
  animation: dialog-in 220ms cubic-bezier(0.2, 0.75, 0.25, 1) both;
}

.link-dialog-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.link-dialog-top h2 {
  margin: 0;
  font-size: 24px;
  letter-spacing: -0.04em;
}

.link-dialog-close {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
}

.link-dialog-close:hover {
  border-color: var(--line-strong);
}

.link-dialog-close svg {
  width: 16px;
  height: 16px;
}

.link-dialog-copy {
  margin: 10px 0 20px;
  color: var(--muted);
  font-size: 12px;
}

.download-options {
  display: grid;
  gap: 8px;
}

.download-option {
  display: flex;
  width: 100%;
  min-height: 66px;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  text-align: left;
  gap: 16px;
}

.download-option:hover {
  border-color: var(--ink);
}

.download-option-copy strong,
.download-option-copy small {
  display: block;
}

.download-option-copy strong {
  margin-bottom: 4px;
  font-size: 13px;
}

.download-option-copy small {
  color: var(--muted);
  font-size: 10px;
}

.download-option > svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

@keyframes view-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes dialog-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 1020px) {
  .resource-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .admin-layout {
    grid-template-columns: 280px minmax(0, 1fr);
  }
}

@media (max-width: 820px) {
  .resource-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .admin-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-layout {
    grid-template-columns: 1fr;
  }

  .admin-collection {
    min-height: 0;
  }

  .admin-list {
    max-height: 270px;
  }

  .editor-panel {
    padding: 24px 22px;
  }
}

@media (max-width: 600px) {
  .site-header {
    width: min(100% - 28px, var(--content-width));
    min-height: 72px;
  }

  .view {
    width: min(100% - 28px, var(--content-width));
  }

  .header-manage span {
    display: none;
  }

  .header-manage {
    width: 40px;
    justify-content: center;
  }

  .hero {
    padding: 48px 0 36px;
  }

  .hero h1 {
    font-size: clamp(31px, 9.6vw, 44px);
  }

  .hero-copy {
    max-width: 300px;
    margin-top: 15px;
    font-size: 13px;
  }

  .search-wrap {
    min-height: 56px;
    padding: 0 14px;
    border-radius: 15px;
  }

  .search-wrap input {
    height: 54px;
    padding: 0 11px;
    font-size: 14px;
  }

  .search-wrap kbd {
    display: none;
  }

  .category-bar {
    min-height: 74px;
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
  }

  .category-list {
    width: 100%;
    margin-top: 2px;
  }

  .category-chip {
    min-height: 34px;
    padding: 0 13px;
  }

  .results-summary {
    padding-left: 2px;
    font-size: 11px;
  }

  .resource-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }

  .resource-card {
    min-height: 199px;
    padding: 20px 12px 12px;
    border-radius: 21px;
  }

  .resource-icon {
    width: 66px;
    height: 66px;
    margin-bottom: 14px;
    border-radius: 19px;
  }

  .resource-icon::after {
    border-radius: 17px;
  }

  .resource-icon svg {
    width: 31px;
    height: 31px;
  }

  .resource-name {
    min-height: 38px;
    margin-bottom: 13px;
    font-size: 13px;
    line-height: 1.45;
  }

  .download-button {
    min-height: 39px;
  }

  .download-more {
    width: 39px;
    min-width: 39px;
    border-radius: 12px;
  }

  .link-dialog {
    align-items: end;
    padding: 0;
  }

  .link-dialog-panel {
    width: 100%;
    padding: 24px 18px calc(22px + env(safe-area-inset-bottom));
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 26px 26px 0 0;
  }

  .site-footer {
    width: min(100% - 28px, var(--content-width));
    min-height: 92px;
    margin-top: 24px;
  }

  .site-footer p {
    max-width: 145px;
  }

  .site-footer .text-button {
    font-size: 12px;
  }

  .admin-view {
    padding-bottom: 8px;
  }

  .admin-heading {
    padding: 34px 0 24px;
    gap: 22px;
  }

  .admin-heading .back-button {
    margin-bottom: 22px;
  }

  .admin-heading > div > p:last-child {
    max-width: 270px;
    line-height: 1.6;
  }

  .admin-tools {
    width: 100%;
  }

  .admin-tools .secondary-button,
  .admin-tools .primary-button {
    flex: 1;
    padding: 0 10px;
  }

  .admin-layout {
    padding: 6px;
    border-radius: 23px;
    gap: 6px;
  }

  .admin-collection,
  .editor-panel {
    border-radius: 18px;
  }

  .editor-panel {
    padding: 22px 16px;
  }

  .editor-top {
    padding-bottom: 19px;
  }

  .editor-top h2 {
    font-size: 21px;
  }

  .icon-editor {
    align-items: flex-start;
    padding: 20px 0;
    gap: 13px;
  }

  .editor-icon-preview {
    width: 76px;
    height: 76px;
    border-radius: 20px;
  }

  .editor-icon-preview svg {
    width: 35px;
    height: 35px;
  }

  .form-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .editor-footer {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .editor-footer-actions {
    width: 100%;
    margin-left: 0;
  }

  .editor-footer-actions .primary-button {
    flex: 1;
  }

  .danger-button {
    align-self: flex-start;
  }

  .toast {
    right: 16px;
    bottom: 16px;
    left: 16px;
    max-width: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
