/* CSS Variables */
:root {
    --primary-color: #1a5f7a;
    --primary-dark: #134b5f;
    --primary-light: #2980b9;
    --secondary-color: #c41e3a;
    --accent-color: #d4af37;
    --background-color: #f8f9fa;
    --card-background: #ffffff;
    --text-primary: #2c3e50;
    --text-secondary: #5d6d7e;
    --border-color: #e0e0e0;
    --success-color: #27ae60;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
    --border-radius: 12px;
    --transition: all 0.3s ease;
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang TC", "Microsoft JhengHei", "Noto Sans TC", sans-serif;
    background-color: var(--background-color);
    color: var(--text-primary);
    line-height: 1.6;
}

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

/* Typography */
h1, h2, h3, h4 {
    font-weight: 600;
    line-height: 1.3;
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

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

a:hover {
    color: var(--primary-dark);
}

/* Navigation */
.navbar {
    background: var(--card-background);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 20px;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
}

.logo span {
    color: var(--secondary-color);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 500;
    transition: var(--transition);
    padding: 0.5rem 0;
    position: relative;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary-color);
}

.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary-color);
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 10px;
    background: none;
    border: none;
    cursor: pointer;
}

.mobile-menu-btn span {
    display: block;
    width: 25px;
    height: 3px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: var(--transition);
}

/* Breadcrumbs */
.breadcrumbs {
    background: var(--card-background);
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 0;
}

.breadcrumbs ol {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.breadcrumbs li {
    display: flex;
    align-items: center;
}

.breadcrumbs li:not(:last-child)::after {
    content: '›';
    margin-left: 0.5rem;
    color: var(--text-secondary);
}

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

.breadcrumbs a:hover {
    text-decoration: underline;
}

.breadcrumbs li:last-child span {
    color: var(--text-secondary);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 4rem 0;
    text-align: center;
}

.hero h1 {
    margin-bottom: 1rem;
}

.subtitle {
    font-size: 1.25rem;
    opacity: 0.9;
}

/* Intro Section */
.intro-section {
    padding: 3rem 0;
    background: var(--card-background);
}

.intro-content {
    max-width: 900px;
    margin: 0 auto;
}

.intro-content h2 {
    text-align: left;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.intro-content p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

.intro-content p:last-child {
    margin-bottom: 0;
}

.intro-content strong {
    color: var(--text-primary);
}

/* Converter Section */
.converter-section {
    padding: 4rem 0;
    background: var(--background-color);
}

.converter-card {
    background: var(--card-background);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    padding: 2.5rem;
    max-width: 800px;
    margin: 0 auto;
}

.input-group {
    margin-bottom: 2rem;
}

.input-group label {
    display: block;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.input-wrapper {
    display: flex;
    gap: 1rem;
    align-items: stretch;
}

.currency-symbol {
    display: flex;
    align-items: center;
    padding: 0 1rem;
    background: var(--background-color);
    border: 2px solid var(--border-color);
    border-right: none;
    border-radius: var(--border-radius) 0 0 var(--border-radius);
    font-weight: 600;
    color: var(--text-secondary);
}

.input-wrapper input {
    flex: 1;
    padding: 1rem 1.25rem;
    font-size: 1.25rem;
    border: 2px solid var(--border-color);
    border-left: none;
    border-radius: 0;
    outline: none;
    transition: var(--transition);
}

.input-wrapper input:focus {
    border-color: var(--primary-color);
}

.btn-primary {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    background: var(--primary-color);
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    color: var(--primary-color);
    background: transparent;
    border: 2px solid var(--primary-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    margin-top: 1.5rem;
}

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

.btn-outline {
    display: inline-block;
    padding: 0.875rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary-color);
    background: transparent;
    border: 2px solid var(--primary-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
}

/* Result Area */
.result-area {
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.result-item {
    margin-bottom: 1.5rem;
}

.result-item h3 {
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.result-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    padding: 1rem;
    background: var(--background-color);
    border-radius: 8px;
    word-break: break-word;
}

.result-value.chinese {
    font-size: 1.75rem;
    color: var(--secondary-color);
}

.result-value.english {
    font-size: 1.25rem;
    color: var(--primary-color);
}

/* FAQ Section */
.faq-section {
    padding: 4rem 0;
    background: var(--card-background);
}

.user-guide {
    max-width: 900px;
    margin: 0 auto 2rem;
    padding: 1.5rem;
    background: var(--background-color);
    border-radius: var(--border-radius);
    border-left: 4px solid var(--primary-color);
}

.user-guide h3 {
    color: var(--primary-color);
    margin-bottom: 0.75rem;
}

.user-guide p {
    color: var(--text-secondary);
    line-height: 1.8;
}

.faq-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    max-width: 900px;
    margin: 0 auto;
}

.faq-item {
    background: var(--background-color);
    padding: 1.5rem;
    border-radius: var(--border-radius);
}

.faq-item h4 {
    color: var(--text-primary);
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
}

.faq-item p {
    color: var(--text-secondary);
    line-height: 1.8;
}

/* Guide Section */
.guide-section {
    padding: 4rem 0;
    background: var(--background-color);
}

.guide-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.guide-card {
    background: var(--card-background);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.guide-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.guide-icon {
    width: 48px;
    height: 48px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.guide-card p {
    color: var(--text-secondary);
}

/* Reference Section */
.reference-section {
    padding: 4rem 0;
    background: var(--card-background);
}

.reference-table {
    display: flex;
    gap: 2rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.reference-table table {
    background: var(--card-background);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    border-collapse: collapse;
    overflow: hidden;
}

.reference-table th,
.reference-table td {
    padding: 1rem 1.5rem;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.reference-table th {
    background: var(--primary-color);
    color: white;
    font-weight: 600;
}

.reference-table tr:last-child td {
    border-bottom: none;
}

.reference-table tr:hover td {
    background: var(--background-color);
}

/* Tips Section */
.tips-section {
    padding: 4rem 0;
    background: var(--background-color);
}

.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.tip-card {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.tip-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.tip-card h3 {
    margin-bottom: 0.75rem;
}

.tip-card p {
    opacity: 0.9;
}

/* Latest Articles Section */
.latest-articles {
    padding: 4rem 0;
    background: var(--card-background);
}

.section-subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-top: -1rem;
    margin-bottom: 2rem;
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.article-card {
    background: var(--background-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: var(--transition);
}

.article-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.article-content {
    padding: 1.5rem;
}

.article-category {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--primary-color);
    color: white;
    font-size: 0.8rem;
    font-weight: 500;
    border-radius: 20px;
    margin-bottom: 0.75rem;
}

.article-card h3 {
    margin-bottom: 0.75rem;
}

.article-card h3 a {
    color: var(--text-primary);
    text-decoration: none;
}

.article-card h3 a:hover {
    color: var(--primary-color);
}

.article-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

.read-more {
    color: var(--primary-color);
    font-weight: 500;
    text-decoration: none;
}

.read-more:hover {
    text-decoration: underline;
}

.view-all-articles {
    text-align: center;
}

/* About Section */
.about-section {
    padding: 4rem 0;
    background: var(--background-color);
}

.about-intro {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 3rem;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    max-width: 800px;
    margin: 0 auto;
}

.team-card {
    background: var(--card-background);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    text-align: center;
    transition: var(--transition);
}

.team-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.team-avatar {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 auto 1rem;
}

.team-role {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* SEO Section */
.seo-section {
    padding: 4rem 0;
    background: var(--background-color);
}

.seo-content {
    max-width: 900px;
    margin: 0 auto;
    text-align: left;
}

.seo-content p {
    margin-bottom: 1.25rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

.seo-content p:last-child {
    margin-bottom: 0;
}

/* Page Hero (for secondary pages) */
.page-hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 3rem 0;
    text-align: center;
}

.page-hero h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.page-hero p {
    opacity: 0.9;
}

/* Page Content */
.page-content {
    padding: 3rem 0;
    background: var(--card-background);
}

.page-content .container {
    max-width: 900px;
}

.page-content h2 {
    text-align: left;
    font-size: 1.5rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.page-content h2:first-child {
    margin-top: 0;
}

.page-content p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

.page-content ul,
.page-content ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
    color: var(--text-secondary);
}

.page-content li {
    margin-bottom: 0.5rem;
    line-height: 1.8;
}

/* Blog Page Styles */
.blog-hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 3rem 0;
    text-align: center;
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    padding: 3rem 0;
}

.blog-card {
    background: var(--card-background);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: var(--transition);
}

.blog-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.blog-card-content {
    padding: 1.5rem;
}

.blog-card-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.blog-card h3 {
    margin-bottom: 0.75rem;
}

.blog-card h3 a {
    color: var(--text-primary);
    text-decoration: none;
}

.blog-card h3 a:hover {
    color: var(--primary-color);
}

.blog-card p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

/* Blog Post Styles */
.blog-post {
    padding: 3rem 0;
    background: var(--card-background);
}

.blog-post .container {
    max-width: 800px;
}

.blog-post-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.blog-post-content h2 {
    text-align: left;
    font-size: 1.5rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.blog-post-content p {
    margin-bottom: 1.25rem;
    line-height: 1.9;
    color: var(--text-secondary);
}

.blog-post-content ul,
.blog-post-content ol {
    margin-bottom: 1.25rem;
    padding-left: 1.5rem;
    color: var(--text-secondary);
}

.blog-post-content li {
    margin-bottom: 0.5rem;
    line-height: 1.8;
}

.blog-post-content strong {
    color: var(--text-primary);
}

.cta-box {
    background: var(--background-color);
    border-left: 4px solid var(--primary-color);
    padding: 1.5rem;
    margin: 2rem 0;
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
}

.cta-box p {
    margin-bottom: 0;
}

.cta-box a {
    font-weight: 600;
}

/* Contact Form */
.contact-form {
    max-width: 600px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 1.5rem;
}

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

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    outline: none;
    transition: var(--transition);
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--primary-color);
}

.form-group textarea {
    min-height: 150px;
    resize: vertical;
}

/* Footer */
footer {
    background: var(--text-primary);
    color: white;
    padding: 3rem 0 0;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    padding-bottom: 2rem;
}

.footer-brand .logo {
    color: white;
}

.footer-brand .logo span {
    color: var(--accent-color);
}

.footer-brand p {
    margin-top: 0.5rem;
    opacity: 0.8;
}

.footer-links h4,
.footer-contact h4 {
    margin-bottom: 1rem;
    color: var(--accent-color);
}

.footer-links ul {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: white;
    text-decoration: none;
    opacity: 0.8;
    transition: var(--transition);
}

.footer-links a:hover {
    opacity: 1;
}

.footer-contact p {
    opacity: 0.8;
}

.contact-email {
    color: var(--accent-color);
    font-weight: 500;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 1.5rem 0;
    text-align: center;
    opacity: 0.7;
}

/* Responsive */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--card-background);
        flex-direction: column;
        padding: 1rem;
        gap: 0;
        box-shadow: var(--shadow-md);
    }

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

    .nav-links li {
        border-bottom: 1px solid var(--border-color);
    }

    .nav-links li:last-child {
        border-bottom: none;
    }

    .nav-links a {
        display: block;
        padding: 1rem;
    }

    .input-wrapper {
        flex-direction: column;
    }

    .currency-symbol {
        border-right: 2px solid var(--border-color);
        border-bottom: none;
        border-radius: var(--border-radius) var(--border-radius) 0 0;
        justify-content: flex-start;
    }

    .input-wrapper input {
        border-left: 2px solid var(--border-color);
        border-radius: 0;
    }

    .btn-primary {
        border-radius: 0 0 var(--border-radius) var(--border-radius);
        width: 100%;
    }

    .converter-card {
        padding: 1.5rem;
    }

    .result-value {
        font-size: 1.25rem;
    }

    .result-value.chinese {
        font-size: 1.5rem;
    }

    .result-value.english {
        font-size: 1.1rem;
    }

    .reference-table {
        flex-direction: column;
        align-items: center;
    }

    .reference-table table {
        width: 100%;
        max-width: 400px;
    }

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

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

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-area {
    animation: fadeIn 0.3s ease;
}

/* Error State */
.error {
    color: var(--secondary-color);
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.input-wrapper input.error {
    border-color: var(--secondary-color);
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--success-color);
    color: white;
    padding: 1rem 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    z-index: 1001;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translate(-50%, 20px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}
