/* ==========================================================================
   2026 苗栗國際陶瓷競賽展 - 主 CSS 樣式表 (CSS Module & Refactored System)
   ========================================================================== */

/* 1. 全域 reset & 基礎排版 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-main);
    background-color: var(--background-solid);
    color: var(--text-color);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ==========================================================================
   2. 按鈕系統 (Unified Button System - Base & Modifiers)
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.65rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
    line-height: 1.2;
}

.btn-primary {
    background-color: var(--button-color, #8b5a2b);
    color: var(--button-f-color, #ffffff);
}
.btn-primary:hover {
    background-color: var(--hover-checked-color, #70451f);
    color: #ffffff;
}

.btn-secondary {
    background-color: #888888;
    color: #ffffff;
}
.btn-secondary:hover {
    background-color: #666666;
}

.btn-hero {
    font-size: 1.05rem;
    padding: 0.75rem 1.8rem;
    box-shadow: 0 4px 12px rgba(139, 90, 43, 0.3);
}

.btn-pill {
    border-radius: 20px;
    padding: 0.45rem 1.1rem;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(140, 90, 50, 0.2);
}

.btn:disabled, .btn-primary:disabled {
    background-color: #cccccc !important;
    color: #888888 !important;
    cursor: not-allowed !important;
    box-shadow: none !important;
}

.btn-lang {
    border: none;
    background: none;
    cursor: pointer;
    font-size: 0.85rem;
    color: #666666;
    padding: 0.2rem 0.4rem;
}
.btn-lang.active {
    font-weight: bold;
    color: var(--secondary-color);
    text-decoration: underline;
}

/* ==========================================================================
   3. Header & Nav 導覽列模組
   ========================================================================== */
.site-header {
    background-color: var(--background-white);
    border-bottom: 2px solid var(--primary-color);
    box-shadow: var(--shadow-soft);
    position: sticky;
    top: 0;
    z-index: 100;
}
.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.65rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.2rem;
}
.brand-title {
    text-decoration: none;
    color: var(--secondary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
}
.badge-year {
    background: var(--secondary-color);
    color: #fff;
    padding: 0.15rem 0.5rem;
    border-radius: 6px;
    font-size: 0.85rem;
    white-space: nowrap;
}
.title-main { font-size: 1.15rem; white-space: nowrap; font-weight: bold; }
.title-abbr { font-size: 0.8rem; color: var(--secondary-color); background: rgba(139,87,51,0.1); padding: 0.1rem 0.4rem; border-radius: 4px; white-space: nowrap; }

.main-nav { display: flex; align-items: center; }
.main-nav .nav-list {
    display: flex;
    list-style: none;
    gap: 0.5rem;
    align-items: center;
    margin: 0;
    padding: 0;
}
.nav-item a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 600;
    font-size: 0.92rem;
    padding: 0.45rem 0.75rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: inline-block;
    white-space: nowrap;
}
.nav-item a:hover, .nav-item.active a {
    background-color: var(--primary-color);
    color: var(--secondary-color);
}
.btn-apply-nav {
    background-color: var(--button-color) !important;
    color: #fff !important;
    white-space: nowrap !important;
}

/* 下拉選單 Dropdown Menu */
.nav-item.dropdown {
    position: relative;
}
.nav-item.dropdown:hover .dropdown-menu {
    display: block;
    animation: fadeIn 0.2s ease;
}
.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: auto;
    background: #ffffff;
    min-width: 150px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    padding: 0.5rem 0;
    list-style: none;
    z-index: 200;
    border-radius: 6px;
}
.dropdown-menu-right, .lang-dropdown .dropdown-menu {
    left: auto;
    right: 0;
}
.dropdown-menu li a {
    display: block;
    padding: 0.6rem 1.2rem;
    color: var(--text-color);
    font-size: 0.9rem;
    border-radius: 0;
    text-align: left;
}
.dropdown-menu li a:hover {
    background-color: var(--primary-color);
    color: var(--secondary-color);
}

/* ==========================================================================
   4. 表單輸入框控制項 (Unified Form Controls & Inputs)
   ========================================================================== */
.form-group {
    margin-bottom: 1.2rem;
}
.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.4rem;
}
.form-control, .form-control-unified, input[type="text"], input[type="email"], input[type="date"], input[type="number"], select, textarea {
    width: 100%;
    height: 42px;
    padding: 0.5rem 0.85rem;
    border: 1px solid #cccccc;
    border-radius: 6px;
    background-color: var(--input-bg, #ffffff);
    font-size: 0.95rem;
    color: var(--text-color, #333333);
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
textarea {
    height: auto !important;
}
.form-control:focus, .form-control-unified:focus, input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--secondary-color, #8b5a2b);
    box-shadow: 0 0 0 3px rgba(139, 90, 43, 0.15);
}
.form-control-readonly {
    background: #f4f1ea !important;
    font-weight: bold;
    color: var(--secondary-color, #8b5a2b) !important;
    border-color: #dcd6cd !important;
    cursor: default;
}

/* ==========================================================================
   5. 卡片與作品規格區塊 (Card & Work Specification Modules)
   ========================================================================== */
.card-section {
    background: var(--background-white);
    padding: 2rem;
    border-radius: var(--border-radius-card);
    box-shadow: var(--shadow-soft);
    margin-bottom: 1.5rem;
}
.section-title {
    color: var(--secondary-color);
    border-left: 4px solid var(--secondary-color);
    padding-left: 0.75rem;
    margin-bottom: 1.5rem;
}

.spec-box {
    background: #ffffff;
    padding: 1.25rem;
    border-radius: 8px;
    border: 1px solid var(--border-color, #e0d8ce);
    margin-bottom: 1.25rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.03);
}

.spec-sub-title {
    color: var(--secondary-color, #8b5a2b);
    font-size: 1.05rem;
    font-weight: bold;
    margin: 0 0 0.75rem 0;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid #f0ede8;
}

.spec-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.2rem;
    margin-bottom: 1rem;
}

.spec-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.spec-grid-6 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

@media (max-width: 768px) {
    .spec-grid-3, .spec-grid-4, .spec-grid-6 { grid-template-columns: 1fr; }
}

/* 圖檔上傳預覽卡片區 */
.upload-preview-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1rem;
}

.preview-thumb-card {
    position: relative;
    width: 140px;
    height: 160px;
    border-radius: 8px;
    border: 2px solid #e0d8ce;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
    display: flex;
    flex-direction: column;
    transition: all 0.2s ease;
}

.preview-thumb-card.is-cover {
    border-color: var(--primary-color, #c62828);
    box-shadow: 0 0 8px rgba(198, 40, 40, 0.3);
}

.preview-thumb-card .img-wrapper {
    position: relative;
    width: 100%;
    height: 110px;
    overflow: hidden;
}

.preview-thumb-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-thumb-card .badge-cover {
    position: absolute;
    top: 4px;
    left: 4px;
    background: var(--primary-color, #c62828);
    color: #fff;
    font-size: 0.72rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: bold;
    z-index: 2;
}

.preview-thumb-card .btn-remove-thumb {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    border: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}
.preview-thumb-card .btn-remove-thumb:hover {
    background: #d32f2f;
}

.preview-thumb-card .card-actions-bar {
    padding: 4px;
    background: #fdfaf6;
    border-top: 1px solid #f0ede8;
    text-align: center;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-thumb-card .btn-set-cover {
    font-size: 0.75rem;
    padding: 3px 8px;
    border-radius: 4px;
    border: 1px solid #ccc;
    background: #fff;
    cursor: pointer;
    color: #555;
    width: 100%;
    transition: all 0.15s ease;
}
.preview-thumb-card.is-cover .btn-set-cover {
    background: var(--primary-color, #c62828);
    color: #fff;
    border-color: var(--primary-color, #c62828);
    font-weight: bold;
}

.opt_div {
    background-color: var(--background-opt_div);
    padding: 0.8rem;
    border-radius: 6px;
    margin-bottom: 0.5rem;
}
.opt_div.check_opt {
    background-color: var(--background-opt_div_checked);
}

.info-notice-box {
    background: var(--question-bg, #f7f4ef);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.confirm-check-box {
    background: rgba(255, 250, 240, 0.9);
    border: 2px dashed var(--secondary-color, #8b5a2b);
    padding: 1.25rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.annex7-box {
    margin-top: 1.5rem;
    background: rgba(255,250,240,0.8);
    border: 1px solid var(--accent-color, #d4a373);
}

.annex7-panel {
    display: none;
    margin-top: 1rem;
    padding: 1rem;
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid #dddddd;
}

/* ==========================================================================
   6. 通用簡潔 Flex & Spacing & Utility Classes
   ========================================================================== */
.d-flex { display: flex; }
.align-center { align-items: center; }
.align-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }

.gap-sm { gap: 0.5rem; }
.gap-md { gap: 1rem; }
.gap-lg { gap: 1.5rem; }

/* 兼顧舊寫法之相容整合 */
.flex-center-gap-sm { display: flex; align-items: center; gap: 0.4rem; }
.flex-center-gap-md { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.flex-start-gap-sm { display: flex; align-items: flex-start; gap: 0.75rem; cursor: pointer; }

.form-label-bold { font-weight: bold; margin-bottom: 0.3rem; display: block; }
.section-divider-dashed { margin-top: 1rem; border-top: 1px dashed #e0d8ce; padding-top: 1rem; }
.input-w-sm { width: 100px; }
.checkbox-lg { width: 22px; height: 22px; margin-top: 2px; }

.text-secondary-md, .s2 { color: var(--secondary-color, #8b5a2b); font-size: 1.05rem; font-weight: bold; }
.text-muted-sub { font-size: 0.85rem; color: #666666; margin-top: 0.3rem; }

.lock-notice-badge {
    color: #777777;
    font-size: 0.9rem;
    font-weight: bold;
    background: #eeeeee;
    padding: 0.5rem 1rem;
    border-radius: 6px;
}

/* Layout Wrapper & Steps */
.main-wrapper {
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 1.8rem auto;
    padding: 0 1.25rem;
}

/* ==========================================================================
   全站頁尾 Footer 樣式 (對齊 .main-wrapper 寬度)
   ========================================================================== */
.site-footer {
    background: #3a2b21;
    color: #e6ded4;
    padding: 2.5rem 0 1.5rem 0;
    margin-top: auto;
    border-top: 4px solid var(--secondary-color, #8b5a2b);
    width: 100%;
}

.footer-container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 0 1.25rem;
}

.footer-info {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1.5fr;
    gap: 2rem;
    padding-bottom: 1.8rem;
    border-bottom: 1px solid rgba(230, 222, 212, 0.15);
}

.footer-brand h4 {
    font-size: 1.2rem;
    color: #f7f3ee;
    margin-bottom: 0.25rem;
    font-weight: 700;
}

.footer-brand .en-sub {
    font-size: 0.85rem;
    color: #c4b5a5;
    margin-bottom: 0.8rem;
}

.footer-orgs p, .footer-contact p {
    font-size: 0.9rem;
    line-height: 1.65;
    color: #d6cac0;
    margin-bottom: 0.35rem;
}

.footer-orgs strong, .footer-contact strong {
    color: #f7f3ee;
}

.footer-bottom {
    padding-top: 1.2rem;
    text-align: center;
    font-size: 0.85rem;
    color: #a89a8c;
}

@media (max-width: 900px) {
    .footer-info {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}
.wizard-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
    background: var(--background-white);
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius-card);
    box-shadow: var(--shadow-soft);
}
.step-item {
    flex: 1;
    text-align: center;
    padding: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: #888;
    border-bottom: 3px solid transparent;
}
.step-item.active {
    color: var(--secondary-color);
    border-bottom-color: var(--secondary-color);
}
.step-item.completed {
    color: var(--accent-color);
}

.form-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
}

/* 數據表格 Data Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}
.data-table th {
    padding: 0.85rem 1rem;
    background: var(--table-header-bg, #333);
    color: var(--table-header-text, #fff);
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid var(--border-color, #ccc);
}
.data-table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    vertical-align: middle;
}
.data-table tbody tr:nth-child(even) { background: var(--table-row-even-bg, rgba(0, 0, 0, 0.02)); }
.data-table tbody tr:nth-child(odd) { background: var(--table-row-odd-bg, #ffffff); }
.data-table tbody tr:hover { background: rgba(184, 138, 88, 0.08); }

/* 內嵌靜態提醒 Banner (置於勾選區最下方) */
.floating-toast-div {
    position: static;
    background: #fff8f0;
    border-left: 5px solid var(--secondary-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    padding: 0.9rem 1.2rem;
    border-radius: 6px;
    margin-top: 1.5rem;
    margin-bottom: 1.2rem;
    width: 100%;
}
.toast-content {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-size: 0.9rem;
    color: var(--text-color);
    font-weight: 600;
}

/* ==========================================================================
   3. 2026 苗栗國際陶瓷競賽展 - 正式首頁模組樣式 (Homepage Module System)
   ========================================================================== */

/* Hero 主視覺 Banner (輪播) */
.preview-hero-container {
    position: relative;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto 1.2rem auto;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 28px rgba(100, 75, 50, 0.15);
    background: #f7f3ee;
    border: 1px solid rgba(212, 192, 172, 0.4);
}

.hero-slider-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.hero-slides {
    display: flex;
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

.hero-slide {
    flex-shrink: 0;
    position: relative;
}

.hero-slide-img {
    width: 100%;
    height: auto;
    max-height: 540px;
    object-fit: cover;
    display: block;
}

/* 輪播控制鍵 (左右箭頭與指示點) */
.slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 42px;
    height: 42px;
    background: rgba(40, 30, 20, 0.45);
    backdrop-filter: blur(4px);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.25s ease;
    z-index: 5;
    opacity: 0.75;
}

.preview-hero-container:hover .slider-arrow { opacity: 1; }

.slider-arrow:hover {
    background: rgba(184, 115, 51, 0.9);
    border-color: #fff;
    transform: translateY(-50%) scale(1.08);
}

.slider-arrow-prev { left: 1rem; }
.slider-arrow-next { right: 1rem; }

.slider-dots {
    position: absolute;
    bottom: 1.2rem;
    right: 1.8rem;
    display: flex;
    gap: 0.5rem;
    z-index: 5;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(4px);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
}

.slider-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
}

.slider-dot.active {
    width: 24px;
    border-radius: 12px;
    background: #e8a86b;
}

/* Hero 下方獨立快捷操作面板 (Quick Action Bar) */
.hero-action-bar {
    max-width: 1200px;
    margin: 0 auto 2.5rem auto;
    background: linear-gradient(135deg, #ffffff 0%, #fcfaf7 100%);
    border: 1px solid rgba(212, 192, 172, 0.5);
    border-radius: 14px;
    padding: 1.4rem 2rem;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.2rem;
}

.action-notice {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    color: #4a3525;
}

.notice-badge {
    background: #b87333;
    color: #ffffff;
    font-size: 0.82rem;
    font-weight: 700;
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    white-space: nowrap;
}

.notice-text {
    font-size: 0.98rem;
    font-weight: 500;
    color: #554433;
    margin: 0;
}

.action-buttons {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.btn-action-primary {
    background: linear-gradient(135deg, #b87333 0%, #8b4513 100%);
    color: #ffffff !important;
    padding: 0.75rem 1.6rem;
    border-radius: 30px;
    font-size: 1rem;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(139, 69, 19, 0.3);
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.btn-action-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(139, 69, 19, 0.45);
    background: linear-gradient(135deg, #c88343 0%, #9b5523 100%);
}

.btn-action-secondary {
    background: #ffffff;
    color: #7a461b !important;
    padding: 0.75rem 1.4rem;
    border-radius: 30px;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    border: 1.5px solid #b87333;
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.btn-action-secondary:hover {
    background: #f7f1ea;
    border-color: #8b4513;
    transform: translateY(-2px);
}

.action-left-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex: 1;
    min-width: 320px;
}

.action-qr-group {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    padding-left: 1.5rem;
    border-left: 2px dashed rgba(212, 192, 172, 0.6);
}

.qr-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: #fdfbf7;
    border: 1px solid #e8decb;
    border-radius: 10px;
    padding: 0.55rem 0.75rem 0.6rem 0.75rem;
    transition: all 0.25s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    text-decoration: none;
    cursor: pointer;
}

.qr-box:hover {
    transform: translateY(-3px);
    border-color: #b87333;
    background: #ffffff;
    box-shadow: 0 8px 20px rgba(184, 115, 51, 0.18);
}

.qr-img-wrapper {
    width: 68px;
    height: 68px;
    border-radius: 6px;
    background: #ffffff;
    padding: 3px;
    border: 1px solid #e2d7c9;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qr-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.qr-badge {
    font-size: 0.73rem;
    font-weight: 700;
    color: #7a461b;
    background: rgba(184, 115, 51, 0.12);
    padding: 0.1rem 0.45rem;
    border-radius: 4px;
    margin-top: 0.35rem;
    white-space: nowrap;
}

.qr-link {
    font-size: 0.76rem;
    font-weight: 600;
    color: #b87333;
    text-decoration: none;
    margin-top: 0.25rem;
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    transition: color 0.2s ease;
}

.qr-link:hover {
    color: #8b4513;
    text-decoration: underline;
}

@media (max-width: 900px) {
    .action-qr-group {
        border-left: none;
        border-top: 2px dashed rgba(212, 192, 172, 0.6);
        padding-left: 0;
        padding-top: 1rem;
        width: 100%;
        justify-content: flex-start;
    }
}

/* QR Code 燈箱 (Lightbox Modal) 放大彈窗樣式 */
.qr-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(5px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.qr-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.qr-modal-content {
    background: #ffffff;
    border-radius: 20px;
    padding: 2rem 1.8rem;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
    position: relative;
    transform: scale(0.85);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid #e8decb;
}

.qr-modal-overlay.active .qr-modal-content {
    transform: scale(1);
}

.qr-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: #f4efe8;
    border: none;
    font-size: 1.2rem;
    color: #666;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.qr-modal-close:hover {
    background: #e2d7c9;
    color: #000;
}

.qr-modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #4a3525;
    margin-top: 0;
    margin-bottom: 0.3rem;
}

.qr-modal-subtitle {
    font-size: 0.88rem;
    color: #776655;
    margin-bottom: 1.2rem;
}

.qr-large-frame {
    width: 250px;
    height: 250px;
    margin: 0 auto 1.2rem auto;
    padding: 12px;
    background: #ffffff;
    border: 2px solid #b87333;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(184, 115, 51, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
}

.qr-large-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.qr-modal-actions {
    display: flex;
    gap: 0.8rem;
    justify-content: center;
    margin-top: 1rem;
}

.qr-modal-btn-pdf {
    background: linear-gradient(135deg, #b87333 0%, #8b4513 100%);
    color: #ffffff !important;
    padding: 0.65rem 1.4rem;
    border-radius: 25px;
    font-weight: 700;
    text-decoration: none;
    font-size: 0.95rem;
    box-shadow: 0 4px 12px rgba(139, 69, 19, 0.25);
    transition: all 0.25s ease;
}

.qr-modal-btn-pdf:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(139, 69, 19, 0.4);
}

/* 競賽主旨區塊 (Concept Section) */
.concept-box {
    background: linear-gradient(135deg, rgba(247, 243, 238, 0.95), rgba(238, 228, 216, 0.8));
    border-left: 6px solid #b87333;
    border-radius: 12px;
    padding: 2.2rem 2.5rem;
    margin-bottom: 2.5rem;
    box-shadow: 0 6px 18px rgba(0,0,0,0.04);
}

.concept-title {
    font-size: 1.5rem;
    color: #4a3525;
    margin-top: 0;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.concept-text {
    font-size: 1.05rem;
    line-height: 1.8;
    color: #554433;
    margin: 0;
}

/* 三大競賽組別 (Category Cards) */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.8rem;
    margin-bottom: 2.5rem;
}

.category-card {
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid rgba(212, 192, 172, 0.4);
    overflow: hidden;
    box-shadow: 0 6px 16px rgba(0,0,0,0.04);
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    position: relative;
}

.category-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 28px rgba(139, 69, 19, 0.15);
}

.category-card-header {
    padding: 1.5rem 1.8rem;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cat-creation .category-card-header {
    background: linear-gradient(135deg, #4a6b5d 0%, #2c4238 100%);
}

.cat-craft .category-card-header {
    background: linear-gradient(135deg, #b87333 0%, #7a461b 100%);
}

.cat-newbie .category-card-header {
    background: linear-gradient(135deg, #5c6b73 0%, #343d42 100%);
}

.category-card-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0;
}

.category-card-body {
    padding: 1.8rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.category-desc {
    color: #555;
    font-size: 0.98rem;
    line-height: 1.75;
    margin-bottom: 1.2rem;
}

/* 參賽資格與網絡報名 雙欄 (Eligibility & Steps) */
.dual-section-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 1.8rem;
    margin-bottom: 2.5rem;
}

.info-card {
    background: #ffffff;
    border-radius: 14px;
    padding: 2rem;
    border: 1px solid rgba(212, 192, 172, 0.4);
    box-shadow: 0 6px 16px rgba(0,0,0,0.04);
}

.info-card-title {
    font-size: 1.35rem;
    color: #4a3525;
    margin-top: 0;
    margin-bottom: 1.2rem;
    padding-bottom: 0.6rem;
    border-bottom: 2px solid #e2d7c9;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.info-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.info-list-item {
    position: relative;
    padding-left: 1.6rem;
    margin-bottom: 1rem;
    line-height: 1.65;
    color: #555;
    font-size: 0.96rem;
}

.info-list-item::before {
    content: "✦";
    position: absolute;
    left: 0;
    top: 0;
    color: #b87333;
    font-size: 1.1rem;
}

/* 報名 5 步驟 Step-by-Step 樣式 */
.steps-timeline {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.step-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    background: #faf7f3;
    padding: 0.8rem 1rem;
    border-radius: 8px;
    border-left: 4px solid #b87333;
}

.step-num {
    background: #b87333;
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
}

.step-content {
    font-size: 0.92rem;
    color: #444;
}

.step-title {
    font-weight: 700;
    color: #333;
    margin-bottom: 0.15rem;
}

/* 動態 雙排 (Dual-Row) 辦理/贊助單位 Grid 樣式 */
.organizers-dynamic-section {
    background: linear-gradient(135deg, #f7f3ee 0%, #ece2d5 100%);
    border-radius: 16px;
    padding: 2.2rem;
    border: 1px solid #dfd2be;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.05);
    margin-bottom: 2.5rem;
}

.dual-row-organizer-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.2rem;
    margin-top: 1.2rem;
}

.org-node-card {
    background: #ffffff;
    border: 1px solid #e8decb;
    border-radius: 14px;
    padding: 2.2rem 1.2rem 1.2rem 1.2rem;
    text-align: center;
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    position: relative;
    text-decoration: none;
    min-height: 180px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.org-node-link { cursor: pointer; }

.org-node-card:hover {
    border-color: #b87333;
    background: #ffffff;
    box-shadow: 0 8px 22px rgba(184, 115, 51, 0.14);
    transform: translateY(-4px);
}

.org-node-role {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    font-size: 0.75rem;
    color: #7a461b;
    font-weight: 700;
    letter-spacing: 0.3px;
    background: rgba(184, 115, 51, 0.16);
    padding: 0.15rem 0.55rem;
    border-radius: 6px;
    border: 1px solid rgba(184, 115, 51, 0.2);
}

.org-node-logo-wrapper {
    height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0.2rem 0 0.5rem 0;
    width: 100%;
}

.org-node-logo {
    max-height: 85px;
    max-width: 90%;
    width: auto;
    object-fit: contain;
    transition: transform 0.25s ease;
}

.org-node-card:hover .org-node-logo {
    transform: scale(1.06);
}

.org-node-name {
    font-size: 0.98rem;
    font-weight: 700;
    color: #2c2c2c;
    line-height: 1.35;
    margin-top: 0.2rem;
}

@media (max-width: 992px) {
    .dual-row-organizer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .dual-row-organizer-grid {
        grid-template-columns: 1fr;
    }
    .hero-action-bar {
        flex-direction: column;
        align-items: flex-start;
        padding: 1.2rem;
    }
    .action-buttons {
        width: 100%;
        justify-content: space-between;
    }
    .btn-action-primary, .btn-action-secondary {
        flex: 1;
        text-align: center;
        justify-content: center;
    }
}

/* ==========================================================================
   2026 苗栗國際陶瓷競賽展 - Preview 全套 RWD 樣式擴充 (pre_main.css 精華整合)
   支援 Step Wizard 2x2 網格膠囊、.custom-overlay 浮動 Fixed 置頂視窗、雙排 Header 與全頁面 RWD
   ========================================================================== */

/* 全局防溢出保護 */
html, body {
    max-width: 100vw;
    overflow-x: hidden !important;
}

.main-wrapper {
    max-width: 100vw;
    overflow-x: hidden;
    padding-left: 1rem;
    padding-right: 1rem;
    box-sizing: border-box;
}

/* 雙欄參賽資格與步驟容器 (.dual-section-grid) */
.dual-section-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.8rem;
    margin-bottom: 2.5rem;
}

/* 三大組別卡片網格 (.categories-grid) */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

/* 雙排 6 大辦理與贊助單位 (.dual-row-organizer-grid) */
.dual-row-organizer-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.2rem;
}

.info-card {
    background: var(--background-white, #ffffff);
    padding: 2rem 1.8rem;
    border-radius: var(--border-radius-card, 16px);
    box-shadow: var(--shadow-soft, 0 4px 20px rgba(0,0,0,0.05));
    border: 1px solid rgba(212, 192, 172, 0.4);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* .custom-overlay 與教學彈窗 Fixed 置頂浮動視窗修復 (Floating Modal) */
.custom-overlay {
    display: none;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0, 0, 0, 0.6) !important;
    backdrop-filter: blur(3px);
    z-index: 99999 !important;
    justify-content: center !important;
    align-items: center !important;
    padding: 1rem !important;
    box-sizing: border-box !important;
}

.custom-overlay .custom-alert-box {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    transform: none !important;
    max-width: 650px !important;
    width: 100% !important;
    max-height: 85vh !important;
    overflow-y: auto !important;
    background: #ffffff !important;
    border-radius: 12px !important;
    padding: 1.5rem !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3) !important;
    z-index: 100000 !important;
    margin: auto !important;
}

/* Header Flex Order 桌面/手機對齊系統 */
.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand-logo {
    order: 1;
}

/* 桌面端 (≥ 769px) 視覺呈現：[Logo (1)] -------- [主導覽列 (2)] [語系選單 (3) 最右側] */
@media (min-width: 769px) {
    .nav-collapse {
        order: 2;
        display: flex !important;
        align-items: center;
        margin-left: auto;
        max-height: none !important;
        overflow: visible !important;
        opacity: 1 !important;
        position: static !important;
        background: transparent !important;
        box-shadow: none !important;
        border: none !important;
        padding: 0 !important;
    }

    .header-right-actions {
        order: 3;
        margin-left: 1.2rem;
        display: flex;
        align-items: center;
    }

    .nav-toggle-btn {
        display: none !important;
    }
}

/* 漢堡選單按鈕 (Hamburger Toggle Button) */
.nav-toggle-btn {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    width: 42px;
    height: 42px;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 6px;
    z-index: 110;
    border-radius: 6px;
    transition: background-color 0.2s ease;
    flex-shrink: 0;
}

.nav-toggle-btn:hover,
.nav-toggle-btn:focus {
    background-color: var(--primary-color, rgba(139, 90, 43, 0.1));
    outline: none;
}

.nav-toggle-btn span {
    display: block;
    width: 24px;
    height: 3px;
    background-color: var(--secondary-color, #8b5733);
    border-radius: 3px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.nav-toggle-btn.active span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}
.nav-toggle-btn.active span:nth-child(2) {
    opacity: 0;
}
.nav-toggle-btn.active span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

/* 遮罩背景 Overlay */
.nav-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(2px);
    z-index: 95;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.nav-backdrop.show {
    display: block;
    opacity: 1;
}

/* 手機版 (RWD < 768px) 雙排 Header 佈局 */
@media (max-width: 768px) {
    .header-container {
        position: relative;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.4rem !important;
        padding: 0.65rem 0.8rem !important;
    }

    .brand-logo {
        order: 1 !important;
        width: 100% !important;
        display: flex !important;
        justify-content: flex-start !important;
    }

    .brand-title {
        gap: 0.4rem !important;
        white-space: nowrap;
    }
    .title-main {
        font-size: 0.98rem !important;
        white-space: nowrap;
    }
    .badge-year {
        font-size: 0.75rem !important;
        padding: 0.1rem 0.35rem;
        flex-shrink: 0;
    }
    .title-abbr {
        display: inline-block !important;
        font-size: 0.78rem;
    }

    .header-right-actions {
        order: 2 !important;
        width: 100% !important;
        display: flex !important;
        justify-content: flex-end !important;
        align-items: center !important;
        gap: 0.6rem !important;
        border-top: 1px dashed rgba(212, 192, 172, 0.4) !important;
        padding-top: 0.45rem !important;
    }

    .nav-toggle-btn {
        display: flex !important;
    }

    .lang-dropdown {
        width: auto !important;
        flex: 0 0 auto !important;
        margin: 0 !important;
    }

    .lang-dropdown .dropdown-menu {
        position: absolute !important;
        top: 100% !important;
        right: 0 !important;
        left: auto !important;
        background: #ffffff !important;
        box-shadow: 0 4px 15px rgba(0,0,0,0.15) !important;
        border-radius: 8px !important;
        width: auto !important;
        min-width: 120px !important;
        max-width: 85vw !important;
        white-space: nowrap !important;
        z-index: 200 !important;
    }

    .nav-collapse {
        order: 3 !important;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: var(--background-white, #ffffff);
        border-bottom: 3px solid var(--secondary-color, #8b5733);
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
        display: flex;
        flex-direction: column;
        padding: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease;
        opacity: 0;
        z-index: 100;
    }

    .nav-collapse.open {
        max-height: 80vh;
        overflow-y: auto;
        opacity: 1;
        padding: 0.75rem 1rem 1.25rem 1rem;
    }

    .main-nav {
        width: 100%;
    }
    .main-nav .nav-list {
        flex-direction: column;
        width: 100%;
        gap: 0.35rem;
    }
    .nav-item {
        width: 100%;
    }
    .nav-item a {
        display: block;
        width: 100%;
        padding: 0.75rem 1rem;
        font-size: 1rem;
        border-radius: 8px;
        text-align: left;
    }

    .btn-apply-nav {
        text-align: center !important;
        margin-top: 0.25rem;
    }

    .main-nav .nav-item.dropdown {
        position: relative;
    }
    .main-nav .nav-item.dropdown:hover .dropdown-menu {
        display: none;
    }

    .main-nav .dropdown-toggle {
        display: flex !important;
        justify-content: space-between;
        align-items: center;
    }

    .main-nav .dropdown-menu {
        position: static !important;
        display: none;
        box-shadow: none !important;
        background-color: rgba(139, 90, 43, 0.05) !important;
        border-radius: 8px;
        margin-top: 0.25rem;
        padding: 0.25rem 0 !important;
        width: 100% !important;
    }

    .main-nav .nav-item.dropdown.open .dropdown-menu {
        display: block !important;
        animation: fadeIn 0.25s ease;
    }

    .main-nav .dropdown-menu li a {
        padding: 0.65rem 1.5rem !important;
        font-size: 0.92rem;
    }

    .main-form-card {
        padding: 1.25rem 0.85rem !important;
    }

    .wizard-steps {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 0.5rem !important;
        overflow-x: visible !important;
        white-space: normal !important;
        flex-wrap: wrap !important;
        padding: 0.5rem !important;
        margin-bottom: 1.25rem !important;
        border-radius: 10px !important;
        background: #fdfbf7 !important;
        border: 1px solid #e8decb !important;
    }

    .wizard-steps .step-item {
        width: 100% !important;
        min-width: 0 !important;
        flex: none !important;
        font-size: 0.78rem !important;
        line-height: 1.35 !important;
        padding: 0.55rem 0.35rem !important;
        border-radius: 8px !important;
        border-bottom: none !important;
        background: rgba(139, 90, 43, 0.05);
        color: #776655;
        text-align: center !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        box-sizing: border-box !important;
    }

    .wizard-steps .step-item.active {
        background: var(--secondary-color, #8b5733) !important;
        color: #ffffff !important;
        font-weight: bold;
        box-shadow: 0 3px 8px rgba(139, 90, 43, 0.3);
    }

    .preview-hero-container {
        border-radius: 10px;
        overflow: hidden;
        margin-bottom: 1.2rem;
    }

    .hero-action-bar {
        padding: 1.2rem 1rem !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 1.2rem !important;
        margin-bottom: 1.8rem !important;
        border-radius: 12px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .action-left-container {
        min-width: 0 !important;
        width: 100% !important;
        gap: 0.85rem !important;
    }

    .action-buttons {
        flex-direction: column !important;
        width: 100% !important;
        gap: 0.6rem !important;
    }

    .btn-action-primary,
    .btn-action-secondary {
        width: 100% !important;
        justify-content: center !important;
        box-sizing: border-box !important;
        padding: 0.75rem 1rem !important;
        font-size: 0.95rem !important;
        text-align: center !important;
    }

    .action-qr-group {
        padding-left: 0 !important;
        border-left: none !important;
        border-top: 1px dashed rgba(212, 192, 172, 0.6) !important;
        padding-top: 1rem !important;
        justify-content: space-around !important;
        width: 100% !important;
        gap: 0.8rem !important;
    }

    .qr-box {
        flex: 1;
        min-width: 120px;
        max-width: 160px;
        padding: 0.5rem !important;
    }

    .categories-grid,
    .dual-section-grid,
    .dual-row-organizer-grid {
        grid-template-columns: 1fr !important;
        gap: 1.2rem !important;
    }

    .info-card {
        padding: 1.2rem 1rem !important;
    }

    .responsive-table-wrapper {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin-bottom: 1rem;
    }
}

/* 桌面端 (一般模式 min-width: 992px) 最大寬度 1200px 居中約束 */
@media (min-width: 992px) {
    .header-container,
    .main-form-card,
    .preview-hero-container,
    .hero-action-bar,
    .concept-box,
    .dual-section-grid,
    .organizers-dynamic-section,
    .footer-container,
    .card-section {
        max-width: 1200px !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }
}


