/* =====================================================
   改枪码分享平台 - 页面特定样式
   ===================================================== */

/* ===== 用户主页 ===== */
.profile-header {
    position: relative;
    padding: 50px 0 30px;
    margin-bottom: 30px;
}

.profile-header-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(59,130,246,0.1), rgba(139,92,246,0.1));
    border-bottom: 1px solid var(--border-color);
}

.profile-header-inner {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 24px;
    flex-wrap: wrap;
}

.profile-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--bg-card);
    box-shadow: var(--shadow-md);
    flex-shrink: 0;
}

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

.profile-name {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
}

.profile-username {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.profile-bio {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 14px;
    max-width: 500px;
    line-height: 1.5;
}

.profile-stats {
    display: flex;
    gap: 24px;
}

.profile-stat {
    display: flex;
    flex-direction: column;
}
.profile-stat .num { font-size: 18px; font-weight: 700; }
.profile-stat .label { font-size: 12px; color: var(--text-muted); }

.profile-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
    align-self: flex-start;
}

/* ===== 改枪码详情页 ===== */
.loadout-detail {
    padding: 30px 0;
}

.loadout-detail-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 30px;
}

.detail-main {
    min-width: 0;
}

.detail-sidebar {
    position: sticky;
    top: 84px;
    height: fit-content;
}

.detail-image {
    width: 100%;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    margin-bottom: 24px;
}

.detail-image img {
    width: 100%;
    display: block;
    cursor: zoom-in;
}

.detail-header {
    margin-bottom: 20px;
}

.detail-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 10px;
}

.detail-meta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    align-items: center;
}

.detail-meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    color: var(--text-secondary);
}
.detail-meta-item i { color: var(--primary); }

.detail-price {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    background: rgba(245,158,11,0.15);
    color: var(--warning);
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 14px;
}

.detail-code-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 24px;
}

.detail-code-box h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.code-display {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 16px;
}

.code-text {
    flex: 1;
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 14px;
    color: var(--text-primary);
    word-break: break-all;
}

.btn-copy {
    flex-shrink: 0;
    padding: 8px 16px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: var(--transition);
}
.btn-copy:hover { background: var(--primary-dark); }
.btn-copy.copied { background: var(--success); }

.detail-description {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 24px;
}

.detail-description h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
}

.detail-description p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.8;
}

/* 侧边栏 */
.sidebar-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 16px;
}

.sidebar-card-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.author-card {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}

.author-card img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
}

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

.author-card-name {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 2px;
}

.author-card-meta {
    font-size: 12px;
    color: var(--text-muted);
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid var(--border-color);
    background: var(--bg-input);
    color: var(--text-secondary);
    transition: var(--transition);
}

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

.action-btn.liked {
    background: rgba(239,68,68,0.15);
    border-color: var(--danger);
    color: var(--danger);
}

.action-btn.favorited {
    background: rgba(245,158,11,0.15);
    border-color: var(--warning);
    color: var(--warning);
}

/* 评论区 */
.comments-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-top: 24px;
}

.comments-section h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 20px;
}

.comment-form {
    margin-bottom: 24px;
}

.comment-form textarea {
    width: 100%;
    padding: 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
}

.comment-form textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.comment-form-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 10px;
}

.comment-item {
    display: flex;
    gap: 12px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-color);
}
.comment-item:last-child { border-bottom: none; }

.comment-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

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

.comment-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.comment-author {
    font-weight: 600;
    font-size: 14px;
}

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

.comment-content {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ===== 登录/注册页面 ===== */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(59,130,246,0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 50%, rgba(139,92,246,0.06) 0%, transparent 50%);
}

.auth-box {
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 40px;
}

.auth-logo {
    text-align: center;
    margin-bottom: 28px;
}

.auth-logo i {
    font-size: 40px;
    color: var(--primary);
}

.auth-logo h1 {
    font-size: 22px;
    margin-top: 10px;
}

.auth-logo p {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

.auth-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
}

.auth-tab {
    flex: 1;
    padding: 12px;
    text-align: center;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: var(--transition);
}

.auth-tab:hover { color: var(--text-secondary); }
.auth-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* ===== 用户中心 ===== */
.user-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 24px;
    padding: 24px 0;
    min-height: calc(100vh - var(--header-height) - 200px);
}

.user-sidebar {
    position: sticky;
    top: 84px;
    height: fit-content;
}

.user-nav {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.user-nav-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    text-align: center;
}

.user-nav-header img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 10px;
}

.user-nav-header .name {
    font-weight: 600;
    font-size: 15px;
}

.user-nav-header .role {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.user-nav-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    font-size: 14px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

.user-nav-menu a:last-child { border-bottom: none; }

.user-nav-menu a:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.user-nav-menu a.active {
    background: rgba(59,130,246,0.1);
    color: var(--primary);
    border-left: 3px solid var(--primary);
}

.user-nav-menu a i {
    font-size: 18px;
    width: 20px;
    text-align: center;
}

.user-main {
    min-width: 0;
}

/* 仪表盘统计 */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    text-align: center;
}

.stat-card-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
    font-size: 20px;
}

.stat-card-value {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 4px;
}

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

/* 表格 */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

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

.data-table th {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.data-table tbody tr:hover {
    background: var(--bg-card-hover);
}

.table-actions {
    display: flex;
    gap: 6px;
}

.table-actions .btn { padding: 4px 10px; font-size: 12px; }

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}
.empty-state i {
    font-size: 48px;
    color: var(--text-muted);
    margin-bottom: 16px;
    display: block;
}
.empty-state h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}
.empty-state p {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

/* 图片预览模态框 */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

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

.modal-overlay img {
    max-width: 90%;
    max-height: 90%;
    border-radius: var(--radius-md);
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 响应式补充 */
@media (max-width: 1024px) {
    .loadout-detail-grid { grid-template-columns: 1fr; }
    .detail-sidebar { position: static; }
    .user-layout { grid-template-columns: 1fr; }
    .user-sidebar { position: static; }
    .dashboard-stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
    .profile-header-inner { text-align: center; justify-content: center; }
    .profile-avatar { margin: 0 auto; }
    .profile-actions { width: 100%; justify-content: center; }
    .auth-box { padding: 24px; }
    .dashboard-stats { grid-template-columns: 1fr; }
    .data-table { display: block; overflow-x: auto; }
}
