/* ============ 全局样式 ============ */
* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background-color: #f5f7fa;
    color: #333;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

/* ============ 导航栏样式 ============ */
.navbar-brand {
    font-weight: 700;
    font-size: 1.4rem;
    color: #1e88e5 !important;
}

.nav-link {
    color: #555 !important;
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    transition: all 0.2s;
}

.nav-link:hover,
.nav-link.active {
    color: #1e88e5 !important;
    background-color: rgba(30, 136, 229, 0.08);
    border-radius: 6px;
}

/* ============ 轮播图样式 ============ */
.carousel-item img {
    width: 100%;
    height: 420px;
    object-fit: cover;
    background-color: #e9ecef;
}

.carousel-indicators [data-bs-target] {
    width: 40px;
    height: 4px;
    border-radius: 2px;
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
    width: 3rem;
    height: 3rem;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 50%;
    background-size: 50% 50%;
}

/* 图片加载失败占位 */
img {
    background-color: #e9ecef;
    position: relative;
}

img::after {
    content: "图片加载失败";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #e9ecef;
    color: #999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    border: 1px dashed #ccc;
}

/* ============ 投票提醒条 ============ */
.vote-alert {
    background: linear-gradient(90deg, #ff9800, #ffb74d);
    color: #fff !important;
    border: none;
    border-radius: 0;
    margin-bottom: 0;
    padding: 10px 0;
    font-weight: 500;
}

.vote-alert a {
    color: #fff !important;
    font-weight: 600;
    text-decoration: underline;
    margin-left: 8px;
}

.vote-alert .btn-close {
    filter: brightness(0) invert(1);
}

/* ============ 快捷入口卡片 ============ */
.quick-entry-card {
    text-align: center;
    padding: 24px 16px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid #eef0f3;
    transition: all 0.25s;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
}

.quick-entry-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(30, 136, 229, 0.12);
    border-color: #bbdefb;
    color: inherit;
}

.quick-entry-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    margin: 0 auto 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: #fff;
}

.quick-entry-card h5 {
    font-size: 15px;
    font-weight: 600;
    margin: 0;
}

.icon-blue {
    background: linear-gradient(135deg, #1e88e5, #42a5f5);
}

.icon-green {
    background: linear-gradient(135deg, #43a047, #66bb6a);
}

.icon-orange {
    background: linear-gradient(135deg, #fb8c00, #ffa726);
}

.icon-purple {
    background: linear-gradient(135deg, #8e24aa, #ab47bc);
}

/* ============ 通用卡片 ============ */
.section-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 16px;
    padding-left: 12px;
    border-left: 4px solid #1e88e5;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-title a {
    font-size: 14px;
    font-weight: normal;
    color: #1e88e5;
    text-decoration: none;
}

.card-custom {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    border: 1px solid #eef0f3;
    overflow: hidden;
    transition: all 0.2s;
}

.card-custom:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

/* ============ 最新动态区 ============ */
.notice-item {
    padding: 14px 0;
    border-bottom: 1px dashed #eef0f3;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.notice-item:last-child {
    border-bottom: none;
}

.notice-title {
    color: #1e88e5;
    text-decoration: none;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.notice-title:hover {
    text-decoration: underline;
}

.notice-date {
    color: #999;
    font-size: 13px;
    white-space: nowrap;
}

.news-summary-item {
    display: flex;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px dashed #eef0f3;
}

.news-summary-item:last-child {
    border-bottom: none;
}

.news-summary-thumb {
    width: 120px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

.news-summary-body {
    flex: 1;
    min-width: 0;
}

.news-summary-title {
    font-weight: 600;
    font-size: 15px;
    color: #333;
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 6px;
}

.news-summary-title:hover {
    color: #1e88e5;
}

.news-summary-text {
    font-size: 13px;
    color: #777;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
}

/* ============ 列表页样式 ============ */
.page-header {
    padding: 40px 0 20px;
    background: #fff;
    border-bottom: 1px solid #eef0f3;
    margin-bottom: 24px;
}

.page-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0;
}

.page-subtitle {
    color: #777;
    margin-top: 6px;
    font-size: 14px;
}

/* Tab 导航 */
.nav-tabs-custom {
    border-bottom: 2px solid #eef0f3;
    margin-bottom: 20px;
}

.nav-tabs-custom .nav-link {
    border: none;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    margin-bottom: -2px;
    color: #666 !important;
    background: transparent !important;
    padding: 10px 20px !important;
}

.nav-tabs-custom .nav-link.active {
    color: #1e88e5 !important;
    border-bottom-color: #1e88e5;
    font-weight: 600;
    background: transparent !important;
}

/* ============ 通知列表 ============ */
.notice-list-item {
    padding: 18px 20px;
    background: #fff;
    border-radius: 10px;
    margin-bottom: 12px;
    border: 1px solid #eef0f3;
    transition: all 0.2s;
    cursor: pointer;
}

.notice-list-item:hover {
    border-color: #bbdefb;
    box-shadow: 0 4px 12px rgba(30, 136, 229, 0.08);
}

.notice-list-title {
    color: #1976d2;
    font-weight: 600;
    font-size: 16px;
    margin: 0 0 8px 0;
    text-decoration: none;
    display: block;
}

.notice-meta {
    font-size: 13px;
    color: #888;
    display: flex;
    gap: 16px;
}

.badge-category {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.cat-property {
    background: #e3f2fd;
    color: #1976d2;
}

.cat-committee {
    background: #e8f5e9;
    color: #2e7d32;
}

.cat-service {
    background: #fff3e0;
    color: #ef6c00;
}

/* ============ 新闻列表 ============ */
.news-list-item {
    display: flex;
    gap: 20px;
    padding: 20px;
    background: #fff;
    border-radius: 10px;
    margin-bottom: 16px;
    border: 1px solid #eef0f3;
    transition: all 0.2s;
}

.news-list-item:hover {
    border-color: #bbdefb;
    box-shadow: 0 4px 16px rgba(30, 136, 229, 0.1);
}

.news-list-cover {
    width: 220px;
    height: 124px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

.news-list-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.news-list-title {
    font-size: 18px;
    font-weight: 700;
    color: #333;
    text-decoration: none;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-list-title:hover {
    color: #1e88e5;
}

.news-list-summary {
    color: #666;
    line-height: 1.6;
    font-size: 14px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
    margin: 0 0 10px 0;
}

.news-list-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: #999;
}

/* ============ 新闻详情 ============ */
.detail-container {
    background: #fff;
    border-radius: 12px;
    padding: 32px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.detail-title {
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 16px;
}

.detail-meta {
    color: #888;
    font-size: 14px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eef0f3;
    margin-bottom: 24px;
    display: flex;
    gap: 20px;
}

.detail-content {
    line-height: 1.8;
    font-size: 15px;
    color: #444;
}

.detail-content img {
    max-width: 100%;
    border-radius: 8px;
    margin: 12px 0;
}

.detail-gallery {
    margin-top: 28px;
}

/* ============ 活动卡片 ============ */
.activity-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #eef0f3;
    transition: all 0.25s;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.activity-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.08);
}

.activity-cover {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.activity-card-body {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.activity-card-title {
    font-size: 16px;
    font-weight: 700;
    color: #333;
    margin-bottom: 10px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.activity-card-time {
    font-size: 13px;
    color: #888;
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ============ 活动详情 ============ */
.activity-detail-cover {
    width: 100%;
    height: 360px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 24px;
}

.activity-info-row {
    display: flex;
    gap: 32px;
    flex-wrap: wrap;
    padding: 16px 20px;
    background: #f8fafc;
    border-radius: 10px;
    margin-bottom: 24px;
}

.activity-info-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #555;
    font-size: 14px;
}

.activity-info-item strong {
    color: #333;
}

.registration-box {
    background: linear-gradient(135deg, #e3f2fd, #f3e5f5);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    text-align: center;
}

.registration-box h5 {
    margin-bottom: 14px;
    color: #1e88e5;
}

/* ============ 招领启事 ============ */
.foundlost-item {
    padding: 18px 20px;
    background: #fff;
    border-radius: 10px;
    margin-bottom: 12px;
    border: 1px solid #eef0f3;
    cursor: pointer;
    transition: all 0.2s;
}

.foundlost-item:hover {
    border-color: #bbdefb;
    box-shadow: 0 4px 12px rgba(30, 136, 229, 0.08);
}

.foundlost-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.foundlost-title {
    font-weight: 600;
    font-size: 16px;
    color: #333;
    flex: 1;
}

.badge-type-found {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.badge-type-lost {
    background: #fce4ec;
    color: #c62828;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.badge-status-active {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.badge-status-resolved {
    background: #eeeeee;
    color: #757575;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.foundlost-meta {
    color: #888;
    font-size: 13px;
    display: flex;
    gap: 16px;
}

/* ============ 投票列表 ============ */
.vote-card {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 16px;
    border: 1px solid #eef0f3;
    transition: all 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.vote-card:hover {
    border-color: #bbdefb;
    box-shadow: 0 4px 16px rgba(30, 136, 229, 0.08);
}

.vote-info h5 {
    font-weight: 700;
    color: #333;
    margin-bottom: 10px;
    font-size: 17px;
}

.vote-meta {
    color: #888;
    font-size: 13px;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.badge-type-single {
    background: #e3f2fd;
    color: #1976d2;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.badge-type-multi {
    background: #f3e5f5;
    color: #7b1fa2;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.badge-status-ongoing {
    background: #fff8e1;
    color: #f57f17;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.badge-status-ended {
    background: #eceff1;
    color: #546e7a;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

/* ============ 投票详情 ============ */
.vote-detail-container {
    background: #fff;
    border-radius: 12px;
    padding: 32px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.vote-detail-title {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.vote-detail-desc {
    color: #666;
    line-height: 1.7;
    padding: 16px;
    background: #f8fafc;
    border-radius: 8px;
    margin-bottom: 24px;
}

.vote-option {
    padding: 14px 18px;
    border: 1.5px solid #eef0f3;
    border-radius: 10px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 12px;
}

.vote-option:hover {
    border-color: #90caf9;
    background: #f5faff;
}

.vote-option.selected {
    border-color: #1e88e5;
    background: #e3f2fd;
}

.vote-option input {
    width: 18px;
    height: 18px;
    cursor: pointer;
    flex-shrink: 0;
}

.vote-option-label {
    flex: 1;
    font-weight: 500;
    font-size: 15px;
}

/* 投票结果进度条 */
.vote-result-item {
    margin-bottom: 18px;
}

.vote-result-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 500;
}

.vote-result-bar {
    height: 24px;
    background: #eef0f3;
    border-radius: 12px;
    overflow: hidden;
}

.vote-result-fill {
    height: 100%;
    background: linear-gradient(90deg, #1e88e5, #42a5f5);
    border-radius: 12px;
    transition: width 0.6s ease;
    display: flex;
    align-items: center;
    padding: 0 10px;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    min-width: 40px;
}

/* ============ 页脚 ============ */
.footer {
    background: #2c3e50;
    color: #bbb;
    padding: 32px 0 20px;
    margin-top: 60px;
    font-size: 14px;
}

.footer a {
    color: #bbb;
    text-decoration: none;
}

.footer a:hover {
    color: #fff;
}

.footer-brand {
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 10px;
}

.footer-copyright {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #3d5266;
    margin-top: 20px;
    color: #8899a6;
    font-size: 13px;
}

/* ============ 空状态 ============ */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-state-icon {
    font-size: 60px;
    margin-bottom: 16px;
    color: #ccc;
}

.empty-state-text {
    font-size: 15px;
}

/* ============ 加载状态 ============ */
.loading-spinner {
    text-align: center;
    padding: 60px 20px;
    color: #888;
}

.spinner-border-custom {
    width: 3rem;
    height: 3rem;
    border-width: 0.3em;
    color: #1e88e5;
}

/* ============ 响应式 ============ */
@media (max-width: 768px) {
    .carousel-item img {
        height: 220px;
    }

    .page-header {
        padding: 24px 0 16px;
    }

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

    .detail-container,
    .vote-detail-container {
        padding: 20px;
    }

    .detail-title,
    .vote-detail-title {
        font-size: 1.3rem;
    }

    .activity-detail-cover {
        height: 200px;
    }

    .news-list-item {
        flex-direction: column;
        gap: 14px;
    }

    .news-list-cover {
        width: 100%;
        height: 180px;
    }

    .news-summary-item {
        flex-direction: column;
    }

    .news-summary-thumb {
        width: 100%;
        height: 150px;
    }

    .activity-info-row {
        gap: 14px;
        flex-direction: column;
    }

    .vote-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .foundlost-header {
        flex-wrap: wrap;
    }
}
