@import url('https://fonts.googleapis.com/css2?family=M+PLUS+Rounded+1c:wght@400;500;600;700;800&family=Noto+Sans+TC:wght@400;500;600;700;800&display=swap');

:root {
  color: #29445f;
  background: #fffaf1;
  font-family: 'Noto Sans TC', 'PingFang TC', 'Microsoft JhengHei', sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --ink: #29445f;
  --ink-soft: #607b91;
  --coral: #ef896f;
  --coral-deep: #d96859;
  --sun: #ffd15c;
  --sun-deep: #e9ad3e;
  --sky: #e4f7ff;
  --mint: #ddf6eb;
  --cream: #fffaf1;
}

* { box-sizing: border-box; }
html { background: var(--cream); }
body { margin: 0; min-width: 320px; min-height: 100vh; background: var(--cream); }
button, a { font: inherit; }
button { border: 0; cursor: pointer; }
button:disabled { cursor: default; opacity: .58; }

.photo-loading { min-height: 100vh; display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--ink-soft); letter-spacing: .08em; background: var(--cream); }
.photo-loading svg { color: var(--coral); }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes rise { from { opacity: 0; transform: translateY(18px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }

.eyebrow { margin: 0; color: var(--coral-deep); font-family: 'M PLUS Rounded 1c', 'Noto Sans TC', sans-serif; font-size: 10px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }

.auth-shell { min-height: 100vh; display: grid; place-items: center; position: relative; isolation: isolate; overflow: hidden; padding: 32px; background: radial-gradient(circle at 10% 12%, rgba(255, 211, 99, .74) 0, transparent 28%), radial-gradient(circle at 92% 18%, rgba(128, 221, 213, .58) 0, transparent 30%), radial-gradient(circle at 82% 92%, rgba(255, 183, 190, .48) 0, transparent 27%), linear-gradient(135deg, #dff7ff 0%, #fff9df 48%, #ffe9ee 100%); }
.auth-shell::before { content: ''; position: absolute; z-index: -1; inset: 0; opacity: .45; background-image: radial-gradient(rgba(41, 68, 95, .16) 1px, transparent 1px); background-size: 24px 24px; mask-image: linear-gradient(to bottom, black, transparent 80%); }
.auth-shell::after { content: '✦'; position: absolute; z-index: -1; right: 10%; bottom: 9%; color: rgba(239, 137, 111, .42); font-family: 'M PLUS Rounded 1c', sans-serif; font-size: clamp(80px, 12vw, 170px); line-height: 1; transform: rotate(14deg); }
.auth-orbit { position: absolute; border: 2px dashed rgba(255, 255, 255, .76); border-radius: 50%; pointer-events: none; }
.orbit-one { width: 600px; height: 600px; right: -205px; top: -185px; border-color: rgba(239, 137, 111, .32); }
.orbit-two { width: 350px; height: 350px; left: -170px; bottom: -150px; border-color: rgba(71, 177, 177, .34); }
.auth-card { width: min(100%, 500px); position: relative; padding: 54px 50px 42px; border: 3px solid rgba(255, 255, 255, .94); border-radius: 32px; background: rgba(255, 255, 255, .86); box-shadow: 0 12px 0 rgba(227, 173, 78, .2), 0 30px 70px rgba(69, 108, 133, .18); backdrop-filter: blur(16px); text-align: center; animation: rise .6s ease both; }
.auth-card::before { content: ''; position: absolute; top: -3px; right: 52px; left: 52px; height: 6px; border-radius: 0 0 8px 8px; background: linear-gradient(90deg, var(--coral), var(--sun), #67cfc7); }
.auth-card--compact { padding-top: 46px; }
.brand-mark, .mini-mark { display: grid; place-items: center; color: #29445f; background: var(--sun); }
.brand-mark { width: 68px; height: 68px; margin: 0 auto 25px; border: 5px solid #fff; border-radius: 23px; box-shadow: 0 7px 0 var(--sun-deep); transform: rotate(-3deg); }
.brand-mark--muted { color: #68769a; background: #e5e5ff; box-shadow: 0 7px 0 #b9b9e5; }
.auth-card h1 { margin: 13px 0 12px; color: var(--ink); font-family: 'Noto Sans TC', sans-serif; font-size: clamp(32px, 7vw, 48px); font-weight: 800; letter-spacing: .02em; line-height: 1.25; }
.auth-copy { margin: 0 auto 28px; max-width: 310px; color: var(--ink-soft); font-size: 14px; line-height: 1.85; }
.line-login-button, .secondary-button { width: 100%; min-height: 58px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; border: 3px solid #fff; border-radius: 17px; text-decoration: none; transition: transform .2s ease, background .2s ease, box-shadow .2s ease; }
.line-login-button { color: #29445f; background: var(--sun); box-shadow: 0 6px 0 var(--sun-deep); font-weight: 800; }
.line-login-button:hover, .secondary-button:hover { transform: translateY(-3px); }
.line-login-button:hover { background: #ffdc7d; box-shadow: 0 9px 0 var(--sun-deep); }
.line-login-button:active { transform: translateY(2px); box-shadow: 0 3px 0 var(--sun-deep); }
.auth-footnote { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 25px 0 0; color: #7890a1; font-size: 11px; }
.auth-footnote svg { color: #4bb797; }
.secondary-button { color: #596b9d; background: #e8e8ff; box-shadow: 0 6px 0 #c7c8ec; font-weight: 700; }
.secondary-button:hover { background: #f0f0ff; box-shadow: 0 9px 0 #c7c8ec; }
.error-note, .error-banner { display: flex; align-items: center; gap: 8px; color: #b95743; background: #fff0e9; border: 2px solid #ffd0c2; }
.error-note { margin: 0 0 18px; padding: 10px 12px; border-radius: 13px; text-align: left; font-size: 12px; line-height: 1.5; }

.directory-shell, .gallery-shell { min-height: 100vh; background: var(--cream); }
.directory-shell { background-image: radial-gradient(circle at 96% 4%, rgba(125, 215, 206, .26) 0, transparent 18%), radial-gradient(circle at 4% 42%, rgba(255, 209, 92, .2) 0, transparent 17%); }
.directory-topbar, .gallery-topbar { min-height: 80px; display: flex; align-items: center; justify-content: space-between; padding: 17px clamp(20px, 4vw, 58px); border-bottom: 2px solid #f4e5c7; background: rgba(255, 255, 255, .88); backdrop-filter: blur(12px); }
.brand-lockup { display: flex; align-items: center; gap: 12px; }
.mini-mark { width: 38px; height: 38px; border: 3px solid #fff; border-radius: 13px; box-shadow: 0 4px 0 var(--sun-deep); transform: rotate(-3deg); }
.brand-lockup h1, .gallery-heading h1 { margin: 2px 0 0; color: var(--ink); font-family: 'Noto Sans TC', sans-serif; font-size: 22px; font-weight: 800; letter-spacing: .04em; }
.directory-actions { display: flex; align-items: center; gap: 16px; }
.verified-pill { display: flex; align-items: center; gap: 5px; padding: 7px 11px; border: 1px solid #bce8d5; border-radius: 999px; color: #258c68; background: var(--mint); font-family: 'M PLUS Rounded 1c', sans-serif; font-size: 11px; font-weight: 700; letter-spacing: .04em; }
.text-button { padding: 4px 0; color: #7890a1; background: transparent; font-size: 12px; font-weight: 700; }
.text-button:hover { color: var(--coral-deep); }
.directory-intro { position: relative; isolation: isolate; display: flex; align-items: end; justify-content: space-between; max-width: 1440px; margin: clamp(24px, 4vw, 54px) auto 28px; padding: clamp(30px, 5vw, 58px) clamp(24px, 4vw, 58px) 34px; overflow: hidden; border: 2px solid #fff; border-radius: 30px; background: linear-gradient(120deg, #fff 0%, #fff4c9 100%); box-shadow: 0 12px 0 rgba(235, 186, 78, .16), 0 22px 42px rgba(71, 104, 124, .08); }
.directory-intro::after { content: '✦'; position: absolute; z-index: -1; right: 8%; bottom: -28px; color: rgba(239, 137, 111, .18); font-family: 'M PLUS Rounded 1c', sans-serif; font-size: 150px; line-height: 1; transform: rotate(18deg); }
.directory-intro h2 { margin: 12px 0 9px; color: #315976; font-family: 'Noto Sans TC', sans-serif; font-size: clamp(28px, 4vw, 44px); font-weight: 800; letter-spacing: .01em; line-height: 1.3; }
.directory-access-summary { display: grid; gap: 8px; margin-top: 2px; color: var(--ink-soft); font-size: 13px; }
.directory-access-line { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; min-height: 22px; }
.directory-access-label { color: var(--ink-soft); }
.directory-access-line strong { color: var(--coral-deep); font-weight: 800; }
.directory-access-line--temporary { color: #4c7c75; }
.directory-access-line--temporary .directory-access-label { color: #4c9880; font-weight: 700; }
.temporary-class-list { display: flex; flex-wrap: wrap; gap: 6px; }
.temporary-class-chip { display: inline-flex; align-items: center; padding: 3px 9px; border: 1px solid #b9e4d2; border-radius: 999px; color: #27896a; background: #edfbf4; font-size: 12px; font-weight: 800; line-height: 1.35; }
.directory-stats { min-width: 120px; padding: 16px 18px; border: 2px solid #f5dda2; border-radius: 22px; background: rgba(255, 255, 255, .76); text-align: right; }
.directory-stats span { display: block; color: var(--coral-deep); font-family: 'M PLUS Rounded 1c', sans-serif; font-size: 38px; font-weight: 800; line-height: 1; }
.directory-stats small { display: block; margin-top: 7px; color: #7b8fa0; font-size: 10px; font-weight: 700; letter-spacing: .12em; }
.directory-note { max-width: 1440px; display: flex; align-items: center; gap: 18px; margin: 0 auto 22px; padding: 11px clamp(20px, 4vw, 58px); border: 1px solid #cbeaf3; border-radius: 16px; color: #5e7890; background: #eaf8ff; font-size: 12px; }
.directory-note-copy { min-width: 0; flex: 1; display: grid; gap: 3px; }
.directory-note-description { display: flex; align-items: flex-start; gap: 8px; line-height: 1.6; }
.directory-note-description svg { flex: 0 0 auto; margin-top: 2px; color: #4eb9c0; }
.directory-retention-note { display: flex; align-items: flex-start; gap: 5px; margin: 0; padding-left: 24px; color: var(--coral-deep); font-size: 11px; font-weight: 700; line-height: 1.55; }
.directory-retention-note svg { flex: 0 0 auto; margin-top: 2px; color: var(--coral-deep); }
.note-open { margin-left: auto; color: #258c68; font-weight: 700; }
.error-banner { max-width: 1324px; margin: 0 auto 24px; padding: 11px 14px; border-radius: 14px; font-size: 12px; }
.error-banner button { display: inline-flex; align-items: center; gap: 5px; margin-left: auto; color: var(--coral-deep); background: transparent; font-size: 12px; font-weight: 700; }
.album-grid { max-width: 1440px; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 30px 22px; margin: 0 auto; padding: 0 clamp(20px, 4vw, 58px) 70px; }
.album-card { min-width: 0; padding: 0; color: inherit; background: transparent; text-align: left; }
.album-card--open { transition: transform .24s ease; }
.album-card--open:hover { transform: translateY(-6px) rotate(-.7deg); }
.album-cover { position: relative; aspect-ratio: 1 / 1.04; overflow: hidden; border: 3px solid #fff; border-radius: 20px; background: #e7f5fa; box-shadow: 0 8px 0 rgba(158, 206, 220, .36), 0 16px 26px rgba(71, 104, 124, .13); }
.album-cover img { width: 100%; height: 100%; display: block; object-fit: cover; transition: transform .45s ease; }
.album-card--open:hover .album-cover img { transform: scale(1.045); }
.cover-shade { position: absolute; inset: 30% 0 0; background: linear-gradient(to bottom, transparent, rgba(31, 62, 87, .82)); }
.cover-title { position: absolute; right: 12px; bottom: 12px; left: 12px; color: #fff; font-size: 14px; font-weight: 800; line-height: 1.35; text-shadow: 0 1px 8px rgba(24, 49, 69, .52); }
.empty-cover { width: 100%; height: 100%; display: grid; place-items: center; color: #79a9b7; }
.album-caption { padding: 12px 5px 0; }
.album-caption h2 { overflow: hidden; margin: 0; color: #36556d; font-size: 13px; font-weight: 800; line-height: 1.45; text-overflow: ellipsis; white-space: nowrap; }
.album-caption p { display: flex; justify-content: space-between; gap: 8px; margin: 4px 0 0; color: #7f96a5; font-family: 'M PLUS Rounded 1c', 'Noto Sans TC', sans-serif; font-size: 10px; letter-spacing: .04em; }
.album-caption p span:last-child { color: #e27b68; font-weight: 700; }
.locked-cover { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: #7689a6; background: linear-gradient(135deg, #eeeaff, #e3f6ff); }
.locked-cover span { color: #7f8faa; font-size: 10px; font-weight: 700; letter-spacing: .14em; }
.lock-rings { position: absolute; width: 105px; height: 105px; border: 2px dashed rgba(123, 137, 181, .28); border-radius: 50%; box-shadow: 0 0 0 18px rgba(123, 137, 181, .07), 0 0 0 36px rgba(123, 137, 181, .045); }
.locked-cover svg, .locked-cover span { position: relative; z-index: 1; }
.load-more { display: flex; align-items: center; justify-content: center; gap: 8px; min-width: 220px; margin: 0 auto 54px; padding: 13px 22px; border: 3px solid #fff; border-radius: 999px; color: #29445f; background: var(--sun); box-shadow: 0 6px 0 var(--sun-deep); font-size: 13px; font-weight: 800; transition: transform .2s ease, box-shadow .2s ease; }
.load-more:hover { transform: translateY(-3px); box-shadow: 0 9px 0 var(--sun-deep); }
.empty-state { margin: 50px auto 100px; padding: 44px 24px; color: #7890a1; text-align: center; }
.empty-state h2 { margin: 16px 0 6px; color: #36556d; font-size: 25px; font-weight: 800; }
.empty-state p { margin: 0; font-size: 13px; }
.directory-footer { display: flex; justify-content: space-between; max-width: 1440px; margin: 0 auto; padding: 18px clamp(20px, 4vw, 58px); border-top: 2px solid #f4e5c7; color: #91a2ad; font-family: 'M PLUS Rounded 1c', sans-serif; font-size: 10px; font-weight: 700; letter-spacing: .12em; }

.gallery-topbar { justify-content: flex-start; gap: 20px; }
.icon-button, .viewer-close { display: grid; place-items: center; color: #55728b; background: transparent; }
.icon-button:hover { color: var(--coral-deep); }
.icon-button { width: 36px; height: 36px; }
.gallery-heading { min-width: 0; flex: 1; }
.gallery-heading h1 { overflow: hidden; font-size: 21px; text-overflow: ellipsis; white-space: nowrap; }
.gallery-count { margin-left: auto; color: var(--coral-deep); font-family: 'M PLUS Rounded 1c', sans-serif; font-size: 27px; font-weight: 800; text-align: right; }
.gallery-count span { display: block; color: #8ca0ad; font-family: 'M PLUS Rounded 1c', sans-serif; font-size: 9px; letter-spacing: .16em; }
.detail-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; padding: 28px clamp(12px, 2.2vw, 34px) 70px; }
.detail-photo { aspect-ratio: 1; overflow: hidden; display: grid; place-items: center; padding: 0; border-radius: 12px; color: #79a9b7; background: #e7f5fa; }
.detail-photo img { width: 100%; height: 100%; display: block; object-fit: cover; transition: filter .2s ease, transform .3s ease; }
.detail-photo:hover img { filter: saturate(1.08) brightness(1.05); transform: scale(1.02); }
.viewer { position: fixed; inset: 0; z-index: 10; display: flex; align-items: center; justify-content: center; background: rgba(20, 35, 47, .96); }
.viewer > img { max-width: min(88vw, 1400px); max-height: 88vh; object-fit: contain; }
.viewer-close { position: absolute; top: 22px; right: 24px; width: 42px; height: 42px; color: #fff; }
.viewer-nav { position: absolute; top: 50%; display: grid; place-items: center; width: 48px; height: 64px; border-radius: 14px; color: #fff; background: rgba(255, 209, 92, .9); transform: translateY(-50%); }
.viewer-nav--left { left: 18px; }
.viewer-nav--right { right: 18px; }
.viewer-meta { position: absolute; right: 0; bottom: 24px; left: 0; color: #c7d8e2; font-family: 'M PLUS Rounded 1c', sans-serif; font-size: 12px; text-align: center; }

@media (max-width: 1180px) { .album-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 720px) {
  .directory-topbar { min-height: 68px; padding: 13px 18px; }
  .verified-pill { display: none; }
  .directory-intro { align-items: flex-start; gap: 24px; margin: 20px 14px 22px; padding: 30px 20px 24px; border-radius: 24px; }
  .directory-intro h2 { font-size: 28px; }
  .directory-access-summary { font-size: 12px; }
  .directory-stats { min-width: 70px; padding: 12px 10px; }
  .directory-stats span { font-size: 28px; }
  .directory-note { align-items: flex-start; gap: 10px; margin: 0 14px 18px; padding: 10px 12px; font-size: 11px; line-height: 1.6; }
  .directory-retention-note { font-size: 10px; }
  .note-open { white-space: nowrap; }
  .album-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 12px; padding: 0 14px 50px; }
  .album-cover { aspect-ratio: 1 / 1.12; border-radius: 16px; }
  .cover-title { right: 8px; bottom: 8px; left: 8px; font-size: 12px; }
  .album-caption { padding-top: 10px; }
  .album-caption h2 { font-size: 12px; }
  .detail-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; padding: 18px 5px 50px; }
  .gallery-topbar { gap: 11px; padding: 13px 15px; }
  .gallery-heading h1 { font-size: 17px; }
  .gallery-count { font-size: 22px; }
  .auth-shell { padding: 20px; }
  .auth-card { padding: 48px 24px 34px; border-radius: 28px; }
  .auth-card h1 { font-size: 34px; }
  .directory-footer { padding: 16px 18px; }
}
