:root {
  --blue: #3f86ea;
  --blue-2: #6aa7f5;
  --blue-soft: #edf5ff;
  --ink: #20304d;
  --muted: #72819a;
  --line: #e5edf7;
  --card: #ffffff;
  --page: #ffffff;
  --shadow: 0 10px 30px rgba(75, 121, 180, .10);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--page);
}
body.no-scroll { overflow: hidden; }
img { display: block; max-width: 100%; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
.page-shell { width: min(1150px, calc(100% - 48px)); margin: 0 auto; }

.topbar {
  height: 50px;
  background: rgba(255,255,255,.97);
  border-bottom: 1px solid #eef3fa;
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
}
.topbar-inner { height: 100%; display: flex; align-items: center; gap: 28px; }
.brand { width: 94px; flex: 0 0 auto; overflow: hidden; }
.brand img { width: 86px; height: 38px; object-fit: cover; object-position: center; mix-blend-mode: multiply; }
.main-nav { display: flex; height: 100%; align-items: stretch; gap: 8px; }
.main-nav a {
  position: relative; display: flex; align-items: center; gap: 7px; padding: 0 18px;
  color: #5c78a7; font-size: 14px; font-weight: 600;
}
.main-nav a::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 0; height: 2px; background: transparent; }
.main-nav a:hover, .main-nav a.active { color: var(--blue); }
.main-nav a.active::after { background: var(--blue); }
.nav-icon { font-size: 11px; color: #4c8fea; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.icon-button { border: 0; background: transparent; color: #4974b6; font-size: 24px; cursor: pointer; }
.admin-link {
  border: 0; border-radius: 18px; background: linear-gradient(135deg, #4b91ef, #327dde);
  color: #fff; padding: 8px 22px; font-weight: 700; font-size: 13px; box-shadow: 0 6px 18px rgba(63,134,234,.22);
}
.mobile-menu-button { display: none; border: 0; background: transparent; color: var(--blue); font-size: 23px; }

.hero { width: 100%; background: #dcecff; overflow: hidden; }
.hero img { width: 100%; height: clamp(190px, 18.5vw, 275px); object-fit: cover; object-position: center; }
/* 移动端 */
@media (max-width: 768px) {
  .hero {
    height: auto;
  }

  .hero img {
    width: 100%;
    height: auto;
    object-fit: contain;
  }
}
.portfolio-section { padding: 20px 0 28px; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.filters { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.filter-button {
  border: 0; border-radius: 9px; background: #f3f7fd; color: #5e7397; padding: 8px 17px; cursor: pointer;
  font-weight: 600; font-size: 13px; transition: .18s ease;
}
.filter-button:hover { transform: translateY(-1px); background: #eaf3ff; }
.filter-button.active { background: var(--blue); color: #fff; box-shadow: 0 5px 14px rgba(63,134,234,.24); }
.search-box {
  min-width: 265px; height: 34px; border: 1px solid #dce7f4; border-radius: 10px; display: flex; align-items: center;
  padding: 0 12px; background: #fff; color: #4b79b8;
}
.search-box input { width: 100%; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 13px; }
.search-box input::placeholder { color: #8ca0bc; }
.search-box span { font-size: 21px; transform: rotate(-15deg); }

.work-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.work-card {
  border: 1px solid #e4ebf4; border-radius: 7px; background: var(--card); overflow: hidden; box-shadow: 0 3px 10px rgba(69, 102, 148, .06);
  cursor: pointer; transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; outline: none;
}
.work-card:hover, .work-card:focus-visible { transform: translateY(-3px); border-color: #cbdff9; box-shadow: var(--shadow); }
.work-cover-wrap { aspect-ratio: 1.5 / 1; overflow: hidden; position: relative; background: #eef5ff; }
.work-cover { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.work-card:hover .work-cover { transform: scale(1.025); }
.work-card-hover {
  position: absolute; inset: 0; display: grid; place-items: center; background: rgba(40,91,160,.25); color: white; font-weight: 700;
  opacity: 0; transition: opacity .2s ease; text-shadow: 0 1px 10px rgba(0,0,0,.25);
}
.work-card:hover .work-card-hover { opacity: 1; }
.work-card-body { padding: 10px 11px 11px; min-height: 54px; }
.work-card h2 { font-size: 14px; line-height: 1.25; margin: 0 0 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.category-pill { display: inline-flex; border-radius: 7px; background: #eff5fd; color: #61799c; padding: 3px 8px; font-size: 11px; line-height: 1.2; }
.empty-state { padding: 60px 0; text-align: center; color: #8091aa; }
.empty-star { font-size: 36px; color: #9ec4f7; margin-bottom: 8px; }

.about-section { padding: 18px 0 50px; }
.about-card {
  padding: 28px 32px; border: 1px solid #e6eef8; border-radius: 16px; background: linear-gradient(135deg,#fbfdff,#f2f8ff);
  display: grid; grid-template-columns: 1.05fr 1fr; align-items: center; gap: 50px;
}
.eyebrow { color: #4b8de5; font-size: 11px; font-weight: 800; letter-spacing: .16em; }
.about-card h2 { margin: 6px 0 0; font-size: 22px; line-height: 1.5; }
.about-card p { color: #6d7d94; line-height: 1.85; margin: 0; font-size: 14px; }

.footer {
  min-height: 88px; border-top: 1px solid #edf2f8; display: flex; align-items: center; justify-content: space-between; gap: 22px;
  color: #7185a4; font-size: 12px;
}
.footer-brand { display: flex; align-items: center; gap: 14px; }
.footer-brand img { width: 66px; height: 34px; object-fit: cover; mix-blend-mode: multiply; }
.footer-icons { display: flex; gap: 22px; color: #5b81ba; font-size: 16px; }

.modal { position: fixed; inset: 0; z-index: 100; display: none; }
.modal.open { display: block; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(18,31,52,.62); backdrop-filter: blur(2px); }
.detail-dialog {
  position: relative; z-index: 1; width: min(760px, calc(100vw - 36px)); max-height: calc(100vh - 60px); overflow: auto;
  margin: 30px auto; border-radius: 13px; background: #fff; box-shadow: 0 26px 70px rgba(15,39,75,.35);
  display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(260px, .92fr); min-height: 430px;
}
.modal-close { position: absolute; top: 10px; right: 10px; z-index: 8; width: 30px; height: 30px; border: 0; border-radius: 50%; background: rgba(27,43,66,.72); color: white; font-size: 20px; cursor: pointer; }
.detail-gallery { min-height: 430px; position: relative; background: #eef4fb; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.detail-image-stage { width: 100%; height: 100%; min-height: 430px; display: flex; align-items: center; justify-content: center; padding: 20px; position: relative; }
.detail-image-stage img { width: 100%; height: 100%; max-height: 560px; object-fit: contain; }
.zoom-hint { position: absolute; right: 18px; bottom: 18px; border: 0; border-radius: 16px; background: rgba(27,55,91,.78); color: white; padding: 7px 12px; font-size: 11px; cursor: pointer; }
.gallery-arrow { position: absolute; z-index: 4; top: 50%; translate: 0 -50%; width: 34px; height: 46px; border: 0; background: rgba(20,45,78,.52); color: white; font-size: 30px; cursor: pointer; opacity: .85; }
.gallery-arrow:hover { opacity: 1; }
.gallery-arrow.left { left: 8px; border-radius: 8px; }
.gallery-arrow.right { right: 8px; border-radius: 8px; }
.image-counter { position: absolute; z-index: 3; left: 50%; bottom: 10px; translate: -50% 0; background: rgba(20,45,78,.58); color: #fff; border-radius: 10px; padding: 3px 9px; font-size: 11px; }
.detail-copy { padding: 38px 28px; }
.detail-copy h2 { margin: 0 0 8px; font-size: 22px; }
.detail-date { margin-top: 18px; color: #7e8ea6; font-size: 12px; }
.detail-copy p { margin: 24px 0 0; color: #5f7089; font-size: 14px; line-height: 1.85; white-space: pre-wrap; }

.zoom-viewer { position: fixed; inset: 0; z-index: 150; display: none; }
.zoom-viewer.open { display: block; }
.zoom-backdrop { position: absolute; inset: 0; background: rgba(6,14,27,.92); }
.zoom-toolbar {
  position: absolute; z-index: 4; top: 18px; left: 50%; translate: -50% 0; display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.16); border-radius: 12px; padding: 7px; backdrop-filter: blur(10px);
}
.zoom-toolbar button { border: 0; border-radius: 8px; background: rgba(255,255,255,.13); color: white; padding: 7px 12px; cursor: pointer; }
.zoom-toolbar span { color: white; min-width: 52px; text-align: center; font-size: 12px; }
.zoom-canvas { position: absolute; z-index: 2; inset: 70px 20px 20px; overflow: hidden; display: flex; align-items: center; justify-content: center; cursor: grab; }
.zoom-canvas.dragging { cursor: grabbing; }
.zoom-canvas img { max-width: 92%; max-height: 92%; object-fit: contain; transform-origin: center center; user-select: none; will-change: transform; }

.error-page { min-height: 100vh; display: grid; place-items: center; text-align: center; background: linear-gradient(#fff,#edf6ff); }
.error-page span { font-size: 80px; font-weight: 800; color: #d7e9ff; }
.error-page h1 { margin: 0 0 20px; }

body.dark {
  --ink: #e7eef9; --muted: #9fb0c7; --line: #263a54; --card: #172437; --page: #101b2a;
  background: #101b2a; color: #e7eef9;
}
body.dark .topbar { background: rgba(16,27,42,.96); border-color: #24364d; }
body.dark .search-box, body.dark .work-card, body.dark .detail-dialog { background: #172437; border-color: #2a3d56; }
body.dark .search-box input { color: #e7eef9; }
body.dark .filter-button { background: #1b2b40; color: #a9bed8; }
body.dark .filter-button.active { background: var(--blue); color: white; }
body.dark .about-card { background: linear-gradient(135deg,#152438,#1a2b41); border-color: #2a3d56; }
body.dark .category-pill { background: #21364f; color: #abc8ec; }
body.dark .detail-gallery { background: #0d1825; }
body.dark .brand img, body.dark .footer-brand img { mix-blend-mode: screen; }

@media (max-width: 980px) {
  .work-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .toolbar { align-items: flex-start; flex-direction: column; }
  .search-box { width: 100%; }
}
@media (max-width: 760px) {
  .page-shell { width: min(100% - 28px, 1150px); }
  .topbar { height: 58px; }
  .topbar-inner { gap: 10px; }
  .brand { width: 82px; }
  .mobile-menu-button { display: block; margin-left: auto; }
  .main-nav { position: absolute; top: 58px; left: 14px; right: 14px; height: auto; display: none; flex-direction: column; padding: 8px; background: white; border: 1px solid #e4edf7; border-radius: 12px; box-shadow: var(--shadow); }
  .main-nav.open { display: flex; }
  .main-nav a { min-height: 42px; border-radius: 8px; }
  .main-nav a.active::after { display: none; }
  .top-actions { margin-left: 0; gap: 7px; }
  .admin-link { padding: 8px 12px; font-size: 12px; }
  .icon-button { font-size: 20px; }
  .hero img { max-height: 180px; object-position: center; }
  .portfolio-section { padding-top: 14px; }
  .filters { flex-wrap: nowrap; overflow-x: auto; width: 100%; padding-bottom: 2px; scrollbar-width: none; }
  .filters::-webkit-scrollbar { display: none; }
  .filter-button { white-space: nowrap; }
  .work-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .work-card-body { padding: 9px; }
  .work-card h2 { font-size: 13px; }
  .about-card { grid-template-columns: 1fr; gap: 14px; padding: 22px; }
  .about-card h2 { font-size: 18px; }
  .footer { align-items: flex-start; flex-direction: column; padding: 24px 0; }
  .footer-icons { display: none; }
  .detail-dialog { grid-template-columns: 1fr; margin: 18px auto; max-height: calc(100vh - 36px); }
  .detail-gallery, .detail-image-stage { min-height: 330px; }
  .detail-copy { padding: 24px 22px 28px; }
  .zoom-toolbar { width: calc(100% - 28px); justify-content: center; top: 12px; }
  .zoom-canvas { inset: 65px 8px 8px; }
  body.dark .main-nav { background: #172437; border-color: #2a3d56; }
}
