/* ==================== CSS 變數 ==================== */
:root {
    --primary-color: #1a3a5f;
    --secondary-color: #e9b84e;
    --accent-color: #3baa6f;
    --background-color: white;
    --text-color: #333333;
    --light-text: #ffffff;
    --light-gray: #f5f5f5;
    --medium-gray: #e0e0e0;
    --dark-gray: #555555;
    --white: #ffffff;
    --border-radius: 8px;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* ==================== 全域樣式 ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Noto Sans TC', sans-serif, "微軟正黑體", "Microsoft JhengHei";
}

body {
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

button {
    cursor: pointer;
}

img {
    max-width: 100%;
}

/* ==================== 容器 ==================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
    width: 100%;
}

.statement-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 1rem;
    width: 100%;
}

/* ==================== 頂部欄 ==================== */
.topbar {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 8px 0;
    font-size: 16px;
}

.topbar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.topbar-text {
    flex-grow: 1;
    font-weight: bold;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.country-logo {
    margin-right: 10px;
}

/* 語言選擇器 */
.language-selector {
    position: relative;
    display: inline-block;
}

.language-selector select {
    appearance: none;
    background-color: transparent;
    border: none;
    color: var(--white);
    padding-right: 20px;
    cursor: pointer;
    font-size: 14px;
}

.language-selector::after {
    content: "▼";
    font-size: 10px;
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
}

/* 使用者控制 */
.user-controls a {
    color: var(--white);
    margin-left: 10px;
    padding: 4px 8px;
    border-radius: 3px;
    transition: background-color 0.3s;
}

.user-controls a:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* ==================== Logo 區域 ==================== */
.logo-area {
    background-color: var(--white);
    padding: 15px 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.logo {
    max-height: 240px;
}

/* ==================== 導航欄 ==================== */
.nav-bar {
    background-color: var(--primary-color);
    color: var(--white);
    position: relative;
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.main-menu {
    display: flex;
}

.main-menu li a {
    display: block;
    color: white;
    font-weight: bold;
    padding: 15px 20px;
    transition: background-color 0.3s;
}

.main-menu li a:hover {
    background-color: var(--primary-color);
    font-weight: bold;
}

/* 下拉選單 */
.dropdown {
    position: relative;
}

.dropdown-menu {
    display: none;
    background-color: #f5f5f5;
    color: #003366;
    border: none;
    box-shadow: 0px 10px 18px rgba(0, 0, 0, 0.1);
    position: absolute;
    z-index: 1000;
    left: 0;
    top: 100%;
    width: 150%;
}

.main-menu li.dropdown:hover > .dropdown-menu {
    display: block;
}

.dropdown-menu a {
    color: #003366 !important;
    font-weight: bold;
    padding: 10px 15px;
    text-align: left;
    display: block;
    transition: background-color 0.3s, color 0.3s;
}

.dropdown-menu a:hover {
    color: #fff !important;
    background-color: #003366 !important;
}

/* 漢堡選單 */
.hamburger-menu {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 10px;
    background: none;
    border: none;
    z-index: 1001;
}

.hamburger-menu span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: white;
    margin: 3px 0;
    transition: 0.3s;
    transform-origin: center;
}

.hamburger-menu div {
    background-color: white;
    height: 4px;
    width: 100%;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.hamburger-menu.active div:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

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

.hamburger-menu.active div:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ==================== 首頁內容 ==================== */
.home-content {
    text-align: center;
    background: white;
    border-radius: 25px;
    padding: 4rem 3rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.1);
    position: relative;
    overflow: hidden;
    animation: fadeIn 0.8s ease-out;
}

.home-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 10px;
    background: #1e3a8a;
}

.seal {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    border-radius: 50%;
    margin: 0 auto 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: bold;
    color: white;
    box-shadow: 0 6px 20px rgba(251, 191, 36, 0.4);
    animation: sealGlow 3s ease-in-out infinite alternate;
}

.announcement-badge {
    display: inline-block;
    background: linear-gradient(135deg, #dc2626, #ef4444);
    color: white;
    padding: 1rem 2.5rem;
    border-radius: 50px;
    font-weight: 600;
    margin-bottom: 2rem;
    box-shadow: 0 4px 15px rgba(220, 38, 38, 0.3);
    animation: pulse 2s infinite;
    font-size: 1.1rem;
}

.home-title {
    font-size: 2.5rem;
    color: #1e3a8a;
    margin-bottom: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
}

.home-description {
    font-size: 1.2rem;
    color: #4b5563;
    margin-bottom: 3rem;
    line-height: 1.8;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.highlight-text {
    color: #dc2626;
    font-weight: 600;
}

.cta-button {
    display: inline-block;
    background: linear-gradient(135deg, #1e3a8a, #3b82f6);
    color: white;
    padding: 1.2rem 3.5rem;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(30, 58, 138, 0.3);
    margin: 0 1rem 1rem 0;
    position: relative;
    overflow: hidden;
}

.cta-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(30, 58, 138, 0.4);
}

.cta-button:hover::before {
    left: 100%;
}

/* 資訊卡片網格 */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.info-card {
    background: rgba(30, 58, 138, 0.05);
    padding: 2rem;
    border-radius: 15px;
    border-left: 4px solid #3b82f6;
    transition: all 0.3s ease;
}

.info-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.info-card h3 {
    color: #1e3a8a;
    font-size: 1.3rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.info-card p {
    color: #6b7280;
    line-height: 1.6;
}

/* ==================== 卡片容器 ==================== */
.card-container {
    max-width: 800px;
    margin: 20px auto 0;
    padding: 1rem;
    width: 100%;
    height: 300px;
    background: linear-gradient(145deg, #f0f0f0, #f0f0f0);
    border-radius: 20px;
    box-shadow: 12px 12px 24px rgba(0, 0, 0, 0.2),
                -6px -6px 12px rgba(255, 255, 255, 0.8),
                inset 3px 3px 6px rgba(255, 255, 255, 0.3);
    display: flex;
    overflow: hidden;
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-container:hover {
    transform: translateY(-2px);
    box-shadow: 12px 12px 24px rgba(0, 0, 0, 0.25),
                -6px -6px 12px rgba(255, 255, 255, 0.9),
                inset 2px 2px 4px rgba(255, 255, 255, 0.4);
}

.left-section {
    width: 400px;
    padding: 40px 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    background: inherit;
    z-index: 2;
}

.diagonal-divider {
    position: absolute;
    top: 0;
    right: -2px;
    width: 0;
    height: 0;
    border-left: 80px solid transparent;
    border-top: 120px solid #f0f0f0;
    border-bottom: 180px solid #f0f0f0;
    z-index: 3;
}

.title-text {
    font-size: 42px;
    font-weight: bold;
    color: #2c3e50;
    line-height: 1.2;
    text-shadow: 2px 2px 4px rgba(255, 255, 255, 0.8),
                 -1px -1px 2px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.learn-more-btn {
    background: linear-gradient(145deg, #3498db, #2980b9);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 5px;
    cursor: pointer;
    box-shadow: 4px 4px 8px rgba(0, 0, 0, 0.2),
                -2px -2px 4px rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
    align-self: flex-start;
}

.learn-more-btn:hover {
    background: linear-gradient(145deg, #2980b9, #3498db);
    box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3),
                -1px -1px 2px rgba(255, 255, 255, 0.4);
    transform: translateY(-1px);
}

.learn-more-btn:active {
    transform: translateY(0);
    box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3),
                inset 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.right-section {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin-left: -60px;
    z-index: 1;
}

.photo-placeholder {
    width: 120%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    position: relative;
}

/* ==================== 導航分頁 ==================== */
.nav-section {
    background-color: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    max-width: 800px;
    margin: 0 auto 2rem;
}

.nav-tab-container {
    display: flex;
    border-bottom: 1px solid #ddd;
    margin-bottom: 1.5rem;
}

.nav-tab {
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    cursor: pointer;
    color: #666;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.nav-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--accent-color);
}

.nav-tab:hover:not(.active) {
    color: var(--primary-color);
    border-bottom-color: #ddd;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ==================== 新聞列表 ==================== */
.news-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.news-item {
    display: flex;
    gap: 1rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.news-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.news-date {
    min-width: 80px;
    text-align: center;
    padding: 0.5rem;
    background-color: var(--primary-color);
    color: white;
    border-radius: var(--border-radius);
    font-weight: 500;
    height: fit-content;
    display: flex;
    flex-direction: column;
}

.news-date .day {
    font-size: 1.25rem;
    font-weight: 700;
}

.news-date .month {
    font-size: 0.8rem;
    opacity: 0.9;
}

.news-content h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.news-content p {
    font-size: 0.95rem;
    color: #666;
    margin-bottom: 0.75rem;
}

.news-content a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.news-content a:hover {
    text-decoration: underline;
}

/* ==================== 政策列表 ==================== */
.policy-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.policy-item {
    display: flex;
    align-items: flex-start;
    background-color: #f9f9f9;
    border-radius: var(--border-radius);
    padding: 1rem;
    gap: 1rem;
    transition: all 0.3s ease;
    border-left: 4px solid var(--primary-color);
}

.policy-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.policy-thumb img {
    max-width: 130px;
    max-height: 130px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

.policy-item h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.policy-item p {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.policy-item a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.policy-item a:hover {
    text-decoration: underline;
}

/* ==================== 按鈕 ==================== */
.back-button {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.75rem 1.5rem;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: var(--border-radius);
    font-weight: 500;
    transition: all 0.3s ease;
}

.back-button:hover {
    background-color: #15304d;
}

/* ==================== 聯絡資訊 ==================== */
.contact-info {
    background-color: #fff;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    max-width: 800px;
    margin: 0 auto 2rem;
    box-shadow: var(--shadow);
    text-align: center;
    border-top: 4px solid var(--accent-color);
}

.contact-info h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.contact-info p {
    margin-bottom: 0.5rem;
}

/* ==================== 頁尾 ==================== */
.footer {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 40px 0 20px;
    display: none;
}

.footer.visible {
    display: block;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    margin-bottom: 30px;
}

.footer-column h4 {
    font-size: 18px;
    margin-bottom: 15px;
    color: #FFB612;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    transition: color 0.3s;
}

.footer-links a:hover {
    color: #FFB612;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 14px;
}

/* ==================== 動畫效果 ==================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes sealGlow {
    from {
        box-shadow: 0 6px 20px rgba(251, 191, 36, 0.4);
    }
    to {
        box-shadow: 0 8px 25px rgba(251, 191, 36, 0.6);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* ==================== 響應式設計 ==================== */
@media (min-width: 769px) {
    .phone-only,
    .hamburger-menu {
        display: none;
    }

    .main-menu {
        display: flex;
        flex-direction: row;
        align-items: center;
    }

    .hamburger-menu.active span {
        transform: none;
        opacity: 1;
    }
}

@media (max-width: 992px) {
    .blog-grid,
    .news-grid,
    .footer-grid,
    .vmblog-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .hamburger-menu {
        display: flex;
    }

    .hamburger-menu.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

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

    .hamburger-menu.active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }

    .main-menu {
        display: none;
        position: fixed;
        top: 140px;
        left: 0;
        width: 100%;
        background-color: #1a3a5f;
        z-index: 10;
        flex-direction: column;
        align-items: center;
        transform: translateY(-100%);
        transition: transform 0.3s ease;
    }

    .main-menu.active {
        display: flex;
        transform: translateY(0);
    }

    .main-menu li a {
        display: block;
        padding: 15px 20px;
        font-weight: 500;
        transition: background-color 0.3s;
    }

    .main-menu li a:hover {
        background-color: var(--primary-color);
    }

    /* 隱藏桌面元素 */
    .topbar-content,
    .topbar,
    .country-logo,
    .topbar-text,
    .user-controls,
    .logo-area,
    .logo,
    .card-container,
    .left-section,
    .diagonal-divider,
    .title-text,
    .learn-more-btn,
    .right-section,
    .photo-placeholder,
    .language-selector {
        display: none;
    }

    /* 單欄佈局 */
    .vmblog-grid,
    .blog-grid,
    .news-grid,
    .services-grid,
    .footer-grid,
    .info-grid {
        grid-template-columns: 1fr;
    }

    .vmblog-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .vmblog-header h2 {
        margin-bottom: 20px;
    }

    .news-item {
        flex-direction: column;
    }

    .news-date {
        min-width: unset;
        align-self: flex-start;
    }

    .nav-tab {
        padding: 0.75rem 1rem;
    }

    .btn {
        display: block;
        width: 100%;
        text-align: center;
    }

    .container {
        padding: 2rem 1rem;
    }

    .home-content {
        padding: 2.5rem 1.5rem;
    }

    .home-title {
        font-size: 2rem;
    }

    .home-description {
        font-size: 1.1rem;
    }

    .cta-button {
        padding: 1rem 2.5rem;
        font-size: 1.1rem;
        margin: 0.5rem;
        display: block;
        text-align: center;
    }
}

@media (max-width: 576px) {
    .topbar-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .search-box input {
        width: 120px;
    }

    .slideshow {
        height: 300px;
    }

    .slide-content {
        margin-left: 10px;
        padding: 15px;
    }

    .slide-content h2 {
        font-size: 22px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .card-container {
        min-height: 200px;
        border-radius: 12px;
    }

    .left-section {
        padding: 25px 15px 15px;
    }

    .title-text {
        font-size: 28px;
        margin-bottom: 15px;
    }

    .learn-more-btn {
        padding: 8px 16px;
        font-size: 13px;
    }

    .right-section {
        min-height: 120px;
    }
}