:root {
    /* 核心品牌色 - 统一主题蓝色（与UNIAPP一致） */
    --primary-color: #3b82f6; 
    --primary-hover: #2563eb;
    --primary-active: #1d4ed8;
    --primary-light: #dbeafe; 
    --primary-bg: #eff6ff;
    
    /* 辅助色 - 分类标识 */
    --accent-tender: #3b82f6; /* 招标 - 蓝 */
    --accent-win: #059669;    /* 中标 - 绿 */
    --accent-plan: #d97706;   /* 商机 - 橙 */
    --accent-org: #7c3aed;    /* 机构 - 紫 */

    /* 中性色系 */
    --text-primary: #1e293b; /* 深蓝灰，更现代 */
    --text-secondary: #475569;
    --text-tertiary: #94a3b8;
    --bg-body: #f1f5f9;      /* 冷灰背景 */
    --bg-white: #ffffff;
    --border-color: #e2e8f0;
    
    /* 阴影系统 */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    
    /* 尺寸 */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s;
}

ul { list-style: none; }

.container {
    width: 78%;
    max-width: 1800px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}

/* --- Header --- */
header {
    background: var(--bg-white);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
    box-sizing: border-box;
}

.top-bar {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%); /* 统一主题蓝色（与UNIAPP一致） */
    color: #ffffff;
    font-size: 13px;
    height: 40px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    width: 100%;
    box-sizing: border-box;
}

.top-bar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.top-links a {
    margin-left: 20px;
    opacity: 0.8;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.top-links a:hover { opacity: 1; color: #fff; }

.top-links #user-auth-link {
    margin-left: 20px;
    display: inline-block;
}

.top-links #user-auth-link a {
    margin-left: 0;
}

.header-main {
    padding-top: 16px;
    padding-bottom: 16px;
    display: flex;
    align-items: flex-end;
    gap: 20px;
}

.logo-box {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    font-size: 26px;
    font-weight: 800;
    color: var(--primary-color);
    letter-spacing: -0.5px;
    /* 改为自适应宽度，消除右侧间隙 */
    flex: 0 0 auto;
    width: auto;
    min-width: 0;
    max-width: 60%;
}

.logo-box .logo-icon {
    width: auto;
    height: auto;
}

.logo-box .logo-icon img, .logo-img {
    /* 固定高度，宽度自适应，使容器紧贴图片 */
    height: 120px;
    width: auto;
    object-fit: contain;
    object-position: left center;
}

.logo-icon {
    width: 100%;
    /* height removed to allow auto sizing */
    background: transparent;
    border-radius: var(--radius-md);
    color: white;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    font-size: 20px;
    box-shadow: none;
}

.logo-text {
    font-size: 15px;
    font-weight: 600;
    color: var(--primary-color);
    white-space: nowrap;
    line-height: 1.2;
    margin-top: 4px;
}

/* Search */
.search-wrapper { 
    flex: 1; 
    min-width: 0; /* 允许flex item缩小 */
    max-width: none; /* 取消最大宽度限制，使其自适应容器 */
}

.search-container {
    display: flex;
    border: 2px solid var(--primary-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: box-shadow 0.2s;
    background: #fff; /* 确保背景白 */
}

.search-container:focus-within {
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}

.search-input {
    flex: 1;
    border: none;
    padding: 12px 20px;
    font-size: 15px;
    outline: none;
}

.search-btn {
    width: 100px;
    background: var(--primary-color);
    color: white;
    border: none;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.search-btn:hover { background: var(--primary-hover); }

.search-helper {
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-tertiary);
    margin-bottom: 12px; /* 增加底部间距 */
}
.search-helper span:hover { color: var(--primary-color); cursor: pointer; text-decoration: underline; }
/* 热门搜索关键词链接（接口动态渲染；无样式时 a 会带默认蓝色下划线） */
.search-helper a { color: inherit; text-decoration: none; }
.search-helper a:hover { color: var(--primary-color); cursor: pointer; text-decoration: underline; }

/* Stats Bar - Revised Layout */
.stats-bar {
    display: flex;
    align-items: center;
    justify-content: space-evenly; /* 四组指标均匀分布 */
    padding: 12px 20px;
    background: #f8fafc; /* 使用极淡的背景色区分 */
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    width: 100%; /* 填满父容器 */
    box-sizing: border-box;
}

.stats-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.stats-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-label { 
    font-size: 13px; 
    color: var(--text-secondary);
}

.stat-num {
    font-size: 18px;
    font-weight: 700;
    font-family: 'DIN Alternate', 'Roboto', sans-serif;
    line-height: 1;
    margin-left: 4px; /* 数字和文字稍微分开一点 */
}

.text-blue { color: var(--primary-color); }
.text-orange { color: #f97316; }
.text-green { color: #10b981; }

.stats-divider-v {
    width: 1px;
    height: 14px;
    background: var(--border-color);
}

/* --- 消息通知条样式 --- */
.notification-banner {
    position: relative;
    z-index: 50;
    animation: slideDown 0.5s ease-out;
    /* 恢复全屏宽度 */
    background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
    border-bottom: 1px solid rgba(59, 130, 246, 0.1);
}

.notification-banner .container {
    /* 恢复正常的container样式 */
    width: 78%;
    max-width: 1800px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}

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

.notification-content {
    display: flex;
    align-items: center;
    padding: 8px 0;  /* 从12px减少到8px */
    gap: 12px;       /* 从15px减少到12px */
    width: 100%;     /* 确保占满容器宽度 */
    box-sizing: border-box;
}

.notification-icon {
    flex-shrink: 0;
    width: 28px;     /* 从35px减少到28px */
    height: 28px;    /* 从35px减少到28px */
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.notification-icon span {
    font-size: 16px;  /* 从18px减少到16px */
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.notification-scroll {
    flex: 1;
    overflow: hidden;
    height: 36px;    /* 从50px减少到36px */
    display: flex;
    align-items: center;
    position: relative;
}

.notification-text {
    font-size: 13px;  /* 从14px减少到13px */
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.3; /* 从1.4减少到1.3 */
    cursor: pointer;
    transition: color 0.2s ease;
    white-space: nowrap;
    animation: marquee 15s linear infinite;
    padding-right: 100px; /* 确保文字完全滚出视窗 */
}

.notification-text:hover {
    color: var(--primary-color);
    animation-play-state: paused;
}

@keyframes marquee {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

.notification-controls {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
}

.notification-btn {
    width: 26px;      /* 从28px减少到26px */
    height: 26px;     /* 从28px减少到26px */
    border: none;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;  /* 从16px减少到14px */
    font-weight: bold;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.notification-btn:hover {
    background: white;
    color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.notification-close {
    color: #ef4444 !important;
}

.notification-close:hover {
    background: #fef2f2 !important;
    color: #dc2626 !important;
}

/* 通知类型样式 */
.notification-banner.type-announcement {
    background: linear-gradient(135deg, #e8f5e8 0%, #f0f9ff 100%) !important;
}

.notification-banner.type-activity {
    background: linear-gradient(135deg, #fff7ed 0%, #fef3e2 100%) !important;
}

.notification-banner.type-system {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%) !important;
}

.notification-banner.type-emergency {
    background: linear-gradient(135deg, #fecaca 0%, #fed7d7 100%) !important;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .notification-content {
        padding: 6px 0;   /* 从8px减少到6px */
        gap: 8px;         /* 从10px减少到8px */
    }

    .notification-icon {
        width: 24px;      /* 从30px减少到24px */
        height: 24px;     /* 从30px减少到24px */
    }

    .notification-icon span {
        font-size: 14px;  /* 从16px减少到14px */
    }

    .notification-text {
        font-size: 12px;  /* 从13px减少到12px */
        line-height: 1.2; /* 进一步减少行高 */
    }

    .notification-btn {
        width: 22px;      /* 从24px减少到22px */
        height: 22px;     /* 从24px减少到22px */
        font-size: 12px;  /* 从14px减少到12px */
    }

    .notification-scroll {
        height: 30px;     /* 从40px减少到30px */
    }
}

@media (max-width: 480px) {
    .notification-controls .notification-prev,
    .notification-controls .notification-next {
        display: none; /* 在小屏幕上隐藏切换按钮 */
    }
}

/* --- Navigation Grid --- */
.nav-section { 
    padding: 24px 0; 
    width: 100%;
    box-sizing: border-box;
}
.nav-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px; /* 增加间距，更协调 */
}

.nav-box {
    background: var(--bg-white);
    padding: 20px 24px; /* 与section-card保持一致的内边距 */
    border-radius: var(--radius-lg); /* 使用更大的圆角，与section-card一致 */
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-height: 120px; /* 使用最小高度，更灵活 */
}

.nav-box:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

/* Nav Box Header Accents - 移除左侧彩色边框和右侧圆形装饰，保持简洁商务风格 */
.nav-box { border-top: none; border-left: none; }

.nav-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-primary);
    position: relative;
    padding-left: 14px; /* 为左侧装饰线留出空间 */
    line-height: 1.4;
}

/* 添加与section-title一致的左侧装饰线 */
.nav-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 2px;
    bottom: 2px;
    width: 4px;
    border-radius: 2px;
    background: var(--primary-color);
    opacity: 0.8;
}

/* 为不同类别的卡片设置不同的装饰线颜色 */
.nav-box.nav-tender .nav-title::before { background: var(--accent-tender); }
.nav-box.nav-win .nav-title::before { background: var(--accent-win); }
.nav-box.nav-plan .nav-title::before { background: var(--accent-plan); }
.nav-box.nav-org .nav-title::before { background: var(--accent-org); }

.nav-items {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px; /* 优化间距，更紧凑整齐 */
    position: relative;
    flex: 1;
}

.nav-item {
    font-size: 13px;
    color: var(--text-secondary);
    padding: 4px 8px;
    background: transparent;
    border-radius: var(--radius-sm);
    text-align: left;
    transition: all 0.2s ease;
    cursor: pointer;
    white-space: nowrap;
    line-height: 1.5;
}

.nav-item:hover {
    color: var(--primary-color);
    background: var(--primary-light);
    text-decoration: none;
}

/* --- Layout --- */
.main-layout {
    display: flex;
    gap: 24px;
    padding-bottom: 60px;
}
.left-content {
    flex: 1;
    min-width: 0; /* 防止Flex子项溢出 */
    display: flex;
    flex-direction: column;
    gap: 24px;
    max-width: 100%; /* 确保占满整个容器宽度 */
}

/* --- Section Cards --- */
.section-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    padding: 24px;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.section-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    position: relative;
    padding-left: 16px;
}

.section-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 4px;
    bottom: 4px;
    width: 6px;
    border-radius: 4px;
    background: var(--primary-color);
}

/* Tabs */
.tabs { display: flex; gap: 8px; margin-left: 24px; }
.tab-btn {
    padding: 6px 16px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-secondary);
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}
.tab-btn:hover { background: var(--bg-body); color: var(--primary-color); }
.tab-btn.active { background: var(--primary-color); color: white; font-weight: 500; box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2); }

.view-more {
    font-size: 13px;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: color 0.2s;
}
.view-more:hover { color: var(--primary-color); }

/* --- List Items --- */
.item-list { display: grid; grid-template-columns: 1fr; gap: 12px; }

.list-card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    transition: all 0.3s;
    position: relative;
    cursor: pointer;
}

.list-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

/* Colored accent bar on hover/active */
.list-card::after {
    content: '';
    position: absolute;
    left: 0;
    top: 10px;
    bottom: 10px;
    width: 3px;
    background: var(--primary-color);
    border-radius: 0 4px 4px 0;
    opacity: 0;
    transition: opacity 0.2s;
}
.list-card:hover::after { opacity: 1; }

.card-header { display: flex; gap: 10px; margin-bottom: 8px; align-items: flex-start; }

.tag {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 500;
    white-space: nowrap;
}

.tag.tender { color: var(--accent-tender); background: #eff6ff; border: 1px solid #bfdbfe; }
.tag.win { color: var(--accent-win); background: #ecfdf5; border: 1px solid #a7f3d0; }
.tag.plan { color: var(--accent-plan); background: #fffbeb; border: 1px solid #fde68a; }

.card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: auto;
    min-height: 21px;
}
.list-card:hover .card-title { color: var(--primary-color); }

.card-date { font-size: 12px; color: #94a3b8; white-space: nowrap; }

.card-footer {
    border-top: 1px dashed var(--border-color);
    margin-top: 8px;
    padding-top: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--text-secondary);
}

.card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    flex-wrap: wrap;
    row-gap: 4px;
}

.card-meta .location {
    color: var(--text-secondary);
}

.card-meta .card-date {
    color: #94a3b8;
}

.card-meta .card-extra-info {
    color: var(--text-secondary);
    font-size: 12px;
    white-space: nowrap;
    flex-shrink: 0;
}

.card-budget {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary-color);
    white-space: nowrap;
    flex-shrink: 0;
}

/* --- Org List --- */
.org-list { 
    display: grid; 
    gap: 16px; 
    grid-template-columns: 1fr;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

@media (min-width: 768px) {
    .org-list {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }
}

.org-card {
    display: flex;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all 0.2s;
    height: 100px;
    overflow: hidden;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
}
.org-card:hover { border-color: var(--primary-color); box-shadow: var(--shadow-md); }

.org-logo {
    width: 64px;
    height: 64px;
    min-width: 64px;
    max-width: 64px;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: var(--primary-color);
    overflow: hidden;
    margin-right: 16px;
    flex-shrink: 0;
}

.org-info { 
    flex: 1; 
    min-width: 0;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.org-header { 
    display: flex; 
    flex-direction: column;
    margin-bottom: 4px; 
    min-width: 0;
    gap: 4px;
    flex-shrink: 0;
}
.org-name { 
    font-size: 15px; 
    font-weight: 700; 
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%;
    line-height: 1.3;
}
.org-stats {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}
.org-stats span {
    font-size: 11px;
    color: var(--text-secondary);
    background: var(--bg-body);
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
    flex-shrink: 0;
}
.org-latest { 
    font-size: 12px; 
    color: var(--text-secondary); 
    margin-top: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex-shrink: 0;
    line-height: 1.4;
    display: block;
}

/* --- Detail Page Styles --- */

/* Breadcrumb */
.breadcrumb {
    padding: 16px 0;
    font-size: 13px;
    color: var(--text-secondary);
}
.breadcrumb a { color: var(--text-secondary); }
.breadcrumb a:hover { color: var(--primary-color); text-decoration: underline; }
.breadcrumb span { color: var(--text-primary); }

/* Detail Card */
.detail-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    padding: 30px;
}

.detail-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 20px;
    margin-bottom: 20px;
}

.detail-top-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.detail-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.4;
    flex: 1;
    margin-right: 20px;
}

.detail-actions {
    display: flex;
    gap: 12px;
    flex-shrink: 0;
}

.btn-outline, .btn-primary, .btn-login-full {
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.btn-outline {
    background: white;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
}
.btn-outline:hover { background: var(--primary-light); }

.btn-primary {
    background: var(--primary-color);
    border: 1px solid var(--primary-color);
    color: white;
}
.btn-primary:hover { background: var(--primary-hover); }

.detail-meta-row {
    display: flex;
    gap: 40px;
    color: var(--text-secondary);
    font-size: 14px;
}

.hidden-content-box {
    background: #fdf2f2; /* Light red/pink bg similar to warning */
    border: 1px solid #fab1a0;
    color: #c0392b;
    padding: 15px;
    text-align: center;
    font-size: 14px;
    margin-bottom: 30px;
}

.detail-content {
    font-size: 15px;
    line-height: 1.8;
    color: var(--text-primary);
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}

.detail-content p { margin-bottom: 20px; }

.detail-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    table-layout: auto; /* 允许表格根据内容调整列宽 */
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.detail-table td {
    border: 1px solid var(--border-color);
    padding: 12px;
    vertical-align: top;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 200px; /* 限制单元格最大宽度 */
}

.detail-table tr:nth-child(odd) { background: #f8fafc; }

/* Login Sidebar Card */
.sidebar-section.login-card {
    text-align: center;
    background: #eff6ff; /* Light blue background */
    border: none;
}

.login-header {
    color: var(--primary-color);
    font-weight: 700;
    margin-bottom: 20px;
    font-size: 16px;
}

.login-decoration { opacity: 0.5; margin: 0 5px; }

.login-icon-area {
    font-size: 48px;
    margin-bottom: 15px;
}

.login-text { margin-bottom: 20px; }
.login-text strong { display: block; font-size: 16px; margin-bottom: 5px; color: var(--text-primary); }
.login-text p { font-size: 12px; color: var(--text-tertiary); }

.btn-login-full {
    width: 100%;
    background: #007bff; /* Bright blue */
    color: white;
    border: none;
    padding: 10px;
    border-radius: 20px;
    font-size: 16px;
}
.btn-login-full:hover { background: #3b82f6; }

/* Recommend List */
.recommend-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.recommend-item a {
    font-size: 15px;
    color: var(--text-primary);
}
.recommend-item a:hover { color: var(--primary-color); text-decoration: underline; }

.simple-list li {
    padding: 10px 0;
    border-bottom: 1px dashed var(--border-color);
}
.simple-list li:last-child { border-bottom: none; }
.simple-list li a { font-size: 14px; color: var(--text-secondary); }
.simple-list li a:hover { color: var(--primary-color); }

/* --- Sidebar --- */
.sidebar-section {
    background: var(--bg-white);
    padding: 20px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}
.sidebar-header {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
}

.sub-item {
    padding-bottom: 12px;
    margin-bottom: 12px;
    border-bottom: 1px dashed var(--border-color);
    cursor: pointer;
    transition: all 0.2s;
}
.sub-item:last-child { margin: 0; border: none; padding: 0; }
.sub-title { font-size: 14px; margin-bottom: 4px; transition: color 0.2s; color: var(--text-primary); }
.sub-item:hover .sub-title { color: var(--primary-color); }
.sub-meta { font-size: 12px; color: var(--text-tertiary); display: flex; justify-content: space-between; }

/* 确保链接内的sub-item样式正常 */
a .sub-item {
    cursor: pointer;
}
a:hover .sub-item .sub-title {
    color: var(--primary-color);
}

.hot-list li {
    display: flex;
    gap: 12px;
    margin-bottom: 14px;
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
    align-items: center;
}
.hot-list li:hover { color: var(--primary-color); }

.rank-num {
    width: 20px;
    height: 20px;
    background: #f1f5f9;
    color: #64748b;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
}
.hot-list li:nth-child(1) .rank-num { background: #fee2e2; color: #ef4444; }
.hot-list li:nth-child(2) .rank-num { background: #ffedd5; color: #f97316; }
.hot-list li:nth-child(3) .rank-num { background: #fef3c7; color: #f59e0b; }

/* --- 推荐区域侧边栏样式 --- */
#recommendation-placeholder {
    flex-shrink: 0; /* 作为 .main-layout 的 flex 子项时不被压缩 */
}

.recommendation-sidebar {
    width: 280px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.recommendation-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.recommendation-header {
    padding: 12px 16px 10px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.recommendation-header h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.manage-link, .view-more-link {
    font-size: 12px;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.manage-link:hover, .view-more-link:hover {
    color: var(--primary-hover);
}

/* 订阅卡片特殊样式 */
.subscription-card .recommendation-header {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-bottom: 1px solid #bae6fd;
}

.subscription-card .recommendation-header h3 {
    color: var(--primary-color);
}

.subscription-list {
    padding: 12px 16px;
}

.subscription-list .login-prompt {
    text-align: center;
    padding: 20px 0;
}

.login-prompt-icon {
    font-size: 32px;
    margin-bottom: 12px;
    opacity: 0.8;
}

.login-prompt-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.login-prompt-text {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 16px;
}

.btn-login-recommendation {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-login-recommendation:hover {
    background: var(--primary-hover);
}

/* 推荐列表样式 */
.recommendation-list {
    padding: 12px 16px;
}

.recommendation-item {
    display: block;
    padding: 10px 0;
    border-bottom: 1px dashed var(--border-color);
    transition: all 0.2s;
    text-decoration: none;
    color: inherit;
}

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

.recommendation-item:hover {
    transform: translateX(4px);
}

.recommendation-item-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.recommendation-item-meta {
    font-size: 12px;
    color: var(--text-tertiary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.recommendation-item-type {
    background: #f1f5f9;
    color: #64748b;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}

/* 响应式调整 */
@media (max-width: 1200px) {
    .recommendation-sidebar {
        width: 260px;
    }
}

@media (max-width: 1000px) {
    .recommendation-sidebar {
        width: 240px;
    }
}

@media (max-width: 992px) {
    .recommendation-sidebar {
        width: 100%;
        margin-top: 24px;
        flex-direction: row;
        gap: 16px;
        flex-wrap: wrap;
    }

    .recommendation-card {
        flex: 1;
        min-width: 280px;
    }
}

@media (max-width: 768px) {
    .recommendation-sidebar {
        flex-direction: column;
        gap: 16px;
    }

    .recommendation-card {
        width: 100%;
    }
}

/* === 我的订阅页面样式 === */

/* 条件组合卡片 */
.combination-card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

.combination-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.combination-header {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.combination-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    flex: 1;
    line-height: 1.4;
    margin: 0;
}

.combination-title:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.combination-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.combination-content {
    padding: 16px;
}

.combination-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
    font-size: 13px;
    color: var(--text-secondary);
}

.combination-meta span {
    background: #f8fafc;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
}

.combination-filters {
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.5;
    background: #f0f9ff;
    padding: 12px;
    border-radius: 6px;
    border-left: 3px solid var(--primary-color);
}

/* 操作按钮样式 */
.btn-link {
    background: none;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.btn-link:hover {
    background: var(--primary-color);
    color: white;
    text-decoration: none;
}

.btn-link:active {
    transform: translateY(1px);
}

/* 空状态样式 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
    display: block;
}

.empty-state div {
    font-size: 16px;
    margin-bottom: 16px;
    color: var(--text-secondary);
}

/* 结果预览区域 */
.results-preview {
    margin-top: 24px;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    display: none;
}

.preview-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.preview-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--primary-color);
}

.preview-content {
    padding: 20px;
}

.preview-summary {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    padding: 12px;
    background: #f8fafc;
    border-radius: 6px;
    border-left: 3px solid var(--primary-color);
}

.preview-results {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.preview-item {
    padding: 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-white);
    transition: all 0.2s ease;
}

.preview-item:hover {
    box-shadow: var(--shadow-sm);
    border-color: var(--primary-color);
}

.preview-item .item-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    line-height: 1.4;
}

.preview-item .item-meta {
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.preview-actions {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

/* 加载和错误状态 */
.loading-state,
.error-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
    font-size: 14px;
}

.loading-state::before {
    content: "⏳";
    font-size: 24px;
    display: block;
    margin-bottom: 12px;
}

.error-state {
    color: #ef4444;
}

.error-state::before {
    content: "❌";
    font-size: 24px;
    display: block;
    margin-bottom: 12px;
}

/* 订阅标签样式优化 */
.subscription-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
    gap: 4px;
}

.subscription-tab {
    background: none;
    border: none;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 8px 8px 0 0;
    transition: all 0.2s ease;
    position: relative;
}

.subscription-tab:hover {
    color: var(--primary-color);
    background: #f0f9ff;
}

.subscription-tab.active {
    color: var(--primary-color);
    background: var(--bg-white);
    border-bottom: 2px solid var(--primary-color);
    font-weight: 600;
}

.subscription-content {
    display: none;
    min-height: 300px;
}

.subscription-content.active {
    display: block;
}

.item-list {
    min-height: 200px;
}

/* 响应式优化 */
@media (max-width: 768px) {
    .combination-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .combination-actions {
        justify-content: flex-start;
    }

    .combination-meta {
        flex-direction: column;
        gap: 8px;
    }

    .preview-item .item-meta {
        flex-direction: column;
        gap: 8px;
    }

    .subscription-tabs {
        flex-wrap: wrap;
    }

    .subscription-tab {
        flex: 1;
        min-width: 120px;
    }
}

@media (max-width: 480px) {
    .combination-content {
        padding: 12px;
    }

    .combination-header {
        padding: 12px;
    }

    .preview-content {
        padding: 16px;
    }

    .btn-link {
        padding: 8px 12px;
        font-size: 13px;
    }
}

/* === 自定义弹窗样式 === */

/* 弹窗容器 */
.custom-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.3s ease;
}

.custom-modal.modal-show {
    opacity: 1;
    transform: scale(1);
}

/* 弹窗背景遮罩 */
.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    /* backdrop-filter: blur(4px); - 已移除，符合项目统一要求 */
}

/* 弹窗内容 */
.modal-content {
    position: relative;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    max-width: 420px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    transform: translateY(-20px);
    transition: transform 0.3s ease;
}

.custom-modal.modal-show .modal-content {
    transform: translateY(0);
}

/* 弹窗头部 */
.modal-header {
    padding: 24px 24px 16px;
    text-align: center;
    border-bottom: 1px solid #f0f0f0;
}

.modal-icon {
    font-size: 48px;
    line-height: 1;
    margin-bottom: 12px;
    display: block;
}

.success-icon {
    color: #10b981;
}

.error-icon {
    color: #ef4444;
}

.modal-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

/* 弹窗内容区 */
.modal-body {
    padding: 20px 24px;
    text-align: center;
}

.modal-message {
    font-size: 16px;
    line-height: 1.5;
    color: var(--text-secondary);
    margin: 0;
}

/* 弹窗按钮区域 */
.modal-actions {
    padding: 16px 24px 24px;
    display: flex;
    gap: 12px;
    justify-content: center;
}

.modal-actions button {
    flex: 1;
    max-width: 160px;
}

/* 主要按钮样式 */
.btn-primary {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-primary:hover {
    background: #1e40af;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

/* 次要按钮样式 */
.btn-secondary {
    background: #f8fafc;
    color: var(--text-secondary);
    border: 1px solid #e2e8f0;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-secondary:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn-secondary:active {
    transform: translateY(0);
}

/* 响应式调整 */
@media (max-width: 480px) {
    .modal-content {
        margin: 20px;
        width: calc(100% - 40px);
    }

    .modal-header {
        padding: 20px 16px 12px;
    }

    .modal-body {
        padding: 16px;
    }

    .modal-actions {
        padding: 12px 16px 20px;
        flex-direction: column;
    }

    .modal-actions button {
        max-width: none;
    }

    .modal-icon {
        font-size: 40px;
    }

    .modal-title {
        font-size: 18px;
    }

    .modal-message {
        font-size: 15px;
    }
}

/* --- Footer --- */
.site-footer {
    background: var(--bg-white);
    border-top: 1px solid var(--border-color);
    padding: 40px 0 30px;
    margin-top: 60px;
    text-align: center;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer-copyright {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    line-height: 1.6;
}

.footer-icp {
    font-size: 12px;
    color: var(--text-tertiary);
}

.footer-icp a {
    color: var(--text-tertiary);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-icp a:hover {
    color: var(--primary-color);
}

/* =========================================
   整站响应式补全（断点：1200 / 992 / 768 / 480）
   说明：统一处理 header、导航宫格、双栏布局、
   详情页标题行与富文本横向溢出兜底
   ========================================= */

/* --- ≤1200：中小桌面，收窄两侧留白 --- */
@media (max-width: 1200px) {
    .container,
    .notification-banner .container {
        width: 86%;
    }
}

/* --- ≤992：平板横竖屏，头部纵向堆叠、内容转单列 --- */
@media (max-width: 992px) {
    .container,
    .notification-banner .container {
        width: 92%;
    }

    /* 头部：logo 与搜索区上下堆叠，搜索区占满整行
       （同时覆盖硬编码头部与 header.js 注入的详情页头部） */
    .header-main {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }

    .logo-box {
        max-width: 100%;
    }

    /* 四宫格导航改两列 */
    .nav-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* 双栏布局转单列（推荐栏在下方横排，配合 992 断点） */
    .main-layout {
        flex-direction: column;
    }
}

/* --- ≤768：手机/窄平板 --- */
@media (max-width: 768px) {
    .container,
    .notification-banner .container {
        width: 100%;
    }

    /* 头部进一步收紧，logo 缩小 */
    .header-main {
        gap: 12px;
        padding-top: 12px;
        padding-bottom: 12px;
    }

    .logo-box .logo-icon img,
    .logo-img {
        height: 72px;
    }

    /* JS 注入头部的搜索 tabs 允许换行（详情页等） */
    .search-tabs {
        flex-wrap: wrap;
        gap: 8px;
    }

    .search-tab {
        padding: 6px 12px;
        font-size: 14px;
    }

    /* 首页统计条：允许换行为 2×2，隐藏竖分隔线 */
    .stats-bar {
        flex-wrap: wrap;
        justify-content: space-around;
        row-gap: 10px;
    }

    .stats-group {
        flex: 1 1 40%;
        justify-content: center;
    }

    .stats-divider-v {
        display: none;
    }

    /* 卡片头：标题+tabs+查看更多允许换行 */
    .section-header {
        flex-wrap: wrap;
        gap: 8px;
    }

    .tabs {
        flex-wrap: wrap;
        margin-left: 12px;
    }

    /* 详情页标题行：长标题与操作按钮允许换行 */
    .detail-top-row {
        flex-wrap: wrap;
        gap: 12px;
    }

    .detail-title {
        margin-right: 0;
        font-size: 20px;
    }

    .detail-actions {
        flex-wrap: wrap;
    }

    .detail-meta-row {
        flex-wrap: wrap;
        gap: 8px 20px;
    }

    /* 富文本/表格横向溢出兜底（ann_detail 等） */
    .detail-content {
        overflow-x: auto;
    }

    .detail-content table,
    .detail-table {
        display: block;
        overflow-x: auto;
    }
}

/* --- ≤480：小屏手机 --- */
@media (max-width: 480px) {
    .logo-box .logo-icon img,
    .logo-img {
        height: 56px;
    }

    .nav-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .stat-num {
        font-size: 15px;
    }

    .top-bar {
        font-size: 12px;
    }

    .top-links a,
    .top-links #user-auth-link {
        margin-left: 12px;
    }

    .search-input {
        padding: 10px 12px;
        font-size: 14px;
    }

    .search-btn {
        width: 84px;
        font-size: 14px;
    }
}

/* 视觉隐藏工具类：仅对搜索引擎与读屏软件可见，不影响页面布局 */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

