html,
body {
    margin: 0;
    padding: 0;
    font-family: "Noto Sans TC", "Segoe UI", "Arial", sans-serif;
    background: #181d27;
    color: #e2e2e2;
    min-height: 100vh;
    height: 100%;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1 0 auto;
    z-index: 1;
    position: relative;
    overflow: visible !important;
}

header {
    background: #232736;
    padding: 1.5em 0.5em 1em 0.5em;
    text-align: center;
    box-shadow: 0 2px 10px #13151d90;
    z-index: 1001 !important;
    position: relative;
    overflow: visible !important;
}

/* LOGO排版 */
.logo-row {
    display: flex;
    justify-content: center;
    /* 置中 */
    align-items: center;
    max-width: 920px;
    margin: 0 auto;
    position: relative;
}

.logo-title {
    display: flex;
    align-items: center;
    gap: 1.2em;
    margin-bottom: 0;
}

.site-logo {
    width: 50px;
    height: 50px;
    object-fit: contain;
    border-radius: 10px;
    background: none;
    box-shadow: none;
    border: none;
    padding: 0;
}

header h1 {
    margin: 0;
    font-size: 2.1em;
    letter-spacing: 0.05em;
    color: #e6b167;
}

header .en {
    font-size: 0.8em;
    color: #e0e0e0b2;
    margin-left: 0.5em;
}

/* 導覽列橫式＋下拉 */
nav {
    margin-top: 0.2em;
    display: flex;
    justify-content: center;
    gap: 1.3em;
    flex-wrap: wrap;
    width: 100%;
    position: relative;
}

.nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    gap: 1.3em;
    flex-wrap: wrap;
}

.nav-list>li {
    position: relative;
}

.nav-list>li>a {
    color: #e6b167;
    text-decoration: none;
    font-weight: 500;
    font-size: 1.1em;
    padding: 0.2em 0.7em 0.2em 0.4em;
    border-bottom: 2px solid transparent;
    display: flex;
    align-items: center;
    gap: 0.5em;
    transition: color 0.2s, border-bottom 0.2s;
}

.nav-list>li>a:hover,
.nav-list>li>a:focus {
    color: #ffebc1;
    border-bottom: 2px solid #e6b167;
}

.nav-logo {
    width: 22px;
    height: 22px;
    object-fit: contain;
    border-radius: 5px;
    vertical-align: middle;
    background: none;
    box-shadow: none;
    border: none;
    padding: 0;
}

/* 下拉選單 */
.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 150px;
    background: #232736;
    border-radius: 0.7em;
    box-shadow: 0 8px 16px #00000033;
    padding: 0.5em 0;
    z-index: 999;
}

.nav-list>.dropdown:hover>.dropdown-menu,
.nav-list>.dropdown:focus-within>.dropdown-menu {
    display: block;
}

.dropdown-menu li {
    display: block;
}

.dropdown-menu a {
    display: block;
    color: #e6b167;
    padding: 0.6em 1.2em;
    font-size: 1em;
    font-weight: 400;
    text-decoration: none;
    background: none;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
    border: none;
}

.dropdown-menu a:hover {
    background: #363d52;
    color: #ffd994;
}

/* 漢堡按鈕與RWD導覽 */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    position: absolute;
    top: 2.1em;
    right: 1.5em;
    width: 2.4em;
    height: 2.4em;
    z-index: 1003;
}

.nav-toggle span {
    display: block;
    width: 2em;
    height: 0.28em;
    margin: 0.38em 0;
    background: #ffd994;
    border-radius: 0.21em;
    transition: 0.2s;
}

/* 手機RWD */
@media (max-width: 700px) {
    .logo-row {
        padding: 0 0.7em;
    }

    .logo-title {
        gap: 0.7em;
        font-size: 1em;
    }

    .nav-toggle {
        display: block;
        position: static;
        margin-left: auto;
        margin-right: 0;
        margin-top: 0;
        align-self: center;
        z-index: 1102;
    }

    .site-logo {
        width: 32px;
        height: 32px;
        border-radius: 7px;
    }

    nav {
        margin-top: 0;
    }

    .nav-list,
    .nav-menu {
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
        width: 100%;
    }

    .nav-menu {
        display: none;
        position: absolute;
        top: 4.4em;
        left: 0;
        width: 100vw;
        background: #232736ee;
        box-shadow: 0 2px 24px #13151d88;
        padding: 1.5em 0 1em 0;
        z-index: 1002;
        animation: fadeInNav 0.23s;
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-list>li {
        width: 100%;
        text-align: center;
    }

    .dropdown-menu {
        position: static;
        min-width: unset;
        box-shadow: none;
        border-radius: 0;
    }

    .dropdown-menu a {
        padding: 0.6em 2em;
    }

    header h1 {
        font-size: 1.3em;
    }
}

/* 下拉第二層RWD處理（可選） */
@media (max-width: 700px) {
    .dropdown-menu .dropdown>.dropdown-menu {
        top: 0;
        left: 100%;
        margin-left: 4px;
        border-radius: 0.7em;
        box-shadow: 0 8px 16px #00000033;
        min-width: 150px;
        background: #232736;
        display: none;
    }

    .dropdown-menu .dropdown:hover>.dropdown-menu,
    .dropdown-menu .dropdown:focus-within>.dropdown-menu {
        display: block;
    }
}

/* 主要區塊/作品區/介紹 */
.intro {
    background: #232736;
    border-radius: 1.2em;
    padding: 2em 1.5em;
    box-shadow: 0 2px 14px #1c202d44;
    margin-bottom: 2em;
    text-align: center;
    color: #fff9ec;
}

.works ul {
    padding: 0;
    list-style: none;
}

.works li {
    background: #232736;
    border-radius: 1em;
    margin-bottom: 1.3em;
    padding: 1.2em 1em;
    box-shadow: 0 1px 8px #00000033;
    transition: box-shadow 0.2s, background 0.2s;
}

.works li:hover {
    box-shadow: 0 4px 20px #e6b16722;
    background: #292d3c;
}

.works h3 {
    margin-top: 0;
    color: #e6b167;
}

/* Footer樣式 */
footer {
    left: 0;
    bottom: 0;
    width: 100%;
    background: #232736e6;
    color: #e6b167;
    font-size: 1em;
    text-align: center;
    padding: 0.9em 0;
    letter-spacing: 0.02em;
    z-index: 100;
    box-shadow: 0 -2px 10px #00000030;
    backdrop-filter: blur(2px);
    flex-shrink: 0;
}

.footer-links {
    margin-bottom: 0.25em;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.2em;
    font-size: 1.06em;
    flex-wrap: wrap;
}

.footer-links a {
    color: #ffd994;
    text-decoration: none;
    font-weight: 500;
    margin: 0 0.18em;
    transition: color 0.18s, border-bottom 0.18s;
    padding: 0.05em 0.3em;
    border-radius: 0.5em;
    border-bottom: 2px solid transparent;
}

.footer-links a:hover,
.footer-links a:focus {
    color: #ffebc1;
    background: #282f3a;
    border-bottom: 2px solid #e6b167;
}

.footer-divider {
    color: #e6b167cc;
    margin: 0 0.13em;
    font-size: 1.06em;
    user-select: none;
}

.footer-copyright {
    font-size: 0.98em;
    color: #e6b167;
    margin-top: 0.15em;
    letter-spacing: 0.02em;
}

@media (max-width: 600px) {
    main {
        padding: 0 0.3em;
    }

    .footer-links {
        font-size: 0.97em;
        gap: 0.09em;
    }

    .footer-copyright {
        font-size: 0.92em;
    }
}

@keyframes fadeInNav {
    0% {
        opacity: 0;
        transform: translateY(-10px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 700px) {
    .logo-title {
        flex-direction: column;
        align-items: center;
        gap: 0.3em;
    }

    header h1 {
        font-size: 1.1em;
        display: flex;
        flex-direction: column;
        align-items: center;
        margin-top: 0.2em;
        margin-bottom: 0;
    }

    header .en {
        display: block;
        margin: 0.1em 0 0 0;
        font-size: 0.98em;
        white-space: normal;
        word-break: keep-all;
    }
}

.logo-row {
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: 920px;
    margin: 0 auto;
    position: relative;
    padding: 0 0.7em;
}

.logo-block {
    display: flex;
    align-items: center;
    gap: 0.7em;
}

.site-logo {
    width: 45px;
    height: 45px;
    border-radius: 8px;
}

.logo-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.08;
}

.title-zh {
    font-size: 2.1em;
    font-weight: bold;
    color: #e6b167;
    margin-bottom: 0.10em;
    letter-spacing: 0.05em;
}

.title-en {
    font-size: 1em;
    color: #b5bbc9;
    font-weight: 400;
    margin-left: 0.04em;
    letter-spacing: 0.03em;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    margin-left: auto;
    z-index: 1102;
}

.nav-toggle span {
    display: block;
    width: 2em;
    height: 0.28em;
    margin: 0.38em 0;
    background: #ffeab7;
    border-radius: 0.21em;
    transition: 0.2s;
}

@media (max-width: 700px) {
    .logo-row {
        justify-content: space-between;
        padding: 0 0.6em;
    }

    .site-logo {
        width: 38px;
        height: 38px;
    }

    .logo-block {
        gap: 0.55em;
    }

    .logo-text {
        line-height: 1.08;
        min-width: 85px;
    }

    .title-zh {
        font-size: 1.11em;
        margin-bottom: 0.08em;
    }

    .title-en {
        font-size: 0.99em;
        white-space: nowrap;
    }

    .nav-toggle {
        display: block;
        position: static;
        margin-left: 0;
        margin-right: 0;
        align-self: center;
    }

    nav {
        margin-top: 0;
    }

    .nav-menu {
        display: none;
        flex-direction: column;
        align-items: flex-start;
        position: fixed;
        top: calc(60px + 1em);
        /* header高度+補丁，讓選單黏在導覽底部，可視情況微調 */
        left: 0;
        width: 100vw;
        background: #232736ee;
        box-shadow: 0 2px 24px #13151d88;
        padding: 0.6em 0 1em 0;
        z-index: 1002;
        animation: fadeInNav 0.23s;
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-list>li {
        width: 100%;
        text-align: left;
        padding-left: 2em;
    }
}

@media (max-width: 460px) {
    .logo-text {
        min-width: 68px;
    }
}