/* ===== KK Workshop — 共用樣式（Nav / Footer / Reset） ===== */

:root {
  --nav-h: 68px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --max-w: 1200px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: "Segoe UI", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }
img { display: block; max-width: 100%; }
ul { list-style: none; }

.container {
  width: min(100% - 40px, var(--max-w));
  margin-inline: auto;
}

/* ---------- Navigation ---------- */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  z-index: 1000;
  transition: background 0.4s var(--ease), backdrop-filter 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.nav__inner {
  width: min(100% - 40px, var(--max-w));
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.nav__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
  font-size: 1.15rem;
  white-space: nowrap;
  min-width: 0;
}
.nav__brand .dot { flex: 0 0 auto; }
.nav__brand .dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 12px currentColor;
}
.nav__links {
  display: flex;
  gap: 28px;
  align-items: center;
  font-weight: 600;
  font-size: 0.95rem;
}
.nav__links a { position: relative; opacity: 0.85; transition: opacity 0.2s; }
.nav__links a:hover { opacity: 1; }
.nav__links a::after {
  content: ""; position: absolute; left: 0; bottom: -6px;
  width: 0; height: 2px; background: currentColor;
  transition: width 0.3s var(--ease);
}
.nav__links a:hover::after { width: 100%; }

.nav__right { display: flex; align-items: center; gap: 14px; }
.lang-switch {
  font-family: inherit;
  appearance: none; -webkit-appearance: none;
  border: 1px solid currentColor; background: transparent; color: inherit;
  border-radius: 8px; padding: 7px 30px 7px 12px; cursor: pointer;
  font-weight: 700; font-size: 0.85rem; line-height: 1;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='7' viewBox='0 0 10 7'><path d='M1 1l4 4 4-4' stroke='%23888' stroke-width='1.6' fill='none' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat; background-position: right 10px center;
  transition: border-color 0.2s, background-color 0.2s;
}
.lang-switch:hover { border-color: currentColor; }
.lang-switch option { color: #222; }

.nav__toggle {
  display: none;
  background: none; border: 0; cursor: pointer;
  width: 40px; height: 40px;
  flex-direction: column; justify-content: center; gap: 6px;
}
.nav__toggle span {
  display: block; height: 2px; width: 24px; background: currentColor;
  transition: transform 0.3s var(--ease), opacity 0.3s;
}
.nav.open .nav__toggle span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.nav.open .nav__toggle span:nth-child(2) { opacity: 0; }
.nav.open .nav__toggle span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* ---------- Footer ---------- */
.footer {
  padding: 64px 0 36px;
}
.footer__grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}
.footer__title { font-weight: 800; font-size: 1.2rem; margin-bottom: 12px; }
.footer__desc { opacity: 0.7; font-size: 0.92rem; max-width: 36ch; }
.footer h4 { font-size: 0.8rem; letter-spacing: 2px; text-transform: uppercase; opacity: 0.5; margin-bottom: 14px; }
.footer__list li { margin-bottom: 10px; opacity: 0.85; font-size: 0.95rem; }
.footer__list a { transition: opacity 0.2s; }
.footer__list a:hover { opacity: 1; text-decoration: underline; }
.footer__bottom {
  border-top: 1px solid rgba(128,128,128,0.25);
  padding-top: 24px;
  text-align: center;
  font-size: 0.85rem;
  opacity: 0.6;
}
.footer__ai {
  text-align: center;
  font-size: 0.78rem;
  opacity: 0.55;
  margin-top: 10px;
  line-height: 1.7;
}
.footer__ai b { font-weight: 700; opacity: 0.9; }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Page fade-in ---------- */
.page-fade { animation: pageFade 0.6s var(--ease); }
@keyframes pageFade { from { opacity: 0; } to { opacity: 1; } }

@media (max-width: 820px) {
  .nav__toggle { display: flex; }
  .nav__links {
    position: fixed;
    inset: var(--nav-h) 0 auto 0;
    flex-direction: column;
    gap: 0;
    padding: 6px 0 10px;
    transform: translateY(-120%);
    transition: transform 0.4s var(--ease);
    background: var(--menu-bg, #101010);
    backdrop-filter: blur(14px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.28);
    border-top: 1px solid rgba(128, 128, 128, 0.18);
    max-height: calc(100vh - var(--nav-h));
    overflow-y: auto;
  }
  .nav.open .nav__links { transform: none; }
  .nav__links a {
    padding: 16px 22px; width: 100%;
    font-size: 1.05rem;
    border-bottom: 1px solid rgba(128, 128, 128, 0.14);
    opacity: 1;
  }
  .nav__links a::after { display: none; }
  .footer__grid { grid-template-columns: 1fr; gap: 28px; }
}

@media (max-width: 480px) {
  .nav__brand { font-size: 0.92rem; letter-spacing: 0.2px; gap: 7px; }
  .nav__brand .dot { width: 8px; height: 8px; }
  .lang-switch { padding: 6px 26px 6px 9px; font-size: 0.78rem; }
  .nav__right { gap: 8px; }
}
@media (max-width: 340px) {
  .nav__brand { font-size: 0.82rem; }
}

/* ---------- Back to top ---------- */
.to-top {
  position: fixed;
  right: 18px; bottom: 18px;
  width: 48px; height: 48px;
  display: grid; place-items: center;
  border: 0; cursor: pointer;
  font-size: 1.4rem; line-height: 1;
  z-index: 900;
  opacity: 0; visibility: hidden; transform: translateY(14px);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease), visibility 0.3s;
}
.to-top.show { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { transform: translateY(-3px); }

/* ---------- Steam「整備中」小視窗 ---------- */
.kk-modal {
  position: fixed; inset: 0; z-index: 1200;
  display: grid; place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(3px);
  opacity: 0; visibility: hidden;
  transition: opacity 0.3s var(--ease), visibility 0.3s;
}
.kk-modal.open { opacity: 1; visibility: visible; }
.kk-modal__card {
  position: relative;
  width: min(100%, 380px);
  background: #1b2838;              /* Steam 深藍，跨主題一致 */
  color: #e6edf3;
  border: 1px solid rgba(102, 192, 244, 0.35);
  border-radius: 16px;
  padding: 34px 26px 26px;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  transform: translateY(14px) scale(0.98);
  transition: transform 0.3s var(--ease);
}
.kk-modal.open .kk-modal__card { transform: none; }
.kk-modal__ico { font-size: 2.4rem; margin-bottom: 10px; }
.kk-modal__title { font-weight: 800; font-size: 1.2rem; margin-bottom: 10px; }
.kk-modal__body { font-size: 0.95rem; opacity: 0.82; margin-bottom: 22px; }
.kk-modal__close {
  font-family: inherit; font-weight: 700; font-size: 0.9rem;
  border: 0; cursor: pointer; border-radius: 10px;
  padding: 11px 28px; color: #fff;
  background: linear-gradient(135deg, #66c0f4, #2a475e);
  transition: filter 0.2s;
}
.kk-modal__close:hover { filter: brightness(1.1); }
.kk-modal__x {
  position: absolute; top: 8px; right: 12px;
  background: none; border: 0; cursor: pointer;
  font-size: 1.5rem; line-height: 1; color: #e6edf3; opacity: 0.55;
}
.kk-modal__x:hover { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
