/* =========================================
   基础设置与权威色调
   ========================================= */
:root {
    --primary-red: #8B0000;    /* 深红/暗红，权威感 */
    --accent-gold: #D4AF37;    /* 金属金/亮金，对比度高 */
    --bg-light: #F5F5F5;
    --content-white: #FFFFFF;
    --text-main: #333333;
    --text-sub: #666666;
    --border-color: #DDDDDD;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-image: linear-gradient(rgba(0, 0, 0, 0.65), rgba(0, 0, 0, 0.65)), url('edmonton.png');
    background-size: cover;
    background-position: center top;
    background-attachment: fixed; 
    color: var(--text-main);
    font-family: 'Microsoft YaHei', 'SimSun', 'STHeiti', sans-serif;
    line-height: 1.8;
}

/* =========================================
   通用规整布局类
   ========================================= */
.gov-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

.gov-panel {
    background-color: rgba(255, 255, 255, 0.95); 
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    border-radius: 4px; 
    padding: 25px;
    margin-bottom: 30px;
}

/* =========================================
   顶部 Header 
   ========================================= */
.gov-header {
    background-color: var(--primary-red);
    padding: 20px 0;
    border-bottom: 4px solid var(--accent-gold);
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-logos {
    display: flex;
    align-items: center;
}

.forum-logo { height: 70px; width: auto; }
.ua-logo { height: 60px; width: auto; }

.header-divider {
    height: 50px;
    width: 2px;
    background-color: var(--accent-gold);
    opacity: 0.5;
    margin: 0 25px;
}

.header-titles { text-align: right; }

.main-title {
    font-family: 'SimSun', 'STSong', serif; 
    font-size: 2.8rem;
    font-weight: bold;
    color: var(--accent-gold);
    letter-spacing: 3px;
    line-height: 1.2;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.4);
}

.sub-title {
    font-size: 1.1rem;
    color: #FFF8DC;
    letter-spacing: 1px;
    margin-top: 5px;
}

/* =========================================
   旗帜与通知栏
   ========================================= */
.header-flags {
    text-align: right;
    margin-top: 10px;
}
.header-flags img {
    max-width: 180px;
    height: auto;
    opacity: 0.9;
}

.notice-box {
    margin-top: 15px;
    background: #fff;
    border: 1px solid #D4AF37;
    border-radius: 4px;
    padding: 10px;
    font-size: 0.9rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    display: none;
}
.notice-title {
    color: #8B0000;
    font-weight: bold;
    border-bottom: 1px solid #eee;
    margin-bottom: 5px;
    padding-bottom: 3px;
}
.notice-item { color: #333; padding: 5px 0; }
.notice-count {
    background: #8B0000;
    color: #D4AF37;
    padding: 1px 5px;
    border-radius: 10px;
    font-size: 0.8rem;
}

/* =========================================
   主要内容区
   ========================================= */
.main-content { margin-top: 40px; margin-bottom: 60px; }
.platform-intro p { color: var(--primary-red); font-size: 1.1rem; line-height: 1.8; text-indent: 2em; }

/* =========================================
   📢 终极版：公告与新闻区 (整行可点击架构)
   ========================================= */
.announcement-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.announcement-list li {
    border-bottom: 1px dashed #ccc;
    display: block; 
    padding: 0;
}

.news-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 10px;
    text-decoration: none;
    color: inherit;
    transition: background-color 0.2s;
    border-radius: 4px;
}

.news-link:hover, .news-link:active {
    background-color: #fdf2f2; 
}

.news-left {
    display: flex;
    align-items: flex-start;
    flex-grow: 1;
    gap: 12px;
}

.tag {
    padding: 4px 10px;
    border-radius: 2px;
    font-size: 0.85rem;
    font-weight: bold;
    white-space: nowrap;
}

.news-title {
    font-size: 1.05rem;
    color: #333;
    font-weight: bold;
    line-height: 1.4;
}

.read-more-text {
    font-size: 0.9rem;
    color: var(--primary-red);
    font-weight: bold;
    white-space: nowrap;
    margin-left: 15px;
}

/* =========================================
   论坛三大板块 Grid
   ========================================= */
.forum-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}

.category-card { padding: 0; overflow: hidden; }

.card-header {
    padding: 25px 20px;
    display: flex;
    flex-direction: column; 
    align-items: center;
    justify-content: center;
    border-bottom: 3px solid var(--accent-gold);
}

.header-red {
    background-color: var(--primary-red);
    color: var(--accent-gold);
}

.category-icon { width: 50px; height: 50px; object-fit: contain; margin-bottom: 12px; }

.card-header h3 {
    font-size: 1.4rem;
    text-align: center;
    letter-spacing: 2px;
    font-family: 'SimSun', 'STSong', serif; 
}

.sub-categories { list-style: none; padding: 20px; background-color: var(--content-white); }
.sub-categories li { margin-bottom: 15px; }

.gov-link {
    text-decoration: none;
    color: var(--text-main);
    display: block;
    padding: 12px 15px;
    border: 1px solid #EEEEEE;
    background-color: #FBFBFB;
    border-left: 4px solid transparent; 
    transition: all 0.2s;
}

.gov-link:hover {
    background-color: #FFF9E6; 
    color: var(--primary-red);
    border-color: var(--accent-gold);
    border-left: 4px solid var(--primary-red); 
    font-weight: bold;
}

/* =========================================
   论坛双栏布局与帖子流
   ========================================= */
.forum-layout { display: flex; gap: 30px; margin-top: 30px; align-items: flex-start; }
.sidebar { width: 260px; flex-shrink: 0; padding: 20px; position: sticky; top: 20px; }
.nav-group { margin-bottom: 25px; }
.nav-main-title { color: var(--primary-red); font-size: 1.1rem; border-bottom: 2px solid var(--accent-gold); padding-bottom: 5px; margin-bottom: 10px; }
.nav-sub-list { list-style: none; padding-left: 10px; }
.nav-sub-list li { margin-bottom: 8px; }
.nav-sub-list a { text-decoration: none; color: var(--text-main); font-size: 0.95rem; transition: color 0.2s; }
.nav-sub-list a:hover { color: var(--primary-red); font-weight: bold; text-decoration: underline; }

.main-feed { flex-grow: 1; }
.breadcrumb { padding: 12px 20px; margin-bottom: 20px; font-weight: bold; color: var(--primary-red); background-color: rgba(255, 255, 255, 0.9); border-left: 5px solid var(--accent-gold); }

.post-box { padding: 20px; border-top: 4px solid var(--accent-gold); }
#post-input { width: 100%; height: 100px; padding: 15px; border: 1px solid #ddd; border-radius: 4px; background-color: #f9f9f9; font-size: 1.1rem; resize: none; font-family: inherit; }
.post-actions { text-align: right; margin-top: 10px; }

.post-card { background: rgba(255, 255, 255, 0.95); margin-bottom: 20px; border-radius: 4px; border-left: 5px solid var(--primary-red); box-shadow: 0 2px 10px rgba(0,0,0,0.2); padding: 20px; }
.post-header { display: flex; justify-content: space-between; margin-bottom: 10px; font-size: 0.9rem; color: var(--text-sub); border-bottom: 1px solid #eee; padding-bottom: 5px; }
.post-author { color: var(--primary-red); font-weight: bold; }
.post-content { font-size: 1.1rem; color: #222; margin: 15px 0; white-space: pre-wrap; }

.reply-section { margin-top: 15px; padding-left: 20px; border-left: 2px dashed #ddd; }
.reply-item { font-size: 0.95rem; padding: 8px 0; border-bottom: 1px solid #f0f0f0; }
.reply-author { color: #555; font-weight: bold; margin-right: 10px; }
.reply-input-group { display: flex; margin-top: 10px; }
.reply-input-group input { flex-grow: 1; padding: 8px; border: 1px solid #ddd; border-radius: 4px 0 0 4px; }
.btn-reply { background: var(--primary-red); color: var(--accent-gold); border: none; padding: 0 15px; border-radius: 0 4px 4px 0; cursor: pointer; }

/* =========================================
   页脚 Footer
   ========================================= */
.gov-footer { background-color: var(--primary-red); color: var(--content-white); padding: 40px 0; text-align: center; border-top: 4px solid var(--accent-gold); }
.gov-footer p { font-size: 1rem; margin-bottom: 10px; color: var(--content-white); }

/* =========================================
   📱 移动端深度适配 (干净无嵌套版)
   ========================================= */

/* 平板及小屏笔记本 (Max-width: 900px) */
@media (max-width: 900px) {
    .forum-layout { flex-direction: column; margin-top: 15px; gap: 15px; }
    .sidebar { width: 100%; position: static; padding: 15px; margin-bottom: 0; }
    .nav-sub-list { display: flex; flex-wrap: wrap; gap: 10px; }
    .nav-sub-list li { margin-bottom: 0; }
    .nav-sub-list a { display: inline-block; background: #f5f5f5; padding: 5px 12px; border-radius: 20px; border: 1px solid #eee; }
}

/* 手机端 (Max-width: 600px) */
@media (max-width: 600px) {
    .header-content { flex-direction: column; text-align: center; gap: 15px; }
    .header-logos { justify-content: center; }
    .forum-logo, .ua-logo { height: 50px; }
    .header-divider { height: 40px; margin: 0 15px; }
    .header-titles { text-align: center; }
    .main-title { font-size: 2rem; letter-spacing: 1px; }
    .header-flags { text-align: center; margin-top: 15px; }
    #user-status-container > div { justify-content: center !important; margin-top: 10px; }

    .gov-container { padding: 0 10px; }
    .gov-panel { padding: 15px; margin-bottom: 15px; }
    .forum-grid { grid-template-columns: 1fr; gap: 15px; }

    /* 手机端公告块：将按钮放在标题下方 */
    .news-link {
        flex-direction: column; 
        align-items: flex-start;
        gap: 12px;
    }
    .read-more-text {
        display: block;
        width: 100%;
        text-align: center;
        background-color: #f5f5f5;
        border: 1px solid #ddd;
        padding: 10px 0;
        border-radius: 4px;
        margin-left: 0;
    }

    .post-box { padding: 15px 10px; }
    #post-input { height: 80px; }
    .post-card { padding: 15px; border-left: 3px solid var(--primary-red); }
    .post-header { flex-direction: column; align-items: flex-start !important; gap: 5px; }
    
    .reply-input-group { flex-direction: column; }
    .reply-input-group input { border-radius: 4px; margin-bottom: 8px; }
    .btn-reply, .reply-input-group button { border-radius: 4px !important; width: 100%; padding: 10px 0; }

    .post-card img[style*="width:calc(33.33%"] { width: calc(50% - 4px) !important; height: 100px !important; }
}