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

html {
    scroll-behavior: smooth;
}

body {
    font-family: "Noto Sans TC", "Microsoft JhengHei", "PingFang TC", -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 16px;
    line-height: 1.9;
    color: #333;
    background: #fff;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul {
    list-style: none;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

.container-narrow {
    max-width: 860px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ===== Header ===== */
.site-header {
    background: transparent;
    border-bottom: 0;
    padding: 0;
    margin-bottom: 24px;
    position: relative;
}

.site-header::before {
    content: none;
}

.header-top {
    display: none;
}

.header-logo-area {
    display: flex;
    grid-column: 1;
    justify-self: start;
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding-right: 0;
    text-align: left;
    position: static;
    flex: 0 1 auto;
    max-width: min(100%, 420px);
}

.header-logo-area > a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: auto;
    height: auto;
    margin: 0;
}

.header-logo-area img {
    width: 48px !important;
    height: auto;
    margin: 0 !important;
}

.header-brand-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.site-title {
    font-size: clamp(1.3rem, 1.6vw, 1.6rem);
    font-weight: 700;
    color: #22372f;
    margin: 0;
    line-height: 1.15;
    letter-spacing: 0.01em;
}

.site-subtitle {
    font-size: 0.84rem;
    color: #8d846f;
    font-weight: 400;
    margin-top: 2px;
    line-height: 1.4;
}

/* ===== Navigation ===== */
.site-nav {
    background: transparent;
    border-top: 0;
    border-bottom: 1px solid #e6dfd3;
    box-shadow: none;
    backdrop-filter: none;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.site-nav .container {
    max-width: none;
    margin: 0;
    padding: 0 24px;
}

.nav-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 20px;
    min-height: 74px;
    padding: 8px 24px;
    position: relative;
}

.nav-center {
    display: flex;
    grid-column: 2;
    justify-content: center;
    min-width: 0;
}

.nav-menu {
    display: flex;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 4px;
    min-width: 0;
}

.menu-toggle {
    grid-column: 3;
    justify-self: end;
}

.nav-menu > li {
    position: relative;
}

.nav-menu > li > a {
    display: block;
    padding: 10px 14px;
    font-size: 0.92rem;
    color: #4c473f;
    font-weight: 600;
    white-space: nowrap;
    border-radius: 0;
}

.nav-menu > li:hover > a,
.nav-menu > li.active > a {
    color: #2f6e5a;
    background: transparent;
}

/* Submenu */
.sub-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background: #fff;
    min-width: 180px;
    box-shadow: none;
    z-index: 1001;
    border: 1px solid #ece6db;
    border-radius: 0;
    padding: 6px 0;
    overflow: hidden;
}

.nav-menu > li:hover .sub-menu {
    display: block;
}

.sub-menu li a {
    display: block;
    padding: 10px 18px;
    font-size: 0.9rem;
    color: #615c52;
    border-bottom: 0;
}

.sub-menu li a:hover {
    background: #f4f8f3;
    color: #2f6e5a;
}

.has-sub > a::after {
    content: ' ▾';
    font-size: 0.72rem;
    opacity: 0.42;
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    cursor: pointer;
    position: static;
    flex: 0 0 auto;
    padding: 8px 10px 8px 0;
}

.menu-toggle span {
    display: block;
    width: 25px;
    height: 2px;
    background: #333;
    margin: 5px 0;
}

/* ===== Home Page - Hero Slider (Placeholder) ===== */
.home-hero {
    margin-bottom: 40px;
}

.hero-featured {
    position: relative;
    height: 500px;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: flex-end;
}

.hero-content {
    background: rgba(255, 255, 255, 0.9);
    padding: 30px;
    margin: 40px;
    max-width: 600px;
    border-left: 5px solid #7ab796;
}

.hero-content .cat {
    color: #2ecc71;
    font-size: 0.8rem;
    text-transform: uppercase;
    margin-bottom: 10px;
    display: block;
}

.hero-content h2 {
    font-size: 1.8rem;
    margin-bottom: 15px;
    line-height: 1.4;
}

/* ===== Post Grid ===== */
.post-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
}

.post-card {
    background: #fff;
    border-bottom: 1px solid #eee;
    padding-bottom: 20px;
}

.post-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    margin-bottom: 15px;
    border-radius: 4px;
}

.post-card .cat {
    color: #7ab796;
    font-size: 0.8rem;
    margin-bottom: 10px;
    display: block;
}

.post-card h3 {
    font-size: 1.2rem;
    line-height: 1.5;
    margin-bottom: 10px;
}

.post-card .excerpt {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ===== Article Page ===== */
.post-header {
    text-align: center;
    padding: 40px 0;
}

.post-header h1 {
    font-size: 2rem;
    margin-bottom: 20px;
}

.post-meta {
    font-size: 0.9rem;
    color: #aaa;
}

.post-meta .author-name,
.post-meta time {
    color: #777;
}

.post-content {
    margin-bottom: 50px;
}

.post-content h2 {
    color: #f39c12;
    margin: 40px 0 20px;
}

/* ===== Sidebar (Simplified for now) ===== */
.main-with-sidebar {
    display: flex;
    gap: 40px;
}

.main-col {
    flex: 1;
}

.sidebar {
    width: 300px;
}

.widget {
    margin-bottom: 40px;
}

.widget-title {
    font-size: 1.1rem;
    border-bottom: 2px solid #7ab796;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

/* ===== Footer ===== */
.site-footer {
    background: transparent;
    color: #4e4a42;
    padding: 8px 0 18px;
    text-align: left;
    border-top: 0;
}

.footer-shell {
    padding-top: 22px;
    border-top: 1px solid #e8e3da;
}

.footer-top {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(0, 0.8fr) minmax(0, 0.8fr);
    gap: 32px;
    align-items: start;
}

.footer-brand-panel {
    padding: 0;
}

.footer-brand-mark {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.footer-brand-mark img {
    width: 34px;
    height: 34px;
    object-fit: contain;
    flex: 0 0 auto;
}

.footer-brand-title {
    margin: 0;
    color: #2f433d;
    font-size: 1.2rem;
    line-height: 1.1;
}

.footer-brand-text {
    margin: 0;
    max-width: 31rem;
    font-size: 0.94rem;
    line-height: 1.75;
    color: #726b61;
}

.footer-highlight {
    display: inline-block;
    margin-top: 10px;
    font-size: 0.82rem;
    letter-spacing: 0.04em;
    color: #8a857c;
}

.footer-nav-group {
    padding: 0;
}

.footer-heading {
    margin: 0 0 10px;
    color: #344740;
    font-size: 0.82rem;
    line-height: 1.3;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.footer-links {
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer-links li + li {
    margin-top: 8px;
}

.footer-links a {
    color: #60594f;
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.2s ease;
}

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

.footer-meta {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 16px;
    margin-top: 14px;
    padding-top: 0;
    border-top: 0;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #ece6dd;
}

.footer-copy {
    margin: 0;
    font-size: 0.86rem;
    color: #8d8579;
}

.footer-note {
    margin: 0;
    font-size: 0.86rem;
    color: #8d8579;
}

/* ===== Responsive ===== */
@media (max-width: 992px) {
    .main-with-sidebar {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
    }
    .footer-top {
        grid-template-columns: 1fr 1fr;
        gap: 28px;
    }
    .footer-brand-panel {
        grid-column: 1 / -1;
    }
}

@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }
    .site-nav {
        height: auto;
    }
    .nav-inner {
        display: flex;
        flex-wrap: wrap;
        gap: 10px 14px;
        min-height: auto;
        padding: 10px 24px;
        justify-content: space-between;
    }
    .nav-menu {
        display: none;
        width: 100%;
        margin: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
    }
    .nav-center {
        display: block;
        width: 100%;
        order: 3;
        grid-column: auto;
    }
    .nav-inner.nav-open .nav-menu {
        display: flex;
    }
    .nav-menu > li > a {
        padding: 12px 24px;
        border-bottom: 1px solid #eee;
        border-radius: 0;
    }
    .sub-menu {
        position: static;
        display: none;
        box-shadow: none;
        background: #f9f9f9;
        padding-left: 20px;
        border: 0;
        border-radius: 0;
    }
    .nav-menu > li.sub-open .sub-menu {
        display: block;
    }
    .site-title {
        font-size: 1.18rem;
    }
    .site-header {
        padding-top: 0;
        margin-bottom: 18px;
    }
    .header-logo-area {
        position: static;
        left: auto;
        top: auto;
        transform: none;
        flex: 1 1 auto;
        gap: 10px;
        padding-right: 0;
        min-width: 0;
    }
    .header-logo-area img {
        width: 40px !important;
    }
    .site-subtitle {
        font-size: 0.82rem;
        margin-top: 2px;
    }
    .site-footer {
        padding: 6px 0 16px;
    }
    .footer-top {
        grid-template-columns: 1fr;
        gap: 22px;
    }
    .footer-meta {
        flex-direction: column;
        align-items: flex-start;
    }
    .footer-bottom {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Copy-paste from previous work for specific elements */
.contents-box {
    border: 1px solid #e0e0e0;
    margin: 36px 0;
    background: #fafafa;
}
.contents-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 22px;
    border-bottom: 1px solid #ebebeb;
}
.contents-title {
    font-size: 1.05rem;
    color: #9ab7a4;
    font-weight: 400;
}
.contents-toggle {
    background: none;
    border: 1px solid #ddd;
    padding: 4px 14px;
    font-size: 0.72rem;
    cursor: pointer;
    color: #666;
}
.contents-list {
    padding: 16px 22px 20px;
    list-style: none;
}
.contents-list li {
    padding: 6px 0;
    border-bottom: 1px dotted #eee;
}
.table-wrap {
    overflow-x: auto;
    margin: 32px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.table-wrap table {
    width: 100%;
    border-collapse: collapse;
}
.table-wrap th, .table-wrap td {
    padding: 10px;
    border: 1px solid #eee;
}
.table-wrap th {
    background: #7ab796;
    color: #fff;
}

.aeo-answer {
    margin: 0 0 30px;
    padding: 22px 24px;
    border-radius: 14px;
    border-left: 4px solid #1f6fb2;
    background: linear-gradient(135deg, #edf6ff 0%, #d6ebff 100%);
}

.aeo-answer h2 {
    margin: 0 0 10px;
    color: #165b93;
}

.aeo-answer p {
    margin: 0;
}

.trust-panel,
.faq-block,
.related-reading {
    margin: 0 0 32px;
    padding: 22px 24px;
    border-radius: 14px;
    background: #faf8f2;
    border: 1px solid #ece4d4;
}

.trust-panel h2,
.faq-block h2,
.related-reading h2 {
    margin: 0 0 14px;
    color: #8b5e13;
}

.trust-panel p,
.related-reading p {
    margin-bottom: 10px;
}

.trust-panel p:last-child,
.related-reading p:last-child {
    margin-bottom: 0;
}

.trust-list,
.related-links-list {
    list-style: disc;
    padding-left: 1.25rem;
}

.trust-list li,
.related-links-list li {
    margin: 0 0 8px;
}

.related-links-list li:last-child {
    margin-bottom: 0;
}

.related-links-list a {
    color: #2a7d5f;
    font-weight: 600;
}

.faq-block {
    margin: 0 0 24px;
    padding: 8px 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.faq-block h2 {
    margin: 0 0 10px;
    color: inherit;
}

.faq-list {
    display: grid;
    gap: 8px;
}

.faq-item {
    background: transparent;
    border: 0;
    border-radius: 0;
    padding: 0;
}

.faq-item summary {
    cursor: pointer;
    font-weight: 400;
    font-size: 1rem;
    line-height: 1.8;
    color: inherit;
}

.faq-item p {
    margin: 6px 0 0;
    font-size: 1rem;
    line-height: 1.8;
}

.author-role {
    margin-top: 6px;
    color: #777;
    font-size: 0.95rem;
}

/* ===== Category Pages ===== */
.category-header {
    text-align: center;
    padding: 40px 0 30px;
    border-bottom: 2px solid #f39c12;
    margin-bottom: 40px;
}

.category-header h1 {
    font-size: 2.2rem;
    margin-bottom: 10px;
}

.category-desc {
    font-size: 1rem;
    color: #888;
}

.category-section {
    margin-bottom: 50px;
}

.section-title {
    font-size: 1.4rem;
    color: #f39c12;
    border-left: 4px solid #f39c12;
    padding-left: 15px;
    margin-bottom: 25px;
}

/* ===== About Page ===== */
.about-content h2 {
    color: #f39c12;
    margin: 30px 0 15px;
}

.about-list {
    list-style: none;
    padding: 0;
    margin-bottom: 20px;
}

.about-list li {
    padding: 8px 0;
    border-bottom: 1px dotted #eee;
    font-size: 1rem;
}

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

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

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #555;
    font-size: 0.95rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #7ab796;
}

.btn-submit {
    background: #7ab796;
    color: #fff;
    border: none;
    padding: 12px 30px;
    font-size: 1rem;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.2s;
}

.btn-submit:hover {
    background: #5fa07e;
}

/* ===== Article Page Extras ===== */
.article-footer {
    margin-top: 50px;
    border-top: 1px solid #eee;
    padding-top: 30px;
}

.share-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #eee;
    color: #999;
    font-size: 0.9rem;
}

.share-icons a {
    display: inline-block;
    margin: 0 8px;
    font-size: 1.2rem;
}

.author-box {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 30px 0;
}

.author-avatar {
    flex-shrink: 0;
}

.author-info strong {
    font-size: 1.1rem;
}

/* ===== Related Posts ===== */
.related-posts {
    margin-top: 50px;
    border-top: 1px solid #eee;
    padding-top: 30px;
}

.related-title {
    text-align: center;
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 25px;
    font-weight: 400;
}

.post-date {
    font-size: 0.8rem;
    color: #aaa;
    display: block;
    margin-top: 8px;
}

/* ===== Comment Section ===== */
.comment-section {
    margin-top: 50px;
    border-top: 1px solid #eee;
    padding-top: 30px;
}

.comment-section h3 {
    text-align: center;
    color: #999;
    font-weight: 400;
    margin-bottom: 30px;
}

.comment-label {
    color: #999;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.comment-textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.95rem;
    resize: vertical;
    margin-bottom: 20px;
}

.comment-textarea:focus {
    outline: none;
    border-color: #7ab796;
}

.comment-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.comment-fields .form-group:last-child {
    grid-column: 1 / -1;
}

/* ===== Footer Widgets ===== */
.footer-widgets {
    background: #fff;
    padding: 40px 0;
    border-top: 1px solid #eee;
}

.footer-widgets .widget-title {
    border-bottom: 2px solid #f39c12;
}

.recent-posts-list {
    list-style: none;
    padding: 0;
}

.recent-posts-list li {
    padding: 10px 0;
    border-bottom: 1px dotted #eee;
}

.recent-posts-list li a {
    color: #333;
    font-size: 0.95rem;
    font-weight: 600;
}

.recent-posts-list li a:hover {
    color: #7ab796;
}

/* ===== Footer Social ===== */
.footer-social {
    text-align: center;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.footer-social a {
    color: #666;
    margin: 0 5px;
}

.footer-social a:hover {
    color: #7ab796;
}

/* ===== Read More ===== */
.read-more {
    display: inline-block;
    margin-top: 10px;
}

/* ===== Responsive Additions ===== */
@media (max-width: 768px) {
    .comment-fields {
        grid-template-columns: 1fr;
    }

    .hero-content {
        margin: 20px;
        padding: 20px;
    }

    .hero-content h2 {
        font-size: 1.3rem;
    }

    .hero-featured {
        height: 350px;
    }

    .category-header h1 {
        font-size: 1.6rem;
    }

    .post-header h1 {
        font-size: 1.5rem;
    }
}
