/* FF14.tw 共用樣式 */

:root {
    --primary-color: #4a90e2;
    --secondary-color: #f39c12;
    --accent-color: #e74c3c;
    --dark-color: #2c3e50;
    --light-color: #ecf0f1;
    --text-color: #333;
    --border-color: #ddd;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --gradient-bg: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Noto Sans TC', 'Microsoft JhengHei', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: #f5f7fa;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 標題樣式 */
h1, h2, h3 {
    margin-bottom: 1rem;
    font-weight: 600;
}

h1 {
    font-size: 2.5rem;
    color: var(--dark-color);
}

h2 {
    font-size: 2rem;
    color: var(--primary-color);
}

h3 {
    font-size: 1.5rem;
}

/* 頁首 */
.header {
    background: var(--gradient-bg);
    color: white;
    padding: 1rem 0;
    box-shadow: var(--shadow);
}

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

.logo {
    font-size: 1.8rem;
    font-weight: bold;
    text-decoration: none;
    color: white;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-main {
    font-size: 1.8rem;
}

.logo-separator {
    font-size: 1.4rem;
    opacity: 0.7;
}

.logo-tool {
    font-size: 1.4rem;
    font-weight: normal;
}

/* 工具頁面標題隱藏 */
.tool-page-title {
    display: none;
}

/* 工具頁面描述文字置中 */
.description {
    text-align: center;
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.nav {
    display: flex;
    gap: 2rem;
}

.nav a {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: background-color 0.3s;
}

.nav a:hover {
    background-color: rgba(255,255,255,0.2);
}

.nav a.active {
    background-color: rgba(255,255,255,0.3);
    font-weight: 600;
}

/* 下拉選單 */
.nav-dropdown {
    position: relative;
    display: inline-block;
    vertical-align: top;
}

.nav-dropdown-content {
    display: none;
    position: absolute;
    background-color: white;
    min-width: 180px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    border-radius: 8px;
    z-index: 1000;
    top: 100%;
    left: 0;
    margin-top: 0.2rem;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
}

.nav-dropdown-content a {
    color: var(--text-color) !important;
    padding: 0.75rem 1rem;
    text-decoration: none;
    display: block;
    transition: background-color 0.3s;
    border-radius: 0;
}

.nav-dropdown-content a:hover {
    background-color: var(--light-color);
}

.nav-dropdown:hover .nav-dropdown-content {
    display: block;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.nav-dropdown-content:hover {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.nav-dropdown > a {
    display: inline-block;
    vertical-align: top;
}

.nav-dropdown > a::after {
    content: ' ▼';
    font-size: 0.8rem;
    margin-left: 0.5rem;
}

/* 主要內容區域 */
.main {
    min-height: calc(100vh - 120px);
    padding: 2rem 0;
}

/* 工具卡片 */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.tool-card {
    background: white;
    border-radius: 10px;
    padding: 2rem;
    box-shadow: var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s;
    text-decoration: none;
    color: inherit;
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.tool-icon {
    width: 60px;
    height: 60px;
    background: var(--gradient-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    font-size: 1.5rem;
    color: white;
}

.tool-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--dark-color);
}

.tool-description {
    color: #666;
    line-height: 1.5;
}

/* 按鈕樣式 */
.btn {
    display: inline-block;
    padding: 0.8rem 2rem;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s;
    font-size: 1rem;
}

.btn:hover {
    background: #357abd;
}

.btn-secondary {
    background: var(--secondary-color);
}

.btn-secondary:hover {
    background: #d68910;
}

/* 頁尾 */
.footer {
    background: var(--dark-color);
    color: white;
    text-align: center;
    padding: 1.5rem 0;
    margin-top: auto;
}

/* 漢堡選單按鈕 */
.hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1002;
}

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

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

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

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

/* 響應式設計 */
@media (max-width: 768px) {
    .header .container {
        position: relative;
        padding-right: 60px; /* 為漢堡選單預留空間 */
    }
    
    .hamburger {
        display: block;
        position: absolute;
        right: 20px;
        top: 50%;
        transform: translateY(-50%);
    }
    
    .nav {
        display: none;
        position: fixed;
        top: 0;
        right: -100%;
        width: 250px;
        height: 100vh;
        background: var(--gradient-bg);
        flex-direction: column;
        padding: 4rem 2rem 2rem;
        gap: 1rem;
        box-shadow: -5px 0 15px rgba(0,0,0,0.3);
        transition: right 0.3s ease;
        z-index: 1001;
        overflow-y: auto;
    }
    
    .nav.active {
        display: flex;
        right: 0;
    }
    
    .nav a {
        width: 100%;
        text-align: left;
        padding: 0.75rem 1rem;
        border-radius: 5px;
    }
    
    .nav-dropdown {
        width: 100%;
    }
    
    .nav-dropdown-content {
        position: static;
        display: none;
        width: 100%;
        box-shadow: none;
        background-color: rgba(255,255,255,0.1);
        margin-top: 0.5rem;
        margin-left: 1rem;
        opacity: 1;
        transform: none;
        pointer-events: auto;
    }
    
    .nav-dropdown.active .nav-dropdown-content {
        display: block;
    }
    
    .nav-dropdown-content a {
        color: white !important;
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    
    .nav-dropdown-content a:hover {
        background-color: rgba(255,255,255,0.2);
    }
    
    /* 遮罩層 */
    .nav-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0,0,0,0.5);
        z-index: 1000;
    }
    
    .nav-overlay.active {
        display: block;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .logo {
        font-size: 1.4rem;
        display: flex;
        align-items: center;
        gap: 0.3rem;
    }
    
    .logo-main {
        font-size: 1.4rem;
    }
    
    .logo-separator {
        font-size: 1.2rem;
    }
    
    .logo-tool {
        font-size: 1.2rem;
    }
    
    .tools-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* 小螢幕調整 */
@media (max-width: 480px) {
    .logo {
        font-size: 1.2rem;
        gap: 0.2rem;
    }
    
    .logo-main {
        font-size: 1.2rem;
    }
    
    .logo-separator {
        font-size: 1rem;
    }
    
    .logo-tool {
        font-size: 1rem;
    }
    
    .header .container {
        padding-right: 50px;
    }
}