/* 重置樣式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 基本樣式 */
body {
    font-family: 'Noto Serif TC', serif;
    line-height: 1.6;
    color: #2d3748;
    background: linear-gradient(135deg, #fef8f0 0%, #f4f1e8 50%, #e8ddd4 100%);
    min-height: 100vh;
}

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

/* 頂部樣式 */
.header {
    background: rgba(254, 248, 240, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(139, 69, 19, 0.1);
    border-bottom: 1px solid rgba(184, 134, 11, 0.2);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: #2c3e50;
    text-decoration: none;
    background: linear-gradient(45deg, #8b4513 0%, #d2691e 50%, #b8860b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 2px 2px 4px rgba(139, 69, 19, 0.1);
}

.nav {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    text-decoration: none;
    color: #654321;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

.nav-link:hover {
    color: #8b4513;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(45deg, #8b4513, #d2691e);
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

.menu-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    position: relative;
    z-index: 1001;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.menu-toggle:focus {
    outline: none;
}

.menu-toggle span {
    width: 25px;
    height: 3px;
    background: #654321;
    margin: 3px 0;
    transition: 0.3s ease;
    border-radius: 2px;
    display: block;
}

/* 主要內容樣式 */
.main {
    margin-top: 100px;
    padding: 2rem 0;
    min-height: calc(100vh - 200px);
}

/* 搜尋區域樣式 */
.search-section {
    margin-bottom: 3rem;
    text-align: center;
}

.search-box {
    position: relative;
    max-width: 500px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid rgba(184, 134, 11, 0.2);
    border-radius: 50px;
    box-shadow: 0 10px 30px rgba(139, 69, 19, 0.15);
    overflow: hidden;
}

.search-input {
    width: 100%;
    padding: 1rem 1.5rem;
    border: none;
    outline: none;
    font-size: 1rem;
    font-family: inherit;
    background: transparent;
    padding-right: 60px;
}

.search-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(45deg, #8b4513, #d2691e);
    border: none;
    color: white;
    padding: 10px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-btn:hover {
    transform: translateY(-50%) scale(1.1);
}

/* 熱門詩句樣式 */
.hot-verses-section {
    margin-bottom: 4rem;
}

.hot-verses-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    max-width: 1000px;
    margin: 0 auto;
}

a.verse-card {
    display: block;
    text-decoration: none;
    color: inherit;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(184, 134, 11, 0.2);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    backdrop-filter: blur(5px);
    box-shadow: 0 4px 15px rgba(139, 69, 19, 0.1);
}

a.verse-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(139, 69, 19, 0.2);
    border-color: rgba(184, 134, 11, 0.4);
}

a.verse-card::before {
    content: '"';
    position: absolute;
    top: 0.5rem;
    left: 1rem;
    font-size: 2rem;
    color: rgba(139, 69, 19, 0.3);
    font-family: Georgia, serif;
    line-height: 1;
}

a.verse-card::after {
    content: '"';
    position: absolute;
    bottom: 0.5rem;
    right: 1rem;
    font-size: 2rem;
    color: rgba(139, 69, 19, 0.3);
    font-family: Georgia, serif;
    line-height: 1;
}

.verse-text {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #5d4e37;
    margin-bottom: 1rem;
    font-weight: 500;
    text-shadow: 1px 1px 2px rgba(139, 69, 19, 0.05);
    min-height: 3.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.verse-author {
    font-size: 0.95rem;
    color: #8b7355;
    font-style: italic;
    position: relative;
}

.verse-author::before {
    content: '——';
    margin-right: 0.3rem;
    color: rgba(139, 69, 19, 0.5);
}

/* 詩詞列表樣式 */
.poems-section {
    margin-bottom: 3rem;
}

.section-title {
    font-size: 2rem;
    text-align: center;
    margin-bottom: 2rem;
    color: #654321;
    position: relative;
    font-weight: 600;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(45deg, #8b4513, #d2691e);
    border-radius: 2px;
}

.poems-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

a.poem-card {
    display: block;
    text-decoration: none;
    color: inherit;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(184, 134, 11, 0.1);
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 5px 20px rgba(139, 69, 19, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(5px);
}

a.poem-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(45deg, #8b4513, #d2691e);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

a.poem-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(139, 69, 19, 0.2);
}

a.poem-card:hover::before {
    transform: scaleX(1);
}

.poem-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #654321;
    margin-bottom: 0.5rem;
}

.poem-author {
    color: #8b7355;
    font-size: 1rem;
    margin-bottom: 1rem;
}

.poem-preview {
    color: #5d4e37;
    font-style: italic;
    line-height: 1.8;
    border-left: 3px solid rgba(184, 134, 11, 0.3);
    padding-left: 1rem;
    background: rgba(184, 134, 11, 0.05);
    padding: 0.8rem 1rem;
    border-radius: 0 8px 8px 0;
}

.poem-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(184, 134, 11, 0.2);
}

.poem-dynasty {
    background: linear-gradient(45deg, #8b4513, #d2691e);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(139, 69, 19, 0.3);
}

.poem-likes {
    color: #8b7355;
    font-size: 0.9rem;
}

/* 載入更多按鈕 */
.load-more {
    text-align: center;
    margin-top: 2rem;
}

.load-more-btn {
    background: linear-gradient(45deg, #8b4513, #d2691e);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(139, 69, 19, 0.3);
}

.load-more-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(139, 69, 19, 0.4);
}

/* 底部樣式 */
.footer {
    background: linear-gradient(135deg, #3c2415 0%, #2d1810 50%, #1a0f08 100%);
    color: #f4f1e8;
    padding: 3rem 0 1rem;
    margin-top: 4rem;
    border-top: 3px solid rgba(184, 134, 11, 0.3);
}

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

.footer-section h3 {
    margin-bottom: 1rem;
    color: #f4f1e8;
    font-size: 1.2rem;
    background: linear-gradient(45deg, #d2691e, #daa520);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.footer-section p {
    color: #c4b59a;
    line-height: 1.6;
}

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

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

.footer-section ul li a {
    color: #c4b59a;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section ul li a:hover {
    color: #d2691e;
}

.footer-bottom {
    text-align: center;
    /*padding-top: 2rem;*/
    /*border-top: 1px solid rgba(184, 134, 11, 0.3);*/
    /*color: #8b7355;*/
}

/* 響應式設計 - 平板 */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(254, 248, 240, 0.98);
        backdrop-filter: blur(10px);
        flex-direction: column;
        padding: 1rem;
        box-shadow: 0 5px 20px rgba(139, 69, 19, 0.2);
        border-top: 1px solid rgba(184, 134, 11, 0.3);
        gap: 1rem;
        z-index: 1000;
        animation: slideDown 0.3s ease;
    }
    
    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    .nav.active {
        display: flex;
    }
    
    .menu-toggle {
        display: flex;
    }
    
    .nav-link {
        padding: 0.8rem 1rem;
        border-radius: 8px;
        transition: all 0.3s ease;
        text-align: center;
    }
    
    .nav-link:hover {
        background: rgba(184, 134, 11, 0.1);
        color: #8b4513;
    }
    
    .menu-toggle.active span:nth-child(1) {
        transform: rotate(-45deg) translate(-5px, 6px);
    }
    
    .menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    
    .menu-toggle.active span:nth-child(3) {
        transform: rotate(45deg) translate(-5px, -6px);
    }
    
    .poems-list {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 1rem;
    }
    
    .section-title {
        font-size: 1.7rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .hot-verses-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    a.verse-card {
        padding: 1.2rem;
    }
    
    .verse-text {
        font-size: 1rem;
        min-height: 2.8rem;
    }
}

/* 響應式設計 - 手機 */
@media (max-width: 480px) {
    .logo {
        font-size: 1.5rem;
    }
    
    .header-content {
        padding: 0.8rem 0;
    }
    
    .menu-toggle {
        padding: 10px;
        margin: -5px;
        min-width: 44px;
        min-height: 44px;
        justify-content: center;
        align-items: center;
    }
    
    .menu-toggle span {
        width: 22px;
        height: 2px;
    }
    
    .main {
        margin-top: 80px;
        padding: 1rem 0;
    }
    
    .search-box {
        margin: 0 10px;
    }
    
    .poems-list {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .poem-card {
        padding: 1rem;
    }
    
    .poem-title {
        font-size: 1.2rem;
    }
    
    .section-title {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .poem-meta {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }
    
    .footer {
        padding: 2rem 0 1rem;
    }
    
    .footer-content {
        gap: 1rem;
    }
    
    .hot-verses-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    a.verse-card {
        padding: 1rem;
    }
    
    .verse-text {
        font-size: 0.95rem;
        line-height: 1.5;
        min-height: 2.4rem;
    }
    
    .verse-author {
        font-size: 0.85rem;
    }
    
    a.verse-card::before,
    a.verse-card::after {
        font-size: 1.5rem;
    }
    
    a.verse-card::before {
        top: 0.3rem;
        left: 0.5rem;
    }
    
    a.verse-card::after {
        bottom: 0.3rem;
        right: 0.5rem;
    }
}

/* 載入動畫 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 滾動條樣式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f4f1e8;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(45deg, #8b4513, #d2691e);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(45deg, #d2691e, #8b4513);
}
