/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Geist", sans-serif;
  background: #fafafa;
  color: #171717;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
button { border: none; background: none; cursor: pointer; font-family: inherit; }
input { font-family: inherit; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* === Header === */
.header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(255,255,255,0.92); backdrop-filter: blur(12px);
  border-bottom: 1px solid #ebebeb;
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between; height: 64px;
}
.logo { display: flex; align-items: center; gap: 10px; }
.logo-icon { width: 32px; height: 32px; border-radius: 6px; }
.logo-text { font-weight: 700; font-size: 20px; letter-spacing: 1px; color: #171717; }
.nav { display: flex; gap: 32px; }
.nav-link { font-size: 14px; color: #4d4d4d; transition: color 0.2s; position: relative; }
.nav-link:hover, .nav-link.active { color: #e63946; }
.nav-link::after {
  content: ''; position: absolute; bottom: -4px; left: 0; width: 0; height: 2px;
  background: #e63946; transition: width 0.3s;
}
.nav-link:hover::after, .nav-link.active::after { width: 100%; }
.mobile-menu-btn { display: none; flex-direction: column; gap: 5px; padding: 8px; }
.mobile-menu-btn span { display: block; width: 24px; height: 2px; background: #171717; transition: 0.3s; }

/* === Hero === */
.hero { padding: 120px 0 80px; background: linear-gradient(180deg, #fafafa 0%, #fff 100%); }
.hero-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; }
.hero-eyebrow {
  font-size: 12px; font-weight: 500; color: #8f8f8f; text-transform: uppercase;
  letter-spacing: 3px; margin-bottom: 12px;
  font-family: 'Geist Mono', 'SF Mono', ui-monospace, monospace;
}
.hero-title { font-size: clamp(32px, 4vw, 44px); font-weight: 700; line-height: 1.2; color: #171717; margin-bottom: 20px; }
.red-text { color: #EA4C89; }
.scrolling-text {
  display: inline-block;
  color: #EA4C89;
  font-weight: 700;
  margin-left: 0;
  vertical-align: bottom;
  overflow: hidden;
  white-space: nowrap;
  position: relative;
  height: 1.2em;
}
.scrolling-text-inner {
  display: inline-block;
  animation: scrollText 12s infinite;
}
@keyframes scrollText {
  0%, 25% { transform: translateY(0); }
  33%, 58% { transform: translateY(-25%); }
  66%, 91% { transform: translateY(-50%); }
  100% { transform: translateY(-75%); }
}
.hero-social {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
}
.hero-social .social-icon {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 6px;
  background: #f5f5f5;
  border: 1px solid #ebebeb;
  font-size: 12px;
  color: #4d4d4d;
  transition: all 0.2s;
}
.hero-social .social-icon:hover {
  background: #e63946;
  color: #fff;
  border-color: #e63946;
}
.hero-social .social-icon img {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  object-fit: contain;
}

/* Search */
.search-box { display: flex; max-width: 480px; width: 100%; border-radius: 10px; overflow: hidden; border: 1px solid #ebebeb; background: #fff; }
.search-box input { flex: 1; padding: 14px 18px; border: none; outline: none; font-size: 14px; background: transparent; color: #171717; }
.search-box input::placeholder { color: #a1a1a1; }
.search-box button { padding: 14px 24px; border: none; background: #171717; color: #fff; font-size: 14px; font-weight: 500; cursor: pointer; transition: background 0.2s; }
.search-box button:hover { background: #333; }

/* === Hero Right / Static Image === */
.hero-right { display: flex; flex-direction: column; align-items: center; justify-content: center; }
.hero-image {
  width: 100%;
  max-width: 480px;
  aspect-ratio: 16 / 10;
  border-radius: 16px;
  overflow: hidden;
  background: #ebebeb;
  box-shadow: 0 8px 40px rgba(0,0,0,0.08);
}
.hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* === Sections === */
.section { padding: 80px 0; }
.section-alt { background: #f8f9fa; }
.section-title {
  font-size: 28px; font-weight: 700; margin-bottom: 32px;
  display: flex; align-items: baseline; gap: 8px;
}
.section-subtitle { font-size: 14px; font-weight: 400; color: #8f8f8f; }

/* === Filter Bar === */
.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 32px; }
.filter-btn {
  padding: 8px 20px; border-radius: 64px; border: 1px solid #ebebeb;
  background: #fff; color: #171717; font-size: 13px; font-weight: 500;
  cursor: pointer; transition: all 0.2s;
}
.filter-btn:hover { border-color: #171717; }
.filter-btn.active { background: #171717; color: #fff; border-color: #171717; }

/* === Grid / Cards === */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}
.card {
  background: #fff; border-radius: 12px; overflow: hidden;
  border: 1px solid #ebebeb; cursor: pointer;
  transition: all 0.3s;
}
.card:hover { box-shadow: 0 8px 30px rgba(0,0,0,0.06); transform: translateY(-2px); }
.card:active { transform: translateY(0); box-shadow: 0 4px 12px rgba(0,0,0,0.04); }
.card-image { display: block; width: 100%; aspect-ratio: 16/10; object-fit: cover; background: #ebebeb; }
.video-thumbnail { pointer-events: none; }
.card-body { padding: 16px; }
.card-title { font-weight: 600; font-size: 16px; margin-bottom: 4px; color: #171717; }
.card-meta { font-size: 13px; color: #8f8f8f; display: flex; justify-content: space-between; margin-bottom: 6px; }
.card-desc { font-size: 13px; color: #666; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* === Resource Cards === */
.resource-grid { display: flex; flex-direction: column; gap: 12px; }
.resource-card {
  display: flex; align-items: center; gap: 16px; padding: 16px;
  background: #fff; border: 1px solid #ebebeb; border-radius: 12px;
  transition: all 0.3s; cursor: pointer;
}
.resource-card:hover { border-color: #e63946; box-shadow: 0 4px 20px rgba(230,57,70,0.06); transform: translateX(4px); }
.resource-icon {
  width: 48px; height: 48px; border-radius: 12px; background: #f5f5f5;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; overflow: hidden; transition: all 0.3s;
}
.resource-card:hover .resource-icon { background: #fef0f0; }
.resource-icon img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }
.resource-info { flex: 1; min-width: 0; }
.resource-title { font-weight: 600; margin-bottom: 4px; color: #171717; }
.resource-url { font-size: 13px; color: #8f8f8f; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.resource-arrow { color: #ccc; font-size: 20px; transition: all 0.3s; }
.resource-card:hover .resource-arrow { color: #e63946; }

/* === Gallery List (2 columns) === */
.gallery-list { 
  display: grid; 
  grid-template-columns: repeat(2, 1fr); 
  gap: 20px; 
}
.gallery-item {
  display: flex; 
  align-items: center; 
  gap: 16px;
  padding: 16px; 
  background: #fff; 
  border: 1px solid #ebebeb; 
  border-radius: 12px;
  cursor: pointer; 
  transition: all 0.2s;
}
.gallery-item:hover { 
  border-color: #e63946; 
  box-shadow: 0 4px 20px rgba(0,0,0,0.06); 
}
.gallery-item-image {
  width: 140px; 
  height: 100px; 
  border-radius: 10px; 
  overflow: hidden;
  background: #f5f5f5; 
  flex-shrink: 0;
}
.gallery-item-image img,
.gallery-item-image video {
  display: block;
  width: 100%; 
  height: 100%; 
  object-fit: cover; 
}
.gallery-item-info { 
  flex: 1; 
  min-width: 0; 
}
.gallery-item-title { 
  font-weight: 600; 
  font-size: 16px; 
  margin-bottom: 6px; 
  color: #171717; 
}
.gallery-item-meta { 
  font-size: 13px; 
  color: #8f8f8f; 
}
.gallery-item-arrow { 
  color: #ccc; 
  font-size: 20px; 
  transition: color 0.2s; 
}
.gallery-item:hover .gallery-item-arrow { 
  color: #e63946; 
}

/* === Resource List (responsive grid) === */
.resource-list { 
  display: grid; 
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px; 
}
.resource-item {
  display: flex; 
  flex-direction: column; 
  align-items: center; 
  text-align: center;
  gap: 12px; 
  padding: 20px 16px 22px;
  background: #fff; 
  border: 1px solid #ebebeb; 
  border-radius: 12px;
  transition: all 0.3s; 
  cursor: pointer;
}
.resource-item:hover { 
  border-color: #e63946; 
  box-shadow: 0 8px 30px rgba(0,0,0,0.06); 
  transform: translateY(-2px); 
}
.resource-item:last-child { border-bottom: 1px solid #ebebeb; }
.resource-item:last-child:hover { border-bottom: 1px solid #e63946; }
.resource-item-image {
  width: 56px; 
  height: 56px; 
  border-radius: 14px; 
  overflow: hidden;
  background: #f5f5f5; 
  flex-shrink: 0; 
  display: flex; 
  align-items: center; 
  justify-content: center;
}
.resource-item-image img { 
  width: 100%; 
  height: 100%; 
  object-fit: contain; 
  padding: 8px; 
}
.resource-item-info { 
  flex: 1; 
  min-width: 0; 
  width: 100%; 
}
.resource-item-title { 
  font-weight: 600; 
  font-size: 14px; 
  color: #171717; 
  margin-bottom: 4px; 
  line-height: 1.4;
}
.resource-item-desc { 
  font-size: 12px; 
  color: #8f8f8f; 
  overflow: hidden; 
  text-overflow: ellipsis; 
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.4;
}
.resource-item-arrow { 
  color: #ccc; 
  font-size: 18px; 
  transition: color 0.2s; 
}
.resource-item:hover .resource-item-arrow { color: #e63946; }
.contact-grid { 
  display: flex; 
  align-items: center; 
  justify-content: space-between; 
  gap: 40px; 
}
.contact-card-info { 
  text-align: left;
  display: flex; 
  flex-direction: column; 
  gap: 16px;
  justify-content: space-between;
}
.contact-card-info .section-title { 
  margin-bottom: 0; 
}
.contact-subtitle { 
  font-size: 14px; 
  color: #666; 
  margin-bottom: 4px; 
}
.contact-card-action { 
  display: flex; 
  align-items: flex-end; 
  justify-content: flex-end; 
  flex-shrink: 0; 
  padding-bottom: 4px;
}
.btn-wechat-icon { 
  width: 24px; 
  height: 24px; 
  object-fit: contain; 
  border-radius: 4px; 
}
.btn-wechat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 16px;
  height: 44px;
  border-radius: 100px;
  background: #F3F3F6 !important;
  color: #0D0C22 !important;
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: none !important;
  margin-top: 46px;
}
.btn-wechat:hover {
  background: #e63946 !important;
  color: #fff !important;
  transform: scale(1.1);
}
.social-row { display: flex; gap: 16px; margin-top: auto; margin-bottom: 0; }
.social-link {
  width: 44px; height: 44px; border-radius: 50%; background: #f0f0f0;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s; overflow: hidden;
}
.social-link:hover { background: #e63946; transform: scale(1.1); }
.social-link img { width: 24px; height: 24px; }
.visit-stats { display: flex; flex-direction: column; gap: 8px; }
.visit-item { font-size: 14px; color: #888; display: flex; align-items: center; gap: 6px; }
.visit-icon { font-size: 16px; }
.visit-num { color: #e63946; font-weight: 700; }

/* === Footer === */
.footer { background: #171717; color: #aaa; padding: 48px 0 24px; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 24px; }
.footer-brand { display: flex; flex-direction: column; gap: 8px; }
.footer-brand p { font-size: 14px; color: #888; margin: 0; }
.footer-logo { width: 32px; height: 32px; opacity: 0.8; border-radius: 6px; }
.footer-links { display: flex; gap: 24px; }
.footer-links a { color: #aaa; font-size: 14px; transition: color 0.2s; }
.footer-links a:hover { color: #e63946; }
.footer-bottom { 
  margin-top: 24px; 
  padding-top: 24px; 
  border-top: 1px solid #333; 
  text-align: left;
  font-size: 13px; 
  color: #888; 
  display: flex; 
  flex-direction: row; 
  align-items: center; 
  justify-content: space-between; 
  gap: 16px; 
}
.footer-bottom .footer-bottom-inner {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
}
.footer-bottom .visit-stats { 
  display: flex; 
  flex-direction: row; 
  gap: 24px; 
  justify-content: flex-start; 
  flex-wrap: wrap; 
}
.footer-bottom .visit-item { 
  font-size: 13px; 
  color: #aaa; 
  display: flex; 
  align-items: center; 
  gap: 4px;
}
.footer-bottom .visit-num { color: #fff; font-weight: 700; }
.footer-credit { color: #888; font-size: 12px; white-space: nowrap; }

/* === Modal (QR only) === */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 200; display: none; align-items: center; justify-content: center; padding: 24px; backdrop-filter: blur(4px); }
.modal-overlay.active { display: flex; }
.modal { background: #fff; border-radius: 16px; max-width: 600px; width: 100%; max-height: 90vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,0.12); }
.modal-fullscreen { max-width: none; width: 100%; max-height: 100vh; height: 100vh; border-radius: 0; }
.modal-sm { max-width: 400px; }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 20px 24px; border-bottom: 1px solid #ebebeb; }
.modal-header h3 { font-size: 18px; }
.modal-close { font-size: 24px; color: #999; line-height: 1; cursor: pointer; background: none; border: none; }
.modal-close:hover { color: #171717; }
.modal-body { padding: 24px; }
.modal-body-qr { text-align: center; padding: 32px; }
.modal-body-qr img { width: 240px; height: 240px; border-radius: 12px; margin: 0 auto 16px; object-fit: contain; border: 1px solid #ebebeb; }
.modal-body-qr p { font-size: 14px; color: #666; margin-bottom: 16px; }
.modal-body-qr .btn { margin-top: 8px; }

/* === Fullscreen Detail Modal (Dribbble style) === */
.modal-fullscreen { max-width: none; max-height: none; width: 100vw; height: 100vh; border-radius: 0; }
.modal-overlay:has(.modal-fullscreen) { padding: 0; }
.modal-fullscreen .modal-close-outer { position: fixed; top: 16px; right: 16px; z-index: 300; width: 40px; height: 40px; border-radius: 50%; background: rgba(0,0,0,0.6); color: #fff; border: none; font-size: 24px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background 0.2s; text-shadow: 0 1px 2px rgba(0,0,0,0.3); }
.modal-fullscreen .modal-close-outer:hover { background: rgba(0,0,0,0.8); }
.modal-fullscreen .modal-close-outer .close-icon { display: block; transform: translateY(-3px); }
.modal-fullscreen .modal-split { display: flex; flex-direction: row; flex: 1; min-height: 0; height: 100%; }
.modal-fullscreen .modal-preview { flex: 0 0 66.666667%; width: 66.666667%; padding: 24px; display: flex; flex-direction: column; align-items: center; justify-content: center; background: #fafafa; overflow-y: auto; }
.modal-fullscreen .modal-preview img, .modal-fullscreen .modal-preview video { max-width: 100%; max-height: 100%; object-fit: contain; }
.modal-fullscreen .modal-form-area { flex: 0 0 33.333333%; width: 33.333333%; padding: 24px; overflow-y: auto; border-left: 1px solid #ebebeb; background: #fff; }
.frontend-modal .modal-split { flex-direction: column; }
.frontend-modal .modal-preview, .frontend-modal .modal-form-area { flex: 1 1 auto; width: 100%; }
.frontend-modal .modal-form-area { border-left: none; border-top: 1px solid #ebebeb; }
.frontend-modal .detail-page-title { text-align: left; }
.frontend-modal .detail-page-meta { justify-content: flex-start; }
.frontend-topbar { position: fixed; top: 0; left: 0; right: 0; z-index: 320; display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: rgba(255,255,255,0.85); backdrop-filter: blur(12px); border-bottom: 1px solid rgba(0,0,0,0.06); }
.frontend-back { font-size: 14px; color: #171717; background: rgba(255,255,255,0.9); border: 1px solid #ebebeb; padding: 6px 12px; border-radius: 8px; cursor: pointer; }
.frontend-content { padding-top: 40px; }
.frontend-header { text-align: left; padding: 24px 24px 8px; max-width: 1102px; margin: 0 auto; width: 100%; }
.frontend-body { max-width: 752px; margin: 0 auto; padding: 0 24px 80px; text-align: left; }
.detail-page-desc { font-size: 15px; line-height: 1.8; }
.detail-page-desc img, .detail-page-desc video { display: block; margin: 12px auto; max-width: 100%; }
.detail-page-desc p { text-align: center; }
.detail-page-desc figure { text-align: center; margin: 12px auto; }
.frontend-modal .modal-preview { background: #fff; max-width: 1112px; margin: 0 auto; position: relative; overflow: visible; }
.frontend-modal .modal-fullscreen { display: flex; flex-direction: column; }
.frontend-content { flex: 1 1 auto; overflow-y: auto; overflow-x: visible; position: relative; }
.modal-media-container { position: relative; width: 100%; display: flex; align-items: center; justify-content: center; }
.modal-preview { position: relative; }
.portfolio-modal-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 10; }
#portfolioModalPrev { left: 24px; transform: translate(-50%, -50%); }
#portfolioModalNext { right: 24px; transform: translate(50%, -50%); }
.modal-overlay:has(.frontend-modal) { background: rgba(0,0,0,0.5); }
#portfolioModal {
  padding: 0 40px 24px;
  align-items: flex-start;
  overflow-x: hidden;
  overflow-y: auto;
  background: rgba(0,0,0,0.9);
  backdrop-filter: none;
}
.modal-fullscreen.portfolio-detail-modal {
  position: relative;
  width: min(1400px, calc(100vw - 80px));
  max-width: 1400px;
  height: auto;
  min-height: calc(100vh - 24px);
  max-height: none;
  border-radius: 12px;
  overflow: visible;
  background: transparent;
  box-shadow: none;
}
.portfolio-detail-modal .frontend-topbar {
  position: static;
  left: auto;
  right: auto;
  z-index: 320;
  height: 0;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  backdrop-filter: none;
}
.portfolio-detail-modal .modal-close-outer {
  position: fixed;
  top: 16px;
  right: 16px;
}
.portfolio-detail-modal .frontend-content {
  padding-top: 0;
  overflow: visible;
  background: transparent;
}
.portfolio-loading {
  position: fixed;
  inset: 0;
  z-index: 290;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0,0,0,0.58);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}
.portfolio-loading.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.portfolio-loading-panel {
  display: flex;
  align-items: center;
  gap: 14px;
  width: min(280px, calc(100vw - 40px));
  min-height: 76px;
  padding: 16px 18px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  background: rgba(20,20,20,0.94);
  color: #fff;
}
.portfolio-loading-spinner {
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  border: 2px solid rgba(255,255,255,0.24);
  border-top-color: #fff;
  border-radius: 50%;
  animation: portfolio-loading-spin 0.8s linear infinite;
}
.portfolio-loading-copy { display: flex; min-width: 0; flex-direction: column; gap: 4px; }
.portfolio-loading-copy strong { font-size: 14px; font-weight: 600; line-height: 1.3; }
.portfolio-loading-copy span { color: rgba(255,255,255,0.62); font-size: 12px; line-height: 1.4; }
.portfolio-loading.is-error .portfolio-loading-spinner {
  animation: none;
  border-color: rgba(255,255,255,0.28);
}
.portfolio-loading.is-error .portfolio-loading-spinner::after {
  content: '!';
  display: grid;
  height: 100%;
  place-items: center;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}
.modal-overlay.portfolio-loading-active .portfolio-project-nav {
  opacity: 0;
  pointer-events: none;
}
@keyframes portfolio-loading-spin { to { transform: rotate(360deg); } }
.modal-fullscreen .modal-form-left .modal-form { max-width: 100%; }
.modal-fullscreen .modal-thumbnails { display: flex; gap: 16px; padding: 12px 0; justify-content: center; flex-wrap: wrap; width: 100%; max-width: 100%; }
.modal-fullscreen .modal-thumbnails .thumb { width: 80px; height: 80px; border-radius: 8px; overflow: hidden; cursor: pointer; border: 2px solid transparent; opacity: 0.75; transition: all 0.2s; flex-shrink: 0; position: relative; }
.modal-fullscreen .modal-thumbnails .thumb:hover { opacity: 1; border-color: #e63946; }
.modal-fullscreen .modal-thumbnails .thumb.active { opacity: 1; border-color: #e63946; }
.modal-fullscreen .modal-thumbnails .thumb img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.thumb-wrap { position: relative; display: inline-flex; flex-direction: column; align-items: center; }
.thumb-wrap .thumb { width: 80px; height: 80px; border-radius: 8px; overflow: hidden; cursor: grab; border: 2px solid #eee; background: #fafafa; opacity: 0.9; transition: all 0.2s; }
.thumb-wrap .thumb:active { cursor: grabbing; }
.thumb-wrap.active .thumb { border-color: #e63946; opacity: 1; }
.thumb-wrap .thumb img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; display: block; }
.thumb-delete { display: none; position: absolute; top: -6px; right: -6px; width: 16px; height: 16px; border: none; background: transparent; padding: 0; cursor: pointer; align-items: center; justify-content: center; z-index: 2; }
.thumb-wrap.active .thumb-delete { display: inline-flex; }
.thumb-delete:hover { transform: scale(1.1); }
.modal-fullscreen .modal-footer { display: flex; justify-content: flex-end; gap: 12px; padding: 16px 24px; border-top: 1px solid #ebebeb; }

/* === Portfolio detail: Behance-style continuous media story === */
.portfolio-project-header {
  position: relative;
  width: min(1400px, 100%);
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px 0 20px;
  color: #fff;
  background: transparent;
}
.portfolio-project-header .detail-page-title {
  max-width: 920px;
  margin-bottom: 16px;
  color: #fff;
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 32px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0;
}
.portfolio-project-header .detail-page-meta {
  gap: 20px;
  margin-bottom: 0;
  color: #fff;
  font-size: 14px;
  line-height: 1;
}
.portfolio-media-count::before {
  content: '';
  width: 3px;
  height: 3px;
  display: inline-block;
  margin: 0 8px 3px 0;
  border-radius: 50%;
  background: currentColor;
}
.portfolio-media-stream {
  width: min(1400px, 100%);
  margin: 0 auto;
  background: #f1f1f1;
  line-height: 0;
  overflow: hidden;
}
.portfolio-media-item {
  width: 100%;
  margin: 0;
  background: #f1f1f1;
}
.portfolio-story-media {
  display: block;
  width: 100%;
  height: auto;
  max-width: none;
  max-height: none;
  margin: 0;
  object-fit: contain;
}
.portfolio-media-item-video { background: #050505; }
.portfolio-media-item-video video { background: #050505; }
.portfolio-document-item {
  padding: 64px clamp(24px, 5vw, 80px);
  line-height: 1.5;
  background: #f5f5f5;
}
.portfolio-document-link {
  min-height: 120px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 28px 32px;
  border: 1px solid #dedede;
  border-radius: 16px;
  background: #fff;
  color: #171717;
  font-size: 16px;
  font-weight: 600;
}
.portfolio-document-link span:last-child { margin-left: auto; font-size: 24px; }
.portfolio-document-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: #171717;
  color: #fff;
  font-size: 12px;
  letter-spacing: 0.08em;
}
.portfolio-media-empty {
  min-height: 360px;
  display: grid;
  place-items: center;
  padding: 40px;
  color: #8f8f8f;
  font-size: 15px;
  line-height: 1.6;
}
.portfolio-overview {
  width: min(1400px, 100%);
  max-width: 1400px;
  padding: 72px max(20px, calc((100% - 800px) / 2));
  background: #fff;
}
.portfolio-overview .detail-page-desc {
  max-width: 800px;
  margin: 0 auto;
  color: #393939;
  font-size: 17px;
  line-height: 1.9;
  white-space: pre-wrap;
}

.more-works {
  width: min(1400px, 100%);
  max-width: 1400px;
  margin: 0 auto;
  padding: 72px 54px 88px 50px;
  background: #191919;
}
.more-works-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1296px;
  margin: 0 auto 24px;
}
.more-works-title { font-size: 20px; font-weight: 700; color: #fff; }
.more-works-viewport { position: relative; width: 100%; max-width: 1296px; margin: 0 auto; }
.more-works-trackwrap { width: 100%; overflow: hidden; }
.more-works-track { display: flex; gap: 20px; transition: transform 0.35s ease; width: max-content; }
.more-works-card {
  width: var(--more-works-card-width, 360px);
  aspect-ratio: 4 / 3;
  height: auto;
  border-radius: 6px;
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
  cursor: pointer;
  background: #252525;
}
.more-works-card img, .more-works-card video { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.more-works-card .more-works-overlay { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,0.55), rgba(0,0,0,0) 60%); opacity: 0; transition: opacity 0.2s ease; display: flex; align-items: flex-end; padding: 20px; }
.more-works-card:hover .more-works-overlay { opacity: 1; }
.more-works-card .more-works-name { color: #fff; font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; text-shadow: 0 1px 2px rgba(0,0,0,0.4); }
.more-works-arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border-radius: 50%; border: none; background: rgba(255,255,255,0.9); cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 12px rgba(0,0,0,0.15); z-index: 2; transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease; }
.more-works-arrow:hover:not(:disabled) { transform: translateY(-50%) scale(1.08); box-shadow: 0 6px 18px rgba(0,0,0,0.25); background: #fff; }
.more-works-arrow:active:not(:disabled) { transform: translateY(-50%) scale(0.96); }
.more-works-prev::after, .more-works-next::after { content: ''; display: block; width: 10px; height: 10px; border-top: 2px solid #171717; border-right: 2px solid #171717; }
.more-works-prev::after { transform: translateX(3px) rotate(-135deg); }
.more-works-next::after { transform: translateX(-3px) rotate(45deg); }
.more-works-viewport .more-works-prev { left: -22px; }
.more-works-viewport .more-works-next { right: -22px; }
.more-works-prev:disabled { display: none; }
.more-works-arrow:disabled { opacity: 0.4; cursor: not-allowed; }
.portfolio-project-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 20px;
  z-index: 310;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin: 0;
  padding: 0 20px;
  background: transparent;
  pointer-events: none;
}
.portfolio-project-nav .more-works-arrow {
  position: relative;
  top: auto;
  right: auto;
  left: auto;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  transform: none;
  pointer-events: auto;
}
.portfolio-project-nav .more-works-arrow:hover:not(:disabled) { transform: scale(1.08); }
.portfolio-project-nav .more-works-arrow:active:not(:disabled) { transform: scale(0.96); }
.portfolio-project-nav .more-works-arrow:disabled { visibility: hidden; }

/* === Detail Page (sub-page) === */
.detail-page {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: none;
}
.detail-page.active { display: block; }
.detail-page-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
}
.detail-page-content {
  position: relative;
  max-width: 100%;
  margin: 0 auto;
  background: #fff;
  border-radius: 0;
  max-height: 100vh;
  overflow-y: auto;
  box-shadow: none;
  animation: none;
}
.detail-page-header {
  position: sticky;
  top: 0;
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(6px);
  padding: 14px 24px;
  border-bottom: 1px solid #ebebeb;
  z-index: 1;
  border-radius: 0;
}
.detail-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid #ebebeb;
  background: #fff;
  color: #333;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}
.detail-back-btn:hover { background: #f5f5f5; border-color: #ccc; }
.back-arrow { font-size: 18px; line-height: 1; }
.detail-page-body { padding: 28px 24px 40px; max-width: 768px; margin: 0 auto; }
.detail-page-title { font-size: 30px; font-weight: 700; margin-bottom: 14px; color: #171717; text-align: left; line-height: 1.35; letter-spacing: 0.2px; }
.detail-page-meta {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 28px;
  font-size: 14px;
  color: #8f8f8f;
  text-align: left;
  flex-wrap: wrap;
}
.detail-page-author {
  color: #8f8f8f;
}
.detail-page-blocks { max-width: 768px; margin: 0 auto; }
.detail-page-block-text {
  max-width: 768px;
  color: #222;
  line-height: 1.85;
  font-size: 16px;
  margin-bottom: 22px;
  white-space: pre-wrap;
  text-align: left;
  font-weight: 400;
  letter-spacing: 0.2px;
}
.detail-page-image {
  width: 100%;
  max-width: 768px;
  border-radius: 10px;
  margin: 0 auto 26px;
  background: #f2f2f2;
  object-fit: contain;
  max-height: none;
  display: block;
}
.detail-page-images {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  max-width: 768px;
  margin: 0 auto;
}
.detail-page-attachments {
  max-width: 768px;
  margin: 0 auto 28px;
}
.detail-page-attachment {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: 1px solid #ebebeb;
  border-radius: 10px;
  background: #fafafa;
  color: #333;
  font-size: 14px;
  text-decoration: none;
  margin: 0 6px 8px 0;
}
.detail-page-attachment:hover { background: #f0f0f0; }
.detail-page-notes {
  max-width: 768px;
  margin: 0 auto 28px;
}
.detail-page-notes-box {
  border: 1px dashed #e0e0e0;
  border-radius: 12px;
  padding: 14px 16px;
  background: #fafafa;
  color: #4a4a4a;
  font-size: 14px;
  line-height: 1.7;
}
.detail-page-notes-title {
  font-weight: 600;
  color: #333;
  margin-bottom: 6px;
  font-size: 14px;
}
.detail-page-notes-content { white-space: pre-wrap; }
.detail-page-backdrop { display: none; }
.detail-page { background: #fff; }

/* === Buttons === */
.btn { padding: 10px 24px; border-radius: 8px; font-size: 14px; font-weight: 600; transition: all 0.2s; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.btn-primary { background: #e63946; color: #fff; border: none; }
.btn-primary:hover { background: #c1121f; }
.btn-secondary { background: #fff; color: #333; border: 1px solid #ebebeb; }
.btn-secondary:hover { background: #f5f5f5; }

/* === Empty State === */
.empty-state { text-align: center; padding: 60px 20px; color: #999; }
.empty-state h3 { font-size: 18px; margin-bottom: 8px; color: #666; }
.empty-state p { font-size: 14px; }

/* === Responsive === */
@media (max-width: 768px) {
  .container { padding-right: 16px; padding-left: 16px; }
  .hero { padding-bottom: 26px; }
  #works { padding-top: 0; }
  .nav { display: none; }
  .mobile-menu-btn { display: flex; }
  .hero-layout { grid-template-columns: 1fr; gap: 40px; }
  .hero-left { order: 2; }
  .hero-right { order: 1; }
  .contact-grid { grid-template-columns: 1fr; }
  .search-box {
    height: 60px;
    max-width: none;
    flex-direction: row;
    align-items: center;
    border: 0;
    border-radius: 30px;
    background: #f5f4f7;
  }
  .search-box input {
    min-width: 0;
    height: 60px;
    padding: 0 16px;
    border-bottom: 0;
    font-size: 16px;
    line-height: 22px;
  }
  .search-box input::placeholder { color: #373342; opacity: 1; }
  .search-box button {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    margin-right: 15px;
    padding: 0;
    border-radius: 50%;
    background: #342f42;
    background-image: url('../assets/images/search.svg');
    background-repeat: no-repeat;
    background-position: center;
    background-size: 20px 20px;
    font-size: 0;
  }
  .section-title {
    gap: 12px;
    margin-bottom: 22px;
    font-size: 24px;
    font-weight: 600;
    line-height: 33px;
  }
  .section-subtitle { font-size: 14px; line-height: 20px; }
  .filter-bar {
    width: calc(100% + 16px);
    max-width: none;
    flex-wrap: nowrap;
    gap: 8px;
    margin-bottom: 32px;
    padding: 0 16px 0 0;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-inline: contain;
    touch-action: pan-x;
  }
  .filter-bar::-webkit-scrollbar { display: none; width: 0; height: 0; }
  .filter-btn {
    height: 30px;
    flex: 0 0 auto;
    padding: 0 12px;
    border-radius: 15px;
    background: #fff;
    color: #171717;
    font-size: 14px;
    font-weight: 400;
    line-height: 20px;
    white-space: nowrap;
  }
  .filter-btn.active { background: #fff; color: #171717; border-color: #ebebeb; }
  .detail-page-images { grid-template-columns: repeat(2, 1fr); }
  .detail-page-content { margin: 0; border-radius: 0; max-height: 100vh; }
  .detail-page { overflow-y: auto; }
  .detail-page-title { font-size: 22px; }
  .gallery-list { grid-template-columns: 1fr; }
  .resource-list { grid-template-columns: 1fr; }
  .modal-split { flex-direction: column; }
  .modal-preview, .modal-form-area { flex: 1 1 auto; width: 100%; }
  .modal-form-area { border-left: none; border-top: 1px solid #ebebeb; }
  .portfolio-project-header { padding: 20px; }
  .portfolio-project-header .detail-page-title { margin-bottom: 12px; font-size: 22px; line-height: 1.2; }
  .portfolio-project-header .detail-page-meta { gap: 8px; font-size: 12px; }
  .portfolio-media-count::before { margin-left: 2px; }
  .portfolio-media-stream { width: 100%; }
  .portfolio-overview { width: 100%; padding: 48px 20px 56px; }
  .portfolio-overview .detail-page-desc { font-size: 16px; line-height: 1.8; }
  .portfolio-document-item { padding: 32px 20px; }
  .portfolio-document-link { min-height: 96px; padding: 20px; }
  .more-works { padding: 48px 20px 64px; }
  .more-works-header { margin-bottom: 16px; }
  .more-works-title { font-size: 18px; }
  .more-works-track { gap: 14px; }
  .portfolio-project-nav { padding: 0 20px; }
  .portfolio-loading { align-items: flex-end; padding: 20px 20px 28px; }
  .portfolio-loading-panel { width: 100%; max-width: 320px; min-height: 72px; }
  #portfolioModal { padding: 0; }
  .modal-fullscreen.portfolio-detail-modal {
    width: 100vw;
    min-height: 100vh;
    max-height: none;
    border-radius: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .portfolio-loading-spinner { animation-duration: 1.6s; }
}

@media (hover: none) {
  .card:hover { transform: none !important; box-shadow: none !important; }
  .resource-card:hover { transform: none !important; border-color: #ebebeb !important; box-shadow: none !important; }
  .resource-card:hover .resource-icon { background: #f5f5f5 !important; }
  .gallery-item:hover { transform: none !important; box-shadow: none !important; border-color: #ebebeb !important; }
  .gallery-item:hover .gallery-item-arrow { color: #ccc !important; }
  .resource-item:hover { border-color: #ebebeb !important; }
  .resource-item:hover .resource-item-arrow { color: #ccc !important; }
  .social-link:hover { background: #f0f0f0 !important; transform: none !important; }
  .btn-wechat:hover { background: #F3F3F3 !important; color: #0D0C22 !important; transform: none !important; }
  .more-works-card:hover .more-works-overlay { opacity: 0 !important; }
  .more-works-arrow:hover:not(:disabled) { transform: translateY(-50%) !important; box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important; background: rgba(255,255,255,0.9) !important; }
  .thumb-delete:hover { transform: none !important; }
  .modal-fullscreen .modal-close-outer:hover { background: rgba(0,0,0,0.6) !important; }
  .modal-fullscreen .modal-thumbnails .thumb:hover { border-color: transparent !important; opacity: 0.75 !important; }
}

/* === Gallery Article Editor (admin) === */
.article-editor-wrap {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}
.modal-fullscreen .article-editor-wrap {
  height: calc(100vh - 120px);
  min-height: 520px;
}
.article-toolbar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 10px 14px;
  background: #f7f7f8;
  border-bottom: 1px solid #ebebeb;
}
.article-toolbar-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.article-tool-btn {
  border: 1px solid #e3e3e3;
  background: #fff;
  color: #333;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}
.article-tool-btn:hover {
  background: #f0f0f0;
  border-color: #ccc;
}
.hidden-file-input {
  display: none;
}
.article-editor-scroll {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 24px;
  background: #fff;
}
.article-editor {
  width: 768px;
  min-height: 1404px;
  margin: 0 auto;
  background: #fff;
  color: #222;
  font-size: 16px;
  line-height: 1.75;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  outline: none;
  border-radius: 12px;
  padding: 28px 28px 60px;
  box-sizing: border-box;
  border: 1px dashed transparent;
  box-shadow: 0 2px 10px rgba(0,0,0,0.04);
}
.article-editor:focus {
  border-color: #e63946;
}
.article-placeholder {
  pointer-events: none;
  color: #b0b0b0;
}
.article-placeholder-line {
  font-size: 16px;
  line-height: 1.75;
  margin-bottom: 10px;
  color: #222;
}
.article-placeholder-muted {
  font-size: 15px;
  color: #c7c7c7;
}
