/** 联创圈 - 全局样式 */

:root {
    --primary-color: #4f46e5;
    --primary-dark: #4338ca;
    --secondary-color: #06b6d4;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --dark-color: #1f2937;
    --gray-color: #6b7280;
    --light-gray: #f3f4f6;
    --border-color: #e5e7eb;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --navbar-bg: #ffffff;
    --text-color: #1f2937;
    --text-secondary: #6b7280;
    --shadow: 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: 8px;
    --radius-lg: 12px;
    --transition: all 0.3s ease;
}

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

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

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

img {
    max-width: 100%;
    height: auto;
}

/* ========== 导航栏 ========== */
.navbar {
    background: var(--navbar-bg);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.navbar-brand img {
    height: 40px;
    width: auto;
    border-radius: 6px;
}

.navbar-nav {
    display: flex;
    align-items: center;
    gap: 30px;
    list-style: none;
}

.navbar-nav a {
    font-weight: 500;
    color: var(--dark-color);
    padding: 8px 0;
    position: relative;
}

.navbar-nav a:hover,
.navbar-nav a.active {
    color: var(--primary-color);
}

.navbar-nav a.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary-color);
    border-radius: 2px;
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.search-box {
    position: relative;
}

.search-box input {
    padding: 8px 35px 8px 15px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    width: 220px;
    font-size: 0.9rem;
    transition: var(--transition);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
    width: 280px;
}

.search-box button {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--gray-color);
    cursor: pointer;
}

/* ========== 按钮 ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: var(--radius);
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    border: none;
    transition: var(--transition);
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-warning {
    background: var(--warning-color);
    color: white;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

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

.btn-outline:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.85rem;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 1.05rem;
}

/* ========== 卡片 ========== */
.card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.card-image {
    position: relative;
    padding-top: 60%;
    overflow: hidden;
    background: #eef1f5;
}

.card-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition), opacity 0.3s ease;
    opacity: 0;
}

.card-image img.loaded {
    opacity: 1;
}

.card:hover .card-image img {
    transform: scale(1.05);
}

.card-body {
    padding: 16px;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--gray-color);
    font-size: 0.85rem;
}

.card-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-hot {
    background: var(--danger-color);
    color: white;
}

.badge-vip {
    background: var(--warning-color);
    color: white;
}

.badge-free {
    background: var(--success-color);
    color: white;
}

/* ========== 布局 ========== */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.section {
    padding: 40px 0;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title::before {
    content: '';
    width: 4px;
    height: 24px;
    background: var(--primary-color);
    border-radius: 2px;
}

.grid {
    display: grid;
    gap: 20px;
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

.grid-6 {
    grid-template-columns: repeat(6, 1fr);
}

/* ========== Hero区域 ========== */
.hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 60px 0;
    text-align: center;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 16px;
}

.hero p {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 30px;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 60px;
    margin-top: 40px;
}

.hero-stat {
    text-align: center;
}

.hero-stat .number {
    font-size: 2rem;
    font-weight: 700;
}

.hero-stat .label {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* ========== Banner轮播 ========== */
.banner-slider {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 30px;
}

.banner-slider img {
    width: 100%;
    height: 300px;
    object-fit: cover;
}

/* ========== 分类标签 ========== */
.category-tabs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.category-tab {
    padding: 8px 20px;
    border-radius: 20px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
}

.category-tab:hover,
.category-tab.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* ========== 表格 ========== */
.table-container {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    background: var(--light-gray);
    font-weight: 600;
    font-size: 0.9rem;
}

.table tr:hover {
    background: #f9fafb;
}

/* ========== 表单 ========== */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 0.95rem;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

/* ========== 分页 ========== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 30px;
}

.pagination a,
.pagination span {
    padding: 8px 14px;
    border-radius: var(--radius);
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    font-size: 0.9rem;
}

.pagination a:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.pagination .current {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* ========== 消息提示 ========== */
.flash-messages {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 9999;
    max-width: 400px;
}

.flash-message {
    padding: 14px 20px;
    border-radius: var(--radius);
    margin-bottom: 10px;
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease;
}

.flash-success {
    background: #d1fae5;
    color: #065f46;
    border-left: 4px solid var(--success-color);
}

.flash-error {
    background: #fee2e2;
    color: #991b1b;
    border-left: 4px solid var(--danger-color);
}

.flash-info {
    background: #dbeafe;
    color: #1e40af;
    border-left: 4px solid #3b82f6;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ========== 后台布局 ========== */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 260px;
    background: var(--dark-color);
    color: white;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.admin-sidebar-brand {
    padding: 20px;
    font-size: 1.3rem;
    font-weight: 700;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.admin-sidebar-nav {
    list-style: none;
    padding: 10px 0;
}

.admin-sidebar-nav li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: rgba(255,255,255,0.7);
    font-size: 0.95rem;
}

.admin-sidebar-nav li a:hover,
.admin-sidebar-nav li a.active {
    background: rgba(255,255,255,0.1);
    color: white;
}

.admin-main {
    flex: 1;
    margin-left: 260px;
    padding: 20px;
    background: #f1f5f9;
    min-height: 100vh;
}

.admin-header {
    background: white;
    padding: 16px 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.stat-card .stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-card .stat-label {
    color: var(--gray-color);
    font-size: 0.9rem;
    margin-top: 4px;
}

/* ========== 会员等级标签 ========== */
.member-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-free-member {
    background: #e5e7eb;
    color: var(--gray-color);
}

.badge-vip-member {
    background: #fef3c7;
    color: #92400e;
}

.badge-svip-member {
    background: #dbeafe;
    color: #1e40af;
}

.badge-partner-member {
    background: #d1fae5;
    color: #065f46;
}

/* ========== 广告解锁 ========== */
.ad-container {
    background: white;
    border-radius: var(--radius-lg);
    padding: 30px;
    text-align: center;
    box-shadow: var(--shadow);
}

.ad-timer {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 20px 0;
}

/* ========== 页脚 ========== */
.footer {
    background: var(--dark-color);
    color: rgba(255,255,255,0.7);
    padding: 40px 0 20px;
    margin-top: 60px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px;
    margin-bottom: 30px;
}

.footer-section h4 {
    color: white;
    margin-bottom: 16px;
    font-size: 1rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 10px;
}

.footer-section ul li a:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 20px;
    text-align: center;
    font-size: 0.85rem;
}

/* ========== 响应式设计 ========== */
@media (max-width: 1200px) {
    .grid-4 {
        grid-template-columns: repeat(3, 1fr);
    }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 992px) {
    .grid-3, .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .hero h1 {
        font-size: 2rem;
    }
    .hero-stats {
        gap: 30px;
    }
    .admin-sidebar {
        width: 200px;
    }
    .admin-main {
        margin-left: 200px;
    }
}

@media (max-width: 768px) {
    .navbar-nav,
    .search-box {
        display: none;
    }
    .hero {
        padding: 30px 0;
    }
    .hero h1 {
        font-size: 1.4rem;
    }
    .hero-stats {
        flex-wrap: wrap;
        justify-content: space-around;
        gap: 16px;
    }
    .section {
        padding: 16px 0;
    }
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .admin-sidebar {
        transform: translateX(-100%);
        z-index: 999;
    }
    .admin-main {
        margin-left: 0;
    }
}

/* 移动端菜单 */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--dark-color);
}

/* ========== 帖子样式 ========== */
.post-item {
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.post-item:hover {
    box-shadow: var(--shadow-lg);
}

.post-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.post-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.post-meta {
    flex: 1;
}

.post-author {
    font-weight: 600;
    font-size: 0.95rem;
}

.post-time {
    font-size: 0.8rem;
    color: var(--gray-color);
}

.post-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.post-content {
    color: var(--gray-color);
    line-height: 1.6;
    margin-bottom: 12px;
}

.post-stats {
    display: flex;
    gap: 20px;
    font-size: 0.85rem;
    color: var(--gray-color);
}

/* ========== 回复样式 ========== */
.reply-item {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
}

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

/* ========== 详情页 ========== */
.detail-header {
    background: white;
    border-radius: var(--radius-lg);
    padding: 30px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
}

.detail-body {
    background: white;
    border-radius: var(--radius-lg);
    padding: 30px;
    box-shadow: var(--shadow);
}

.detail-cover {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    border-radius: var(--radius);
    margin-bottom: 20px;
}

/* ========== 工具类 ========== */
.text-primary { color: var(--primary-color); }
.text-success { color: var(--success-color); }
.text-warning { color: var(--warning-color); }
.text-danger { color: var(--danger-color); }
.text-gray { color: var(--gray-color); }
.text-center { text-align: center; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.p-2 { padding: 16px; }
.p-3 { padding: 24px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 16px; }
.w-100 { width: 100%; }

/* ========== 外部链接访问器（站内窗口模式） ========== */
.ext-link-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.92);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    animation: extLinkFadeIn 0.25s ease;
}
@keyframes extLinkFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 顶部工具栏 */
.ext-link-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    height: 56px;
    background: linear-gradient(135deg, #1a56db, #2563eb);
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.ext-link-info {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
}
.ext-link-info > i {
    font-size: 1.1rem;
    flex-shrink: 0;
}
.ext-link-title {
    font-size: 1rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}
.ext-link-url {
    font-size: 0.8rem;
    opacity: 0.7;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: none;
}
.ext-link-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.ext-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    text-decoration: none;
    white-space: nowrap;
}
.ext-link-btn-open {
    background: rgba(255,255,255,0.2);
    color: #fff;
}
.ext-link-btn-open:hover {
    background: rgba(255,255,255,0.35);
}
.ext-link-btn-close {
    background: #fff;
    color: #1a56db;
}
.ext-link-btn-close:hover {
    background: #f0f4ff;
}

/* iframe 容器 */
.ext-link-frame-container {
    flex: 1;
    position: relative;
    background: #fff;
    overflow: hidden;
}
#extLinkFrame {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* 加载提示 */
.ext-link-loading {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    color: #64748b;
    z-index: 2;
}
.ext-link-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e2e8f0;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: extLinkSpin 0.8s linear infinite;
    margin-bottom: 16px;
}
@keyframes extLinkSpin {
    to { transform: rotate(360deg); }
}
.ext-link-loading p {
    margin: 4px 0;
    font-size: 0.9rem;
}

/* 被阻止时的提示 */
.ext-link-blocked {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    text-align: center;
    padding: 40px 20px;
    z-index: 3;
}
.ext-link-blocked i {
    font-size: 3.5rem;
    color: #f59e0b;
    margin-bottom: 20px;
}
.ext-link-blocked h3 {
    font-size: 1.3rem;
    color: #1e293b;
    margin-bottom: 12px;
}
.ext-link-blocked p {
    color: #64748b;
    margin: 6px 0;
    font-size: 0.95rem;
}
.ext-link-blocked-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 32px;
    background: linear-gradient(135deg, #2563eb, #667eea);
    color: #fff !important;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    margin-top: 20px;
    transition: all 0.2s;
}
.ext-link-blocked-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37,99,235,0.4);
}

/* 底部提示栏 */
.ext-link-hint {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 8px 20px;
    background: rgba(0,0,0,0.7);
    color: #fff;
    font-size: 0.8rem;
    text-align: center;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.ext-link-hint a {
    color: #93c5fd;
    text-decoration: underline;
    cursor: pointer;
}
