/* ==========================================================================
   PHI — phi.sankuai.asia
   複用主站 style.css 的核心樣式變數，維持一致的極簡、舒適、高級排版質感。
   ========================================================================== */

:root {
    --bg-color: #f7f7f7;
    --text-main: #222222;
    --text-secondary: #52525b;
    --text-muted: #666666;
    --text-light: #999999;
    --border-color: #e0e0e0;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.5);
    --shadow-soft: 0 4px 30px rgba(0, 0, 0, 0.03);
    --hover-bg: rgba(0, 0, 0, 0.03);
    --accent: #2563eb;
    --accent-rgb: 37, 99, 235;
    --surface: #ffffff;
    --border: #e0e0e0;
    --input-bg: #f0f0f0;
    --accent-alpha-05: rgba(37, 99, 235, 0.05);
    --accent-alpha-10: rgba(37, 99, 235, 0.10);
    --accent-alpha-15: rgba(37, 99, 235, 0.15);
    --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-display: 'Playfair Display', 'Georgia', 'Times New Roman', serif;
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --trans-fast: 0.2s ease;
    --trans-smooth: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --phi-gradient: linear-gradient(135deg, #4a5568, #7b8794);
}

[data-theme="dark"] {
    --bg-color: #0a0a0a;
    --text-main: #e0e0e0;
    --text-secondary: #a1a1aa;
    --text-muted: #888888;
    --text-light: #555555;
    --border-color: #222222;
    --glass-bg: rgba(18, 18, 18, 0.75);
    --glass-border: rgba(255, 255, 255, 0.05);
    --shadow-soft: 0 4px 30px rgba(0, 0, 0, 0.5);
    --hover-bg: rgba(255, 255, 255, 0.05);
    --accent: #3b82f6;
    --accent-rgb: 59, 130, 246;
    --surface: #141414;
    --border: #2a2a2a;
    --input-bg: #1c1c1c;
    --accent-alpha-05: rgba(59, 130, 246, 0.08);
    --accent-alpha-10: rgba(59, 130, 246, 0.12);
    --accent-alpha-15: rgba(59, 130, 246, 0.18);
    --phi-gradient: linear-gradient(135deg, #e4e4e7, #3b82f6);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
    font-family: var(--font-body);
    background: var(--bg-color);
    color: var(--text-main);
    line-height: 1.7;
    font-size: 16px;
    overflow-x: hidden;
    transition: background var(--trans-smooth), color var(--trans-smooth);
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
}
a { text-decoration: none; color: inherit; }
.hidden { display: none !important; }
mark { background: var(--accent-alpha-15); color: var(--text-main); padding: 0 2px; border-radius: 3px; }

/* ==========================================================================
   NAV
   ========================================================================== */
.site-nav {
    position: fixed; top: 0; left: 0; width: 100%; height: 64px; z-index: 1000;
    background: var(--glass-bg);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}
.nav-inner {
    max-width: 1100px; margin: 0 auto; padding: 0 24px; height: 100%;
    display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; gap: 10px; align-items: center;
}
.brand {
    font-family: var(--font-display); font-weight: 700; font-size: 1.25rem;
    letter-spacing: 0.02em; color: var(--text-main);
    min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.brand .phi { font-style: italic; font-weight: 700; font-size: 1.4em; line-height: 1; }
.theme-toggle-btn {
    width: 34px; height: 34px; border-radius: 50%;
    background: transparent; border: 1px solid var(--border);
    color: var(--text-muted); font-size: 1rem; cursor: pointer;
    transition: all var(--trans-fast);
}
.theme-toggle-btn:hover { border-color: var(--text-light); color: var(--text-main); }
.snap-nav-link {
    color: var(--text-muted); font-size: .75rem; font-weight: 600; letter-spacing: .08em;
    text-transform: uppercase; padding: 7px 10px; border: 1px solid var(--border); border-radius: 999px;
    transition: color var(--trans-fast), border-color var(--trans-fast), background var(--trans-fast);
}
.snap-nav-link:hover, .snap-nav-link:focus-visible { color: var(--text-main); border-color: var(--text-light); background: var(--hover-bg); }

/* Hamburger */
.nav-hamburger { display: none; background: none; border: none; color: var(--text-main); font-size: 1.5rem; cursor: pointer; padding: 4px; }
.nav-links-mobile {
    display: flex;
    position: absolute; top: 64px; left: 0; width: 100%;
    background: var(--glass-bg); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    flex-direction: column; gap: 4px; z-index: 999;
    max-height: 0; overflow: hidden; padding: 0 20px;
    transition: max-height 0.35s cubic-bezier(0.4,0,0.2,1), padding 0.35s ease;
}
.nav-links-mobile.open {
    max-height: 360px; padding: 12px 20px;
}
.nav-links-mobile a {
    font-size: 0.9rem; padding: 12px 0; color: var(--text-secondary);
    text-decoration: none; border-bottom: 1px solid var(--border);
    opacity: 0; transform: translateX(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    min-height: 44px; display: flex; align-items: center;
}
.nav-links-mobile.open a { opacity: 1; transform: translateX(0); }
.nav-links-mobile a:nth-child(1) { transition-delay: 0.05s; }
.nav-links-mobile a:nth-child(2) { transition-delay: 0.10s; }
.nav-links-mobile a:nth-child(3) { transition-delay: 0.15s; }
.nav-links-mobile a:nth-child(4) { transition-delay: 0.20s; }
.nav-links-mobile a:nth-child(5) { transition-delay: 0.25s; }
.nav-links-mobile a:nth-child(6) { transition-delay: 0.30s; }
.nav-links-mobile a:last-child { border-bottom: none; }

@media (max-width: 760px) {
    .nav-inner { grid-template-columns: minmax(0, 1fr) auto auto; }
    .nav-hamburger { display: block; }
    .snap-nav-link { display: none; }
    .theme-toggle-btn { margin-left: 4px; }
}

/* ==========================================================================
   HERO
   ========================================================================== */
.hero {
    min-height: 78vh; display: flex; flex-direction: column;
    align-items: center; justify-content: center; text-align: center;
    padding: 120px 24px 64px; position: relative; overflow: hidden;
    border-bottom: 1px solid var(--border);
}
.hero::before {
    content: ''; position: absolute; inset: 0;
    background: radial-gradient(ellipse at 50% 28%, var(--accent-alpha-05) 0%, transparent 70%);
    pointer-events: none;
}
.hero > * { position: relative; z-index: 1; }
.hero-glyph {
    font-family: var(--font-display); font-style: italic; font-weight: 700;
    font-size: clamp(5rem, 16vw, 9rem);
    line-height: 1;
    margin: -0.28em 0 0.28em;   /* 向上移動，避免與標題重疊 */
    background: var(--phi-gradient);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
}
.hero-title {
    font-family: var(--font-display); font-weight: 700;
    font-size: clamp(1.6rem, 4vw, 2.4rem); letter-spacing: -0.01em;
}
.hero-sub {
    max-width: 620px; margin-top: 1.4rem;
    color: var(--text-muted); font-size: 1.05rem; font-weight: 300; line-height: 1.9;
    word-break: break-word;
}
.hero-sub em { font-style: italic; color: var(--text-main); }
.hero-line { display: block; }

/* ==========================================================================
   SECTIONS
   ========================================================================== */
.section {
    max-width: 960px; margin: 0 auto; padding: 72px 24px;
    border-bottom: 1px solid var(--border);
}
.section:last-of-type { border-bottom: none; }
.section-eyebrow {
    font-size: 0.7rem; font-weight: 600; letter-spacing: 0.15em;
    text-transform: uppercase; color: var(--text-muted); margin-bottom: 0.5rem;
}
.section-title {
    font-family: var(--font-display); font-weight: 700;
    font-size: clamp(1.7rem, 4vw, 2.2rem); margin-bottom: 1rem;
}
.section-lead { color: var(--text-muted); font-size: 1.05rem; line-height: 1.8; margin-bottom: 2rem; }

.entry-btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 12px 24px; border-radius: var(--radius-md);
    background: var(--text-main); color: var(--bg-color);
    border: 1px solid var(--text-main);
    font-family: var(--font-body); font-size: 0.9rem; font-weight: 600; cursor: pointer;
    transition: background var(--trans-fast), color var(--trans-fast), transform var(--trans-fast);
}
.entry-btn:hover { background: transparent; color: var(--text-main); transform: translateY(-2px); }

/* Cygnus static card */
.cygnus-card-static {
    background: var(--glass-bg); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 32px 34px;
    border-left: 3px solid var(--accent);
}
.cygnus-card-static p { color: var(--text-muted); font-size: 0.98rem; line-height: 1.9; margin-bottom: 0.75rem; }
.cygnus-card-static p:last-child { margin-bottom: 0; }
.cygnus-card-static strong { color: var(--text-main); }

/* ==========================================================================
   CARDS (Labs)
   ========================================================================== */
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.card {
    background: var(--glass-bg); border: 1px solid var(--border);
    border-radius: var(--radius-md); padding: 24px; cursor: pointer;
    transition: transform var(--trans-smooth), border-color var(--trans-fast), box-shadow var(--trans-smooth);
}
.card:hover { transform: translateY(-3px); border-color: var(--text-light); box-shadow: var(--shadow-soft); }
.card-title { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; margin-bottom: 0.5rem; }
.card-summary { color: var(--text-muted); font-size: 0.9rem; line-height: 1.7; }

/* ==========================================================================
   OVERLAYS (full-screen)
   ========================================================================== */
.overlay {
    position: fixed; inset: 0; z-index: 9000;
    background: var(--bg-color);
    opacity: 0; visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    overflow-y: auto;
}
.overlay.open { opacity: 1; visibility: visible; }
.overlay-panel {
    max-width: 1100px; margin: 0 auto; padding: 72px 28px 56px;
    position: relative; min-height: 100vh;
}
.overlay-close {
    position: fixed; top: 18px; right: 24px; z-index: 10;
    background: var(--glass-bg); border: 1px solid var(--border); border-radius: 50%;
    width: 40px; height: 40px; color: var(--text-muted); font-size: 1.4rem; cursor: pointer;
    transition: color var(--trans-fast), border-color var(--trans-fast);
}
.overlay-close:hover { color: var(--text-main); border-color: var(--text-light); }
.overlay-head { margin-bottom: 28px; }
.overlay-title { font-family: var(--font-display); font-weight: 700; font-size: 1.9rem; margin-bottom: 1rem; }

/* ==========================================================================
   Q&A VIEWER
   ========================================================================== */
.qa-search input {
    width: 100%; padding: 14px 18px; border-radius: var(--radius-md);
    border: 1px solid var(--border); background: var(--input-bg); color: var(--text-main);
    font-family: inherit; font-size: 1rem; outline: none;
    transition: border-color var(--trans-fast), box-shadow var(--trans-fast);
}
.qa-search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-alpha-10); }

.qa-layout { display: grid; grid-template-columns: 260px 1fr; gap: 28px; align-items: start; }
.qa-sidebar { position: sticky; top: 80px; display: flex; flex-direction: column; gap: 6px; }
.qa-cat { border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.qa-cat-head {
    width: 100%; text-align: left; padding: 13px 15px; cursor: pointer;
    background: var(--glass-bg); border: none; color: var(--text-main);
    font-family: var(--font-body); font-size: 0.85rem; font-weight: 600;
    display: flex; justify-content: space-between; align-items: center;
    transition: background var(--trans-fast);
}
.qa-cat-head:hover { background: var(--hover-bg); }
.qa-cat-head .chev { color: var(--text-muted); transition: transform var(--trans-fast); }
.qa-cat.open .qa-cat-head .chev { transform: rotate(90deg); }
.qa-cat-list { max-height: 0; overflow: hidden; transition: max-height 0.3s ease; }
.qa-cat.open .qa-cat-list { max-height: 600px; }
.qa-cat-q {
    display: block; width: 100%; text-align: left; padding: 10px 15px 10px 24px;
    background: transparent; border: none; border-top: 1px solid var(--border);
    color: var(--text-muted); font-size: 0.8rem; line-height: 1.5; cursor: pointer;
    transition: color var(--trans-fast), background var(--trans-fast);
}
.qa-cat-q:hover { color: var(--text-main); background: var(--hover-bg); }

.qa-content { min-width: 0; }
.qa-block { margin-bottom: 40px; }
.qa-cat-title {
    font-family: var(--font-display); font-weight: 700; font-size: 1.3rem;
    margin-bottom: 14px; color: var(--text-main);
    border-bottom: 1px solid var(--border); padding-bottom: 0.5rem;
}
.qa-item {
    background: var(--glass-bg); border: 1px solid var(--border);
    border-radius: var(--radius-md); padding: 20px 22px; margin-bottom: 12px;
    transition: border-color var(--trans-fast), box-shadow var(--trans-fast);
}
.qa-item.flash { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-alpha-10); }
.qa-q { font-weight: 600; color: var(--text-main); margin-bottom: 0.5rem; font-size: 1rem; }
.qa-a { color: var(--text-muted); font-size: 0.94rem; line-height: 1.8; }
.qa-a code { font-family: 'SF Mono', Consolas, monospace; background: var(--hover-bg); padding: 1px 5px; border-radius: 4px; font-size: 0.9em; }

.qa-empty { color: var(--text-muted); font-style: italic; padding: 20px 0; }

/* ==========================================================================
   CYGNUS READING SPLASH
   ========================================================================== */
.reader-splash {
    position: fixed; inset: 0; z-index: 1;
    display: flex; align-items: center; justify-content: center;
    padding: 24px; background: var(--bg-color);
    transition: opacity 0.5s ease;
}
.reader-splash.hide { opacity: 0; pointer-events: none; }

.cygnus-card {
    background: var(--glass-bg);
    backdrop-filter: blur(30px) saturate(150%);
    -webkit-backdrop-filter: blur(30px) saturate(150%);
    border: 1px solid var(--glass-border);
    padding: 40px 60px; border-radius: 12px;
    box-shadow: 0 30px 60px rgba(0,0,0,0.1);
    position: relative; max-width: 700px; width: 90%; margin: 0 auto;
    font-family: 'Times New Roman', Times, serif;
    font-weight: 400 !important; color: var(--text-main);
}
[data-theme="dark"] .cygnus-card { box-shadow: 0 30px 60px rgba(0,0,0,0.6); }
.cygnus-header {
    text-align: center; font-size: 1.25rem; font-style: italic; font-weight: 400 !important;
    letter-spacing: 2px; text-transform: uppercase; opacity: 0.8;
}
.cygnus-divider { height: 1px; width: 100%; background: var(--border-color); margin: 20px 0; opacity: 0.6; }
.cygnus-body { display: flex; align-items: center; justify-content: center; gap: 50px; padding: 10px 0; }
.cygnus-logo { max-width: 140px; height: auto; display: block; transition: filter 0.3s; }
[data-theme="dark"] .cygnus-logo { filter: invert(1) hue-rotate(180deg); }
.cygnus-info { display: flex; flex-direction: column; gap: 16px; }
.cygnus-title { font-size: 2.2rem; font-weight: 400 !important; letter-spacing: 3px; }
.cygnus-reading { font-size: 1.5rem; font-style: italic; font-weight: 400 !important; display: flex; align-items: baseline; opacity: 0.9; }
.cygnus-footer { text-align: center; font-size: 1.05rem; font-style: italic; font-weight: 400 !important; line-height: 1.6; max-width: 550px; margin: 0 auto; opacity: 0.85; }

.loading-dots::after {
    content: ''; animation: dots 1.5s steps(4, end) infinite;
    display: inline-block; width: 1.5em; text-align: left;
}
@keyframes dots {
    0% { content: ''; } 25% { content: '.'; } 50% { content: '..'; } 75% { content: '...'; }
}

/* ==========================================================================
   READER (Featured Writing)
   ========================================================================== */
.reader-panel { padding-top: 60px; }
.reader-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 22px; flex-wrap: wrap; }
.reader-title { font-family: var(--font-display); font-weight: 700; font-size: 1.8rem; }
.cat-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }
.cat-chip {
    padding: 7px 14px; border-radius: 20px; border: 1px solid var(--border);
    background: var(--glass-bg); color: var(--text-muted); font-size: 0.8rem; cursor: pointer;
    transition: all var(--trans-fast);
}
.cat-chip:hover { border-color: var(--text-light); color: var(--text-main); }
.cat-chip.active { background: var(--accent-alpha-15); border-color: var(--accent); color: var(--text-main); }

.reader-list { display: flex; flex-direction: column; gap: 12px; }
.reader-row {
    display: flex; justify-content: space-between; align-items: center; gap: 16px;
    padding: 18px 22px; border: 1px solid var(--border); border-radius: var(--radius-md);
    cursor: pointer; transition: border-color var(--trans-fast), transform var(--trans-fast);
}
.reader-row:hover { border-color: var(--text-light); transform: translateX(3px); }
.reader-row .r-main { min-width: 0; }
.reader-row .r-title { font-weight: 600; color: var(--text-main); }
.reader-row .r-summary { color: var(--text-muted); font-size: 0.86rem; margin-top: 3px; }
.reader-row .r-tags { display: flex; gap: 6px; flex-shrink: 0; flex-wrap: wrap; }
.r-tag { font-size: 0.68rem; color: var(--text-muted); border: 1px solid var(--border); border-radius: 20px; padding: 2px 9px; }

.reader-detail .back-btn {
    display: inline-flex; align-items: center; gap: 8px; margin-bottom: 20px;
    background: none; border: none; color: var(--text-muted); font-size: 0.85rem; cursor: pointer;
}
.reader-detail .back-btn:hover { color: var(--text-main); }
.reader-detail h1 { font-family: var(--font-display); font-size: 1.9rem; margin-bottom: 0.5rem; }
.reader-detail .r-meta { color: var(--text-muted); font-size: 0.8rem; margin-bottom: 24px; }

/* ==========================================================================
   MODAL (labs detail)
   ========================================================================== */
.modal-overlay {
    position: fixed; inset: 0; z-index: 9500;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,0.7); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    opacity: 0; visibility: hidden; transition: opacity 0.3s, visibility 0.3s;
}
.modal-overlay.open { opacity: 1; visibility: visible; }
.modal-box {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 40px 32px;
    max-width: 720px; width: calc(100% - 48px); max-height: 85vh;
    overflow-y: auto; position: relative; box-shadow: 0 16px 64px rgba(0,0,0,0.4);
    transform: translateY(20px); transition: transform 0.3s;
}
.modal-overlay.open .modal-box { transform: translateY(0); }
.modal-close {
    position: absolute; top: 16px; right: 20px;
    background: none; border: none; color: var(--text-muted);
    font-size: 1.5rem; cursor: pointer; transition: color var(--trans-fast);
}
.modal-close:hover { color: var(--text-main); }
.modal-title { font-family: var(--font-display); font-size: 1.6rem; margin-bottom: 1.5rem; line-height: 1.4; }

/* ==========================================================================
   MARKDOWN BODY
   ========================================================================== */
.markdown-body { font-size: 0.98rem; line-height: 1.9; color: var(--text-secondary); }
.markdown-body h1 { font-family: var(--font-display); font-size: 1.8rem; margin: 1.5em 0 0.8em; color: var(--text-main); }
.markdown-body h2 { font-family: var(--font-display); font-size: 1.5rem; margin: 1.6em 0 0.8em; color: var(--text-main); border-bottom: 1px solid var(--border); padding-bottom: 0.4em; }
.markdown-body h3 { font-family: var(--font-display); font-size: 1.2rem; margin: 1.4em 0 0.6em; color: var(--text-main); }
.markdown-body p { margin-bottom: 1.2em; }
.markdown-body strong { color: var(--text-main); }
.markdown-body em { font-style: italic; }
.markdown-body a { color: var(--accent); font-weight: 500; }
.markdown-body a:hover { text-decoration: underline; }
.markdown-body ul, .markdown-body ol { padding-left: 1.5rem; margin-bottom: 1.2em; }
.markdown-body li { margin-bottom: 0.4rem; }
.markdown-body blockquote { border-left: 3px solid var(--accent); padding-left: 16px; color: var(--text-muted); font-style: italic; margin: 1.4em 0; }
.markdown-body code { font-family: 'SF Mono', Consolas, monospace; font-size: 0.9em; background: var(--hover-bg); padding: 2px 6px; border-radius: 4px; }
.markdown-body pre { background: #111; border-radius: var(--radius-sm); padding: 20px; font-size: 0.85rem; overflow-x: auto; margin: 1.4em 0; border: 1px solid #333; }
.markdown-body pre code { background: none; padding: 0; color: #e0e0e0; }
.markdown-body img { max-width: 100%; border-radius: var(--radius-sm); margin: 1.4em 0; }
.markdown-body hr { border: none; border-top: 1px solid var(--border); margin: 2rem 0; }

/* ==========================================================================
   FOOTER
   ========================================================================== */
.site-footer { padding: 48px 24px; text-align: center; border-top: 1px solid var(--border); }
.footer-copy { font-size: 0.78rem; color: var(--text-muted); letter-spacing: 0.04em; }

/* ==========================================================================
   RESPONSIVE — Tablet
   ========================================================================== */
@media (max-width: 900px) {
    .nav-inner { padding: 0 20px; }
    .hero { padding: 100px 20px 48px; }
    .section { padding: 64px 20px; }
    .overlay-panel { padding: 64px 20px 48px; }
    .qa-layout { grid-template-columns: 1fr; }
    .qa-sidebar { position: static; }
    .card-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
    .cygnus-body { gap: 30px; }
    .reader-row { gap: 12px; }
    .phi-security .ps-shell { padding: 40px 24px 80px; }
}

/* ==========================================================================
   RESPONSIVE — Large Mobile
   ========================================================================== */
@media (max-width: 760px) {
    /* NAV */
    .site-nav { height: 56px; }
    .nav-inner { padding: 0 16px; }
    .brand { font-size: 1.1rem; }
    .theme-toggle-btn { width: 32px; height: 32px; font-size: 0.9rem; }

    /* HERO — restructure for mobile */
    .hero {
        min-height: 70vh;
        padding: 80px 16px 40px;
    }
    .hero-glyph {
        font-size: clamp(3.5rem, 14vw, 6rem);
        margin: -0.2em 0 0.2em;
    }
    .hero-title {
        font-size: clamp(1.3rem, 5vw, 1.8rem);
    }
    .hero-sub {
        max-width: 100%;
        font-size: 0.95rem;
        margin-top: 1rem;
    }

    /* SECTIONS */
    .section { padding: 56px 16px; }
    .section-title { margin-bottom: 0.8rem; }
    .section-lead { font-size: 0.95rem; margin-bottom: 1.5rem; }
    .entry-btn { padding: 14px 28px; min-height: 48px; }

    /* CARDS */
    .card-grid { grid-template-columns: 1fr; gap: 12px; }
    .card { padding: 20px; }
    .card-title { font-size: 1.05rem; }

    /* CYGNUS STATIC CARD */
    .cygnus-card-static { padding: 24px 20px; }
    .cygnus-card-static p { font-size: 0.92rem; }

    /* OVERLAYS */
    .overlay-panel { padding: 56px 16px 40px; max-width: 100%; }
    .overlay-close { top: 12px; right: 16px; width: 36px; height: 36px; font-size: 1.2rem; }
    .overlay-title { font-size: 1.5rem; }
    .qa-search input { padding: 12px 14px; font-size: 0.95rem; }

    /* Q&A */
    .qa-layout { grid-template-columns: 1fr; gap: 16px; }
    .qa-sidebar { position: static; display: flex; flex-direction: column; gap: 4px; }
    .qa-item { padding: 16px; margin-bottom: 10px; }
    .qa-q { font-size: 0.92rem; }

    /* READER */
    .reader-panel { padding-top: 48px; }
    .reader-toolbar { flex-direction: column; align-items: flex-start; gap: 10px; }
    .reader-title { font-size: 1.4rem; }
    .cat-chips { gap: 6px; }
    .cat-chip { padding: 6px 12px; font-size: 0.75rem; }
    .reader-row { padding: 14px 16px; flex-direction: column; align-items: flex-start; }
    .reader-row .r-title { font-size: 0.95rem; }
    .reader-row .r-summary { font-size: 0.82rem; }
    .reader-detail h1 { font-size: 1.5rem; }

    /* CYGNUS READING SPLASH */
    .cygnus-card { padding: 30px 20px; max-width: 90%; }
    .cygnus-header { font-size: 1rem; letter-spacing: 1px; }
    .cygnus-body { flex-direction: column; gap: 20px; text-align: center; }
    .cygnus-logo { max-width: 110px; margin: 0 auto; }
    .cygnus-info { align-items: center; gap: 8px; }
    .cygnus-title { font-size: 1.8rem; }
    .cygnus-reading { font-size: 1.3rem; justify-content: center; }
    .cygnus-footer { font-size: 0.9rem; max-width: 90%; }

    /* MODAL */
    .modal-overlay { align-items: flex-end; }
    .modal-box { width: 100%; max-height: 90vh; border-radius: var(--radius-lg) var(--radius-lg) 0 0; padding: 32px 20px; }
    .modal-title { font-size: 1.3rem; }

    /* FOOTER */
    .site-footer { padding: 36px 16px; }
    .footer-copy { font-size: 0.72rem; }

    /* PHI SECURITY */
    .phi-security .ps-shell { grid-template-columns: 1fr; gap: 24px; padding: 32px 16px 64px; }
    .phi-security .ps-doc-title { font-size: clamp(1.3rem, 5vw, 1.6rem); }
    .phi-security .ps-doc-summary { font-size: 0.88rem; }

    /* MARKDOWN BODY */
    .markdown-body { font-size: 0.92rem; }
    .markdown-body h1 { font-size: 1.5rem; }
    .markdown-body h2 { font-size: 1.3rem; }
    .markdown-body h3 { font-size: 1.1rem; }
    .markdown-body pre { padding: 14px; font-size: 0.8rem; }
}

/* ==========================================================================
   RESPONSIVE — Small Mobile
   ========================================================================== */
@media (max-width: 480px) {
    .hero {
        min-height: 65vh;
        padding: 72px 14px 32px;
    }
    .hero-glyph {
        font-size: clamp(3rem, 18vw, 5rem);
    }
    .hero-title {
        font-size: clamp(1.1rem, 6vw, 1.5rem);
    }
    .hero-sub {
        font-size: 0.88rem;
        line-height: 1.7;
    }
    .hero-line { margin-top: 0.3rem; }

    .section { padding: 48px 14px; }
    .section-eyebrow { font-size: 0.65rem; }
    .section-title { font-size: clamp(1.3rem, 5vw, 1.6rem); }
    .section-lead { font-size: 0.88rem; }

    .entry-btn { padding: 12px 22px; font-size: 0.85rem; }

    .overlay-panel { padding: 48px 14px 36px; }
    .overlay-title { font-size: 1.3rem; }
    .qa-item { padding: 14px; }

    .card { padding: 16px; }
    .card-title { font-size: 1rem; }
    .card-summary { font-size: 0.82rem; }

    .cygnus-card-static { padding: 18px 14px; border-radius: var(--radius-md); }
    .cygnus-card-static p { font-size: 0.85rem; line-height: 1.7; }

    .phi-security .ps-doc-title { font-size: 1.2rem; }
    .phi-security .ps-doc-summary { font-size: 0.82rem; line-height: 1.6; }
}

/* ==========================================================================
   RESPONSIVE — Touch-friendly interactive elements
   ========================================================================== */
@media (hover: none) and (pointer: coarse) {
    .entry-btn { min-height: 48px; }
    .qa-cat-head { min-height: 44px; }
    .qa-cat-q { min-height: 40px; }
    .overlay-close { min-width: 44px; min-height: 44px; }
    .theme-toggle-btn { min-width: 44px; min-height: 44px; }
    .cat-chip { min-height: 40px; }
    .reader-row { min-height: 44px; }
    .card { min-height: 44px; }
}

/* ==========================================================================
   PHI SECURITY — Disclaimer Center
   Scope 在 .phi-security 下，避免污染首頁
   ========================================================================== */
.phi-security {
    --ps-c1: rgba(123, 151, 181, 0.35);
    --ps-c2: rgba(154, 139, 180, 0.30);
    --ps-c3: rgba(123, 160, 150, 0.26);
    --ps-progress: 0;
    min-height: 100vh;
    color: var(--text-main);
}
[data-theme="dark"] .phi-security {
    --ps-c1: rgba(90, 110, 140, 0.30);
    --ps-c2: rgba(120, 100, 150, 0.26);
    --ps-c3: rgba(80, 120, 110, 0.24);
}

/* ---- Hero：純背景，固定高度，在 document flow 中自然移出 ---- */
.phi-security .ps-hero {
    position: relative;
    min-height: 100vh;
    min-height: 100svh;
    overflow: hidden;
}
.phi-security .ps-hero-bg {
    position: absolute; inset: -20%;
    background:
        radial-gradient(40% 42% at 22% 30%, var(--ps-c1), transparent 62%),
        radial-gradient(44% 46% at 72% 62%, var(--ps-c2), transparent 64%),
        radial-gradient(36% 38% at 50% 80%, var(--ps-c3), transparent 62%);
    filter: blur(60px);
    opacity: 0.55;
    animation: ps-drift 26s ease-in-out infinite alternate;
    will-change: transform;
}
@keyframes ps-drift {
    0% { transform: translate3d(0, 0, 0) scale(1); }
    50% { transform: translate3d(4%, -3%, 0) scale(1.08); }
    100% { transform: translate3d(-3%, 4%, 0) scale(1.05); }
}

/* ---- 單一文字 source：fixed 於 viewport，隨 progress 連續變形 ---- */
.phi-security .ps-brand,
.phi-security .ps-tagline {
    position: fixed; left: 50%; top: 50%;
    margin: 0; white-space: nowrap;
    transform: translate(-50%, -50%);
    will-change: transform, font-size;
    z-index: 1000;
    pointer-events: none;
    max-width: calc(50vw - 48px);
    overflow: hidden;
    text-overflow: ellipsis;
}
.phi-security .ps-brand {
    font-family: var(--font-display); font-weight: 700;
    font-size: clamp(2.5rem, 8vw, 5rem);
    letter-spacing: -0.02em;
}
.phi-security .ps-tagline {
    color: var(--text-muted); font-style: italic; font-weight: 300;
    font-size: clamp(1rem, 2.5vw, 1.4rem);
}

/* ---- compact header 背景（固定頂欄，隨 progress 淡入，不含文字） ---- */
.phi-security .ps-header-bg {
    position: fixed; top: 0; left: 0; right: 0; height: 64px;
    background: var(--glass-bg);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    opacity: var(--ps-progress);
    pointer-events: none;
    z-index: 900;
}
.phi-security .ps-burger {
    display: none; position: fixed; top: 12px; left: 16px; z-index: 1001;
    align-items: center; justify-content: center;
    width: 40px; height: 40px; border: 1px solid var(--border); border-radius: 10px;
    background: transparent; color: var(--text-main); font-size: 1.3rem; cursor: pointer;
}

/* ---- Shell ---- */
.phi-security .ps-shell {
    display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 48px;
    max-width: 1100px; margin: 0 auto; padding: 48px 28px 96px;
    align-items: start;
}
.phi-security .ps-sidebar {
    position: sticky;
    top: 80px;
    max-height: calc(100vh - 96px);
    overflow-y: auto;
    align-self: start;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
    padding-right: 4px;
}
.phi-security .ps-sidebar::-webkit-scrollbar { width: 6px; }
.phi-security .ps-sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ---- Nav ---- */
.phi-security .ps-nav { display: flex; flex-direction: column; gap: 4px; }
.phi-security .ps-nav-item { border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.phi-security .ps-nav-doc {
    display: flex; align-items: center; gap: 10px; width: 100%;
    padding: 13px 14px; background: transparent; border: none; cursor: pointer;
    color: var(--text-main); font-size: 0.88rem; text-align: left; font-family: inherit;
    transition: background var(--trans-fast);
}
.phi-security .ps-nav-doc:hover { background: var(--hover-bg); }
.phi-security .ps-nav-num { color: var(--text-muted); font-size: 0.72rem; font-variant-numeric: tabular-nums; }
.phi-security .ps-nav-label { flex: 1; font-weight: 600; line-height: 1.4; }
.phi-security .ps-nav-chev { color: var(--text-muted); transition: transform 0.3s ease; flex-shrink: 0; }
.phi-security .ps-nav-item.open .ps-nav-chev { transform: rotate(90deg); }

/* 真正 collapse：子選單收起後完全不佔據 layout 高度 */
.phi-security .ps-nav-sections {
    display: grid; grid-template-rows: 0fr;
    transition: grid-template-rows 0.32s cubic-bezier(0.4, 0, 0.2, 1);
}
.phi-security .ps-nav-item.open .ps-nav-sections { grid-template-rows: 1fr; }
.phi-security .ps-nav-sections-inner { min-height: 0; overflow: hidden; }
.phi-security .ps-nav-sec {
    display: block; padding: 8px 14px 8px 30px; margin-left: 8px;
    border-left: 1px solid var(--border);
    color: var(--text-muted); font-size: 0.82rem; line-height: 1.4;
    transition: color var(--trans-fast), border-color var(--trans-fast);
}
.phi-security .ps-nav-sec:last-child { padding-bottom: 18px; }
.phi-security .ps-nav-sec:hover { color: var(--text-main); }
.phi-security .ps-nav-sec.active { color: var(--accent); border-left-color: var(--accent); }

/* ---- Content ---- */
.phi-security .ps-content { min-width: 0; }
.phi-security .ps-content [id] { scroll-margin-top: 84px; }
.phi-security .ps-doc { padding-bottom: 48px; margin-bottom: 48px; border-bottom: 1px solid var(--border); }
.phi-security .ps-doc:last-child { border-bottom: none; }
.phi-security .ps-doc-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 18px; }
.phi-security .ps-doc-num { color: var(--text-muted); font-size: 0.78rem; font-variant-numeric: tabular-nums; }
.phi-security .ps-doc-title { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.5rem, 3.5vw, 2rem); line-height: 1.3; }
.phi-security .ps-doc-summary { color: var(--text-muted); font-size: 0.95rem; line-height: 1.7; margin-bottom: 24px; }

/* ---- focus / accessibility ---- */
.phi-security .ps-nav-doc:focus-visible,
.phi-security .ps-nav-sec:focus-visible,
.phi-security .ps-burger:focus-visible {
    outline: 2px solid var(--accent); outline-offset: 2px;
}

/* ---- PHI Security Mobile ---- */
@media (max-width: 860px) {
    .phi-security .ps-shell { grid-template-columns: 1fr; gap: 24px; padding-top: 32px; }
    .phi-security .ps-burger { display: flex; }
    .phi-security .ps-tagline {
        display: block;
        max-width: min(78vw, 440px);
        white-space: normal;
        text-align: center;
    }
    .phi-security .ps-sidebar {
        position: fixed; top: 64px; left: 0; bottom: 0; width: min(300px, 84vw);
        background: var(--bg-color); border-right: 1px solid var(--border);
        padding: 18px; overflow-y: auto; z-index: 999;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    .phi-security.menu-open .ps-sidebar { transform: translateX(0); }
    .phi-security .ps-brand {
        font-size: clamp(2rem, 10vw, 3.5rem);
    }
    .phi-security .ps-hero { min-height: 100vh; min-height: 100svh; }
    .phi-security .ps-burger { opacity: var(--ps-progress); }
}

@media (max-width: 480px) {
    .phi-security .ps-hero { min-height: 100vh; min-height: 100svh; }
    .phi-security .ps-brand {
        font-size: clamp(1.6rem, 12vw, 2.5rem);
    }
    .phi-security .ps-shell { padding: 24px 12px 48px; }
    .phi-security .ps-doc { padding-bottom: 32px; margin-bottom: 32px; }
    .phi-security .ps-doc-head { gap: 10px; margin-bottom: 12px; }
}

/* ========================================================================== 
   UPDATE LOG / BETA PROJECTS
   ========================================================================== */
.updates-overlay { z-index: 9100; }
.updates-panel {
    width: min(1440px, 100%);
    min-height: 100vh;
    margin: 0 auto;
    padding: 72px 28px 64px;
}
.updates-header {
    max-width: 760px;
    margin: 0 0 42px;
}
.updates-header p { color: var(--text-muted); max-width: 620px; }
.updates-layout {
    display: grid;
    grid-template-columns: minmax(310px, 420px) minmax(0, 1fr);
    gap: clamp(28px, 5vw, 72px);
    align-items: start;
}
.updates-timeline {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding-left: 26px;
}
.updates-timeline::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 10px;
    bottom: 10px;
    width: 1px;
    background: linear-gradient(var(--accent), var(--border) 84%, transparent);
}
.timeline-card {
    position: relative;
    width: 100%;
    text-align: left;
    color: var(--text-main);
    background: var(--glass-bg);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 18px;
    cursor: pointer;
    transition: transform .25s ease, border-color .25s ease, background .25s ease;
}
.timeline-card::before {
    content: '';
    position: absolute;
    left: -24px;
    top: 22px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--bg-color);
    border: 2px solid var(--accent);
    box-shadow: 0 0 0 5px var(--accent-alpha-10);
}
.timeline-card:hover { transform: translateX(4px); border-color: var(--text-light); }
.timeline-card.active { border-color: var(--accent); background: var(--accent-alpha-05); }
.timeline-card.active::before { background: var(--accent); }
.timeline-card-time { color: var(--text-muted); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; }
.timeline-card-title { display: block; margin: 7px 0 8px; font-family: var(--font-display); font-size: 1.06rem; line-height: 1.35; }
.timeline-card-meta { display: flex; gap: 7px; flex-wrap: wrap; color: var(--text-muted); font-size: .72rem; }
.timeline-type, .timeline-latest {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 3px 7px;
    text-transform: uppercase;
    letter-spacing: .08em;
}
.timeline-type.beta { color: #8b5cf6; border-color: rgba(139,92,246,.35); }
.timeline-latest { color: var(--accent); border-color: rgba(var(--accent-rgb),.32); }
.updates-detail {
    position: sticky;
    top: 28px;
    min-height: 60vh;
    max-height: calc(100vh - 56px);
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--glass-bg);
    box-shadow: var(--shadow-soft);
    padding: clamp(24px, 4vw, 50px);
    scrollbar-width: thin;
}
.updates-empty { min-height: 42vh; display: grid; place-items: center; color: var(--text-muted); text-align: center; }
.update-detail-kicker { color: var(--accent); font-size: .72rem; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; }
.update-detail-title { font-family: var(--font-display); font-size: clamp(1.7rem, 4vw, 2.65rem); line-height: 1.18; margin: 9px 0 14px; }
.update-detail-byline { color: var(--text-muted); font-size: .84rem; margin-bottom: 18px; }
.update-detail-tags { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 30px; }
.update-detail-tag { padding: 5px 9px; border: 1px solid var(--border); border-radius: 999px; color: var(--text-muted); font-size: .73rem; }
.update-detail-actions { display: flex; flex-wrap: wrap; gap: 9px; margin: 0 0 28px; }
.update-action {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 9px 13px;
    background: transparent;
    color: var(--text-main);
    cursor: pointer;
    font: 600 .76rem var(--font-body);
}
.update-action:hover { border-color: var(--accent); color: var(--accent); }
.update-content img { max-width: 100%; height: auto; border-radius: 14px; margin: 20px 0; border: 1px solid var(--border); }
.update-content > * { scroll-margin-top: 30px; }
.update-target-flash { animation: updateTargetFlash 1.8s ease; }
.update-relations { margin-top: 42px; padding-top: 28px; border-top: 1px solid var(--border); }
.update-relations h3 { font-family: var(--font-display); font-size: 1.15rem; margin-bottom: 13px; }
.relation-link {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 10px;
    align-items: center;
    width: 100%;
    padding: 13px 0;
    border: 0;
    border-bottom: 1px solid var(--border);
    background: transparent;
    color: var(--text-main);
    text-align: left;
    cursor: pointer;
}
.relation-link:hover .relation-title { color: var(--accent); }
.relation-node { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 5px var(--accent-alpha-10); }
.relation-title { font-weight: 600; transition: color .2s ease; }
.relation-anchor { color: var(--text-muted); font-size: .7rem; }
.updates-warning { margin: 0 0 18px 26px; color: #a16207; font-size: .8rem; }

@keyframes updateTargetFlash {
    0%, 100% { background: transparent; box-shadow: none; }
    24% { background: var(--accent-alpha-15); box-shadow: 0 0 0 8px var(--accent-alpha-10); }
}

@media (max-width: 860px) {
    .updates-panel { padding: 68px 16px 48px; }
    .updates-layout { grid-template-columns: 1fr; gap: 24px; }
    .updates-timeline { padding-left: 22px; }
    .updates-detail { position: relative; top: auto; max-height: none; min-height: 0; padding: 24px 18px; }
    .updates-empty { min-height: 180px; }
}

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
    .phi-security .ps-hero-bg { animation: none; }
    .phi-security .ps-brand,
    .phi-security .ps-tagline,
    .phi-security .ps-header-bg,
    .phi-security .ps-nav-sections,
    .phi-security .ps-nav-chev,
    .phi-security .ps-sidebar { transition: none; }
}
