:root {
  --bg: #f9f5f0;
  --surface: #ffffff;
  --text: #333333;
  --muted: #666666;
  --line: #eadfd5;
  --primary: #ff8a5b;
  --primary-dark: #ec7143;
  --accent: #ff6b6b;
  --success: #4caf50;
  --error: #f44336;
  --warning: #ffc107;
  --shadow: 0 18px 45px rgba(89, 55, 35, 0.12);
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(255, 138, 91, 0.18), transparent 34rem),
    linear-gradient(180deg, #fffaf5 0%, var(--bg) 38rem);
  color: var(--text);
  font-family:
    "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  font-size: 16px;
  letter-spacing: 0;
}

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

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

button {
  cursor: pointer;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px clamp(18px, 5vw, 72px);
  background: rgba(249, 245, 240, 0.88);
  border-bottom: 1px solid rgba(234, 223, 213, 0.78);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  box-shadow: 0 8px 18px rgba(255, 138, 91, 0.35);
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  color: var(--muted);
  font-size: 15px;
}

.nav-links a {
  padding: 9px 12px;
  border-radius: 8px;
  transition:
    background 200ms var(--ease),
    color 200ms var(--ease);
}

.nav-links a:hover {
  background: #fff;
  color: var(--primary-dark);
}

.app-shell {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
  padding: 38px 0 58px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
  gap: clamp(24px, 5vw, 56px);
  align-items: center;
  min-height: calc(100vh - 96px);
  padding-bottom: 34px;
}

.hero-copy h1 {
  max-width: 720px;
  margin: 0 0 18px;
  font-size: clamp(38px, 6vw, 64px);
  line-height: 1.08;
  letter-spacing: 0;
}

.hero-copy p {
  max-width: 580px;
  margin: 0 0 26px;
  color: var(--muted);
  font-size: clamp(17px, 2vw, 20px);
  line-height: 1.8;
}

.hero-actions,
.search-row,
.toolbar,
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.search-box {
  display: flex;
  align-items: center;
  width: min(100%, 520px);
  min-height: 52px;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(77, 55, 36, 0.08);
}

.search-box input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  padding: 0 14px;
  color: var(--text);
  background: transparent;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  transition:
    transform 200ms var(--ease),
    background 200ms var(--ease),
    box-shadow 200ms var(--ease);
}

.btn:hover {
  transform: translateY(-2px);
  background: var(--primary-dark);
  box-shadow: 0 12px 24px rgba(255, 138, 91, 0.26);
}

.btn.secondary {
  background: #fff;
  color: var(--primary-dark);
  border-color: var(--line);
}

.btn.secondary:hover {
  background: #fff7f1;
}

.btn.success {
  background: var(--success);
}

.hero-board {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 0.82fr;
  grid-template-rows: 220px 170px;
  gap: 14px;
  min-height: 420px;
}

.hero-tile {
  overflow: hidden;
  border-radius: 8px;
  background: #fff;
  border: 1px solid rgba(234, 223, 213, 0.85);
  box-shadow: var(--shadow);
}

.hero-tile:first-child {
  grid-row: span 2;
}

.hero-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin: 22px 0 18px;
}

.section-head h2,
.page-title h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 42px);
  letter-spacing: 0;
}

.section-head p,
.page-title p {
  max-width: 680px;
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.75;
}

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

.category-card,
.image-card,
.form-panel,
.detail-info,
.empty-state {
  background: var(--surface);
  border: 1px solid rgba(234, 223, 213, 0.88);
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(89, 55, 35, 0.08);
}

.category-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 170px;
  gap: 18px;
  min-height: 190px;
  padding: 18px;
  overflow: hidden;
  transition:
    transform 200ms var(--ease),
    border-color 200ms var(--ease),
    box-shadow 200ms var(--ease);
}

.category-card:hover,
.image-card:hover {
  transform: translateY(-2px) scale(1.01);
  border-color: rgba(255, 138, 91, 0.7);
  box-shadow: var(--shadow);
}

.category-card h3,
.image-card h3 {
  margin: 0;
  font-size: 22px;
}

.category-card p {
  color: var(--muted);
  line-height: 1.7;
}

.category-card img {
  width: 100%;
  height: 100%;
  min-height: 150px;
  object-fit: cover;
  border-radius: 8px;
}

.pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255, 107, 107, 0.12);
  color: #ce4b4b;
  font-size: 13px;
  font-weight: 700;
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.bento-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.bento-grid .image-card:nth-child(1),
.bento-grid .image-card:nth-child(6) {
  grid-column: span 2;
}

.image-card {
  overflow: hidden;
  min-width: 0;
  transition:
    transform 200ms var(--ease),
    border-color 200ms var(--ease),
    box-shadow 200ms var(--ease);
}

.image-card img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #fff8f2;
}

.image-meta {
  display: grid;
  gap: 10px;
  padding: 13px;
}

.image-meta h3 {
  overflow-wrap: anywhere;
  font-size: 17px;
  line-height: 1.35;
}

.meta-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.toolbar {
  justify-content: space-between;
  margin: 20px 0;
}

.select {
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(310px, 0.55fr);
  gap: 22px;
  align-items: start;
}

.detail-image {
  overflow: hidden;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.detail-image img {
  display: block;
  width: 100%;
  max-height: 78vh;
  object-fit: contain;
  cursor: zoom-in;
}

.detail-info {
  display: grid;
  gap: 16px;
  padding: 20px;
}

.detail-info h1 {
  margin: 0;
  font-size: clamp(26px, 3vw, 34px);
}

.detail-info p {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.form-panel {
  width: min(100%, 720px);
  margin: 0 auto;
  padding: clamp(18px, 4vw, 30px);
}

.form-panel h1 {
  margin: 0 0 8px;
  font-size: clamp(28px, 4vw, 40px);
}

.form-panel > p {
  margin: 0 0 24px;
  color: var(--muted);
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.field label {
  font-weight: 700;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  min-height: 46px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  outline-color: rgba(255, 138, 91, 0.35);
}

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

.hint {
  color: var(--muted);
  font-size: 13px;
}

.dropzone {
  position: relative;
  display: grid;
  min-height: 220px;
  place-items: center;
  padding: 20px;
  border: 2px dashed rgba(255, 138, 91, 0.5);
  border-radius: 8px;
  background: #fff8f2;
  text-align: center;
}

.dropzone input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 3;
}

.dropzone-copy {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 8px;
  place-items: center;
  max-width: 88%;
  padding: 12px;
  border-radius: 8px;
  background: rgba(255, 248, 242, 0.86);
}

.dropzone-copy .btn {
  position: relative;
  z-index: 4;
}

.upload-preview {
  position: absolute;
  inset: 10px;
  width: calc(100% - 20px);
  height: calc(100% - 20px);
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
}

.upload-result {
  min-height: 44px;
  margin-top: 12px;
}

.progress {
  overflow: hidden;
  height: 10px;
  background: #f2e6dc;
  border-radius: 999px;
}

.progress span {
  display: block;
  width: 0%;
  height: 100%;
  background: var(--primary);
  transition: width 200ms var(--ease);
}

.empty-state {
  padding: 34px;
  color: var(--muted);
  text-align: center;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 50;
  min-width: 220px;
  max-width: calc(100vw - 36px);
  padding: 12px 14px;
  border-radius: 8px;
  background: #333;
  color: #fff;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition:
    opacity 200ms var(--ease),
    transform 200ms var(--ease);
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.success {
  background: var(--success);
}

.toast.error {
  background: var(--error);
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 28px clamp(18px, 5vw, 72px);
  border-top: 1px solid var(--line);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.45);
}

.site-footer p {
  margin: 6px 0 0;
}

.footer-links {
  display: flex;
  gap: 14px;
}

.fade-in {
  animation: fadeInUp 450ms var(--ease) both;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(35, 27, 21, 0.72);
}

.modal img {
  max-width: 96vw;
  max-height: 92vh;
  background: #fff;
  border-radius: 8px;
}

@media (max-width: 1023px) {
  .hero,
  .detail-layout {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .image-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav-links {
    justify-content: flex-start;
    width: 100%;
  }

  .app-shell {
    width: min(100% - 24px, 1180px);
    padding-top: 24px;
  }

  .hero-board {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 170px 130px;
    min-height: 314px;
  }

  .category-grid,
  .category-card {
    grid-template-columns: 1fr;
  }

  .category-card img {
    height: 180px;
  }

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

  .bento-grid .image-card:nth-child(1),
  .bento-grid .image-card:nth-child(6) {
    grid-column: span 2;
  }

  .section-head,
  .toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .search-box {
    width: 100%;
  }

  .btn {
    min-height: 46px;
  }
}
