/* ==================== */
/* 導航與頁尾樣式 */
/* ==================== */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    width: 100%;
    overflow-x: clip; /* 防止橫向滾動 */
}

main {
    flex: 1 0 auto;
    width: 100%;
}

/* 修正：確保所有頁面的導航列都是白色 */
.nav-bar {
    background: white ;
    padding: 1.2rem 2.5rem;
    box-shadow: 0 2px 8px #00000014;
    display: flex;
    justify-content: space-between;
    writing-mode: horizontal-tb;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    position: relative;
    z-index: 1000;
}

.nav-brand {
    font-family: 'Iansui', cursive ;
    font-size: 1.5rem ;
    font-weight: 700;
    color: var(--vermilion);
    cursor: pointer;
    text-decoration: none;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

/* 導航列內的指南針也放大 */
.nav-brand .compass-logo {
    width: 38px;
    height: 38px;
}

/* 導航列Logo - 極簡光點版本 */
.compass-logo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    position: relative;
    flex-shrink: 0;
    cursor: pointer;
    background: none;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 光點核心 */
.compass-logo::before {
    content: "";
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%,
        #F9A825 0%,
        rgba(249,168,37,0.7) 30%,
        rgba(249,168,37,0.3) 70%,
        transparent 100%);
    box-shadow:
        0 0 0 1px rgba(249,168,37,0.2),
        0 0 15px rgba(249,168,37,0.3);
    position: absolute;
    z-index: 2;
    animation: gentlePulse 4s ease-in-out infinite;
}

/* 光環 */
.compass-logo::after {
    content: "";
    width: 28px;
    height: 28px;
    border-radius: 50%;
    position: absolute;
    border: 1px dashed rgba(249,168,37,0.25);
    animation: rotateSlow 20s linear infinite;
}

/* 四角錨點 */
.compass-logo {
    background-image:
        radial-gradient(circle at 20% 20%, rgba(33,33,33,0.15) 1px, transparent 1px),
        radial-gradient(circle at 80% 20%, rgba(33,33,33,0.15) 1px, transparent 1px),
        radial-gradient(circle at 20% 80%, rgba(33,33,33,0.15) 1px, transparent 1px),
        radial-gradient(circle at 80% 80%, rgba(33,33,33,0.15) 1px, transparent 1px);
    background-size: 100% 100%;
    background-repeat: no-repeat;
}

/* 漢堡選單按鈕 - 僅在行動裝置顯示 */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

.hamburger span {
    display: block;
    height: 3px;
    width: 100%;
    background-color: var(--ink);
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* 漢堡選單展開時的動畫 */
.hamburger.active span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.nav-link {
    color: var(--ink);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
    background: none;
    border: none;
    font-size: 1rem;
    font-family: inherit;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: var(--vermilion);
    transition: width 0.3s ease;
}

.nav-link:hover {
    color: var(--vermilion);
}

.nav-link:hover::after {
    width: 80%;
}

.nav-link.active {
    color: var(--vermilion);
    font-weight: 700;
}

.nav-link.active::after {
    width: 80%;
    background: var(--vermilion);
}

.page, main, [role="main"] {
    flex: 1 0 auto;
    width: 100%;
}

/* 頁尾（FIX：移除 100vw + 負 margin，避免手機左右溢出） */
.footer {
    background: #000000cc;
    color: white;
    text-align: center;
    writing-mode: horizontal-tb;
    -webkit-writing-mode: horizontal-tb;
    padding: 40px 20px;
    margin-top: auto;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    position: relative;
    left: 0;
    right: 0;
    margin-left: 0;
    margin-right: 0;
    z-index: 9999;
}
