/* Reset & Base */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "HarmonyOS Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}
#app { min-height: 100vh; transition: background-color .2s, color .2s; }

/* Light Mode */
.light-mode { background: #FFF; color: #000; }
.light-mode .header { background: rgba(255,255,255,0.0001); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
.light-mode .header-inner { border-bottom: none; }
.light-mode .icon-fill, .light-mode .logo-fill, .light-mode .btn-contact-icon { fill: #000 !important; }
.light-mode .btn-contact { background: #FFF; border: 1px solid #D8D8D8; color: #000; }
.light-mode .btn-contact:hover { background: #F6F6F6; }
.light-mode .btn-resume { background: #F43B00; border: none; color: #FFF; }
.light-mode .btn-resume:hover { background: #D44823; }
.light-mode .footer { border-top: 1px solid #D8D8D8; }
.light-mode .footer-group-title { border-bottom: 1px solid #000; color: #000; }
.light-mode .footer-link { color: rgba(0,0,0,.8); }
.light-mode .footer-link:hover { color: #000; }
.light-mode .footer-copyright { color: #000; }

/* Dark Mode */
.dark-mode { background: #171A1B; color: #FFF; }
.dark-mode .header { background: rgba(23,26,27,0.0001); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
.dark-mode .header-inner { border-bottom: none; }
.dark-mode .icon-fill, .dark-mode .logo-fill, .dark-mode .btn-contact-icon { fill: #FFF !important; }
.dark-mode .btn-contact { background: #2D3237; border: 1px solid #4D565F; color: #FFF; }
.dark-mode .btn-contact:hover { background: #3a4147; }
.dark-mode .btn-resume { background: #F43B00; border: none; color: #FFF; }
.dark-mode .btn-resume:hover { background: #D44823; }
.dark-mode .footer { border-top: 1px solid #4D565F; }
.dark-mode .footer-group-title { border-bottom: 1px solid #FFF; color: #FFF; }
.dark-mode .footer-link { color: rgba(255,255,255,.8); }
.dark-mode .footer-link:hover { color: #FFF; }
.dark-mode .footer-copyright { color: #FFF; }

/* Header */
.header { position: fixed; top: 0; left: 0; right: 0; height: 60px; z-index: 100; }

.header-inner {
  max-width: 1600px; margin: 0 auto; height: 100%; padding: 0 20px;
  display: flex; align-items: center; justify-content: space-between;
}
.header-controls { display: flex; gap: 20px; align-items: center; }
.icon-btn {
  width: 40px; height: 40px; border: none; background: none; cursor: pointer;
  opacity: .5; transition: opacity .2s; display: flex; align-items: center; justify-content: center;
  padding: 0; position: relative;
}
.icon-btn:hover { opacity: 1; }
.icon-btn svg { width: 40px; height: 40px; position: absolute; top: 0; left: 0; }

/* Hero */
.hero { padding-top: 60px; min-height: 758px; display: flex; align-items: center; }
.hero-inner { max-width: 1600px; margin: 0 auto; padding: 0 20px; width: 100%; }
.hero-avatar img { width: 98px; height: 98px; border-radius: 50%; display: block; }
.hero-title {
  font-size: 32px; line-height: 56px; font-weight: 400; margin-top: 31px; letter-spacing: 0;
}
.hero-desc { max-width: 792px;
  font-size: 14px; line-height: 30px; font-weight: 400; margin-top: 31px; letter-spacing: 0; opacity: 0.6;
}
.hero-buttons { display: flex; gap: 16px; margin-top: 59px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px;
  padding: 0 16px; border-radius: 4px; cursor: pointer;
  font-size: 13px; font-weight: 400; transition: all .2s;
}
.btn svg { flex-shrink: 0; }
.btn-contact { width: 138px; }
.btn-resume { width: 138px; }
.btn-resume svg { width: 14px; height: 14px; }

/* Works Grid */
.works { padding: 60px 0; }
.works-grid {
  max-width: 1600px; margin: 0 auto; padding: 0 20px;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px 16px;
}
.work-item { cursor: pointer; display: block; max-width: 388px; min-width: 0; overflow: hidden; text-decoration: none; color: inherit; }
.work-thumb { width: 100%; max-width: 388px; min-width: 0; aspect-ratio: 1; overflow: hidden; }
.work-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.work-name {
  font-size: 16px; line-height: 16px; margin-top: 24px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* Footer */
.footer { padding-top: 60px; }
.footer-inner { max-width: 1600px; margin: 0 auto; padding: 0 20px; }
.footer-groups { display: flex; gap: 16px; flex-wrap: wrap; }
.footer-group { flex: 1; min-width: 200px; }
.footer-group-title {
  font-size: 16px; line-height: 16px; font-weight: 400;
  padding-bottom: 10px; border-bottom-style: solid; border-bottom-width: 1px;
}
.footer-links { list-style: none; padding: 10px 0 0 0; }
.footer-link {
  display: block; font-size: 13px; line-height: 17px; padding: 5px 0;
  cursor: pointer; transition: all .2s; text-decoration: none;
}
.footer-copyright {
  text-align: center; font-size: 13px; padding: 30px 0; opacity: .5;
}

/* Responsive */
@media (max-width: 1000px) {
  .works-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
}
@media (max-width: 600px) {
  .header { height: 60px; }
  .header-inner { padding: 0 16px; }
  .header-controls { gap: 12px; }
  .icon-btn, .icon-btn svg { width: 36px; height: 36px; }
  .hero { padding-top: 60px; min-height: auto; padding-bottom: 40px; }
  .hero-inner { padding: 0 16px; }
  .hero-title { font-size: 24px; line-height: 40px; margin-top: 24px; }
  .hero-desc { font-size: 13px; line-height: 26px; margin-top: 24px; }
  .hero-buttons { margin-top: 40px; gap: 16px; justify-content: center; }
  .btn-contact, .btn-resume { width: auto; flex: 1; min-width: 0; }
  .works-grid { padding: 0 16px; gap: 16px; }
  .works { padding: 30px 0; }
  .work-name { font-size: 14px; margin-top: 16px; }
  .footer-inner { padding: 0 16px; }
  .footer { padding-top: 30px; }
  .footer-group-title { font-size: 14px; }
  .footer-copyright { padding: 20px 0; font-size: 12px; }
  .footer-link { padding: 4px 0; }
  .btn { height: 36px; }
  .hero-avatar img { width: 80px; height: 80px; }
}
@media (max-width: 480px) {
  .header { height: 56px; }
  .header-inner { padding: 0 12px; }
  .header-controls { gap: 8px; }
  .icon-btn, .icon-btn svg { width: 32px; height: 32px; }
  .hero { padding-top: 60px; padding-bottom: 30px; }
  .hero-inner { padding: 0 12px; }
  .hero-title { font-size: 20px; line-height: 32px; margin-top: 20px; }
  .hero-desc { font-size: 13px; line-height: 22px; margin-top: 20px; }
  .hero-buttons { margin-top: 30px; gap: 12px; }
  .works-grid { padding: 0 12px; gap: 12px; }
  .works { padding: 20px 0; }
  .work-name { font-size: 13px; margin-top: 12px; }
  .footer { padding-top: 20px; }
  .footer-inner { padding: 0 12px; }
  .footer-group-title { font-size: 13px; padding-bottom: 8px; }
  .footer-link { font-size: 12px; padding: 3px 0; }
  .footer-copyright { padding: 16px 0; font-size: 11px; }
  .btn { height: 36px; }
  .hero-avatar img { width: 70px; height: 70px; }
  .btn-resume, .btn-contact { width: auto; flex: 1; min-width: 0; font-size: 13px; }
}
@media (max-width: 360px) {
  .works-grid { grid-template-columns: 1fr; }
  .footer-groups { flex-direction: column; }
}

/* ===== Work Detail Page ===== */
.work-detail {
  padding: 60px 16px 80px;
}

.work-detail-inner {
  max-width: 1600px;
  margin: 0 auto;
}

.work-detail-cover {
  width: 100%;
  margin-bottom: 40px;
  border-radius: 0;
  overflow: hidden;
}

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

.work-detail-title {
  font-family: "HarmonyOS Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 32px;
  line-height: 48px;
  font-weight: 400;
  color: var(--color-font, #000000);
  margin-bottom: 32px;
}

.work-detail-content {
  font-family: "HarmonyOS Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 30px;
  font-weight: 400;
  color: var(--color-font, #000000);
}

/* Zero out font-size/line-height to kill whitespace text node gaps */
.work-detail-content {
  font-size: 0 !important;
  line-height: 0 !important;
}

.work-detail-content p,
.work-detail-content div,
.work-detail-content span,
.work-detail-content h1,
.work-detail-content h2,
.work-detail-content h3,
.work-detail-content h4,
.work-detail-content h5,
.work-detail-content h6,
.work-detail-content li,
.work-detail-content figcaption,
.work-detail-content blockquote,
.work-detail-content pre,
.work-detail-content td,
.work-detail-content th {
  font-size: 14px;
  line-height: 30px;
  margin: 0 !important;
}

.work-detail-content img {
  display: block;
  width: 1600px !important;
  max-width: 100% !important;
  height: auto;
  margin: 0;
  padding: 0;
}

.work-detail-content br {
  display: none;
}

/* ===== Work Detail Navigation ===== */
.work-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 16px;
  margin-top: 60px;
  padding-top: 32px;
  border-top: 1px solid #D8D8D8;
}

.work-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 12px;
  background: #FFFFFF;
  border: 1px solid #D8D8D8;
  border-radius: 4px;
  font-family: "HarmonyOS Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 13px;
  color: #000000;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s;
  outline: none;
}

.work-nav-btn:hover {
  background: #F6F6F6;
  border-color: #BBBBBB;
}

.work-nav-btn svg {
  width: 14px;
  height: 10px;
  flex-shrink: 0;
}

.work-nav-center {
  border: none;
  background: #000000;
  color: #FFFFFF;
}

.work-nav-center:hover {
  background: rgba(0, 0, 0, 0.7);
  border: none;
}

/* Dark mode overrides for work detail */
.dark-mode .work-nav-btn {
  background: #2D3237;
  border-color: #4D565F;
  color: #FFF;
}

.dark-mode .work-nav-btn:hover {
  background: #3A4147;
}

.dark-mode .work-nav-center {
  background: #000000;
  color: #FFFFFF;
}

.dark-mode .work-nav-center:hover {
  background: rgba(0, 0, 0, 0.7);
}

.dark-mode .work-nav {
  border-top-color: #4D565F;
}

.dark-mode .work-detail-title {
  color: #FFFFFF;
}

.dark-mode .work-detail-content {
  color: #FFFFFF;
}

.dark-mode .modal-dialog {
  background: #2D3237;
}

.dark-mode .modal-title {
  color: #FFFFFF;
}

.dark-mode .modal-body p {
  color: rgba(255,255,255,0.6) !important;
}

.dark-mode .modal-body .field-input {
  background: #171A1B;
  border-color: #4D565F;
  color: #FFFFFF;
}

.dark-mode .modal-body .field-input:focus {
  border-color: #000000;
}

.dark-mode .btn-cancel {
  background: #2D3237;
  border-color: #4D565F;
  color: #FFFFFF;
}

@media (max-width: 600px) {
  .work-detail { padding: 40px 12px 60px; }
  .work-detail-title { font-size: 24px; line-height: 36px; margin-bottom: 24px; }
  .work-detail-content p,
  .work-detail-content div,
  .work-detail-content span,
  .work-detail-content h1,
  .work-detail-content h2,
  .work-detail-content h3,
  .work-detail-content h4,
  .work-detail-content h5,
  .work-detail-content h6,
  .work-detail-content li,
  .work-detail-content figcaption,
  .work-detail-content blockquote,
  .work-detail-content pre,
  .work-detail-content td,
  .work-detail-content th { font-size: 13px; line-height: 26px; }
  .work-nav { margin-top: 40px; padding-top: 24px; gap: 8px; }
  .work-nav-btn { height: 32px; padding: 0 8px; font-size: 12px; }
}

@media (max-width: 480px) {
  .work-detail { padding: 30px 8px 40px; }
  .work-detail-title { font-size: 20px; line-height: 30px; margin-bottom: 20px; }
  .work-nav-btn .nav-text { display: flex; }
  .work-nav-center .nav-text { display: inline; }
}

/* ===== Password Work Modal (Homepage) ===== */
.password-work-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(100px);
  -webkit-backdrop-filter: blur(100px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.dark-mode .password-work-modal,
.password-work-modal.dark-overlay {
  background: rgba(0, 0, 0, 0.5);
}

.password-work-modal.open { display: flex; }

.password-work-dialog {
  width: 360px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 0;
}

.pwd-modal-input {
  width: 100%;
  height: 40px;
  padding: 0 13px;
  background: #FFFFFF;
  border: 1px solid #D8D8D8;
  border-radius: 4px;
  font-family: "HarmonyOS Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 13px;
  color: #000000;
  outline: none;
  transition: border-color 0.2s;
  text-align: center;
}

.pwd-modal-input:focus { border-color: #000000; }

.pwd-modal-input::placeholder {
  color: rgba(0, 0, 0, 0.4);
  text-align: center;
}

.pwd-modal-error {
  font-family: "HarmonyOS Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 12px;
  color: #FF6B6B;
  text-align: center;
  display: flex;
  line-height: 1.4;
}

.pwd-modal-actions {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 16px;
  width: 100%;
}

.pwd-modal-btn-primary {
  width: 100%;
  height: 40px;
  background: #000000;
  border: none;
  border-radius: 4px;
  font-family: "HarmonyOS Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 13px;
  color: #FFFFFF;
  cursor: pointer;
  transition: background 0.2s;
}

.pwd-modal-btn-primary:hover { background: rgba(0, 0, 0, 0.7); }

.pwd-modal-btn-secondary {
  width: 100%;
  height: 40px;
  background: #FFFFFF;
  border: 1px solid #D8D8D8;
  border-radius: 4px;
  font-family: "HarmonyOS Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 13px;
  color: #000000;
  cursor: pointer;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.pwd-modal-btn-secondary:hover { background: #F6F6F6; }

.dark-mode .pwd-modal-input {
  background: #171A1B;
  border-color: #4D565F;
  color: #FFFFFF;
}

.dark-mode .pwd-modal-input:focus { border-color: #000000; }

.dark-mode .pwd-modal-btn-secondary {
  background: #2D3237;
  border-color: #4D565F;
  color: #FFFFFF;
}

.dark-mode .pwd-modal-btn-secondary:hover { background: #3A4147; }

.dark-mode .pwd-modal-input::placeholder { color: rgba(255, 255, 255, 0.4); }

.pwd-dialog-gap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin-top: 16px;
  width: 100%;
}

.pwd-badge {
  width: 100%;
  height: 40px;
  background: rgba(0, 160, 93, 0.2);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  flex-shrink: 0;
}

.pwd-badge-left {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: "HarmonyOS Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 13px;
  font-weight: 400;
  color: #00A05D;
  white-space: nowrap;
}

.pwd-badge-left img { width: 14px; height: 14px; flex-shrink: 0; }

.pwd-badge-right {
  font-family: "HarmonyOS Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 12px;
  font-weight: 400;
  color: #00A05D;
  white-space: nowrap;
}

.dark-mode .pwd-badge { background: rgba(0, 160, 93, 0.25); }
.dark-mode .pwd-badge-left,
.dark-mode .pwd-badge-right { color: #00CC77; }

.work-detail-content .img-close { display: none !important; }

.work-thumb { position: relative; }
.work-thumb::after {
  content: '';
  position: absolute; inset: 0; z-index: 2;
  pointer-events: auto;
}
.work-detail-content picture { position: relative; display: block; max-width: 100%; margin: 0; }
.work-detail-content picture::after {
  content: '';
  position: absolute; inset: 0; z-index: 2;
}



/* ===== Hero Globe ===== */
.hero {
  position: relative;
  overflow: hidden;
}

.hero-globe-area {
  position: absolute;
  top: calc(50% + 190px);
  right: -450px;
  transform: translateY(-50%);
  width: 1200px;
  height: 1200px;
  pointer-events: none;
  z-index: -1;
  transition: opacity 0.8s ease;
}

.hero-globe-area canvas {
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: auto;
}

.hero-inner {
  position: relative;
  z-index: 1;
}

.globe-sticker {
  position: absolute;
  bottom: anchor(top);
  left: anchor(center);
  translate: -50% 0;
  width: 44px;
  height: 44px;
  object-fit: cover;
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
  margin-bottom: 4px;
}

.globe-sticker:nth-child(3n) { transform: rotate(5deg); }
.globe-sticker:nth-child(4n) { transform: rotate(-3deg); }
.globe-sticker:nth-child(5n) { transform: rotate(8deg); }

@supports not (anchor-name: --test) {
  .globe-sticker { display: none; }
}

.dark-mode .hero-globe-area { opacity: 1; }

@media (max-width: 1200px) {
  .hero-globe-area {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-globe-area { display: none; }
}

@media (max-width: 640px) {
  .hero-globe-area {
    width: 80vw;
    height: 80vw;
    max-width: 500px;
    max-height: 500px;
    right: -80px;
  }
  .globe-sticker { width: 32px; height: 32px; }
}

@media (max-width: 480px) {
  .hero-globe-area {
    width: 90vw;
    height: 90vw;
    max-width: 380px;
    max-height: 380px;
    right: -60px;
  }
}
