/* 夜猫资源俱乐部 - 主样式表 */

/* 基础变量 */
:root {
    --primary: #1890ff;
    --primary-light: #40a9ff;
    --primary-dark: #096dd9;
    --success: #52c41a;
    --warning: #faad14;
    --error: #f5222d;
    --gold: #fa8c16;
    --diamond: #722ed1;
    
    /* 亮色模式 */
    --bg-primary: #f5f5f5;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --text-primary: #333333;
    --text-secondary: #666666;
    --text-muted: #999999;
    --border-color: #e8e8e8;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-hover: 0 4px 16px rgba(0,0,0,0.12);
}

/* 暗色模式 */
[data-theme="dark"] {
    --bg-primary: #141414;
    --bg-secondary: #1f1f1f;
    --bg-card: #262626;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --text-muted: #666666;
    --border-color: #434343;
    --shadow: 0 2px 8px rgba(0,0,0,0.3);
    --shadow-hover: 0 4px 16px rgba(0,0,0,0.4);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    transition: background 0.3s, color 0.3s;
}

/* 头部导航 */
.header {
    background: var(--bg-secondary);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.logo img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.logo-text {
    font-size: 18px;
    font-weight: bold;
    color: var(--text-primary);
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s;
}

.header-nav a:hover {
    color: var(--primary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.theme-toggle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.theme-toggle:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 主内容区 */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 16px;
}

/* 轮播图 */
.banner-section {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 20px;
}

.banner-slider {
    position: relative;
    height: 200px;
}

.banner-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s;
}

.banner-slide.active {
    opacity: 1;
}

.banner-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.banner-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 30px 20px 20px;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    color: white;
}

.banner-content h2 {
    font-size: 24px;
    margin-bottom: 5px;
}

.banner-content p {
    font-size: 14px;
    opacity: 0.9;
}

.banner-dots {
    position: absolute;
    bottom: 10px;
    right: 20px;
    display: flex;
    gap: 8px;
}

.banner-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: all 0.3s;
}

.banner-dot.active {
    background: white;
    width: 20px;
    border-radius: 4px;
}

/* 搜索框 */
.search-box {
    position: relative;
    margin-bottom: 20px;
}

.search-input {
    width: 100%;
    height: 50px;
    padding: 0 50px 0 20px;
    border: 1px solid var(--border-color);
    border-radius: 25px;
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: all 0.3s;
}

.search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(24,144,255,0.1);
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-btn {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border: none;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

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

/* 功能卡片 */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.feature-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    transition: all 0.3s;
    box-shadow: var(--shadow);
}

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

.feature-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.feature-icon.blue { background: #e6f7ff; color: #1890ff; }
.feature-icon.green { background: #f6ffed; color: #52c41a; }
.feature-icon.red { background: #fff1f0; color: #f5222d; }
.feature-icon.purple { background: #f9f0ff; color: #722ed1; }
.feature-icon.orange { background: #fff7e6; color: #fa8c16; }
.feature-icon.cyan { background: #e6fffb; color: #13c2c2; }

.feature-info {
    flex: 1;
    min-width: 0;
}

.feature-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.feature-desc {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.feature-badge {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    background: #f5222d;
    color: white;
}

.feature-go {
    font-size: 12px;
    color: var(--primary);
    background: rgba(24,144,255,0.1);
    padding: 2px 8px;
    border-radius: 4px;
}

/* 排序标签 */
.sort-tabs {
    display: flex;
    gap: 20px;
    margin-bottom: 16px;
    padding: 0 4px;
}

.sort-tab {
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
    position: relative;
    padding-bottom: 4px;
}

.sort-tab.active {
    color: var(--primary);
    font-weight: 500;
}

.sort-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary);
    border-radius: 1px;
}

/* 文章列表 */
.article-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.article-item {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    gap: 12px;
    box-shadow: var(--shadow);
    transition: all 0.3s;
}

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

.article-cover {
    width: 100px;
    height: 75px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.article-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.article-content {
    flex: 1;
    min-width: 0;
}

.article-title {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: var(--text-muted);
}

.article-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* 底部导航 */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 8px 0;
    z-index: 1000;
}

.bottom-nav-content {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 11px;
    transition: color 0.3s;
    padding: 4px 12px;
}

.nav-item i {
    font-size: 22px;
}

.nav-item.active {
    color: var(--primary);
}

.nav-item.publish {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #ff6b9d, #c44569);
    border-radius: 50%;
    color: white;
    justify-content: center;
    margin-top: -20px;
    box-shadow: 0 4px 12px rgba(196,69,105,0.4);
}

.nav-item.publish i {
    font-size: 24px;
}

/* 浮动按钮 */
.float-actions {
    position: fixed;
    right: 16px;
    bottom: 80px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 999;
}

.float-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: all 0.3s;
}

.float-btn:hover {
    transform: scale(1.1);
}

.float-btn.vip {
    background: linear-gradient(135deg, #fa8c16, #ffc53d);
    color: white;
}

.float-btn.gift {
    background: linear-gradient(135deg, #ff6b9d, #c44569);
    color: white;
}

.float-btn.theme {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.float-btn.chat {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

/* 用户卡片 */
.user-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}

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

.user-avatar {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary);
}

.user-info {
    flex: 1;
}

.user-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-level {
    font-size: 12px;
    padding: 2px 8px;
    background: linear-gradient(135deg, #fa8c16, #ffc53d);
    color: white;
    border-radius: 10px;
}

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

.user-actions {
    display: flex;
    gap: 12px;
}

.user-actions .btn {
    flex: 1;
}

/* 按钮样式 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
    text-decoration: none;
}

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

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

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

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

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

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

.btn-block {
    width: 100%;
}

.btn-lg {
    padding: 14px 24px;
    font-size: 16px;
}

/* 统计卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}

.stat-item {
    text-align: center;
    padding: 12px 4px;
}

.stat-value {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

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

/* 菜单列表 */
.menu-list {
    background: var(--bg-card);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}

.menu-title {
    padding: 16px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    text-decoration: none;
    color: var(--text-primary);
    transition: background 0.3s;
    border-bottom: 1px solid var(--border-color);
}

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

.menu-item:hover {
    background: rgba(24,144,255,0.05);
}

.menu-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    font-size: 18px;
}

.menu-text {
    flex: 1;
    font-size: 14px;
}

.menu-arrow {
    color: var(--text-muted);
}

/* 资产卡片 */
.asset-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.asset-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 16px;
    box-shadow: var(--shadow);
}

.asset-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.asset-value {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
}

.asset-value.primary { color: var(--primary); }
.asset-value.warning { color: var(--warning); }

/* 会员卡片 */
.vip-banner {
    background: linear-gradient(135deg, #262626, #1f1f1f);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    color: white;
}

.vip-banner.gold {
    background: linear-gradient(135deg, #fa8c16, #ffc53d);
}

.vip-banner.diamond {
    background: linear-gradient(135deg, #722ed1, #b37feb);
}

.vip-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.vip-icon {
    font-size: 32px;
}

.vip-text h4 {
    font-size: 16px;
    margin-bottom: 4px;
}

.vip-text p {
    font-size: 12px;
    opacity: 0.8;
}

/* 登录/注册模态框 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--bg-card);
    border-radius: 16px;
    width: 90%;
    max-width: 400px;
    padding: 24px;
    transform: scale(0.9);
    transition: transform 0.3s;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-header {
    text-align: center;
    margin-bottom: 24px;
}

.modal-header h2 {
    font-size: 24px;
    margin-bottom: 8px;
}

.modal-header p {
    color: var(--text-muted);
    font-size: 14px;
}

.modal-header p a {
    color: var(--primary);
    text-decoration: none;
}

.form-group {
    margin-bottom: 16px;
}

.form-input {
    width: 100%;
    height: 48px;
    padding: 0 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: all 0.3s;
}

.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(24,144,255,0.1);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.password-input {
    position: relative;
}

.password-input .form-input {
    padding-right: 45px;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 18px;
}

/* 发布菜单 */
.publish-menu {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    gap: 20px;
    box-shadow: var(--shadow-hover);
    z-index: 1500;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.publish-menu.active {
    opacity: 1;
    visibility: visible;
}

.publish-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text-primary);
}

.publish-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
}

.publish-icon.green { background: var(--success); }
.publish-icon.red { background: var(--error); }
.publish-icon.orange { background: var(--warning); }
.publish-icon.blue { background: var(--primary); }

.publish-text {
    font-size: 12px;
}

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

.empty-state img {
    width: 150px;
    margin-bottom: 16px;
}

.empty-state p {
    color: var(--text-muted);
    font-size: 14px;
}

/* 提示消息 */
.toast {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 3000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.toast.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.toast.success { background: var(--success); }
.toast.error { background: var(--error); }

/* 响应式 */
@media (max-width: 768px) {
    .feature-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stats-grid {
        grid-template-columns: repeat(5, 1fr);
    }
    
    .article-cover {
        width: 80px;
        height: 60px;
    }
}

/* 动画 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

.fade-in {
    animation: fadeIn 0.3s ease;
}

.slide-up {
    animation: slideUp 0.3s ease;
}

/* 侧边栏 */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1500;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

.sidebar-menu-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 260px;
    height: 100vh;
    background: var(--bg-secondary);
    z-index: 1600;
    transform: translateX(-100%);
    transition: transform 0.3s;
    overflow-y: auto;
}

.sidebar-menu-panel.active {
    transform: translateX(0);
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-header img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.sidebar-header span {
    font-size: 18px;
    font-weight: bold;
    color: var(--text-primary);
}

.sidebar-nav {
    padding: 10px 0;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 15px;
    transition: background 0.3s;
}

.sidebar-item:hover {
    background: rgba(24,144,255,0.1);
}

.sidebar-item.active {
    background: rgba(24,144,255,0.15);
    color: var(--primary);
}

.sidebar-item i {
    font-size: 20px;
    width: 24px;
    text-align: center;
}

.sidebar-divider {
    height: 1px;
    background: var(--border-color);
    margin: 10px 20px;
}

/* 菜单切换按钮 */
.menu-toggle {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
