/* 部落格前台樣式 */

/* 基本重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Microsoft JhengHei", "微軟正黑體", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #fff;
    background: #0a0a0a;
}

a {
    text-decoration: none;
    color: #667eea;
    transition: color 0.3s ease;
}

a:hover {
    color: #764ba2;
}

ul, ol {
    list-style: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* 頁首 */
.header {
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
}

.logo {
    display: flex;
    align-items: center;
    font-size: 2rem;
    font-weight: bold;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo img {
    height: 40px;
}

nav ul {
    display: flex;
    gap: 20px;
}

nav ul li a {
    color: #fff;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 4px;
    transition: all 0.3s ease;
    position: relative;
}

nav ul li a:hover,
nav ul li a.active {
    color: #667eea;
    transform: translateY(-2px);
}

nav ul li a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transition: width 0.3s ease;
}

nav ul li a:hover::after {
    width: 100%;
}

.admin-link {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white !important;
}

.admin-link:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%) !important;
    transform: translateY(-2px);
}

/* 頁尾 */
.footer {
    background: #0a0a0a;
    color: #ecf0f1;
    padding: 60px 0 30px;
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    margin-bottom: 40px;
}

.footer-section {
    flex: 1 1 250px;
}

.footer-section h3 {
    color: white;
    margin-bottom: 20px;
    font-size: 1.2rem;
    position: relative;
    padding-bottom: 10px;
}

.footer-section h3:after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 50px;
    height: 2px;
    background-color: #3498db;
}

.footer-section p {
    margin-bottom: 10px;
}

.footer-section ul li {
    margin-bottom: 8px;
}

.footer-section ul li a {
    color: #bdc3c7;
    transition: color 0.3s ease;
}

.footer-section ul li a:hover {
    color: #3498db;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

/* 部落格頁頭 */
.blog-header {
    text-align: center;
    padding: 60px 0;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    margin-bottom: 40px;
}

.blog-title {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.blog-description {
    font-size: 1.2rem;
    max-width: 700px;
    margin: 0 auto;
    opacity: 0.9;
}

/* 部落格卡片 */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.blog-card {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.blog-image {
    height: 200px;
    background: linear-gradient(45deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    overflow: hidden;
}

.blog-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.blog-card:hover .blog-image img {
    transform: scale(1.05);
}

.blog-content {
    padding: 20px;
}

.blog-date {
    color: #7f8c8d;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.blog-content h3 {
    font-size: 1.3rem;
    margin-bottom: 12px;
    color: #2c3e50;
    line-height: 1.4;
}

.blog-content p {
    color: #666;
    margin-bottom: 15px;
    line-height: 1.6;
}

.read-more {
    display: inline-block;
    color: #3498db;
    font-weight: 500;
    transition: color 0.3s ease;
}

.read-more:hover {
    color: #2980b9;
}

/* 部落格空狀態 */
.blog-empty {
    text-align: center;
    padding: 60px 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 40px;
}

.blog-empty h2 {
    font-size: 1.8rem;
    margin-bottom: 15px;
    color: #2c3e50;
}

.blog-empty p {
    color: #7f8c8d;
    margin-bottom: 20px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* 部落格分類 */
.blog-categories {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin: 0 auto 40px;
}

.category-link {
    display: inline-block;
    padding: 8px 16px;
    background-color: #ecf0f1;
    color: #2c3e50;
    border-radius: 30px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.category-link:hover {
    background-color: #dfe6e9;
}

.category-link.active {
    background-color: #3498db;
    color: white;
}

/* 部落格分頁 */
.blog-pagination {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 40px 0;
}

.page-link {
    display: inline-block;
    padding: 8px 16px;
    background-color: white;
    color: #2c3e50;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.page-link:hover {
    background-color: #f8f9fa;
}

.page-link.active {
    background-color: #3498db;
    color: white;
}

.page-link.disabled {
    opacity: 0.5;
    pointer-events: none;
}

/* 更多按鈕 */
.blog-more {
    text-align: center;
    margin: 30px 0;
}

.btn {
    display: inline-block;
    padding: 10px 24px;
    border-radius: 4px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
}

/* 文章詳情頁 */
.article-container {
    max-width: 800px;
    margin: 60px auto;
    padding: 30px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 8px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.article-header {
    text-align: center;
    margin-bottom: 30px;
}

.article-category {
    display: inline-block;
    padding: 6px 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 30px;
    font-size: 0.8rem;
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

.article-category:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    color: white;
    transform: translateY(-2px);
}

.article-title {
    font-size: 2.2rem;
    color: #fff;
    line-height: 1.3;
    margin-bottom: 20px;
}

.article-meta {
    color: #7f8c8d;
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.article-meta span {
    margin: 0 8px;
}

.article-featured-image {
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 30px;
}

.article-content {
    color: #ccc;
    font-size: 1.05rem;
    line-height: 1.8;
}

.article-content p {
    margin-bottom: 20px;
}

.article-content h2 {
    font-size: 1.6rem;
    margin: 30px 0 15px;
    color: #fff;
}

.article-content h3 {
    font-size: 1.3rem;
    margin: 25px 0 15px;
    color: #fff;
}

.article-content ul, .article-content ol {
    margin-bottom: 20px;
    padding-left: 20px;
}

.article-content ul li, .article-content ol li {
    margin-bottom: 8px;
    list-style-type: disc;
}

.article-content ol li {
    list-style-type: decimal;
}

.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 20px 0;
}

/* 響應式影片容器 */
.responsive-video-container {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%; /* 16:9 比例 */
    margin: 20px 0;
    overflow: hidden;
    border-radius: 8px;
}

.responsive-video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 8px;
}

/* 文章內容中的影片響應式處理 */
.article-content iframe,
.article-content video,
.article-content embed {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 20px 0;
    display: block;
}

/* 針對 YouTube iframe 的響應式處理 */
.article-content iframe[src*="youtube.com"],
.article-content iframe[src*="youtu.be"] {
    width: 100%;
    height: 315px;
    border: none;
    border-radius: 8px;
    margin: 20px 0;
}

/* 手機版影片調整 */
@media (max-width: 768px) {
    .responsive-video-container {
        margin: 15px 0;
        padding-bottom: 56.25%; /* 保持 16:9 比例 */
    }
    
    .article-content iframe[src*="youtube.com"],
    .article-content iframe[src*="youtu.be"] {
        height: 200px;
        margin: 15px 0;
    }
    
    .article-content iframe,
    .article-content video,
    .article-content embed {
        margin: 15px 0;
    }
}

@media (max-width: 480px) {
    .responsive-video-container {
        margin: 10px 0;
        padding-bottom: 56.25%; /* 保持 16:9 比例 */
    }
    
    .article-content iframe[src*="youtube.com"],
    .article-content iframe[src*="youtu.be"] {
        height: 180px;
        margin: 10px 0;
    }
}

/* 隱藏錯誤的圖片 */
.article-content img[src=""],
.article-content img:not([src]),
.article-featured-image[src=""],
.article-featured-image:not([src]) {
    display: none;
}

/* 圖片載入錯誤時的處理 */
.article-content img,
.article-featured-image {
    background-color: transparent;
}

.article-content img::before,
.article-featured-image::before {
    content: "";
    display: none;
}

.article-content blockquote {
    border-left: 4px solid #667eea;
    padding: 15px 20px;
    background: rgba(102, 126, 234, 0.1);
    margin: 20px 0;
    font-style: italic;
    color: #ccc;
}

.article-related {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid #ecf0f1;
}

.article-related-title {
    font-size: 1.5rem;
    margin-bottom: 30px;
    color: #2c3e50;
    text-align: center;
}

.article-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid #ecf0f1;
}

/* 留言區塊樣式 */
.comments-section {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 2px solid #ecf0f1;
}

.comments-title {
    font-size: 1.8rem;
    color: #fff;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.comments-title::before {
    content: "💬";
    font-size: 1.5rem;
}

/* 留言表單樣式 */
.comment-form-container {
    background: rgba(26, 26, 46, 0.5);
    padding: 30px;
    border-radius: 8px;
    margin-bottom: 40px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.comment-form-container h3 {
    color: #fff;
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.comment-message {
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.comment-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.comment-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.comment-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.comment-form .form-group {
    margin-bottom: 20px;
}

.comment-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #fff;
}

.comment-form input,
.comment-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.comment-form input:focus,
.comment-form textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.comment-form textarea {
    resize: vertical;
    min-height: 120px;
}

.comment-form .btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.comment-form .btn:hover {
    background: #2980b9;
}

/* 留言列表樣式 */
.comments-list h3 {
    color: #2c3e50;
    margin-bottom: 25px;
    font-size: 1.3rem;
}

.comment-item {
    background: rgba(26, 26, 46, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    transition: box-shadow 0.3s ease;
}

.comment-item:hover {
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.2);
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #ecf0f1;
}

.comment-author {
    font-weight: 600;
    color: #fff;
}

.comment-author a {
    color: #667eea;
    text-decoration: none;
    transition: color 0.3s ease;
}

.comment-author a:hover {
    color: #764ba2;
}

.comment-author i {
    margin-right: 5px;
}

.comment-date {
    color: #7f8c8d;
    font-size: 0.9rem;
}

.comment-date i {
    margin-right: 5px;
}

.comment-content {
    color: #ccc;
    line-height: 1.6;
    font-size: 1rem;
}

/* 無留言狀態 */
.no-comments {
    text-align: center;
    padding: 40px;
    color: #7f8c8d;
}

.no-comments i {
    font-size: 3rem;
    margin-bottom: 15px;
    color: #bdc3c7;
}

.no-comments p {
    font-size: 1.1rem;
}

/* 響應式設計 */
@media (max-width: 768px) {
    .comment-form .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .comment-form-container {
        padding: 20px;
    }
    
    .comment-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .comments-title {
        font-size: 1.5rem;
    }
}

/* 響應式設計 */
@media (max-width: 992px) {
    .blog-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
    
    .article-title {
        font-size: 1.8rem;
    }
}

@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
    }
    
    .logo {
        margin-bottom: 15px;
    }
    
    nav ul {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .blog-header {
        padding: 40px 0;
    }
    
    .blog-title {
        font-size: 2rem;
    }
    
    .blog-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        flex-direction: column;
    }
    
    .article-container {
        padding: 20px;
    }
    
    .article-title {
        font-size: 1.6rem;
    }
}

/* 首頁英雄區塊 */
.hero {
    position: relative;
    background: linear-gradient(135deg, #3498db, #9b59b6);
    height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    overflow: hidden;
}

.floating-element {
    position: absolute;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    animation: float 15s infinite ease-in-out;
}

.floating-element:nth-child(1) {
    top: -50px;
    left: 10%;
    width: 150px;
    height: 150px;
    animation-delay: 0s;
}

.floating-element:nth-child(2) {
    bottom: -70px;
    right: 15%;
    width: 250px;
    height: 250px;
    animation-delay: 5s;
}

.floating-element:nth-child(3) {
    top: 40%;
    left: 60%;
    width: 100px;
    height: 100px;
    animation-delay: 2s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-20px) rotate(5deg);
    }
}

.hero-content {
    position: relative;
    z-index: 10;
    max-width: 800px;
    padding: 0 20px;
}

.hero-content h1 {
    font-size: 3.5rem;
    margin-bottom: 20px;
    letter-spacing: 1px;
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    opacity: 0.9;
}

.cta-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
}

/* 產品卡片區域 */
.products {
    padding: 80px 0;
    background-color: #f8f9fa;
}

.section-title {
    text-align: center;
    font-size: 2.2rem;
    color: #2c3e50;
    margin-bottom: 50px;
    position: relative;
}

.section-title:after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    width: 80px;
    height: 3px;
    background-color: #3498db;
    transform: translateX(-50%);
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
}

.product-card {
    background-color: white;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.07);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-align: center;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.product-icon {
    font-size: 3rem;
    margin-bottom: 20px;
}

.product-card h3 {
    font-size: 1.4rem;
    color: #2c3e50;
    margin-bottom: 15px;
}

.product-card p {
    color: #666;
    margin-bottom: 20px;
}

.product-features {
    text-align: left;
    margin-bottom: 25px;
}

.product-features li {
    margin-bottom: 8px;
    position: relative;
    padding-left: 25px;
}

.product-features li:before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #3498db;
}

@media (max-width: 768px) {
    .hero {
        height: 400px;
    }
    
    .hero-content h1 {
        font-size: 2.5rem;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    .cta-buttons {
        flex-direction: column;
    }
} 