﻿:root {
  --blue: rgb(0, 108, 196);
  --red: rgb(222, 0, 0);
  --black: #000;
  --white: #fff;
  --line: #d9e0e9;
  --muted: #4f5d6b;
  --yellow: rgb(255, 255, 0);
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--white); color: var(--black); }
body { font-family: "Times New Roman", "KaiTi", "STKaiti", serif; font-size: 16px; line-height: 1.72; }

.zh-title { font-family: "Times New Roman", "SimSun", "Songti SC", serif; font-weight: 700; }
.zh-body { font-family: "Times New Roman", "KaiTi", "STKaiti", serif; }
.lang-option#lang-en { font-family: "Times New Roman", serif; }
.lang-option#lang-zhHans, .lang-option#lang-zhHant { font-family: "SimSun", "Times New Roman", serif; }

.page-loader {
  position: fixed; inset: 0; z-index: 2000; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.95); transition: opacity .35s ease;
}
.page-loader.hide { opacity: 0; pointer-events: none; }
.loader-spin { width: 44px; height: 44px; border-radius: 50%; border: 4px solid #d7e9fb; border-top-color: var(--blue); animation: spin .9s linear infinite; }
.loader-text { margin-top: 12px; color: var(--blue); }
@keyframes spin { to { transform: rotate(360deg); } }

.verify-overlay {
  position: fixed; inset: 0; z-index: 1900; background: rgba(255, 255, 255, 0.92); display: flex; align-items: center; justify-content: center;
}
.verify-overlay.fade-out { opacity: 0; transition: opacity .18s ease; }
.verify-overlay.hidden { display: none; }
.verify-card { width: min(460px, 92vw); background: var(--white); border: 1px solid var(--line); padding: 20px; border-radius: 16px; }
.verify-track {
  position: relative;
  width: 100%;
  height: 26px;
  margin: 16px 0 8px;
  border: 1px solid #a9c2dd;
  border-radius: 999px;
  background: linear-gradient(180deg, #f2f7fd 0%, #e8f1fa 100%);
  overflow: visible;
  user-select: none;
}
.verify-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  border-radius: 999px;
  background: rgba(0, 108, 196, 0.18);
  transition: width .05s linear;
}
.verify-handle {
  --verify-arrow-y-offset: -2px;
  --jelly-sx1: 1.08;
  --jelly-sy1: 0.92;
  --jelly-sx2: 0.96;
  --jelly-sy2: 1.04;
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid #0a5da5;
  background: var(--blue);
  color: transparent;
  font-size: 20px;
  line-height: 1;
  cursor: grab;
  overflow: hidden;
  will-change: transform, left;
}
.verify-handle:active { cursor: grabbing; }
.verify-handle::before {
  content: "»";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 26px;
  line-height: 1;
  font-weight: 700;
  animation: arrowShineX 1s ease-in-out infinite;
}
.verify-track.done .verify-fill { background: rgba(0, 108, 196, 0.3); }
.verify-track.done .verify-handle::before { animation-play-state: paused; }
.verify-handle.jelly-left { animation: verifyJellyLeft .5s ease; }
.verify-handle.jelly-right { animation: verifyJellyRight .5s ease; }
.verify-msg { margin-top: 8px; color: var(--red); min-height: 20px; }
.bi-zh, .bi-en { display: block; text-align: center; }
.bi-zh { font-family: "SimSun", "Times New Roman", serif; font-weight: 700; }
.bi-en { font-family: "Times New Roman", serif; font-size: 13px; margin-top: 2px; }
@keyframes arrowShineX {
  0% {
    transform: translate(-9px, var(--verify-arrow-y-offset));
    opacity: 0.64;
    text-shadow: none;
  }
  52% {
    transform: translate(0, var(--verify-arrow-y-offset));
    opacity: 1;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.95);
  }
  100% {
    transform: translate(9px, var(--verify-arrow-y-offset));
    opacity: 0.72;
    text-shadow: none;
  }
}
@keyframes verifyJellyLeft {
  0% { transform: translateY(-50%) scaleX(1) scaleY(1); }
  30% { transform: translateY(-50%) scaleX(var(--jelly-sx1)) scaleY(var(--jelly-sy1)); }
  66% { transform: translateY(-50%) scaleX(var(--jelly-sx2)) scaleY(var(--jelly-sy2)); }
  100% { transform: translateY(-50%) scaleX(1) scaleY(1); }
}
@keyframes verifyJellyRight {
  0% { transform: translateY(-50%) scaleX(1) scaleY(1); }
  28% { transform: translateY(-50%) scaleX(var(--jelly-sx1)) scaleY(var(--jelly-sy1)); }
  62% { transform: translateY(-50%) scaleX(var(--jelly-sx2)) scaleY(var(--jelly-sy2)); }
  100% { transform: translateY(-50%) scaleX(1) scaleY(1); }
}
body.verify-lock .topbar,
body.verify-lock .layout,
body.verify-lock .site-footer,
body.verify-lock #auth-modal,
body.verify-lock #alert-box {
  filter: blur(14px) saturate(0.85);
  opacity: 1;
  pointer-events: none;
  user-select: none;
}

.topbar { position: sticky; top: 0; z-index: 12; background: var(--blue); border-bottom: 2px solid var(--blue); }
.topbar-inner { max-width: 1280px; margin: 0 auto; padding: 14px 18px; display: flex; gap: 16px; align-items: center; justify-content: space-between; }
.nav { display: flex; gap: 10px; flex-wrap: wrap; }
.nav-link {
  color: var(--white); text-decoration: none; padding: 8px 10px; border: 1px solid transparent; transition: transform .2s ease, border-color .2s ease;
}
.nav-link:hover { transform: scale(1.06); border-color: var(--white); }
.nav-link.active { border-bottom: 2px solid var(--red); }

.top-tools { display: flex; align-items: center; gap: 10px; }
.search-wrap { position: relative; width: 170px; transition: width .4s ease; }
.search-wrap.focused { width: 300px; animation: jellyX 0.75s ease 1; }
@keyframes jellyX {
  0% { transform: scaleX(1); }
  35% { transform: scaleX(1.12); }
  65% { transform: scaleX(.97); }
  100% { transform: scaleX(1); }
}
.site-search {
  width: 100%; border: 1px solid #ffffff; border-radius: 999px; padding: 7px 38px 7px 12px; outline: none;
  background: linear-gradient(90deg, #0a6fc8, #1178d2); color: var(--white); transition: background .25s ease, color .25s ease;
}
.site-search::placeholder { color: #e8f4ff; }
.search-wrap.focused .site-search { background: var(--white); color: var(--black); }
.search-wrap.focused .site-search::placeholder { color: #98a5b5; }
.search-btn {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--blue); cursor: pointer;
  width: 28px; height: 28px;
}
.search-suggest {
  position: absolute; top: 38px; left: 0; width: 100%; background: var(--white); border: 1px solid var(--line); z-index: 20; max-height: 220px; overflow: auto;
}
.suggest-item { width: 100%; text-align: left; background: var(--white); border: 0; border-bottom: 1px solid #eef2f6; padding: 8px 10px; cursor: pointer; }
.suggest-item:hover { background: #f3f8ff; }

.login-btn {
  border: 1px solid #fff; background: transparent; color: #fff; padding: 7px 12px; cursor: pointer; font-family: "KaiTi", "Times New Roman", serif;
}
body[data-lang="zhHant"] .login-btn,
body[data-lang="zhHans"] .login-btn,
body[data-lang="zhHant"] .docs-refresh,
body[data-lang="zhHans"] .docs-refresh {
  font-family: "KaiTi", "STKaiti", "Times New Roman", serif;
}
body[data-lang="en"] .login-btn,
body[data-lang="en"] .docs-refresh {
  font-family: "Times New Roman", serif;
}
body[data-lang="zhHant"] .download-action,
body[data-lang="zhHans"] .download-action {
  font-family: "KaiTi", "STKaiti", "Times New Roman", serif;
}
body[data-lang="en"] .download-action {
  font-family: "Times New Roman", serif;
}

.lang-switch { display: flex; gap: 8px; }
.lang-option {
  border: 1px solid transparent; border-bottom: 2px solid transparent; background: transparent; color: #fff; padding: 7px 3px; cursor: pointer;
}
.lang-option:hover { transform: scale(1.06); border-color: var(--white); }
.lang-option.active { border-bottom-color: var(--red); }

.layout {
  max-width: 1280px; margin: 0 auto; padding: 30px 18px 44px; display: grid; grid-template-columns: 300px 1fr; gap: 26px;
}
.sidebar { position: sticky; top: 92px; align-self: start; border: 1px solid var(--line); padding: 20px; background: var(--white); }
.profile-photo { width: 100%; max-height: 420px; object-fit: contain; border: 1px solid var(--line); border-radius: 10px; display: block; margin-bottom: 14px; transition: transform .5s cubic-bezier(.2,.85,.25,1.15); transform-origin: center center; }
.profile-photo:hover { transform: scale(1.04); }
.sidebar-name { margin: 0 0 8px; font-size: 32px; }
.sidebar-alias { margin: 0 0 14px; color: var(--blue); font-size: 17px; font-weight: 700; }
.sidebar-line, .sidebar-copy-link { margin: 8px 0; color: var(--black); text-decoration: none; display: block; }
.sidebar-copy-link { white-space: nowrap; word-break: keep-all; overflow-wrap: normal; }
.sidebar-link { color: var(--black); text-decoration: none; }
.sidebar-link:hover, .sidebar-copy-link:hover { color: var(--blue); text-decoration: underline; }
.bullet::before { content: "• "; font-size: 16px; }
.copy-toast { min-height: 20px; color: var(--red); opacity: 0; transition: opacity .2s ease; }
.copy-toast.show { opacity: 1; }

.main { min-width: 0; }
.page-title { margin: 0 0 20px; font-size: 34px; }
.content-block, .entry-card, .docs { border: 1px solid var(--line); padding: 20px; margin-bottom: 18px; background: var(--white); }
.content-block h2, .entry-title, .docs-title { margin: 0 0 12px; font-size: 24px; color: var(--blue); transition: transform .2s ease; }
.content-block:hover h2, .entry-card:hover .entry-title, .docs:hover .docs-title { transform: scale(1.03); transform-origin: left center; }

.meta-line { display: grid; gap: 10px; font-weight: 700; }
.meta-cols-2 { grid-template-columns: 1fr auto; }
.meta-cols-3 { grid-template-columns: 2.2fr 1.2fr 1fr; }
.meta-cols-4 { grid-template-columns: 1.25fr 1.25fr 1.6fr 1fr; }
.meta-seg.left { text-align: left; }
.meta-seg.mid { text-align: center; }
.meta-seg.right { text-align: right; }
.meta-seg.no-wrap { white-space: nowrap; }
.meta-link { color: inherit; text-decoration: none; }
.meta-link:hover { color: var(--blue); text-decoration: underline; }

.item-list { margin: 0; padding-left: 20px; }
.text-item { margin-bottom: 8px; }
.text-item.meta-item { list-style: none; margin-left: -20px; }
.home-education .edu-gap-before-highschool { margin-top: 18px; }
.home-education .edu-gap-before-junior { margin-top: 18px; }
.keyword { font-weight: 700; }
.note-text { color: var(--muted); margin: 10px 0 0; }

.docs-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.docs-refresh { border: 1px solid var(--blue); background: var(--white); color: var(--blue); padding: 8px 12px; cursor: pointer; }
.docs-list { display: grid; gap: 12px; }
.doc-item { border: 1px solid var(--line); padding: 14px; }
.doc-name { font-weight: 700; margin-bottom: 6px; word-break: break-all; }
.doc-meta { display: flex; gap: 16px; flex-wrap: wrap; color: var(--muted); margin-bottom: 8px; font-size: 14px; }
.doc-download { color: var(--blue); text-decoration: none; font-weight: 700; }
.doc-loading, .doc-empty, .doc-error { border: 1px dashed var(--line); padding: 12px; color: var(--muted); }

.style-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.style-card { border: 1px solid var(--line); padding: 12px; background: var(--white); transition: transform .18s ease; }
.style-tilt-card { transform-style: preserve-3d; }
.style-image-wrap { width: 100%; aspect-ratio: 1 / 1; border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.style-image-wrap.broken::after { content: "圖片載入失敗"; color: var(--muted); }
.style-image { width: 100%; height: 100%; object-fit: contain; }
.style-caption { margin: 8px 0 0; text-align: center; font-size: 14px; font-weight: 700; word-break: break-all; }
.gallery-group { border: 1px solid var(--line); padding: 14px; margin-bottom: 16px; }
.gallery-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.gallery-body { margin-top: 10px; }
.gallery-toggle { border: 1px solid var(--line); background: #fff; color: var(--blue); width: 34px; height: 30px; cursor: pointer; font-size: 16px; }

.collapsible-panel { overflow: hidden; transform-origin: top; will-change: height, opacity, transform; }
.is-collapsing { pointer-events: none; }

.education-collapsible {
  list-style: none;
  margin-left: -20px;
  border: 1px dashed #c6d9ef;
  border-radius: 10px;
  padding: 10px 12px;
  background: #fbfdff;
}
.education-collapsible-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; }
.education-collapsible-head .gallery-toggle { margin-left: auto; }
.education-collapsed-label { color: var(--blue); font-size: 20px; font-weight: 700; }
.education-collapsible-body { margin-top: 8px; }
.education-collapsible-details { display: grid; gap: 8px; }
.education-collapsible-row .meta-line { margin: 0; }

.download-tree { display: grid; gap: 12px; }
.download-folder { border: 1px solid var(--line); padding: 12px; background: #fff; }
.download-folder-open { border-color: #bcd8f3; box-shadow: 0 0 0 1px rgba(46, 106, 190, 0.08); }
.download-folder-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.download-folder-actions { display: flex; align-items: center; gap: 8px; }
.download-folder-link {
  border: 0;
  background: transparent;
  color: var(--blue);
  cursor: pointer;
  padding: 0;
  text-align: left;
}
.download-folder-link:hover { color: #0a6fc8; text-decoration: underline; }
.download-folder-body { margin-top: 10px; display: grid; gap: 10px; }
.download-file-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.download-file-row .doc-name { margin: 0; min-width: 0; flex: 1 1 auto; }
.download-file-row .download-file-meta { margin: 0; flex: 0 1 auto; }
.download-file-row .download-file-type { color: var(--blue); font-weight: 700; white-space: nowrap; }
.download-action {
  border: 0;
  background: none;
  color: var(--blue);
  text-decoration: none;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  margin-left: 8px;
  transition: color .16s ease, opacity .16s ease, transform .16s ease;
}
.download-action:hover { color: #0a6fc8; text-decoration: underline; }
.download-action:active { opacity: .75; transform: translateY(1px); }

.style-lightbox { position: fixed; inset: 0; z-index: 2100; background: rgba(0, 0, 0, 0.86); display: flex; align-items: center; justify-content: center; padding: 20px; opacity: 0; pointer-events: none; transition: opacity .5s ease; }
.style-lightbox.is-visible { opacity: 1; pointer-events: auto; }
.style-lightbox-image { max-width: 92vw; max-height: 92vh; object-fit: contain; transition: transform .25s ease; cursor: zoom-in; }
.style-lightbox-image.zoomed { transform: scale(1.8); cursor: zoom-out; }
.style-lightbox-close { position: absolute; right: 18px; top: 14px; border: 0; background: transparent; color: #fff; font-size: 36px; cursor: pointer; }


.captcha-box { margin: 10px 0 12px; border: 1px solid var(--line); padding: 10px; }
.captcha-title { font-size: 18px; margin: 0 0 6px; color: var(--blue); }
.captcha-hint { margin: 0 0 8px; color: #2e3b4a; }
.captcha-question { border: 1px solid var(--line); background: #f8fbff; color: #1f2c3a; width: 100%; text-align: left; padding: 8px 10px; cursor: pointer; margin-bottom: 8px; }
.captcha-change-hint { font-size: 12px; color: #8a9097; margin-top: 4px; }

.captcha-step-modal {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
}
.captcha-step-mask {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.78);
}
.captcha-step-card {
  position: relative;
  width: min(360px, 92%);
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 14px;
  box-shadow: 0 10px 28px rgba(10, 43, 79, 0.12);
}
.captcha-step-actions { display: flex; justify-content: space-between; gap: 10px; margin-top: 10px; }

.search-hit { background: var(--yellow); }

.hidden { display: none !important; }

.site-footer { max-width: 1280px; margin: 0 auto 14px; text-align: center; color: #2d3a48; }
.site-footer p { margin: 2px 0; }
#footer-datetime { margin-bottom: 8px; }
.footer-greg, .footer-lunar, .footer-debug { display: block; text-align: center; }
.footer-lunar { margin-top: 4px; }
.footer-debug { margin-top: 6px; font-size: 13px; color: #4f5d6b; }
.footer-debug-toggle { color: var(--blue); text-decoration: none; margin-left: 8px; }
.footer-debug-toggle:hover { text-decoration: underline; }

.modal { position: fixed; inset: 0; z-index: 1800; display: flex; align-items: center; justify-content: center; }
.modal.hidden { display: none; }
.modal-mask { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.35); }
.modal-card { position: relative; width: min(440px, 92vw); background: var(--white); border: 1px solid var(--line); padding: 18px; z-index: 1; }
.modal-close { position: absolute; right: 8px; top: 6px; border: 0; background: transparent; font-size: 22px; cursor: pointer; }
.auth-panel { position: relative; }
.auth-panel.hidden { display: none; }
.auth-input { width: 100%; border: 1px solid var(--line); padding: 9px 10px; margin: 8px 0; }
.auth-submit { border: 1px solid var(--blue); background: var(--blue); color: var(--white); padding: 8px 12px; cursor: pointer; }
.auth-links { display: flex; justify-content: space-between; margin-top: 8px; gap: 10px; }
.auth-links a { color: var(--blue); text-decoration: none; }
.auth-field { display: grid; grid-template-columns: 22px 1fr; gap: 6px; align-items: center; margin-top: 5px; }
.auth-msg { color: var(--red); min-height: 20px; margin-top: 8px; }
.remember-row { display: flex; align-items: center; gap: 6px; margin: 8px 0; }

.alert-box {
  position: fixed; right: 20px; top: 90px; z-index: 1850; width: min(360px, 88vw); background: var(--white); border: 1px solid var(--line); padding: 12px 14px;
}
.alert-box.hidden { display: none; }
.alert-close { position: absolute; right: 8px; top: 4px; border: 0; background: transparent; cursor: pointer; }
.alert-box p { margin: 4px 0 0; padding-right: 20px; }

.visitor-map {
  width: 100%;
  height: 460px;
  border: 1px solid #cbd7e5;
  background: linear-gradient(180deg, #fbfdff 0%, #f7fbff 100%);
}
.visitor-messages { margin-top: 12px; display: grid; gap: 10px; }
.visitor-msg-item { border: 1px solid var(--line); padding: 10px; }

@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .style-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topbar-inner { flex-direction: column; align-items: stretch; }
  .top-tools { width: 100%; justify-content: space-between; }
}

@media (max-width: 700px) {
  .style-grid { grid-template-columns: 1fr; }
  .search-wrap { width: 140px; }
  .search-wrap.focused { width: 210px; }
  .meta-cols-3, .meta-cols-4 { grid-template-columns: 1fr; }
  .meta-seg.mid, .meta-seg.right { text-align: left; }
  .download-file-row { align-items: flex-start; flex-wrap: wrap; }
  .download-file-row .download-file-meta { width: 100%; }
  .download-action { margin-left: 0; }
}
