/* 全局樣式 */
:root {
    --primary-color: #4285f4; /* Google藍色 */
    --secondary-color: #34a853; /* Google綠色 */
    --accent-color: #ea4335; /* Google紅色 */
    --light-color: #fbbc05; /* Google黃色 */
    --dark-color: #333333;
    --light-gray: #f5f5f5;
    --medium-gray: #e0e0e0;
    --text-color: #333333;
    --text-light: #666666;
    --white: #ffffff;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--white);
}

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

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: var(--transition);
}

a:hover {
    color: var(--secondary-color);
}

ul {
    list-style: none;
}

button {
    cursor: pointer;
    border: none;
    outline: none;
    background: none;
    transition: var(--transition);
}

.primary-btn {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 12px 24px;
    border-radius: 4px;
    font-weight: 600;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    box-shadow: var(--shadow);
}

.primary-btn:hover {
    background-color: #3367d6; /* 深藍色 */
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* 頂部導航欄 */
header {
    background-color: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 15px 0;
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.logo-text {
    color: var(--white);
    font-weight: bold;
    font-size: 18px;
}

.logo h1 {
    font-size: 1.5rem;
    color: var(--dark-color);
    margin: 0;
}

nav ul {
    display: flex;
    gap: 20px;
}

nav ul li a {
    color: var(--text-color);
    font-weight: 500;
    padding: 5px 10px;
    border-radius: 4px;
    transition: var(--transition);
}

nav ul li a:hover {
    color: var(--primary-color);
    background-color: rgba(66, 133, 244, 0.1);
}

.header-buttons {
    display: flex;
    gap: 10px;
}

.header-buttons button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color);
    background-color: var(--white);
    transition: var(--transition);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.header-buttons button:hover {
    background-color: var(--light-gray);
    color: var(--primary-color);
    transform: translateY(-2px);
}

/* 主要內容 */
main {
    padding: 40px 0;
}

.hero {
    text-align: center;
    margin-bottom: 50px;
    padding: 40px 20px;
    background: linear-gradient(135deg, rgba(66, 133, 244, 0.1), rgba(52, 168, 83, 0.1));
    border-radius: 10px;
}

.hero h2 {
    font-size: 2.5rem;
    margin-bottom: 15px;
    color: var(--dark-color);
}

.hero p {
    font-size: 1.2rem;
    color: var(--text-light);
    max-width: 700px;
    margin: 0 auto;
}

/* 計算器部分 */
.calculator-section {
    margin-bottom: 60px;
}

.calculator-section h2 {
    text-align: center;
    margin-bottom: 30px;
    color: var(--dark-color);
}

.calculator-container {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    background-color: var(--white);
    border-radius: 10px;
    box-shadow: var(--shadow);
    padding: 30px;
}

.calculator-form {
    flex: 1;
    min-width: 300px;
}

.calculator-results {
    flex: 1;
    min-width: 300px;
    background-color: var(--light-gray);
    padding: 25px;
    border-radius: 8px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-color);
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--medium-gray);
    border-radius: 4px;
    font-size: 1rem;
    transition: var(--transition);
}

.form-group input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(66, 133, 244, 0.2);
    outline: none;
}

.input-with-currency {
    position: relative;
}

.currency-symbol {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
}

.input-with-currency input {
    padding-left: 30px;
}

.calculator-results h3 {
    margin-bottom: 20px;
    color: var(--dark-color);
    text-align: center;
}

.result-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--medium-gray);
}

.result-item:last-child {
    border-bottom: none;
}

.result-item span:first-child {
    color: var(--text-light);
}

.result-item span:last-child {
    font-weight: 600;
    color: var(--primary-color);
}

/* 工具說明框 */
.tools-section {
    margin-bottom: 60px;
}

.tools-section h2 {
    text-align: center;
    margin-bottom: 30px;
    color: var(--dark-color);
}

.tool-boxes {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.tool-box {
    background-color: var(--white);
    border-radius: 10px;
    box-shadow: var(--shadow);
    padding: 25px;
    transition: var(--transition);
    display: flex;
    align-items: flex-start;
    gap: 20px;
}

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

.tool-icon {
    width: 60px;
    height: 60px;
    background-color: rgba(66, 133, 244, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 1.5rem;
}

.tool-box:nth-child(2) .tool-icon {
    background-color: rgba(52, 168, 83, 0.1);
    color: var(--secondary-color);
}

.tool-box:nth-child(3) .tool-icon {
    background-color: rgba(234, 67, 53, 0.1);
    color: var(--accent-color);
}

.tool-box h3 {
    margin-bottom: 10px;
    color: var(--dark-color);
}

.tool-box p {
    color: var(--text-light);
    line-height: 1.6;
}

/* 詳細說明框 */
.details-section {
    margin-bottom: 60px;
}

.details-section h2 {
    text-align: center;
    margin-bottom: 30px;
    color: var(--dark-color);
}

.detail-boxes {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.detail-box {
    background-color: var(--white);
    border-radius: 10px;
    box-shadow: var(--shadow);
    padding: 25px;
    transition: var(--transition);
}

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

.detail-box h3 {
    margin-bottom: 15px;
    color: var(--dark-color);
    position: relative;
    padding-left: 20px;
}

.detail-box h3::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 10px;
    background-color: var(--primary-color);
    border-radius: 50%;
}

.detail-box:nth-child(2) h3::before {
    background-color: var(--secondary-color);
}

.detail-box:nth-child(3) h3::before {
    background-color: var(--accent-color);
}

.detail-box:nth-child(4) h3::before {
    background-color: var(--light-color);
}

.detail-box:nth-child(5) h3::before {
    background-color: #9c27b0; /* 紫色 */
}

.detail-box p {
    color: var(--text-light);
    line-height: 1.6;
}

/* 頁腳 */
footer {
    background-color: var(--dark-color);
    color: var(--white);
    padding: 50px 0 20px;
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    margin-bottom: 30px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-logo .logo-icon {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.footer-logo h3 {
    color: var(--white);
    margin: 0;
}

.footer-links {
    flex: 1;
}

.footer-links h4 {
    color: var(--white);
    margin-bottom: 15px;
    position: relative;
    display: inline-block;
}

.footer-links h4::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -5px;
    width: 100%;
    height: 2px;
    background-color: var(--primary-color);
}

.footer-links ul {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 20px;
}

.footer-links ul li a {
    color: var(--medium-gray);
    transition: var(--transition);
}

.footer-links ul li a:hover {
    color: var(--white);
}

.copyright {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--medium-gray);
    font-size: 0.9rem;
}

/* 回到頂部/底部按鈕 */
.scroll-buttons {
    position: fixed;
    right: 20px;
    bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 999;
}

.scroll-buttons button {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    transition: var(--transition);
}

.scroll-buttons button:hover {
    background-color: var(--secondary-color);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

/* 分享彈窗 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1001;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: var(--white);
    border-radius: 10px;
    padding: 30px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    position: relative;
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
    transition: var(--transition);
}

.close-modal:hover {
    color: var(--accent-color);
}

.modal-content h3 {
    margin-bottom: 15px;
    color: var(--dark-color);
}

.share-link {
    display: flex;
    margin: 20px 0;
}

.share-link input {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid var(--medium-gray);
    border-radius: 4px 0 0 4px;
    font-size: 0.9rem;
}

.share-link button {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 0 20px;
    border-radius: 0 4px 4px 0;
    font-weight: 500;
}

.share-link button:hover {
    background-color: #3367d6;
}

.share-description {
    margin-top: 15px;
    padding: 15px;
}

/* 自定義提示框 */
.toast-notification {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
}

.toast-notification.fade-out {
    opacity: 0;
    transform: translate(-50%, -20px);
}
    background-color: var(--light-gray);
    border-radius: 4px;
}

.share-description p {
    color: var(--text-light);
    font-size: 0.9rem;
    line-height: 1.5;
}

.copy-success {
    display: none;
    margin-top: 15px;
    padding: 10px;
    background-color: var(--secondary-color);
    color: var(--white);
    border-radius: 4px;
    text-align: center;
    font-weight: 500;
}

/* 響應式設計 */
@media (max-width: 992px) {
    .hero h2 {
        font-size: 2rem;
    }
    
    .hero p {
        font-size: 1.1rem;
    }
    
    .calculator-container {
        flex-direction: column;
    }
    
    .tool-box {
        flex-direction: column;
    }
    
    .tool-icon {
        margin-bottom: 15px;
    }
}

@media (max-width: 768px) {
    header .container {
        flex-direction: column;
        gap: 15px;
    }
    
    nav ul {
        gap: 10px;
    }
    
    .hero {
        padding: 30px 15px;
    }
    
    .hero h2 {
        font-size: 1.8rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 30px;
    }
}

@media (max-width: 576px) {
    .logo h1 {
        font-size: 1.2rem;
    }
    
    nav ul {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .calculator-section h2,
    .tools-section h2,
    .details-section h2 {
        font-size: 1.5rem;
    }
    
    .calculator-form,
    .calculator-results {
        padding: 20px 15px;
    }
    
    .scroll-buttons {
        right: 10px;
        bottom: 10px;
    }
    
    .scroll-buttons button {
        width: 40px;
        height: 40px;
    }
}