/* ========================================
   新版首頁樣式 - 淺色舒適配色
   ======================================== */

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

body {
    font-family: 'Inter', 'Noto Sans TC', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #f5f7fa;
    min-height: 100vh;
    color: #1e293b;
    overflow-x: hidden;
}

/* 動態背景粒子效果 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(circle at 20% 50%, rgba(14, 165, 233, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(6, 182, 212, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* 主要內容區 */
main {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem 4rem 2rem;
    /* 移除頂部 padding */
}

/* Hero 區塊 - 滿版背景 */
.hero-section {
    text-align: center;
    margin-bottom: 4rem;
    /* 突破 main 的 max-width 限制，達成滿版 */
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    /* 背景圖設定 */
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.92) 0%, rgba(255, 255, 255, 0.75) 100%), url('/assets/imgs/hero-bg-ai.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    padding: 3rem 2rem;
}

.hero-section .container {
    background: transparent;
    box-shadow: none;
    padding: 0;
    max-width: 800px;
    margin: 0 auto;
}

.hero-section .title {
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-section .subtitle {
    font-size: 1.25rem;
    color: #64748b;
    margin-bottom: 3rem;
    font-weight: 400;
}

/* 輸入區 - 玻璃擬態 */
.input-container {
    max-width: 700px;
    margin: 0 auto 3rem;
    position: relative;
}

.glass-card {
    background: #ffffff;
    backdrop-filter: blur(20px);
    border: 1px solid #e2e8f0;
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 32px rgba(14, 165, 233, 0.15);
}

.input-group {
    display: flex;
    gap: 1rem;
    align-items: stretch;
    border: none;
    border-radius: 0;
    background: transparent;
}

.input-group input[type="url"] {
    flex: 1;
    padding: 1.25rem 1.5rem;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    color: #1e293b;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s;
}

.input-group input[type="url"]:focus {
    outline: none;
    border-color: #0ea5e9;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.1);
}

.input-group input[type="url"]::placeholder {
    color: #94a3b8;
}

#submit-btn {
    padding: 1.25rem 2.5rem;
    background: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 100%);
    border: none;
    border-radius: 16px;
    color: #ffffff;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#submit-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

#submit-btn:hover::before {
    left: 100%;
}

#submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(14, 165, 233, 0.4);
}

/* 查看連結按鈕 */
#my-links-container {
    text-align: center;
}

.btn-tag {
    display: inline-block;
    margin-top: 1.5rem;
    padding: 0.875rem 2rem;
    background: transparent;
    border: 2px solid #0ea5e9;
    border-radius: 12px;
    color: #0ea5e9;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s;
    cursor: pointer;
}

.btn-tag:hover {
    background: rgba(14, 165, 233, 0.1);
    border-color: #0284c7;
    transform: translateY(-2px);
}

/* 結果顯示 */
#result {
    display: none;
    margin-top: 1.5rem;
    padding: 1rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    text-align: center;
}

#result a {
    color: #0ea5e9;
    text-decoration: none;
    font-weight: 600;
}

#result a.copyShortURL {
    margin-left: 8px;
    border: 1px solid #0ea5e9;
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 0.9rem;
    background: #ffffff;
    transition: 0.3s;
    display: inline-block;
}

#result a.copyShortURL:hover {
    background: #0ea5e9;
    color: white;
}

p.error {
    color: #ef4444;
    font-weight: 600;
}

/* QR Code */
#qrcode-container {
    display: none;
    margin-top: 1.5rem;
}

#sponsor-section {
    display: none;
    margin-top: 1rem;
    padding: 1rem;
    background: #f8fafc;
    border: 2px dashed #e2e8f0;
    border-radius: 12px;
}

/* Loading Spinner */
.loading-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0ea5e9;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    animation: spin 0.8s linear infinite;
    margin: 10px auto;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* 輪播預留區 */
.carousel-placeholder {
    margin: 4rem auto;
    padding: 3rem 2rem;
    max-width: 900px;
    background: #ffffff;
    border: 2px dashed #e2e8f0;
    border-radius: 20px;
    text-align: center;
    color: #94a3b8;
    font-size: 0.9rem;
}

/* 特色區塊 */
.feature-section {
    padding: 4rem 0;
    text-align: center;
}

.feature-section h2 {
    font-size: 2rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 1rem;
}

.intro-text,
.section-intro {
    font-size: 1.1rem;
    color: #64748b;
    margin-bottom: 2rem;
}

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

.feature-card {
    background: #ffffff;
    backdrop-filter: blur(10px);
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 2.5rem 2rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    text-align: left;
}

/* 用純 CSS 幾何圖形替代圖標 */
.feature-card::before {
    content: '';
    position: absolute;
    top: 2rem;
    right: 2rem;
    width: 60px;
    height: 60px;
    opacity: 0.15;
    transition: all 0.4s;
}

.feature-card:nth-child(1)::before {
    background: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 100%);
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
}

.feature-card:nth-child(2)::before {
    background: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 100%);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
}

.feature-card:nth-child(3)::before {
    background: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 100%);
    clip-path: polygon(0% 0%, 100% 0%, 100% 70%, 50% 100%, 0% 70%);
}

.feature-card:nth-child(4)::before {
    background: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 100%);
    clip-path: circle(50%);
}

.feature-card:hover {
    transform: translateY(-8px);
    background: #f8fafc;
    border-color: #0ea5e9;
    box-shadow: 0 12px 40px rgba(14, 165, 233, 0.15);
}

.feature-card:hover::before {
    opacity: 0.3;
    transform: scale(1.1) rotate(10deg);
}

.feature-label {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #0ea5e9;
    margin-bottom: 1rem;
    opacity: 0.9;
}

.feature-card h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #1e293b;
}

.feature-card p {
    font-size: 0.95rem;
    line-height: 1.7;
    color: #64748b;
}

/* 文章專區 */
.articles-section {
    background: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 100%);
    padding: 4rem 2rem;
    text-align: center;
    margin-top: 4rem;
    border-radius: 24px;
}

.articles-section h2 {
    color: #fff;
    font-size: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.articles-section .section-intro {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.featured-articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto 2rem;
}

.featured-article-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 2rem;
    text-decoration: none;
    color: #1e293b;
    transition: all 0.3s;
    text-align: left;
}

.featured-article-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    background: #ffffff;
}

.featured-article-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: #0ea5e9;
}

.featured-article-card p {
    font-size: 0.95rem;
    color: #64748b;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.featured-article-card .read-more {
    color: #0ea5e9;
    font-weight: 600;
    font-size: 0.9rem;
}

.articles-cta {
    display: flex;
    justify-content: center;
    align-items: center;
}

.articles-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: #fff;
    color: #0ea5e9;
    padding: 1rem 2rem;
    border-radius: 50px;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 600;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.articles-link-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.25);
    background: #f8f9ff;
}

.articles-link-btn .btn-arrow {
    transition: transform 0.3s ease;
}

.articles-link-btn:hover .btn-arrow {
    transform: translateX(5px);
}

/* 響應式設計 */
@media (max-width: 768px) {
    main {
        padding: 0 1rem 2rem 1rem;
        /* 移除頂部 padding */
    }

    .hero-section .title {
        font-size: 2.5rem;
    }

    .hero-section .subtitle {
        font-size: 1.1rem;
    }

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

    .glass-card {
        padding: 2rem;
    }

    #submit-btn {
        width: 100%;
        justify-content: center;
    }

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

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

    .articles-section {
        padding: 3rem 1.5rem;
    }

    .articles-section h2 {
        font-size: 2rem;
    }
}

/* 微動畫 */
@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.hero-section {
    animation: float 6s ease-in-out infinite;
}