/* ============================================
   FiveM 服务器赞助网站 - 样式文件
   配色：灰色 + 白色，3D效果，阴影
   ============================================ */

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

:root {
    --bg-primary: #f0f0f0;
    --bg-secondary: #e8e8e8;
    --bg-card: rgba(255, 255, 255, 0.85);
    --text-primary: #2c2c2c;
    --text-secondary: #666666;
    --text-muted: #999999;
    --border-color: #d0d0d0;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.16);
    --shadow-3d: 0 10px 40px rgba(0, 0, 0, 0.15), 0 2px 8px rgba(0, 0, 0, 0.1);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 50%, #f0f0f0 100%);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ============================================
   顶部导航栏
   ============================================ */
.top-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 32px;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.server-icon-wrapper {
    position: relative;
    width: 56px;
    height: 56px;
}

.server-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    object-fit: cover;
    box-shadow: var(--shadow-3d);
    transition: var(--transition);
}

.server-icon:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.2);
}

.icon-placeholder {
    display: none;
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, #e0e0e0, #c8c8c8);
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    box-shadow: var(--shadow-3d);
}

.icon-placeholder svg {
    width: 28px;
    height: 28px;
}

.icon-placeholder.visible {
    display: flex;
}

.server-icon.hidden {
    display: none;
}

.server-name {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.header-center {
    flex: 1;
    text-align: center;
}

.site-title {
    font-size: 18px;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: 1px;
}

.header-right {
    display: flex;
    align-items: center;
}

.copyright-badge {
    padding: 8px 20px;
    background: linear-gradient(135deg, #3a3a3a, #555555);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-3d);
    transform: perspective(500px) rotateY(-2deg);
    transition: var(--transition);
}

.copyright-badge:hover {
    transform: perspective(500px) rotateY(0deg) translateY(-2px);
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.25);
}

.copyright-text {
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* ============================================
   主体布局
   ============================================ */
.main-container {
    display: flex;
    min-height: calc(100vh - 90px);
    padding: 24px;
    gap: 24px;
}

/* ============================================
   左侧导航
   ============================================ */
.sidebar-nav {
    width: 200px;
    flex-shrink: 0;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-3d);
    padding: 20px 16px;
    height: fit-content;
    position: sticky;
    top: 110px;
}

.nav-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border-color);
    text-align: center;
}

.nav-items {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.nav-item {
    padding: 10px 14px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.nav-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.8), rgba(240,240,240,0.6));
    opacity: 0;
    transition: var(--transition);
}

.nav-item:hover {
    color: var(--text-primary);
    border-color: var(--border-color);
    box-shadow: var(--shadow-sm);
    transform: translateX(4px);
}

.nav-item:hover::before {
    opacity: 1;
}

.nav-item.active {
    background: linear-gradient(135deg, #4a4a4a, #666666);
    color: #ffffff;
    border-color: transparent;
    box-shadow: var(--shadow-md);
    transform: translateX(4px);
}

.nav-item.active::before {
    opacity: 0;
}

/* ============================================
   中间内容区
   ============================================ */
.content-area {
    flex: 1;
    min-width: 0;
}

/* 工具栏 */
.toolbar {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.search-box {
    display: flex;
    align-items: center;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 12px 20px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.search-box:focus-within {
    box-shadow: var(--shadow-md);
    border-color: #999;
}

.search-icon {
    width: 20px;
    height: 20px;
    color: var(--text-muted);
    margin-right: 12px;
    flex-shrink: 0;
}

.search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 15px;
    color: var(--text-primary);
    background: transparent;
    font-family: inherit;
}

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

/* 筛选区域 */
.filter-area {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 16px 20px;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.filter-btn {
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
}

.filter-btn:hover {
    background: rgba(255, 255, 255, 1);
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

.filter-btn.active {
    background: linear-gradient(135deg, #4a4a4a, #666666);
    color: #ffffff;
    border-color: transparent;
    box-shadow: var(--shadow-sm);
}

/* ============================================
   物品网格
   ============================================ */
.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.item-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-3d);
    transition: var(--transition);
    transform: perspective(800px) rotateX(0deg);
}

.item-card:hover {
    transform: perspective(800px) rotateX(2deg) translateY(-6px);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2), 0 4px 12px rgba(0, 0, 0, 0.1);
}

.item-image-wrapper {
    width: 100%;
    aspect-ratio: 4/3;
    overflow: hidden;
    background: linear-gradient(135deg, #e8e8e8, #d8d8d8);
    position: relative;
}

.item-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.item-card:hover .item-image {
    transform: scale(1.08);
}

.item-info {
    padding: 14px 16px;
}

.item-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-type {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
    display: inline-block;
    padding: 2px 10px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 12px;
}

.item-price {
    font-size: 18px;
    font-weight: 900;
    color: #3a3a3a;
    letter-spacing: -0.5px;
}

/* 空状态 */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state svg {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    opacity: 0.4;
}

.empty-state p {
    font-size: 16px;
}

/* ============================================
   翻页区
   ============================================ */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 20px;
    flex-wrap: wrap;
}

.page-btn {
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.page-btn:hover:not(.disabled):not(.active) {
    background: #ffffff;
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.page-btn.active {
    background: linear-gradient(135deg, #4a4a4a, #666666);
    color: #ffffff;
    border-color: transparent;
    box-shadow: var(--shadow-md);
}

.page-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.page-info {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0 12px;
}

/* ============================================
   右侧规则面板
   ============================================ */
.rules-panel {
    width: 260px;
    flex-shrink: 0;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-3d);
    padding: 24px 20px;
    height: fit-content;
    position: sticky;
    top: 110px;
    max-height: calc(100vh - 130px);
    overflow-y: auto;
}

.rules-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border-color);
    text-align: center;
}

.rules-content {
    font-size: 13px;
    line-height: 1.8;
    color: var(--text-secondary);
}

.rules-content p {
    margin-bottom: 10px;
}

.rules-content strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* ============================================
   联系方式区
   ============================================ */
.contact-section {
    padding: 0 24px 24px;
}

.contact-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-3d);
    padding: 24px 32px;
    display: flex;
    align-items: center;
    gap: 40px;
    flex-wrap: wrap;
}

.contact-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-right: 20px;
}

.contact-items {
    display: flex;
    gap: 32px;
    flex-wrap: wrap;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.contact-icon {
    width: 24px;
    height: 24px;
    color: var(--text-secondary);
}

.contact-info {
    display: flex;
    flex-direction: column;
}

.contact-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

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

/* ============================================
   底部版权
   ============================================ */
.footer {
    padding: 20px 32px;
    text-align: center;
    border-top: 1px solid var(--border-color);
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.footer-copyright {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.footer-year {
    font-size: 13px;
    color: var(--text-muted);
}

/* ============================================
   滚动条样式
   ============================================ */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #c0c0c0;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a0a0a0;
}

/* ============================================
   响应式
   ============================================ */
@media (max-width: 1200px) {
    .rules-panel {
        display: none;
    }
}

@media (max-width: 900px) {
    .sidebar-nav {
        display: none;
    }

    .main-container {
        padding: 16px;
    }

    .top-header {
        padding: 12px 16px;
        flex-wrap: wrap;
        gap: 8px;
    }

    .header-center {
        order: 3;
        width: 100%;
    }

    .items-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 12px;
    }
}

/* ============================================
   隐形水印（倾斜、极淡、全屏重复）
   肉眼几乎看不见，截图时会显示
   ============================================ */
#watermark-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    grid-template-rows: repeat(8, 1fr);
}

.watermark-text {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: rgba(180, 180, 180, 0.06);
    transform: rotate(-25deg);
    user-select: none;
    pointer-events: none;
    letter-spacing: 2px;
    white-space: nowrap;
}

/* ============================================
   更新公告按钮
   ============================================ */
.announce-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    margin-right: 12px;
    background: linear-gradient(135deg, #5a5a5a, #777777);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    font-family: inherit;
}

.announce-btn:hover {
    background: linear-gradient(135deg, #4a4a4a, #666666);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.announce-btn svg {
    flex-shrink: 0;
}

/* ============================================
   排序区域
   ============================================ */
.sort-area {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    flex-wrap: wrap;
}

.sort-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-right: 4px;
}

.sort-btn {
    padding: 5px 14px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

.sort-btn:hover {
    background: #ffffff;
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

.sort-btn.active {
    background: linear-gradient(135deg, #4a4a4a, #666666);
    color: #ffffff;
    border-color: transparent;
    box-shadow: var(--shadow-sm);
}

/* ============================================
   公告弹窗
   ============================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

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

.modal-content {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow: hidden;
    transform: translateY(20px) scale(0.95);
    transition: transform 0.3s ease;
}

.modal-overlay.visible .modal-content {
    transform: translateY(0) scale(1);
}

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

.modal-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-secondary);
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    max-height: calc(80vh - 70px);
}

.announce-item {
    padding: 16px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

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

.announce-date {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.announce-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}

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