:root {
  color-scheme: light;
  --accent: #d61f33;
  --accent-dark: #a91627;
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --line: #e5e7eb;
  --panel: #ffffff;
  --bg: #f5f5f7;
  --input: #f1f1f3;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

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

.shell {
  max-width: 1400px;
  margin: 0 auto;
  padding: 30px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0 34px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand img {
  width: 74px;
  height: 58px;
  object-fit: contain;
  padding: 6px;
  border-radius: 8px;
  background: #fff;
}

.brand h1 {
  margin: 0;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1;
  letter-spacing: 0;
}

.intro p,
.muted {
  color: var(--muted);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  font-weight: 700;
}

.button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.button.primary:hover {
  background: var(--accent-dark);
}

.home-page {
  background: linear-gradient(180deg, #ffffff 0%, var(--bg) 36%, #f7f8fa 100%);
  overflow-x: hidden;
}

.home-topbar {
  min-height: 118px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 24px clamp(24px, 6vw, 90px);
  border-bottom: 1px solid rgba(210, 214, 222, 0.8);
  background: rgba(255, 255, 255, 0.82);
}

.home-brand {
  display: flex;
  align-items: center;
  gap: 28px;
  min-width: 0;
}

.home-logo {
  width: 126px;
  height: 72px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #fff;
}

.home-logo img {
  width: 112px;
  height: 58px;
  object-fit: contain;
}

.home-divider {
  width: 1px;
  height: 50px;
  background: #d8dce3;
}

.home-brand-title {
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 800;
  letter-spacing: 0;
  white-space: nowrap;
}

.admin-btn {
  min-width: 152px;
  min-height: 58px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 0 24px;
  border: 1px solid #d9dde5;
  border-radius: 16px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 10px 28px rgba(17, 24, 39, 0.04);
  font-size: 16px;
  font-weight: 800;
}

.admin-btn svg {
  width: 24px;
  height: 24px;
  color: var(--accent);
}

.home-shell {
  position: relative;
  max-width: 1360px;
  margin: 0 auto;
  padding: clamp(48px, 6vw, 72px) 48px 42px;
}

.home-dots {
  position: absolute;
  right: -90px;
  top: 260px;
  width: 180px;
  height: 72px;
  background-image: radial-gradient(circle, rgba(214, 31, 51, 0.45) 1.7px, transparent 1.7px);
  background-size: 24px 24px;
  opacity: 0.62;
  pointer-events: none;
}

.home-intro {
  max-width: 760px;
  margin-bottom: clamp(48px, 6vw, 72px);
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 26px;
  color: var(--accent);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 3px;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 28px;
  height: 4px;
  border-radius: 999px;
  background: var(--accent);
}

.home-intro h1 {
  margin: 0 0 26px;
  font-size: clamp(52px, 5.1vw, 82px);
  line-height: 0.98;
  font-weight: 800;
  letter-spacing: 0;
  text-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
}

.home-intro p {
  margin: 0;
  max-width: 670px;
  color: var(--muted);
  font-size: clamp(18px, 2vw, 23px);
  line-height: 1.5;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 24px;
  width: 100%;
  margin-bottom: 38px;
}

.section-title-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 0 0 auto;
  font-size: 24px;
  font-weight: 800;
}

.section-icon {
  width: 31px;
  height: 31px;
  color: var(--accent);
}

.section-line {
  flex: 1;
  height: 1px;
  background: #cfd3dc;
}

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

.card {
  min-height: 430px;
  display: flex;
  flex-direction: column;
  position: relative;
  gap: 0;
  padding: 30px;
  border: 1px solid #e5e7ec;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 24px 56px rgba(22, 28, 45, 0.09);
  transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease;
}

.card:hover {
  transform: translateY(-6px);
  border-color: rgba(214, 31, 51, 0.2);
  box-shadow: 0 34px 70px rgba(22, 28, 45, 0.13);
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

.thumb {
  width: 134px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1px solid rgba(214, 31, 51, 0.14);
  border-radius: 24px;
  background: linear-gradient(145deg, #fff7f8, #f2e5e8);
  overflow: hidden;
  color: var(--accent);
  font-size: 58px;
  font-weight: 800;
}

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

.thumb.thumb-contain img {
  width: 82%;
  height: 82%;
  object-fit: contain;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 12px;
  background: #e9f8e9;
  color: #269341;
  font-size: 15px;
  font-weight: 700;
}

.status i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #35b653;
}

.category {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1.3px;
  font-size: 15px;
  font-weight: 800;
}

.category svg {
  width: 22px;
  height: 22px;
}

.card h2 {
  margin: 0 0 13px;
  font-size: clamp(24px, 2.2vw, 28px);
  line-height: 1.2;
  letter-spacing: 0;
  font-weight: 800;
}

.card p {
  margin: 0;
  max-width: 430px;
  color: #596172;
  font-size: 17px;
  line-height: 1.42;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.open-btn {
  width: 100%;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin-top: auto;
  border-radius: 10px;
  background: linear-gradient(90deg, #f20d25, var(--accent));
  color: #fff;
  box-shadow: 0 12px 24px rgba(214, 31, 51, 0.22);
  font-size: 17px;
  font-weight: 800;
}

.open-btn span {
  position: absolute;
  right: 24px;
  font-size: 28px;
  font-weight: 400;
}

.footer-note {
  margin-top: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: #7b8291;
  font-size: 15px;
}

.help-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 2px solid #9098a8;
  border-radius: 50%;
  font-weight: 800;
}

.empty {
  padding: 24px;
  border: 1px dashed #c9ced6;
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.7);
}

.admin-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.panel {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.panel h2,
.panel h3 {
  margin: 0 0 14px;
}

.stack {
  display: grid;
  gap: 12px;
}

.field {
  display: grid;
  gap: 6px;
}

.field label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 800;
  text-transform: uppercase;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  background: #fff;
  color: var(--ink);
}

.field textarea {
  min-height: 78px;
  resize: vertical;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.tool-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.tool-row-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.tool-row-thumb,
.thumbnail-preview {
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--input);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  overflow: hidden;
}

.tool-row-thumb {
  width: 54px;
  height: 54px;
  flex: 0 0 auto;
}

.tool-row-thumb img,
.thumbnail-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumbnail-control {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.thumbnail-preview {
  width: 118px;
  aspect-ratio: 1;
}

.tool-row h4 {
  margin: 0 0 4px;
}

.tool-row p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.notice {
  padding: 10px 12px;
  border-radius: 8px;
  background: #fff4d8;
  color: #654200;
}

.notice.ok {
  background: #e8f7ee;
  color: #176339;
}

.notice.err {
  background: #ffe8eb;
  color: #931628;
}

.hidden {
  display: none !important;
}

@media (max-width: 980px) {
  .home-topbar {
    padding-inline: 24px;
  }

  .home-shell {
    padding-inline: 24px;
  }

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

@media (max-width: 760px) {
  .shell {
    padding: 18px;
  }

  .home-topbar {
    min-height: 92px;
    padding: 18px;
    gap: 14px;
  }

  .home-brand {
    gap: 14px;
  }

  .home-logo {
    width: 92px;
    height: 58px;
  }

  .home-logo img {
    width: 82px;
    height: 44px;
  }

  .home-divider {
    display: none;
  }

  .home-brand-title {
    font-size: 22px;
  }

  .admin-btn {
    min-width: 94px;
    min-height: 48px;
    padding: 0 14px;
    border-radius: 12px;
    font-size: 14px;
  }

  .admin-btn svg {
    display: none;
  }

  .home-shell {
    padding: 46px 22px 34px;
  }

  .home-dots {
    display: none;
  }

  .eyebrow {
    font-size: 13px;
    letter-spacing: 2px;
  }

  .home-intro h1 {
    font-size: clamp(42px, 13vw, 58px);
  }

  .home-intro p {
    font-size: 17px;
  }

  .section-title {
    gap: 16px;
    margin-bottom: 24px;
  }

  .section-title-left {
    font-size: 20px;
  }

  .topbar,
  .tool-row {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }

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

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

  .card {
    min-height: 390px;
    padding: 24px;
  }

  .thumb {
    width: 104px;
    border-radius: 18px;
  }

  .status {
    min-height: 36px;
    padding: 0 13px;
    font-size: 13px;
  }

  .thumbnail-control {
    grid-template-columns: 1fr;
  }

  .thumbnail-preview {
    width: 100%;
    max-width: 160px;
  }
}
