/* 築序官方網頁共用樣式。色彩與字體照 docs/品牌手冊_工程雲端系統.md 第 5 節 */
:root {
  --navy: #1F3A5F;
  --navy-top: #2C4472;
  --navy-deep: #1A2A4E;
  --orange: #E8742C;
  --orange-hi: #F08A3C;
  --ink: #FFFFFF;
  --ink-soft: #C9D6F2;
  --line: rgba(255, 255, 255, .12);
  --rail: 76px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; scroll-behavior: smooth; }
body {
  min-height: 100%;
  font-family: "Noto Sans TC", "Microsoft JhengHei", "PingFang TC", sans-serif;
  color: var(--ink);
  background: linear-gradient(#2C4472, #1A2A4E) fixed var(--navy-deep);
  line-height: 1.9;
  -webkit-font-smoothing: antialiased;
}
body.home { height: 100%; overflow: hidden; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }

/* 背景：深藍漸層、淡格線、等角疊板、橘色星芒（由 site.js 畫） */
.scene { position: fixed; z-index: 0; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; }

/* 左側直式選單 */
.rail {
  position: fixed; z-index: 3; left: 0; top: 0; bottom: 0; width: var(--rail);
  display: flex; flex-direction: column; align-items: center;
  background: rgba(20, 32, 60, .55);
  border-right: 1px solid rgba(255, 255, 255, .08);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.rail .mark { display: block; width: 46px; margin: 18px 0 26px; }
.rail nav { display: flex; flex-direction: column; align-items: center; flex: 1; width: 100%; }
.rail nav a {
  writing-mode: vertical-rl; letter-spacing: .32em; line-height: 1.2;
  font-size: 15px; font-weight: 500; color: var(--ink-soft);
  padding: 20px 0; width: 100%; display: flex; align-items: center; justify-content: center;
  position: relative; transition: color .2s;
}
.rail nav a:hover, .rail nav a:focus-visible, .rail nav a[aria-current] { color: var(--ink); }
.rail nav a[aria-current]::before {
  content: ""; position: absolute; left: 0; top: 18px; bottom: 18px; width: 3px; background: var(--orange);
}
.rail nav a.contact {
  margin-top: auto; padding: 26px 0; background: var(--orange); color: #fff; transition: background .2s;
}
.rail nav a.contact:hover, .rail nav a.contact:focus-visible { background: var(--orange-hi); }
.rail nav a.contact[aria-current]::before { display: none; }
.menu-btn { display: none; }

/* ── 首頁：Logo 與一句話 ── */
.hero {
  position: relative; z-index: 2; height: 100%;
  margin-left: var(--rail);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 0 6vw 16vh; text-align: center;
}
.hero .logo { width: clamp(200px, 24vw, 380px); height: auto; margin-bottom: clamp(28px, 5vh, 56px); overflow: visible; }
.hero h1 {
  font-weight: 900; line-height: 1.32; letter-spacing: .1em; text-indent: .1em;
  font-size: clamp(2.3rem, 5.6vw, 5.6rem);
}
.hero h1 span { display: block; }
.hero h1 .accent { color: var(--orange); }
.home-foot {
  position: fixed; z-index: 2; right: 26px; bottom: 16px;
  font-size: 12px; letter-spacing: .12em; color: rgba(201, 214, 242, .6);
}

/* 首頁進場動畫：Logo 三層板由下往上一層一層疊上，星芒亮起，字樣與標語再浮現 */
.ply { opacity: 0; transform: translateY(-64px); animation: land .7s cubic-bezier(.2, .9, .3, 1.25) forwards; }
.ply1 { animation-delay: .3s; }
.ply2 { animation-delay: .85s; }
.ply3 { animation-delay: 1.4s; }
@keyframes land { 60% { opacity: 1; } to { opacity: 1; transform: none; } }
.spark { opacity: 0; transform: scale(0) rotate(-90deg); animation: spark .6s cubic-bezier(.2, .9, .3, 1.4) 2.05s forwards; }
@keyframes spark { to { opacity: 1; transform: scale(2) rotate(0); } }
.word { opacity: 0; animation: show .9s ease 2.4s forwards; }
.say { opacity: 0; animation: show 1.2s ease 3s forwards; }
@keyframes show { to { opacity: 1; } }
.twinkle { animation: twinkle 4.5s ease-in-out infinite; }
@keyframes twinkle { 50% { opacity: .35; } }
.float { animation: float 7s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-9px); } }

/* ── 內頁 ── */
.page {
  position: relative; z-index: 2;
  margin-left: var(--rail);
  padding: clamp(56px, 11vh, 120px) clamp(24px, 7vw, 120px) 0;
  min-height: 100vh; display: flex; flex-direction: column;
}
.page > * { width: 100%; max-width: 820px; }
.page-head { margin-bottom: clamp(36px, 7vh, 72px); }
.eyebrow {
  font-family: "Roboto Mono", Consolas, monospace; font-size: 13px; letter-spacing: .34em;
  color: var(--orange); text-transform: uppercase; margin-bottom: 10px;
}
.page-head h1 { font-size: clamp(2.1rem, 4.6vw, 3.6rem); font-weight: 900; letter-spacing: .12em; line-height: 1.3; }
.page-head .lead { margin-top: 18px; color: var(--ink-soft); font-size: 1.06rem; }

.block { padding: clamp(28px, 5vh, 44px) 0; border-top: 1px solid var(--line); }
.block h2 {
  font-size: 1.32rem; font-weight: 700; letter-spacing: .1em; margin-bottom: 16px;
  display: flex; align-items: center; gap: 12px;
}
.block h2::before { content: ""; width: 10px; height: 10px; background: var(--orange); transform: rotate(45deg) scale(1, .9); flex: none; }
.block p { color: var(--ink-soft); font-size: 1.04rem; }
.block p + p { margin-top: 14px; }
.block strong { color: var(--ink); font-weight: 700; }
.big { font-size: clamp(1.4rem, 2.6vw, 1.9rem) !important; font-weight: 900; color: var(--ink) !important; letter-spacing: .08em; line-height: 1.6; }
.big em { font-style: normal; color: var(--orange); }

.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 6px; }
.card { background: rgba(255, 255, 255, .05); border: 1px solid var(--line); border-radius: 6px; padding: 24px 26px; }
.card .tag { font-size: 13px; letter-spacing: .2em; color: var(--orange); margin-bottom: 6px; }
.card h3 { font-size: 1.22rem; font-weight: 700; letter-spacing: .08em; margin-bottom: 8px; color: var(--ink); }
.card p { font-size: .98rem; }

.list { list-style: none; }
.list li { padding: 16px 0 16px 26px; position: relative; border-bottom: 1px dashed var(--line); color: var(--ink-soft); }
.list li:last-child { border-bottom: 0; }
.list li::before { content: ""; position: absolute; left: 2px; top: 1.85em; width: 8px; height: 8px; background: var(--orange); transform: rotate(45deg) scale(1, .9); }
.list b { display: block; color: var(--ink); font-weight: 700; letter-spacing: .06em; }

.logo-show { display: flex; align-items: center; gap: clamp(20px, 4vw, 44px); flex-wrap: wrap; }
.logo-show img { width: 150px; flex: none; }
.logo-show p { flex: 1; min-width: 240px; }

dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 10px 28px; color: var(--ink-soft); }
dl.facts dt { color: var(--ink); font-weight: 500; letter-spacing: .1em; }

/* 最新消息 */
.news { padding: clamp(26px, 4.5vh, 40px) 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: 130px 1fr; gap: 8px 24px; }
.news time { font-family: "Roboto Mono", Consolas, monospace; color: var(--orange); letter-spacing: .06em; padding-top: 4px; }
.news h2 { font-size: 1.3rem; font-weight: 700; letter-spacing: .06em; line-height: 1.6; margin-bottom: 8px; }
.news p { color: var(--ink-soft); }
.news .links { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 10px 22px; }
.more { color: var(--ink); font-weight: 500; border-bottom: 1px solid var(--orange); padding-bottom: 2px; transition: color .2s; }
.more::after { content: " →"; color: var(--orange); }
.more:hover, .more:focus-visible { color: var(--orange-hi); }

/* 系統介紹：操作說明影片（一個播放器＋分類頁籤＋片名清單） */
.vtabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0 18px; }
.vtabs button {
  font: inherit; font-size: .95rem; font-weight: 500; letter-spacing: .08em; line-height: 1.4; cursor: pointer;
  color: var(--ink-soft); background: rgba(255, 255, 255, .05); border: 1px solid var(--line); border-radius: 999px;
  padding: 8px 16px; transition: background .2s, color .2s, border-color .2s;
}
.vtabs button small { font-family: "Roboto Mono", Consolas, monospace; font-size: .78rem; margin-left: 8px; opacity: .7; }
.vtabs button:hover { color: var(--ink); border-color: rgba(255, 255, 255, .3); }
.vtabs button[aria-selected="true"] { background: var(--orange); border-color: var(--orange); color: #fff; }
.vplayer video { display: block; width: 100%; aspect-ratio: 16 / 9; background: #101a33; border: 1px solid var(--line); border-radius: 6px; }
.block .vnow { margin-top: 12px; color: var(--ink); font-weight: 700; font-size: 1.15rem; letter-spacing: .06em; }
.block .vchap { margin-top: 26px; font-size: .9rem; letter-spacing: .14em; color: var(--orange); }
.vlist { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; margin-top: 6px; }
.vrow {
  font: inherit; color: var(--ink-soft); background: none; border: 0; border-bottom: 1px dashed var(--line); cursor: pointer;
  width: 100%; text-align: left; padding: 12px 6px; display: flex; align-items: baseline; gap: 12px; line-height: 1.5; transition: color .2s, background .2s;
}
.vrow .no { font-family: "Roboto Mono", Consolas, monospace; color: var(--orange); font-size: .85rem; }
.vrow b { flex: 1; font-weight: 500; letter-spacing: .05em; }
.vrow time { font-family: "Roboto Mono", Consolas, monospace; font-size: .82rem; opacity: .75; }
.vrow:hover { color: var(--ink); background: rgba(255, 255, 255, .04); }
.vrow.on { color: var(--ink); }
.vrow.on b { font-weight: 700; }
.vrow.on b::after { content: "　目前這支"; font-size: .78rem; font-weight: 500; color: var(--orange); letter-spacing: .1em; }

/* 聯絡築序 */
.line-card { display: flex; align-items: center; gap: clamp(20px, 4vw, 40px); flex-wrap: wrap; }
.qr { width: 168px; flex: none; background: #fff; border-radius: 6px; padding: 10px; line-height: 0; }
.qr img { width: 100%; display: block; }
.line-card .txt { flex: 1; min-width: 240px; }
.block .line-id { font-family: "Roboto Mono", Consolas, monospace; font-size: 1.6rem; color: var(--ink); letter-spacing: .04em; line-height: 1.4; margin-bottom: 6px; }
.btn {
  display: inline-block; margin-top: 16px; padding: 12px 30px; border-radius: 4px;
  background: var(--orange); color: #fff; font-weight: 700; letter-spacing: .16em; transition: background .2s;
}
.btn:hover, .btn:focus-visible { background: var(--orange-hi); }
.steps { list-style: none; counter-reset: s; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.steps li { counter-increment: s; background: rgba(255, 255, 255, .05); border: 1px solid var(--line); border-radius: 6px; padding: 20px 22px; color: var(--ink-soft); font-size: .98rem; }
.steps li::before { content: "0" counter(s); display: block; font-family: "Roboto Mono", Consolas, monospace; color: var(--orange); font-size: 1.3rem; margin-bottom: 4px; }
.steps b { display: block; color: var(--ink); letter-spacing: .06em; }
.ways { list-style: none; }
.ways li { display: grid; grid-template-columns: 110px 1fr; gap: 16px; padding: 14px 0; border-bottom: 1px dashed var(--line); }
.ways li:last-child { border-bottom: 0; }
.ways span { color: var(--ink); font-weight: 500; letter-spacing: .1em; }
.ways a { color: var(--ink-soft); border-bottom: 1px solid var(--orange); padding-bottom: 1px; word-break: break-all; justify-self: start; }
.ways a:hover, .ways a:focus-visible { color: var(--ink); }

.page-foot {
  margin-top: auto; padding: 56px 0 26px; font-size: 12px; letter-spacing: .12em; color: rgba(201, 214, 242, .6);
}

a:focus-visible, button:focus-visible { outline: 2px solid var(--orange-hi); outline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .ply, .word, .say { opacity: 1; transform: none; animation: none; }
  .spark { opacity: 1; transform: scale(2); animation: none; }
  .twinkle, .float { animation: none; }
}

/* 手機：選單收到上方 */
@media (max-width: 760px) {
  :root { --rail: 0px; }
  .rail {
    right: 0; bottom: auto; width: auto; height: 60px; flex-direction: row;
    padding: 0 16px; border-right: 0; border-bottom: 1px solid rgba(255, 255, 255, .08);
    background: rgba(20, 32, 60, .88);
  }
  .rail .mark { width: 38px; margin: 0; }
  .menu-btn {
    display: block; margin-left: auto; width: 44px; height: 44px;
    background: none; border: 0; cursor: pointer; position: relative;
  }
  .menu-btn i, .menu-btn i::before, .menu-btn i::after {
    content: ""; position: absolute; left: 10px; width: 24px; height: 2px; background: #fff; transition: transform .2s;
  }
  .menu-btn i { top: 21px; }
  .menu-btn i::before { left: 0; top: -8px; }
  .menu-btn i::after { left: 0; top: 8px; }
  .rail.open .menu-btn i { background: transparent; }
  .rail.open .menu-btn i::before { transform: translateY(8px) rotate(45deg); }
  .rail.open .menu-btn i::after { transform: translateY(-8px) rotate(-45deg); }
  .rail nav {
    /* .rail 有 backdrop-filter，裡面的 fixed 會以 .rail 為基準，所以高度要自己算 */
    position: fixed; left: 0; right: 0; top: 60px; height: calc(100vh - 60px); height: calc(100dvh - 60px); flex: none;
    background: rgba(20, 32, 60, .98); justify-content: center; gap: 4px;
    display: none;
  }
  .rail.open nav { display: flex; }
  .rail nav a { writing-mode: horizontal-tb; font-size: 20px; padding: 18px 0; }
  .rail nav a[aria-current]::before { display: none; }
  .rail nav a[aria-current] { color: var(--orange-hi); }
  .rail nav a.contact { margin-top: 20px; width: 220px; border-radius: 4px; padding: 16px 0; color: #fff; }
  .hero { padding: 60px 24px 22vh; }
  .hero h1 { letter-spacing: .06em; text-indent: .06em; }
  .home-foot { left: 0; right: 0; text-align: center; font-size: 11px; }
  .page { padding-top: 104px; }
  .pair, .steps, .vlist { grid-template-columns: 1fr; }
  .news { grid-template-columns: 1fr; }
  .ways li { grid-template-columns: 1fr; gap: 2px; }
  dl.facts { grid-template-columns: 1fr; gap: 2px; }
  dl.facts dd { margin-bottom: 12px; }
}
