﻿:root {
  --blue-50: #eef8fb;
  --blue-100: #d9eef5;
  --blue-500: #6faec4;
  --ink: #2c3a43;
  --muted: #6d7a80;
  --line: #dbe8ec;
  --white: #fff;
  --warm: #fff8f1;
  --peach: #f4c8b8;
  --green: #9ab8a2;
  --shadow: 0 14px 32px rgba(65, 96, 108, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: linear-gradient(180deg, var(--blue-50), #fff 340px);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  letter-spacing: 0;
}

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

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

.site-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px 40px;
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

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

.logo {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--blue-100);
  border: 1px solid var(--line);
}

.brand-name {
  font-weight: 700;
  font-size: 18px;
}

.brand-sub {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav button,
.pill-button,
.ghost-button {
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--ink);
  border-radius: 8px;
  padding: 9px 14px;
  cursor: pointer;
}

.nav button.active,
.pill-button {
  background: var(--blue-500);
  border-color: var(--blue-500);
  color: #fff;
}

.ghost-button {
  background: transparent;
}

.container {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
}

.hero {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 44px;
  align-items: center;
  padding: 56px 0 34px;
}

.hero h1 {
  margin: 0 0 18px;
  font-size: 46px;
  line-height: 1.12;
}

.hero p {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.9;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-board {
  min-height: 360px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.feature-tile {
  min-height: 170px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--warm);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  position: relative;
}

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

.feature-tile.empty {
  display: grid;
  place-items: center;
  padding: 20px;
  color: var(--muted);
  text-align: center;
}

.section {
  padding: 34px 0;
}

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

.section h2 {
  margin: 0;
  font-size: 28px;
}

.section-note {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.filters {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 18px;
}

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

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

.work-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 8px 22px rgba(65, 96, 108, 0.08);
  cursor: pointer;
}

.work-cover {
  aspect-ratio: 4 / 3;
  background: var(--blue-100);
}

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

.work-cover.empty {
  display: grid;
  place-items: center;
  color: var(--muted);
  padding: 12px;
  text-align: center;
}

.work-body {
  padding: 14px;
}

.work-title {
  margin: 0 0 8px;
  font-weight: 700;
  line-height: 1.35;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--blue-50);
  color: #426777;
  font-size: 12px;
}

.price {
  font-weight: 700;
  color: #b86b55;
}

.plain-block {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  line-height: 1.9;
  white-space: pre-line;
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 22px;
  align-items: start;
}

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

.contact-item {
  padding: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.contact-item strong {
  display: block;
  margin-bottom: 5px;
}

.qr-box {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  text-align: center;
}

.qr-box img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 6px;
  background: var(--blue-50);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(32, 49, 57, 0.48);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 28px;
}

.modal.open {
  display: flex;
}

.modal-panel {
  width: min(980px, 100%);
  max-height: calc(100vh - 56px);
  overflow: auto;
  background: #fff;
  border-radius: 8px;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.modal-head h3 {
  margin: 0;
}

.modal-content {
  display: grid;
  grid-template-columns: 1fr 0.9fr;
  gap: 20px;
  padding: 20px;
}

.gallery-main {
  aspect-ratio: 4 / 3;
  background: var(--blue-50);
  border-radius: 8px;
  overflow: hidden;
}

.gallery-main img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.thumbs {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.thumbs button {
  width: 70px;
  height: 58px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 6px;
  overflow: hidden;
  background: var(--blue-50);
  cursor: pointer;
}

.thumbs button.active {
  border-color: var(--blue-500);
}

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

.detail-list {
  display: grid;
  gap: 10px;
}

.detail-row {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.detail-row span:first-child {
  color: var(--muted);
}

.admin-shell {
  display: grid;
  grid-template-columns: 230px 1fr;
  min-height: 100vh;
  background: #f6fbfd;
}

.sidebar {
  background: #fff;
  border-right: 1px solid var(--line);
  padding: 20px;
}

.sidebar h1 {
  font-size: 20px;
  margin: 0 0 20px;
}

.admin-nav {
  display: grid;
  gap: 8px;
}

.admin-nav button {
  text-align: left;
  border: 1px solid transparent;
  background: transparent;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
}

.admin-nav button.active {
  background: var(--blue-50);
  border-color: var(--line);
  color: #316273;
}

.admin-main {
  min-width: 0;
  padding: 24px;
}

.admin-main > section, .sidebar, .field { min-width: 0; }
.table-panel { overflow-x: auto; }
.table-panel .table { min-width: 680px; }
.field input, .field select, .field textarea { min-width: 0; }
.image-chip { max-width: 100%; overflow-wrap: anywhere; }

.toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

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

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

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

.field.full {
  grid-column: 1 / -1;
}

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

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

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

.table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

.table th,
.table td {
  border-bottom: 1px solid var(--line);
  padding: 10px;
  text-align: left;
  vertical-align: top;
}

.table th {
  color: var(--muted);
  font-weight: 500;
  background: #f8fcfd;
}

.row-actions {
  display: flex;
  gap: 8px;
}

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, var(--blue-50), #fff);
}

.login-card {
  width: min(420px, calc(100% - 32px));
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
  box-shadow: var(--shadow);
}

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

.image-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.image-chip img {
  width: 52px;
  height: 42px;
  object-fit: cover;
  border-radius: 6px;
}

.hidden {
  display: none !important;
}

@media (max-width: 980px) {
  .hero,
  .modal-content,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .filters,
  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

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

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 640px) {
  .topbar {
    padding: 12px 16px;
    align-items: flex-start;
    flex-direction: column;
  }

  .container {
    width: min(100% - 28px, 1180px);
  }

  .hero h1 {
    font-size: 34px;
  }

  .filters,
  .form-grid,
  .work-grid,
  .contact-list {
    grid-template-columns: 1fr;
  }
}

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

body.editor-open {
  overflow: hidden;
}

body.editor-open::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 55;
  background: rgba(32, 49, 57, 0.42);
}

#workEditor:not(.hidden) {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 60;
  width: min(1120px, calc(100vw - 36px));
  max-height: calc(100vh - 36px);
  overflow: auto;
  transform: translate(-50%, -50%);
  box-shadow: 0 22px 56px rgba(32, 49, 57, 0.24);
}

#workEditor:not(.hidden) h3 {
  position: sticky;
  top: -22px;
  z-index: 1;
  margin: -6px -4px 16px;
  padding: 8px 4px 14px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

@media (max-width: 640px) {
  #workEditor:not(.hidden) {
    width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
  }
}

.home-copy-section {
  margin-top: -8px;
  margin-bottom: 18px;
}

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

.home-copy-card {
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px 20px;
  box-shadow: 0 8px 22px rgba(65, 96, 108, 0.06);
}

.copy-label {
  display: block;
  margin-bottom: 8px;
  color: #477185;
  font-size: 13px;
  font-weight: 700;
}

.home-copy-card p {
  margin: 0;
  color: var(--ink);
  line-height: 1.9;
  white-space: pre-line;
}

@media (max-width: 760px) {
  .home-copy-grid {
    grid-template-columns: 1fr;
  }
}
