/* 
 * 方案 A+：方案 A 完全增強版
 * 包含所有方案 A 的特色 + 額外功能
 * 特色：Logo微動畫 + 搜尋自動完成 + 通知小紅點 + 深色模式切換
 */

/* 導入方案 A 的基礎樣式 */
@import url('modern-home_optionA.css');

/* ========== Logo 微動畫增強 (已停用) ========== */
/* ... existing styles ... */
@keyframes logo-pulse {
    0%, 100% { 
        transform: scale(1) rotate(0deg);
        filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
    }
    50% { 
        transform: scale(1.05) rotate(0deg); /* 移除旋轉 */
        filter: drop-shadow(0 4px 16px rgba(59, 192, 255, 0.4));
    }
}

@keyframes logo-spin {
    0% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.2) rotate(180deg); }
    100% { transform: scale(1) rotate(360deg); }
}

/* ========== 搜尋自動完成增強 ========== */
.header-search {
    position: relative;
}

.search-suggestions {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: rgba(26, 35, 50, 0.98);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1001;
    display: none;
}

.search-suggestions.active {
    display: block;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.suggestion-section {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.suggestion-section:last-child {
    border-bottom: none;
}

.suggestion-title {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 8px;
}

.suggestion-item {
    padding: 10px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 12px;
}

.suggestion-item:hover {
    background: rgba(59, 192, 255, 0.1);
    transform: translateX(4px);
}

.suggestion-icon {
    font-size: 1.2rem;
    opacity: 0.6;
}

.suggestion-text {
    flex: 1;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.95rem;
}

.suggestion-meta {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.4);
}

/* ========== 通知小紅點 ========== */
.user-menu {
    position: relative;
}

.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg, #ff6b6b, #ff8787);
    border-radius: 50%;
    border: 2px solid rgba(15, 20, 25, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    color: #fff;
    animation: pulse-notification 2s ease-in-out infinite;
}

@keyframes pulse-notification {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 107, 107, 0.7); }
    50% { transform: scale(1.1); box-shadow: 0 0 0 8px rgba(255, 107, 107, 0); }
}

/* ========== 通知下拉選單 ========== */
.notifications-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: 360px;
    background: rgba(26, 35, 50, 0.98);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
    z-index: 1002;
    display: none;
}

.notifications-dropdown.active {
    display: block;
    animation: slideDown 0.3s ease;
}

.notifications-header {
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notifications-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
}

.mark-all-read {
    font-size: 0.85rem;
    color: #3bc0ff;
    cursor: pointer;
    transition: color 0.3s ease;
}

.mark-all-read:hover {
    color: #4ff0ca;
}

.notifications-list {
    max-height: 400px;
    overflow-y: auto;
}

.notification-item {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    gap: 12px;
}

.notification-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.notification-item.unread {
    background: rgba(59, 192, 255, 0.05);
}

.notification-icon-box {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3bc0ff, #4ff0ca);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.notification-content {
    flex: 1;
}

.notification-title {
    font-size: 0.95rem;
    color: #fff;
    font-weight: 500;
    margin-bottom: 4px;
}

.notification-time {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
}

/* ========== 深色/淺色模式切換按鈕 ========== */
.theme-toggle-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    padding: 8px 12px;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-right: 12px;
}

.theme-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: scale(1.05);
}

.theme-icon {
    transition: transform 0.5s ease;
}

.theme-toggle-btn:hover .theme-icon {
    transform: rotate(180deg);
}

/* 淺色模式樣式 */
body.light-theme {
    background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf0 100%);
}

body.light-theme .modern-header {
    background: rgba(255, 255, 255, 0.85);
    border-bottom-color: rgba(0, 0, 0, 0.08);
}

body.light-theme .modern-header.scrolled {
    background: rgba(255, 255, 255, 0.95);
}

body.light-theme .header-search input {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.12);
    color: #1a2332;
}

body.light-theme .header-search input::placeholder {
    color: rgba(26, 35, 50, 0.4);
}

body.light-theme .nav-link {
    color: rgba(26, 35, 50, 0.8);
}

body.light-theme .nav-link:hover,
body.light-theme .nav-link--active {
    color: #3bc0ff;
}

body.light-theme .reading-progress {
    background: linear-gradient(90deg, #667eea, #764ba2);
}

/* ========== 增強的過渡動畫 ========== */
.modern-header * {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========== 響應式調整 ========== */
@media (max-width: 768px) {
    .theme-toggle-btn {
        padding: 6px 10px;
        font-size: 1rem;
    }
    
    .notifications-dropdown {
        width: calc(100vw - 32px);
        right: -120px;
    }
    
    .search-suggestions {
        left: -16px;
        right: -16px;
        width: calc(100vw - 32px);
    }
}

/* ========== 滾動條美化 ========== */
.notifications-list::-webkit-scrollbar,
.search-suggestions::-webkit-scrollbar {
    width: 6px;
}

.notifications-list::-webkit-scrollbar-track,
.search-suggestions::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.notifications-list::-webkit-scrollbar-thumb,
.search-suggestions::-webkit-scrollbar-thumb {
    background: rgba(59, 192, 255, 0.3);
    border-radius: 3px;
}

.notifications-list::-webkit-scrollbar-thumb:hover,
.search-suggestions::-webkit-scrollbar-thumb:hover {
    background: rgba(59, 192, 255, 0.5);
}

/* ========== 動態生成海報樣式 (Dynamic Typography Posters) ========== */
.poster-generated {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0; left: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px;
    overflow: hidden;
}

/* 風格 1: 現代極簡 (Modern) */
.poster-style-1 {
    background: linear-gradient(135deg, #0f172a 0%, #334155 100%);
    color: #fff;
    justify-content: space-between;
    align-items: flex-start;
    text-align: left;
}
.poster-style-1::before {
    content: ''; position: absolute; top: -30%; right: -30%;
    width: 80%; height: 80%; border-radius: 50%;
    background: radial-gradient(circle, rgba(59,192,255,0.15) 0%, transparent 70%);
}
.poster-style-1::after {
    content: ''; position: absolute; bottom: 20px; left: 20px;
    width: 40px; height: 2px; background: #3bc0ff;
}
.poster-style-1 .pg-date {
    font-family: monospace; color: #94a3b8; font-size: 0.85em; letter-spacing: 1px; z-index: 1;
}
.poster-style-1 .pg-title {
    font-weight: 900; font-size: 1.4em; line-height: 1.3; margin: auto 0 20px 0;
    background: linear-gradient(180deg, #fff 0%, #cbd5e1 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; z-index: 1;
}
.poster-style-1 .pg-unit {
    font-size: 0.8em; color: #3bc0ff; font-weight: 500; margin-bottom: 30px; z-index: 1;
}

/* 風格 2: 古典優雅 (Classic) */
.poster-style-2 {
    background-color: #1a0b0e;
    border: 6px solid #1a0b0e;
    outline: 1px solid rgba(212, 175, 55, 0.5);
    color: #f0e6d2;
}
.poster-style-2::before {
    content: '♪'; font-size: 6em; position: absolute;
    color: rgba(212, 175, 55, 0.05); font-family: serif;
}
.poster-style-2 .pg-date {
    color: #d4af37; font-family: serif; font-style: italic; font-size: 0.9em;
    margin-bottom: 12px; position: relative; display: inline-block; z-index: 1;
}
.poster-style-2 .pg-date::before, .poster-style-2 .pg-date::after {
    content: ''; position: absolute; top: 50%; width: 20px; height: 1px; background: #d4af37;
}
.poster-style-2 .pg-date::before { right: 110%; }
.poster-style-2 .pg-date::after { left: 110%; }
.poster-style-2 .pg-title {
    font-family: serif; font-weight: 700; font-size: 1.3em; line-height: 1.4;
    color: #fff; text-shadow: 0 2px 4px rgba(0,0,0,0.5); margin-bottom: 15px; z-index: 1;
}
.poster-style-2 .pg-unit {
    font-family: serif; font-size: 0.8em; color: rgba(240, 230, 210, 0.7); letter-spacing: 1px; z-index: 1;
}

/* 風格 3: 幾何色塊 (Pop) */
.poster-style-3 {
    background: #1e293b; padding: 0;
}
.poster-style-3 .pg-top {
    flex: 2; width: 100%; background: #4f46e5; position: relative;
    display: flex; align-items: center; justify-content: center; padding: 20px; overflow: hidden;
}
.poster-style-3 .pg-circle {
    position: absolute; top: -10%; right: -10%; width: 40%; height: 40%;
    background: #fbbf24; border-radius: 50%;
}
.poster-style-3 .pg-square {
    position: absolute; bottom: -5%; left: 5%; width: 20%; height: 20%;
    background: #f472b6; transform: rotate(15deg);
}
.poster-style-3 .pg-title {
    font-weight: 900; font-size: 1.3em; color: #fff; line-height: 1.3; z-index: 1;
    text-shadow: 2px 2px 0px rgba(0,0,0,0.2); width: 100%;
}
.poster-style-3 .pg-bottom {
    flex: 1; width: 100%; background: #1e293b; display: flex;
    flex-direction: column; justify-content: center; align-items: center; padding: 10px;
}
.poster-style-3 .pg-date {
    color: #fbbf24; font-weight: 700; font-size: 1em; margin-bottom: 4px;
}
.poster-style-3 .pg-unit {
    color: #94a3b8; font-size: 0.8em;
}

/* ===== 新增風格 ===== */

/* 風格 4: 極簡漸層 - 古典藍紫 */
.poster-style-4 {
    background: linear-gradient(135deg, #4e54c8 0%, #8f94fb 100%);
    color: #fff;
    justify-content: space-between;
}
.poster-style-4 .pg-content {
    z-index: 1;
    width: 100%;
}
.poster-style-4 .pg-title {
    font-size: 1.4em;
    font-weight: bold;
    line-height: 1.3;
    margin-bottom: 10px;
}
.poster-style-4 .pg-divider {
    width: 60px;
    height: 3px;
    background: white;
    margin: 10px 0;
}
.poster-style-4 .pg-unit {
    font-size: 1em;
    opacity: 0.95;
    margin-bottom: 20px;
}
.poster-style-4 .pg-meta {
    font-size: 0.9em;
    opacity: 0.9;
}
.poster-style-4 .pg-meta-item {
    margin-bottom: 8px;
}

/* 風格 5: 極簡漸層 - 流行橙粉 */
.poster-style-5 {
    background: linear-gradient(135deg, #f857a6 0%, #ff5858 100%);
    color: #fff;
    justify-content: space-between;
}
.poster-style-5 .pg-content {
    z-index: 1;
    width: 100%;
}
.poster-style-5 .pg-title {
    font-size: 1.4em;
    font-weight: bold;
    line-height: 1.3;
    margin-bottom: 10px;
}
.poster-style-5 .pg-divider {
    width: 60px;
    height: 3px;
    background: white;
    margin: 10px 0;
}
.poster-style-5 .pg-unit {
    font-size: 1em;
    opacity: 0.95;
    margin-bottom: 20px;
}
.poster-style-5 .pg-meta {
    font-size: 0.9em;
    opacity: 0.9;
}
.poster-style-5 .pg-meta-item {
    margin-bottom: 8px;
}

/* 風格 6: 幾何圖案 */
.poster-style-6 {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: #fff;
    position: relative;
}
.poster-style-6::before {
    content: '♪ ♫ ♩ ♬';
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 2rem;
    opacity: 0.2;
    letter-spacing: 10px;
}
.poster-style-6::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40%;
    background: linear-gradient(to top, rgba(0,0,0,0.3), transparent);
    pointer-events: none;
}
.poster-style-6 .pg-content {
    position: relative;
    z-index: 1;
    text-align: center;
    width: 100%;
}
.poster-style-6 .pg-title {
    font-size: 1.5em;
    font-weight: bold;
    margin-bottom: 15px;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.3);
}
.poster-style-6 .pg-unit {
    font-size: 1em;
    margin-bottom: 20px;
    opacity: 0.95;
}
.poster-style-6 .pg-divider {
    width: 80px;
    height: 2px;
    background: white;
    margin: 15px auto;
}
.poster-style-6 .pg-date {
    font-size: 0.95em;
    opacity: 0.9;
}

/* 風格 7: 大字排版 */
.poster-style-7 {
    background: #1a1a1a;
    color: #fff;
    justify-content: space-between;
    align-items: flex-start;
}
.poster-style-7 .pg-big-title {
    font-size: 2.8em;
    font-weight: 900;
    line-height: 0.9;
    letter-spacing: -2px;
    transform: rotate(-5deg);
    margin-bottom: 20px;
}
.poster-style-7 .pg-big-title span {
    display: block;
    padding-left: 0;
}
.poster-style-7 .pg-big-title span:nth-child(2) {
    padding-left: 20px;
}
.poster-style-7 .pg-big-title span:nth-child(3) {
    padding-left: 40px;
}
.poster-style-7 .pg-big-title span:nth-child(4) {
    padding-left: 60px;
}
.poster-style-7 .pg-info {
    color: #999;
    font-size: 0.85em;
}
.poster-style-7 .pg-unit {
    color: white;
    margin-bottom: 5px;
}

/* 風格 8: 霓虹風格 */
.poster-style-8 {
    background: #0a0a0a;
    color: #fff;
    position: relative;
}
.poster-style-8::before {
    content: '';
    position: absolute;
    top: 10%;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(255,0,255,0.3), transparent);
    border-radius: 50%;
    animation: neonPulse 2s ease-in-out infinite;
}
@keyframes neonPulse {
    0%, 100% { opacity: 0.5; transform: translateX(-50%) scale(1); }
    50% { opacity: 0.8; transform: translateX(-50%) scale(1.1); }
}
.poster-style-8 .pg-content {
    position: relative;
    z-index: 1;
    text-align: center;
}
.poster-style-8 .pg-title {
    font-size: 1.6em;
    font-weight: bold;
    text-align: center;
    text-shadow: 
        0 0 10px #ff00ff,
        0 0 20px #ff00ff,
        0 0 30px #ff00ff;
    margin-bottom: 30px;
}
.poster-style-8 .pg-meta {
    color: #00ffff;
    font-size: 0.9em;
    text-align: center;
    text-shadow: 0 0 10px #00ffff;
}
.poster-style-8 .pg-meta-item {
    margin-bottom: 8px;
}

/* 風格 9: 極簡色塊 */
.poster-style-9 {
    background: white;
    color: #333;
    padding: 0;
    justify-content: flex-start;
    align-items: stretch;
}
.poster-style-9 .pg-color-bar {
    height: 80px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    flex-shrink: 0;
}
.poster-style-9 .pg-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.poster-style-9 .pg-title {
    font-size: 1.4em;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
}
.poster-style-9 .pg-unit {
    font-size: 0.95em;
    color: #666;
    margin-bottom: 20px;
}
.poster-style-9 .pg-meta {
    font-size: 0.85em;
    color: #999;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 風格 10: 音波視覺 */
.poster-style-10 {
    background: linear-gradient(135deg, #232526 0%, #414345 100%);
    color: white;
    justify-content: space-between;
    padding: 15px 20px;
}
.poster-style-10 .pg-wave {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 30px;
    justify-content: center;
}
.poster-style-10 .pg-wave-bar {
    flex: 1;
    max-width: 4px;
    background: linear-gradient(to top, #667eea, #764ba2);
    border-radius: 2px;
    animation: wave 1.5s ease-in-out infinite;
}
.poster-style-10 .pg-wave-bar:nth-child(1) { height: 20%; animation-delay: 0s; }
.poster-style-10 .pg-wave-bar:nth-child(2) { height: 40%; animation-delay: 0.1s; }
.poster-style-10 .pg-wave-bar:nth-child(3) { height: 70%; animation-delay: 0.2s; }
.poster-style-10 .pg-wave-bar:nth-child(4) { height: 100%; animation-delay: 0.3s; }
.poster-style-10 .pg-wave-bar:nth-child(5) { height: 70%; animation-delay: 0.4s; }
.poster-style-10 .pg-wave-bar:nth-child(6) { height: 40%; animation-delay: 0.5s; }
.poster-style-10 .pg-wave-bar:nth-child(7) { height: 20%; animation-delay: 0.6s; }
@keyframes wave {
    0%, 100% { transform: scaleY(1); }
    50% { transform: scaleY(0.5); }
}
.poster-style-10 .pg-content {
    text-align: center;
    z-index: 1;
}
.poster-style-10 .pg-icon {
    font-size: 2em;
    margin-bottom: 10px;
}
.poster-style-10 .pg-title {
    font-size: 1.4em;
    font-weight: bold;
    margin-bottom: 10px;
}
.poster-style-10 .pg-unit {
    font-size: 0.95em;
    opacity: 0.9;
    margin-bottom: 10px;
}
.poster-style-10 .pg-divider {
    width: 60px;
    height: 2px;
    background: white;
    margin: 10px auto;
}
.poster-style-10 .pg-date {
    font-size: 0.85em;
    opacity: 0.8;
}

/* 風格 11: 拼貼藝術 */
.poster-style-11 {
    background: #f0f0f0;
    color: #333;
    position: relative;
}
.poster-style-11 .pg-shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.3;
}
.poster-style-11 .pg-shape1 {
    width: 120px;
    height: 120px;
    background: #667eea;
    top: -40px;
    right: -40px;
}
.poster-style-11 .pg-shape2 {
    width: 100px;
    height: 100px;
    background: #764ba2;
    bottom: -20px;
    left: -20px;
}
.poster-style-11 .pg-shape3 {
    width: 60px;
    height: 60px;
    background: #f857a6;
    top: 40%;
    left: 10%;
}
.poster-style-11 .pg-content {
    position: relative;
    z-index: 1;
    text-align: center;
}
.poster-style-11 .pg-icon {
    font-size: 2em;
    margin-bottom: 15px;
}
.poster-style-11 .pg-title {
    font-size: 1.4em;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
}
.poster-style-11 .pg-unit {
    font-size: 0.95em;
    color: #666;
    margin-bottom: 15px;
}
.poster-style-11 .pg-meta {
    font-size: 0.85em;
    color: #999;
}
