/* 當紅俱樂部品牌配色 - 雜誌感版本 */
:root {
    --primary-orange: #FF5733;
    --secondary-orange: #FF8C42;
    --light-orange: #FFE4D6;
    --dark-text: #2C2C2C;
    --light-text: #666666;
    --white: #FFFFFF;
    --shadow-light: rgba(0, 0, 0, 0.1);
    --shadow-medium: rgba(0, 0, 0, 0.15);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Microsoft JhengHei', 'PingFang TC', 'Noto Sans TC', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, var(--primary-orange) 0%, var(--secondary-orange) 100%);
    background-image: 
        linear-gradient(135deg, rgba(255, 87, 51, 0.95) 0%, rgba(255, 140, 66, 0.95) 100%),
        url('brand-background.png');
    background-size: cover, cover;
    background-position: center, center;
    background-attachment: fixed;
    background-filter: blur(2px);
    filter: blur(0px);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: var(--dark-text);
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('brand-background.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    filter: blur(3px);
    opacity: 0.08;
    z-index: -1;
    pointer-events: none;
}

.container {
    width: 100%;
    max-width: 1200px;
    display: flex;
    flex-direction: column;
    gap: 40px;
}

/* Header */
.header {
    animation: fadeInDown 0.8s ease-out;
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 8px 32px var(--shadow-medium);
}

.header-content {
    display: flex;
    align-items: center;
    gap: 30px;
    justify-content: center;
    flex-wrap: wrap;
}

.logo-container {
    flex-shrink: 0;
    background: var(--white);
    padding: 8px;
    border-radius: 14px;
    border: 2px solid #F0F0F0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    /* 視差滾動效果 */
    position: relative;
    z-index: 10;
}

.logo-container:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    border-color: #E0E0E0;
}

.logo {
    max-width: 120px;
    width: 100%;
    height: auto;
    display: block;
    border-radius: 10px;
}

.brand-info {
    text-align: center;
}

.brand-title {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--primary-orange);
    margin-bottom: 8px;
    letter-spacing: 2px;
}

.brand-subtitle {
    font-size: 1rem;
    color: var(--light-text);
    font-weight: 400;
    letter-spacing: 1px;
}

/* 導航連結 */
.nav-links {
    display: flex;
    gap: 15px;
    margin-top: 10px;
}

.nav-link {
    color: var(--light-text);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 20px;
    background: rgba(0, 0, 0, 0.05);
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.nav-link:hover {
    background: rgba(0, 0, 0, 0.1);
}

.nav-link.active {
    background: var(--primary-orange);
    color: white;
}

/* Main Content - Magazine Grid */
.main-content {
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    width: 100%;
}

/* News Card */
.news-card {
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 24px var(--shadow-medium);
    transition: all 0.3s ease;
    animation: slideIn 0.5s ease-out;
    display: flex;
    flex-direction: column;
    height: 100%;
    border: 3px solid var(--primary-orange);
    position: relative;
}

.news-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-orange), var(--secondary-orange));
}

.news-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 32px var(--shadow-medium);
}

/* 動畫應用 - 按左上至右下的順序，每張卡片相隔 400ms */
.news-card.animate-0 {
    animation: flipPageUp 0.6s ease-out forwards;
    animation-delay: 0ms;
}

.news-card.animate-1 {
    animation: flipPageUp 0.6s ease-out forwards;
    animation-delay: 400ms;
}

.news-card.animate-2 {
    animation: flipPageUp 0.6s ease-out forwards;
    animation-delay: 800ms;
}

.news-card.animate-3 {
    animation: flipPageUp 0.6s ease-out forwards;
    animation-delay: 1200ms;
}

.news-card.animate-4 {
    animation: flipPageUp 0.6s ease-out forwards;
    animation-delay: 1600ms;
}

.news-card.animate-5 {
    animation: flipPageUp 0.6s ease-out forwards;
    animation-delay: 2000ms;
}

.card-content {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.card-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--dark-text);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
}

.card-time {
    font-size: 0.85rem;
    color: var(--primary-orange);
    font-weight: 600;
}

.card-source {
    font-size: 0.8rem;
    color: var(--light-text);
    background: var(--light-orange);
    padding: 4px 10px;
    border-radius: 4px;
}

.card-link {
    display: inline-block;
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--primary-orange), var(--secondary-orange));
    color: var(--white);
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    align-self: flex-start;
    box-shadow: 0 4px 12px rgba(255, 87, 51, 0.3);
    border: none;
    cursor: pointer;
    margin-top: 12px;
}

.card-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 87, 51, 0.4);
}

.card-link:active {
    transform: translateY(0);
}

.empty-state {
    background: var(--white);
    border-radius: 12px;
    padding: 40px 24px;
    text-align: center;
    color: var(--primary-orange);
    font-size: 1.1rem;
    animation: pulse 1.5s ease-in-out infinite;
    box-shadow: 0 8px 24px var(--shadow-light);
    border: 3px solid var(--primary-orange);
}

.news-card.loading {
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

.news-card.loading .card-content {
    text-align: center;
    color: var(--primary-orange);
    font-size: 1.1rem;
    animation: pulse 1.5s ease-in-out infinite;
}

/* Footer */
.footer {
    text-align: center;
    animation: fadeIn 1s ease-out 0.4s both;
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 8px 24px var(--shadow-light);
}

.footer-content {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.update-info {
    font-size: 0.9rem;
    color: var(--light-text);
}

.status {
    font-size: 0.85rem;
    padding: 6px 16px;
    border-radius: 20px;
    font-weight: 600;
    display: inline-block;
}

.status.online {
    background: #4CAF50;
    color: var(--white);
}

.status.offline {
    background: #F44336;
    color: var(--white);
}

.status.updating {
    background: var(--secondary-orange);
    color: var(--white);
    animation: pulse 1.5s ease-in-out infinite;
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 中軸翻轉動畫效果 - 每張卡片以中軸翻轉 */
@keyframes flipPageUp {
    from {
        opacity: 0;
        transform: rotateY(90deg);
        transform-origin: center center;
    }
    50% {
        opacity: 1;
    }
    to {
        opacity: 1;
        transform: rotateY(0deg);
        transform-origin: center center;
    }
}

/* 延遲動畫 - 按左上至右下的順序依序啟動 */


@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-8px);
    }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .news-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
}

@media (max-width: 768px) {
    .container {
        gap: 30px;
    }

    .header {
        padding: 20px;
    }

    .header-content {
        gap: 20px;
    }

    .logo {
        max-width: 100px;
    }

    .brand-title {
        font-size: 1.8rem;
    }

    .brand-subtitle {
        font-size: 0.9rem;
    }

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

    .card-title {
        font-size: 1.1rem;
    }

    .card-link {
        padding: 8px 16px;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    body {
        padding: 12px;
    }

    .container {
        gap: 20px;
    }

    .header {
        padding: 15px;
    }

    .header-content {
        flex-direction: column;
        gap: 15px;
    }

    .logo {
        max-width: 80px;
    }

    .brand-title {
        font-size: 1.4rem;
    }

    .brand-subtitle {
        font-size: 0.8rem;
    }

    .card-content {
        padding: 16px;
    }

    .card-title {
        font-size: 1rem;
    }

    .card-link {
        padding: 8px 12px;
        font-size: 0.8rem;
    }

    .footer-content {
        flex-direction: column;
        gap: 10px;
    }
}
