:root {
    --primary: #4361ee;
    --secondary: #3f37c9;
    --accent: #4cc9f0;
    --background: #1a1a2e;
    --surface: #16213e;
    --text: #ffffff;
    --text-secondary: #a0a0a0;
    --border: #2a2a4a;
}

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

body {
    font-family: 'Segoe UI', sans-serif;
    background: var(--background);
    color: var(--text);
    line-height: 1.6;
}

/* 導航欄樣式 */
.community-nav {
    background: var(--surface);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
    background: rgba(22, 33, 62, 0.95);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1.5rem;
}

.nav-actions {
    display: flex;
    gap: 1rem;
}

.back-btn, .logout-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text);
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.back-btn:hover, .logout-btn:hover {
    background: rgba(255,255,255,0.1);
}

/* 主容器布局 */
.community-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    height: calc(100vh - 64px);
    margin-top: 64px; /* 導航欄的高度 */
}

/* 創建文章按鈕 */
.create-article-btn {
    margin-bottom: 1rem;
    padding: 0.8rem 1.5rem;
    background: var(--primary);
    border: none;
    border-radius: 8px;
    color: white;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.1rem;
    box-shadow: 0 4px 15px rgba(67,97,238,0.3);
}

.create-article-btn:hover {
    background: var(--secondary);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(67,97,238,0.4);
}

.create-article-btn i {
    font-size: 1.2rem;
}

/* 彈出視窗樣式 */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: var(--surface);
    width: 90%;
    max-width: 600px;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.1);
    animation: modalShow 0.3s ease;
}

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

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.close-btn:hover {
    color: var(--text);
    transform: rotate(90deg);
}

.modal-body {
    padding: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.8rem;
    background: rgba(255,255,255,0.1);
    border: 1px solid var(--border);
    border-radius: 5px;
    color: var(--text);
    font-family: inherit;
}

.form-group textarea {
    resize: vertical;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

.cancel-btn,
.submit-btn {
    padding: 0.8rem 1.5rem;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cancel-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}

.submit-btn {
    background: var(--primary);
    border: none;
    color: white;
}

.cancel-btn:hover {
    background: rgba(255,255,255,0.1);
}

.submit-btn:hover {
    background: var(--secondary);
}

/* 無文章時的提示樣式 */
.no-articles {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
}

.no-articles i {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.no-articles p {
    font-size: 1.1rem;
}

/* 頁面標題區域 */
.page-header {
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
    padding: 2rem;
    background: var(--surface);
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.header-content h1 {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.header-content p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.header-decoration {
    position: absolute;
    right: -50px;
    top: -50px;
    width: 200px;
    height: 200px;
    opacity: 0.1;
}

.decoration-circle {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 4px solid var(--primary);
    border-radius: 50%;
    animation: rotate 20s linear infinite;
}

.decoration-line {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 4px solid var(--accent);
    border-radius: 50%;
    transform: rotate(45deg);
}

/* 頁面標題區域美化 */
.header-stats {
    display: flex;
    gap: 2rem;
    margin-top: 1.5rem;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem 1.2rem;
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.1);
}

.stat-item i {
    color: var(--accent);
    font-size: 1.2rem;
}

/* 裝飾點效果 */
.decoration-dots {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(circle, var(--text-secondary) 1px, transparent 1px);
    background-size: 15px 15px;
    opacity: 0.1;
    animation: float 10s ease-in-out infinite;
}

/* 文章項目美化 */
.article-item {
    position: relative;
    background: linear-gradient(145deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.02) 100%);
    border: 1px solid rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.article-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.article-item::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, var(--primary) 0%, transparent 70%);
    opacity: 0.1;
    transform: translate(50%, -50%);
    pointer-events: none;
}

.article-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.action-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.8rem;
    border-radius: 5px;
    transition: all 0.3s ease;
    font-size: 1.2rem;
    margin-left: 0.5rem;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255,68,68,0.1);
}

.action-btn:hover {
    color: #ff4444;
    background: rgba(255,68,68,0.1);
    transform: scale(1.1);
}

.article-footer {
    margin-top: 1rem;
    display: flex;
    justify-content: flex-end;
}

.read-more-btn {
    position: relative;
    overflow: hidden;
    padding: 0.8rem 1.5rem;
    border: 1px solid rgba(67,97,238,0.3);
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 1rem;
    color: var(--primary);
    background: rgba(67,97,238,0.05);
    transition: all 0.3s ease;
}

.read-more-btn:hover {
    background: rgba(67,97,238,0.1);
    transform: translateX(5px);
}

.read-more-btn i {
    transition: transform 0.3s ease;
}

.read-more-btn:hover i {
    transform: translateX(5px);
}

.article-date {
    position: relative;
    padding: 0.4rem 1rem 0.4rem 2rem;
}

.article-date::before {
    content: '';
    position: absolute;
    left: 0.5rem;
    top: 50%;
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    transform: translateY(-50%);
}

/* 動畫效果 */
@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-10px) rotate(5deg);
    }
}

/* 文章標題美化 */
.article-item h3 {
    position: relative;
    display: inline-block;
    margin: 1rem 0;
    padding-bottom: 0.5rem;
    font-size: 1.4rem;
    color: var(--text);
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.article-item p {
    color: var(--text-secondary);
    line-height: 1.8;
    margin: 1rem 0;
    font-size: 1.05rem;
}

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