/* ZeitFrei SPA 專用樣式 */

/* Windows 11 動畫偏好設定支援 - SPA 模組 */
@media (prefers-reduced-motion: reduce) {
    /* 移除所有動畫和過渡效果 */
    .post-card,
    .pagination-btn,
    .search-input,
    .search-btn,
    .article-card,
    .back-to-home,
    .back-btn,
    .posts-grid,
    .posts-grid-section,
    .posts-grid-container,
    .create-post-btn,
    .create-post-modal,
    .create-post-modal-overlay,
    .form-input,
    .form-textarea,
    .form-select {
        animation: none !important;
        transition: none !important;
        transform: none !important;
    }
    
    /* 確保所有卡片和內容始終可見 */
    .posts-grid,
    .posts-grid-section,
    .posts-grid-container,
    .post-card,
    .post-card-image,
    .post-card-content,
    .post-card-title,
    .pagination-container,
    .pagination-btn,
    .pagination-info,
    .search-input,
    .search-btn,
    .article-card,
    .back-to-home,
    .back-btn {
        opacity: 1 !important;
        visibility: visible !important;
        display: initial !important;
    }
    
    /* 特別處理網格顯示 */
    .posts-grid {
        display: grid !important;
        opacity: 1 !important;
        visibility: visible !important;
    }
    
    /* 確保分頁按鈕功能正常 */
    .pagination-container {
        display: flex !important;
    }
    
    .pagination-btn {
        display: flex !important;
        opacity: 1 !important;
        visibility: visible !important;
    }
    
    .pagination-info {
        display: flex !important;
        opacity: 1 !important;
        visibility: visible !important;
    }
    
    /* 移除 Hover 動畫但保持顏色變化和布局 */
    .post-card:hover,
    .pagination-btn:hover,
    .article-card:hover {
        transform: none !important;
        animation: none !important;
        transition: none !important;
    }
    
    /* 搜尋框和按鈕定位完全重置 - 確保與動畫開啟時一致 */
    .search-btn {
        /* 強制使用原始定位，不使用任何縮放 */
        transform: translateY(-50%) !important;
        transition: none !important;
        animation: none !important;
    }
    
    .search-btn:hover {
        /* hover 時保持原始位置，只改變顏色 */
        transform: translateY(-50%) !important;
        transition: none !important;
        animation: none !important;
    }
    
    .search-input:focus ~ .search-btn {
        /* focus 狀態保持原始位置 */
        transform: translateY(-50%) !important;
        transition: none !important;
        animation: none !important;
    }
    
    .search-input:focus ~ .search-btn svg {
        /* SVG 保持原始狀態 */
        transform: none !important;
        transition: none !important;
        animation: none !important;
    }
    
    .search-btn svg {
        /* 確保所有狀態下 SVG 都不變換 */
        transform: none !important;
        transition: none !important;
        animation: none !important;
    }
    
    /* 確保載入狀態可見 */
    .posts-grid.loading {
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
    }
    
    .posts-grid.loading .post-card {
        animation: none !important;
        opacity: 0.8 !important;
        visibility: visible !important;
        display: initial !important;
    }
    
    /* 移除可能導致隱藏的效果 */
    .search-ripple {
        display: none !important;
    }
    
    /* 確保搜尋結果和文章頁面可見 */
    .search-results,
    .article-page {
        opacity: 1 !important;
        visibility: visible !important;
        display: block !important;
    }

    /* 確保建立貼文相關元素可見 */
    .create-post-modal-overlay,
    .create-post-modal,
    .create-post-btn,
    .action-buttons {
        opacity: 1 !important;
        visibility: visible !important;
        display: initial !important;
    }

    .create-post-modal-overlay.show {
        display: flex !important;
    }

    .action-buttons {
        display: flex !important;
    }
}

/* 卡片式貼文網格系統 */
.posts-grid-section {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1rem;
    background: transparent;
    position: relative;
    z-index: 1;
}

.posts-grid-container {
    position: relative;
    z-index: 1;
    background: transparent;
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(5, 300px);
    gap: 1.5rem;
    margin-bottom: 2rem;
    justify-content: center;
    min-height: calc(6 * (450px + 1.5rem) - 1.5rem); /* 6排卡片的最小高度 */
    background: transparent;
}

/* 單一貼文卡片 */
.post-card {
    background: rgba(30, 30, 46, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(88, 101, 242, 0.2);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    width: 300px;
    height: 450px;
    position: relative;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.post-card:hover {
    transform: translateY(-8px);
    border-color: rgba(88, 101, 242, 0.5);
    box-shadow: 0 12px 48px rgba(88, 101, 242, 0.2);
}

.post-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: linear-gradient(135deg, rgba(88, 101, 242, 0.1), rgba(114, 137, 218, 0.1));
}

.post-card-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem;
    background: linear-gradient(
        transparent, 
        rgba(0, 0, 0, 0.7) 50%, 
        rgba(0, 0, 0, 0.9) 100%
    );
    backdrop-filter: blur(10px);
}

.post-card-title {
    font-size: 0.75rem;
    font-weight: 500;
    color: white;
    line-height: 1.3;
    margin: 0;
    text-align: center;
    word-wrap: break-word;
    overflow-wrap: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

/* 分頁控制 */
.pagination-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    margin-top: 2rem;
    padding: 1rem;
}

.pagination-btn {
    background: rgba(30, 30, 46, 0.95);
    backdrop-filter: blur(15px);
    border: 2px solid rgba(88, 101, 242, 0.3);
    border-radius: 12px;
    color: white;
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.pagination-btn:hover:not(:disabled) {
    background: rgba(88, 101, 242, 0.2);
    border-color: #5865F2;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(88, 101, 242, 0.3);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.pagination-btn svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
    transition: transform 0.2s ease;
}

.pagination-btn.prev svg {
    margin-right: -0.25rem;
}

.pagination-btn.next svg {
    margin-left: -0.25rem;
}

.pagination-btn:hover:not(:disabled) svg {
    transform: scale(1.1);
}

.pagination-info {
    background: rgba(30, 30, 46, 0.8);
    border: 1px solid rgba(88, 101, 242, 0.2);
    border-radius: 8px;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    color: white;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.current-page {
    color: #5865F2;
    font-weight: 600;
}

.page-separator {
    color: rgba(255, 255, 255, 0.5);
}

.total-pages {
    color: rgba(255, 255, 255, 0.8);
}

/* 載入狀態 */
.posts-grid.loading {
    opacity: 0.6;
    pointer-events: none;
}

.posts-grid.loading .post-card {
    background: rgba(30, 30, 46, 0.5);
    animation: cardPulse 2s ease-in-out infinite;
}

@keyframes cardPulse {
    0%, 100% { 
        background: rgba(30, 30, 46, 0.5);
        border-color: rgba(88, 101, 242, 0.1);
    }
    50% { 
        background: rgba(30, 30, 46, 0.7);
        border-color: rgba(88, 101, 242, 0.3);
    }
}

/* 響應式設計 - 自適應網格 */

/* 平板版 - 4x6 網格 (24張卡片) */
@media (max-width: 1024px) {
    .posts-grid {
        grid-template-columns: repeat(4, 200px);
        gap: 1rem;
        min-height: calc(6 * (300px + 1rem) - 1rem);
    }
    
    .post-card {
        width: 200px;
        height: 300px;
    }
    
    .post-card-title {
        font-size: 0.7rem;
        line-height: 1.3;
    }
    
    .post-card-content {
        padding: 0.8rem;
    }
}

/* 手機版 - 3x4 網格 (12張卡片) */
@media (max-width: 768px) {
    .posts-grid-section {
        padding: 1rem 0.5rem;
    }
    
    .posts-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.8rem;
        min-height: calc(4 * (200px + 0.8rem) - 0.8rem);
        max-width: 100%;
    }
    
    .post-card {
        width: 100%;
        max-width: 150px;
        height: 200px;
        justify-self: center;
    }
    
    .post-card-content {
        padding: 0.6rem;
    }
    
    .post-card-title {
        font-size: 0.65rem;
        line-height: 1.2;
        -webkit-line-clamp: 2;
    }
    
    .pagination-container {
        gap: 0.8rem;
        margin-top: 1.5rem;
    }
    
    .pagination-btn {
        padding: 0.5rem 0.8rem;
        font-size: 0.75rem;
    }
    
    .pagination-btn svg {
        width: 16px;
        height: 16px;
    }
}

/* 小手機版 - 3x2 網格 (6張卡片) */
@media (max-width: 480px) {
    .posts-grid-section {
        padding: 1rem 0.5rem;
    }
    
    .posts-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.6rem;
        min-height: calc(2 * (150px + 0.6rem) - 0.6rem);
        max-width: 100%;
    }
    
    .post-card {
        width: 100%;
        max-width: 100px;
        height: 150px;
        justify-self: center;
        border-radius: 12px;
    }
    
    .post-card-content {
        padding: 0.4rem;
    }
    
    .post-card-title {
        font-size: 0.5rem;
        line-height: 1.1;
        -webkit-line-clamp: 3;
    }
    
    .pagination-btn {
        padding: 0.4rem 0.6rem;
        font-size: 0.65rem;
    }
    
    .pagination-btn svg {
        width: 14px;
        height: 14px;
    }
    
    .pagination-info {
        padding: 0.3rem 0.5rem;
        font-size: 0.7rem;
    }
}

/* 搜尋結果頁面 */
.search-results {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    text-align: left;
}

.search-results h2 {
    color: white;
    margin-bottom: 2rem;
    text-align: center;
}

.results-container {
    display: grid;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.article-card {
    background: rgba(64, 68, 75, 0.6);
    border: 1px solid rgba(88, 101, 242, 0.2);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.article-card:hover {
    background: rgba(64, 68, 75, 0.8);
    border-color: rgba(88, 101, 242, 0.5);
    transform: translateY(-2px);
}

.article-card h3 {
    color: #5865F2;
    margin-bottom: 0.8rem;
    font-size: 1.2rem;
}

.article-card p {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 1rem;
    line-height: 1.5;
}

.article-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
}

.back-to-home {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.8rem 2rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    display: block;
    margin: 0 auto;
}

.back-to-home:hover {
    background: var(--accent-color);
    transform: translateY(-2px);
}

/* 文章頁面 */
.article-page {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
    color: white;
    line-height: 1.6;
}

.article-header {
    margin-bottom: 2rem;
    text-align: center;
    border-bottom: 1px solid rgba(88, 101, 242, 0.2);
    padding-bottom: 2rem;
}

.back-btn {
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(88, 101, 242, 0.3);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    position: absolute;
    top: 2rem;
    left: 2rem;
}

.back-btn:hover {
    color: white;
    border-color: var(--primary-color);
    background: rgba(88, 101, 242, 0.1);
}

.article-page h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.article-page .article-meta {
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.article-content {
    font-size: 1.1rem;
    line-height: 1.8;
}

.article-content h2,
.article-content h3,
.article-content h4 {
    color: #5865F2;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.article-content p {
    margin-bottom: 1.5rem;
}

.article-content img {
    max-width: 100%;
    border-radius: 8px;
    margin: 1.5rem 0;
}

.article-content pre {
    background: rgba(30, 30, 46, 0.8);
    border: 1px solid rgba(88, 101, 242, 0.2);
    border-radius: 8px;
    padding: 1.5rem;
    overflow-x: auto;
    margin: 1.5rem 0;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
}

.article-content code {
    background: rgba(88, 101, 242, 0.2);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9em;
}

.article-content blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: 1.5rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: rgba(255, 255, 255, 0.8);
}

.article-content ul,
.article-content ol {
    margin: 1.5rem 0;
    padding-left: 2rem;
}

.article-content li {
    margin-bottom: 0.5rem;
}

/* 載入狀態 */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

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

/* 輸入震動動畫 */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* 錯誤訊息 */
.error-message {
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid rgba(255, 107, 107, 0.3);
    border-radius: 8px;
    padding: 1rem;
    color: #ff6b6b;
    text-align: center;
    margin: 2rem 0;
}

/* 設定下拉選單內容樣式 */
.settings-dropdown-header {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid rgba(88, 101, 242, 0.2);
    background: rgba(88, 101, 242, 0.1);
}

.settings-dropdown-header h3 {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: white;
    text-align: center;
}

.settings-dropdown-body {
    padding: 0.5rem 0;
}

.settings-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem 1rem;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.settings-item:hover {
    background: rgba(88, 101, 242, 0.15);
    color: white;
}

.settings-item svg {
    flex-shrink: 0;
    color: rgba(255, 255, 255, 0.6);
    transition: color 0.2s ease;
}

.settings-item:hover svg {
    color: #5865F2;
}

.settings-divider {
    height: 1px;
    background: rgba(88, 101, 242, 0.2);
    margin: 0.5rem 0;
}

.logout-item {
    color: rgba(255, 107, 107, 0.8);
}

.logout-item:hover {
    background: rgba(255, 107, 107, 0.15);
    color: #ff6b6b;
}

.logout-item svg {
    color: rgba(255, 107, 107, 0.6);
}

.logout-item:hover svg {
    color: #ff6b6b;
}

/* 搜尋漣漪效果 */
.search-ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(88, 101, 242, 0.3);
    transform: scale(0);
    animation: searchRipple 0.6s linear forwards;
    pointer-events: none;
}

@keyframes searchRipple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* SPA 過渡動畫 */
.fade-in {
    opacity: 0;
    animation: fadeIn 0.3s ease-in-out forwards;
}

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

.slide-in {
    transform: translateY(20px);
    opacity: 0;
    animation: slideIn 0.4s ease-out forwards;
}

@keyframes slideIn {
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* 響應式設計 */
@media (max-width: 768px) {
    .search-results {
        padding: 1rem;
    }
    
    .article-page {
        padding: 1rem;
    }
    
    .article-page h1 {
        font-size: 2rem;
    }
    
    .back-btn {
        position: relative;
        top: auto;
        left: auto;
        margin-bottom: 1rem;
    }
    
    .article-header {
        text-align: left;
    }
    
    .article-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .search-results,
    .article-page {
        padding: 0.5rem;
    }
    
    .article-card {
        padding: 1rem;
    }
    
    .article-card h3 {
        font-size: 1.1rem;
    }
}

/* ==================== 建立貼文樣式 ==================== */

/* 建立貼文按鈕區域 */
.action-buttons {
    display: flex;
    justify-content: center;
    margin-top: 1rem;
    margin-bottom: 1.5rem;
    gap: 1rem;
}

/* 建立貼文主按鈕 */
.create-post-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        0 0 25px rgba(102, 126, 234, 0.4),
        0 8px 25px rgba(102, 126, 234, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.create-post-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.6s ease;
}

.create-post-btn:hover {
    background: linear-gradient(135deg, #764ba2 0%, #f093fb 100%);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 
        0 0 35px rgba(118, 75, 162, 0.5),
        0 12px 30px rgba(118, 75, 162, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.create-post-btn:hover::before {
    left: 100%;
}

.create-post-btn:active {
    transform: translateY(-1px) scale(1);
}

.create-post-btn svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
}

/* 精簡版建立貼文按鈕 */
.create-post-btn.compact {
    background: rgba(30, 30, 46, 0.9);
    backdrop-filter: blur(15px);
    border: 2px solid rgba(88, 101, 242, 0.4);
    color: rgba(255, 255, 255, 0.9);
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 25px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.3s ease;
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.create-post-btn.compact::before {
    display: none;
}

.create-post-btn.compact:hover {
    background: rgba(88, 101, 242, 0.2);
    border-color: #5865F2;
    color: white;
    transform: translateY(-1px);
    box-shadow: 
        0 6px 20px rgba(88, 101, 242, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.create-post-btn.compact:active {
    transform: translateY(0);
}

.create-post-btn.compact svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
}

/* 建立貼文模態框遮罩 */
.create-post-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 1rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.create-post-modal-overlay.show {
    opacity: 1;
}

/* 建立貼文模態框主體 */
.create-post-modal {
    background: linear-gradient(135deg, 
        rgba(15, 15, 18, 0.98) 0%, 
        rgba(26, 26, 31, 0.98) 50%, 
        rgba(15, 15, 18, 0.98) 100%);
    backdrop-filter: blur(25px) saturate(180%);
    border: 1px solid rgba(102, 126, 234, 0.2);
    border-radius: 20px;
    box-shadow: 
        0 0 40px rgba(102, 126, 234, 0.3),
        0 20px 60px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    width: 100%;
    max-width: 700px;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.create-post-modal-overlay.show .create-post-modal {
    transform: scale(1);
}

/* 模態框標題區 */
.create-post-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid rgba(102, 126, 234, 0.2);
    background: rgba(102, 126, 234, 0.1);
}

.create-post-header h2 {
    color: white;
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.close-modal-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-modal-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

/* 表單樣式 */
.create-post-form {
    padding: 2rem;
    max-height: calc(90vh - 120px);
    overflow-y: auto;
}

.form-section {
    margin-bottom: 2rem;
}

.form-section:last-child {
    margin-bottom: 0;
}

.form-label {
    display: block;
    color: white;
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.required {
    color: #ff6b6b;
}

.optional {
    color: rgba(255, 255, 255, 0.6);
    font-weight: 400;
}

/* 表單控制項 */
.form-input,
.form-textarea,
.form-select {
    width: 100%;
    background: rgba(30, 30, 46, 0.8);
    border: 2px solid rgba(88, 101, 242, 0.3);
    border-radius: 12px;
    color: white;
    font-size: 1rem;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: #5865F2;
    background: rgba(30, 30, 46, 0.9);
    box-shadow: 0 0 0 3px rgba(88, 101, 242, 0.15);
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
    font-family: inherit;
    line-height: 1.5;
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

/* 字數統計 */
.input-counter {
    text-align: right;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 0.25rem;
}

.input-counter.warning {
    color: #ffa726;
}

.input-counter.error {
    color: #ff6b6b;
}

/* 圖片上傳區域 */
.image-upload-section {
    margin-bottom: 1.5rem;
}

.image-upload-area {
    position: relative;
    min-height: 200px;
    border: 2px dashed rgba(88, 101, 242, 0.3);
    border-radius: 12px;
    background: rgba(30, 30, 46, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
}

.image-upload-area:hover {
    border-color: #5865F2;
    background: rgba(30, 30, 46, 0.7);
}

.image-upload-area.drag-over {
    border-color: #5865F2;
    background: rgba(88, 101, 242, 0.1);
}

.upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
}

.upload-placeholder svg {
    margin-bottom: 1rem;
    color: rgba(88, 101, 242, 0.6);
}

.upload-placeholder p {
    margin: 0.5rem 0;
    font-size: 1rem;
    font-weight: 500;
}

.upload-hint {
    font-size: 0.85rem !important;
    color: rgba(255, 255, 255, 0.5) !important;
    font-weight: 400 !important;
}

/* 圖片預覽 */
.image-preview {
    position: relative;
    width: 100%;
    height: 200px;
}

.image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
}

.remove-image-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(0, 0, 0, 0.8);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.remove-image-btn:hover {
    background: rgba(255, 107, 107, 0.8);
    transform: scale(1.1);
}

/* 表單提示 */
.form-hint {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 0.25rem;
}

/* 錯誤訊息 */
.error-message {
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid rgba(255, 107, 107, 0.3);
    border-radius: 8px;
    padding: 0.5rem;
    color: #ff6b6b;
    font-size: 0.85rem;
    margin-top: 0.5rem;
    display: none;
}

.upload-error {
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid rgba(255, 107, 107, 0.3);
    border-radius: 8px;
    padding: 0.5rem;
    color: #ff6b6b;
    font-size: 0.85rem;
    margin: 0.5rem;
    text-align: center;
}

/* 表單動作按鈕 */
.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 2rem;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border-color: rgba(255, 255, 255, 0.3);
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-width: 120px;
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #764ba2 0%, #f093fb 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(118, 75, 162, 0.3);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-preview {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.btn-preview:hover:not(:disabled) {
    background: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(79, 172, 254, 0.3);
}

.btn-preview:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Steam連結輸入群組樣式 */
.steam-input-group {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}

.steam-link-input {
    flex: 1;
}

.steam-apply-btn {
    background: linear-gradient(135deg, #1b2838 0%, #2a475e 50%, #1b2838 100%);
    color: #66c0f4;
    border: 1px solid #355166;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    min-width: 120px;
    white-space: nowrap;
}

.steam-apply-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #2a475e 0%, #4582a4 50%, #2a475e 100%);
    color: #ffffff;
    border-color: #66c0f4;
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(102, 192, 244, 0.2);
}

.steam-apply-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    background: rgba(27, 40, 56, 0.5);
    color: rgba(102, 192, 244, 0.5);
}

.steam-apply-btn.loading {
    background: linear-gradient(135deg, #1b2838 0%, #2a475e 50%, #1b2838 100%);
    color: #66c0f4;
}

.steam-apply-btn.loading svg {
    animation: spin 1s linear infinite;
}

.steam-apply-btn.success {
    background: linear-gradient(135deg, #2a7d32 0%, #4caf50 50%, #2a7d32 100%);
    color: white;
    border-color: #4caf50;
}

@media (max-width: 768px) {
    .steam-input-group {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .steam-apply-btn {
        min-width: 100%;
        justify-content: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .steam-apply-btn {
        animation: none !important;
        transition: none !important;
        transform: none !important;
    }
    
    .steam-apply-btn.loading svg {
        animation: none !important;
    }
    
    .steam-apply-btn:hover:not(:disabled) {
        transform: none !important;
    }
}

/* 下載連結管理樣式 */
.download-links-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.add-download-btn {
    background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.85rem;
}

.add-download-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #45a049 0%, #4caf50 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.add-download-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.download-links-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

.download-link-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.download-link-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.download-link-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.download-link-index {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
}

.remove-download-btn {
    background: none;
    border: none;
    color: rgba(244, 67, 54, 0.8);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.remove-download-btn:hover {
    background: rgba(244, 67, 54, 0.1);
    color: #f44336;
}

.download-link-fields {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 1rem;
    align-items: start;
}

.download-platform-select {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white;
    padding: 0.75rem;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.download-platform-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
    background: rgba(255, 255, 255, 0.1);
}

.download-platform-select option {
    background: #2a2a35;
    color: white;
    padding: 0.5rem;
}

.download-url-input {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white;
    padding: 0.75rem;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.download-url-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
    background: rgba(255, 255, 255, 0.1);
}

.download-url-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.download-link-preview {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: rgba(76, 175, 80, 0.1);
    border: 1px solid rgba(76, 175, 80, 0.3);
    border-radius: 8px;
    display: none;
}

.download-link-preview.show {
    display: block;
}

.download-preview-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.download-preview-btn:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    transform: translateY(-1px);
}

.download-empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: rgba(255, 255, 255, 0.6);
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    margin-top: 1rem;
}

.download-empty-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    opacity: 0.3;
}

@media (max-width: 768px) {
    .download-links-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .add-download-btn {
        width: 100%;
        justify-content: center;
    }
    
    .download-link-fields {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .download-link-header {
        flex-wrap: wrap;
    }
}

@media (prefers-reduced-motion: reduce) {
    .add-download-btn,
    .remove-download-btn,
    .download-preview-btn {
        transition: none !important;
        transform: none !important;
    }
    
    .add-download-btn:hover:not(:disabled),
    .download-preview-btn:hover {
        transform: none !important;
    }
    
    .download-link-item {
        transition: none !important;
    }
}

.btn-loading {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.loading-spinner {
    animation: spin 1s linear infinite;
}

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

/* 響應式設計 */
@media (max-width: 768px) {
    .create-post-modal {
        margin: 0.5rem;
        max-width: calc(100vw - 1rem);
    }
    
    .create-post-header {
        padding: 1rem 1.5rem;
    }
    
    .create-post-form {
        padding: 1.5rem;
    }
    
    .create-post-header h2 {
        font-size: 1.3rem;
    }
    
    .form-actions {
        flex-direction: column-reverse;
    }
    
    .btn-primary,
    .btn-secondary {
        width: 100%;
        justify-content: center;
    }

    .action-buttons {
        margin-bottom: 1rem;
    }

    .create-post-btn {
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .create-post-modal {
        margin: 0.25rem;
        border-radius: 16px;
    }
    
    .create-post-header {
        padding: 0.75rem 1rem;
    }
    
    .create-post-form {
        padding: 1rem;
    }
    
    .image-upload-area {
        min-height: 150px;
    }
    
    .upload-placeholder {
        height: 150px;
    }
    
    .image-preview {
        height: 150px;
    }

    .create-post-btn {
        padding: 0.7rem 1.2rem;
        font-size: 0.85rem;
    }

    .create-post-btn svg {
        width: 16px;
        height: 16px;
    }
}

/* ==================== Steam 連結相關樣式 ==================== */

/* Steam 遊戲資訊顯示 */
.steam-info {
    background: rgba(30, 30, 46, 0.8);
    border: 1px solid rgba(88, 101, 242, 0.3);
    border-radius: 12px;
    padding: 1rem;
    margin-top: 0.5rem;
}

.steam-game-preview {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.steam-game-image {
    width: 100px;
    height: 47px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.steam-game-details h4 {
    color: #5865F2;
    margin: 0 0 0.25rem 0;
    font-size: 1rem;
    font-weight: 600;
}

.steam-game-details p {
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
    font-size: 0.9rem;
}

/* Steam 圖片選擇器 */
.steam-image-options {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(88, 101, 242, 0.2);
}

.steam-image-selector h5 {
    color: white;
    margin: 0 0 1rem 0;
    font-size: 0.95rem;
    font-weight: 500;
}

.steam-image-choices {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.steam-image-choice {
    flex-shrink: 0;
    cursor: pointer;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 0.5rem;
    transition: all 0.3s ease;
    background: rgba(15, 15, 18, 0.5);
    text-align: center;
    min-width: 120px;
}

.steam-image-choice:hover {
    border-color: rgba(88, 101, 242, 0.5);
    background: rgba(30, 30, 46, 0.7);
}

.steam-image-choice.selected {
    border-color: #5865F2;
    background: rgba(88, 101, 242, 0.2);
    box-shadow: 0 0 0 2px rgba(88, 101, 242, 0.3);
}

.steam-image-choice img {
    width: 100%;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.steam-image-choice .image-label {
    display: block;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.8rem;
    font-weight: 500;
}

.steam-image-choice.selected .image-label {
    color: #5865F2;
}

/* Steam 圖片動作按鈕 */
.steam-image-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.btn-use-steam-image,
.btn-skip-steam-image {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.btn-use-steam-image {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-use-steam-image:hover:not(:disabled) {
    background: linear-gradient(135deg, #764ba2 0%, #f093fb 100%);
    transform: translateY(-1px);
}

.btn-use-steam-image:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-skip-steam-image {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-skip-steam-image:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}