/**
 * 文件路径: /wp-content/plugins/delta-gunmod-plugin/templates/css/frontend-style.css
 * 优化改枪码区块视觉效果 - 更醒目的设计
 */

/* ========== CSS变量 ========== */
:root {
    --primary: #ff6b35;
    --primary-dark: #e55525;
    --secondary: #ff9558;
    --success: #00ff88;
    --code-bg: #0d1117;
    --code-border: #30363d;
    --code-text: #58a6ff;
    --code-highlight: #ffa657;
    --bg-dark: #0a0a0a;
    --bg-medium: #141414;
    --bg-light: #1a1a1a;
    --card-bg: #161616;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --text-muted: #666666;
    --border: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 107, 53, 0.3);
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    --radius: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========== 基础重置 ========== */
.delta-gunmod-page * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.delta-gunmod-page {
    min-height: 100vh;
    background: var(--bg-dark);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
}

/* ========== 英雄区域 ========== */
.gunmod-hero {
    position: relative;
    height: 280px;
    background: linear-gradient(135deg, #0f0f0f 0%, #1a0f0f 50%, #0f0f0f 100%);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-particles {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(255, 107, 53, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 50%, rgba(255, 149, 88, 0.1) 0%, transparent 50%);
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: url('data:image/svg+xml,<svg width="60" height="60" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="grid" width="60" height="60" patternUnits="userSpaceOnUse"><path d="M 60 0 L 0 0 0 60" fill="none" stroke="rgba(255,255,255,0.03)" stroke-width="1"/></pattern></defs><rect width="100%" height="100%" fill="url(%23grid)"/></svg>');
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 20px;
}

.hero-badge {
    display: inline-block;
    margin-bottom: 16px;
}

.hero-badge span {
    padding: 6px 16px;
    background: rgba(255, 107, 53, 0.15);
    border: 1px solid var(--primary);
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 2px;
    color: var(--primary);
}

.hero-title {
    margin-bottom: 12px;
}

.title-main {
    display: block;
    font-size: 36px;
    font-weight: 900;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 4px;
}

.title-en {
    display: block;
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 3px;
    color: var(--text-secondary);
    opacity: 0.7;
}

.hero-desc {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.hero-stats {
    display: inline-flex;
    align-items: center;
    gap: 24px;
    padding: 12px 24px;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 30px;
}

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

.stat-number {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
}

.stat-label {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.stat-divider {
    width: 1px;
    height: 24px;
    background: var(--border);
}

/* ========== 容器 ========== */
.gunmod-container {
    max-width: 1320px;
    margin: 0 auto;
    padding: 32px 20px 60px;
}

/* ========== 筛选区域 ========== */
.filter-section {
    margin-bottom: 32px;
}

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

.search-box {
    display: flex;
    background: var(--bg-medium);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: var(--transition);
}

.search-box:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

#gunmod-search {
    flex: 1;
    padding: 14px 20px;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 15px;
    outline: none;
}

#gunmod-search::placeholder {
    color: var(--text-muted);
}

.search-button {
    padding: 0 24px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border: none;
    color: white;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
    white-space: nowrap;
}

.search-button:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
}

/* 分类按钮 */
.category-wrapper {
    margin-bottom: 20px;
    width: 100%;
}

.category-scroll-container {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

.category-scroll-container::-webkit-scrollbar {
    height: 6px;
}

.category-scroll-container::-webkit-scrollbar-track {
    background: var(--bg-medium);
    border-radius: 3px;
}

.category-scroll-container::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 3px;
}

.category-list {
    display: inline-flex;
    gap: 10px;
    padding-bottom: 8px;
    min-width: 100%;
}

.cat-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    flex-shrink: 0;
}

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

.cat-btn.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-color: transparent;
    color: white;
}

.cat-icon {
    font-size: 18px;
    display: inline-block;
}

.cat-name {
    font-weight: 500;
    display: inline-block;
}

.cat-count {
    padding: 2px 8px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
    min-width: 24px;
    text-align: center;
}

/* ========== 改枪方案网格 ========== */
.gunmod-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

/* 改枪方案卡片 */
.gunmod-item {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    position: relative;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.5s ease-out;
    animation-fill-mode: both;
}

.gunmod-item:hover {
    transform: translateY(-4px);
    border-color: var(--border-hover);
    box-shadow: var(--shadow);
}

.gunmod-item.is-pinned {
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.05) 0%, var(--card-bg) 100%);
    border-color: rgba(255, 107, 53, 0.2);
}

/* 置顶标签 */
.pin-badge {
    position: absolute;
    top: -1px;
    right: 20px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 5px 12px;
    border-radius: 0 0 8px 8px;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.3);
    z-index: 2;
}

/* 卡片头部 */
.item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

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

.item-category {
    padding: 4px 10px;
    background: rgba(255, 107, 53, 0.1);
    color: var(--primary);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

.item-recommender {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--text-secondary);
    font-size: 13px;
}

.item-price {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
}

/* ========== 改枪码区域 - 重新设计更醒目 ========== */
.code-section {
    background: linear-gradient(135deg, #16110f 0%, #171210 100%);
    border: 2px solid #30363d;
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 12px;
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* 添加动态边框效果 */
.code-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent,
        var(--primary),
        var(--secondary),
        var(--primary),
        transparent
    );
    background-size: 200% 100%;
    animation: borderGlow 3s linear infinite;
}

@keyframes borderGlow {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.code-label {
    font-size: 10px;
    color: #7d8590;
    letter-spacing: 1.5px;
    margin-bottom: 10px;
    font-weight: 700;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 添加闪烁的指示灯 */
.code-label::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(0, 255, 136, 0.7);
    }
    50% {
        opacity: 0.7;
        box-shadow: 0 0 0 4px rgba(0, 255, 136, 0);
    }
}

.code-content {
    position: relative;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    padding: 12px;
    border: 1px solid rgba(88, 166, 255, 0.2);
}

.code-content code {
    display: block;
    color: #000000;
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 11.5px;
    line-height: 2.1;
    letter-spacing: 0.5px;
    word-break: break-all;
    white-space: pre-wrap;
    font-weight: 500;
    text-shadow: 0 0 10px rgba(88, 166, 255, 0.5);
}

/* 鼠标悬停时增强效果 */
.gunmod-item:hover .code-section {
    border-color: rgba(88, 166, 255, 0.5);
    box-shadow: 
        0 4px 20px rgba(88, 166, 255, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.gunmod-item:hover .code-content code {
    color: #79c0ff;
    text-shadow: 0 0 15px rgba(121, 192, 255, 0.6);
}

/* 推荐理由 */
.reason-section {
    padding: 10px;
    background: rgba(255, 255, 255, 0.02);
    border-left: 2px solid var(--primary);
    border-radius: 4px;
    margin-bottom: 12px;
    flex: 1;
}

.reason-section p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

/* 卡片底部 */
.item-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    margin-top: auto;
}

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

/* 复制按钮 - 优化设计 */
.copy-button {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.copy-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.copy-button:hover::before {
    width: 100px;
    height: 100px;
}

.copy-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}

.copy-button:active {
    transform: translateY(0);
}

.copy-button.copied {
    background: linear-gradient(135deg, var(--success) 0%, #00cc70 100%);
    animation: successPulse 0.5s;
}

@keyframes successPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* ========== 分页 ========== */
.pagination-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 40px;
}

.page-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.page-btn:hover:not(:disabled) {
    background: rgba(255, 107, 53, 0.1);
    border-color: var(--primary);
}

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

.page-numbers {
    display: flex;
    align-items: center;
    gap: 8px;
}

.page-num {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.page-num:hover {
    background: rgba(255, 107, 53, 0.1);
    border-color: var(--primary);
}

.page-num.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-color: transparent;
    color: white;
}

/* ========== Toast提示 ========== */
.copy-toast {
    position: fixed;
    bottom: 32px;
    right: 32px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    background: var(--bg-light);
    border: 1px solid var(--success);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 255, 136, 0.2);
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 9999;
}

.copy-toast.show {
    transform: translateX(0);
    opacity: 1;
}

/* ========== 响应式设计 ========== */
@media (max-width: 768px) {
    .gunmod-hero {
        height: 240px;
    }
    
    .title-main {
        font-size: 28px;
    }
    
    .gunmod-container {
        padding: 20px 15px 40px;
    }
    
    .gunmod-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .category-wrapper {
        margin: 0 -15px 20px;
        padding: 0 15px;
    }
    
    .category-list {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .code-content code {
        font-size: 13px;
    }
    
    .copy-toast {
        bottom: 20px;
        right: 20px;
        left: 20px;
    }
}

@media (max-width: 480px) {
    .gunmod-container {
        padding: 16px 12px 40px;
    }
    
    .gunmod-item {
        padding: 16px;
    }
    
    .item-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .item-footer {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }
    
    .copy-button {
        width: 100%;
        justify-content: center;
    }
    
    .code-section {
        padding: 12px;
    }
    
    .code-content {
        padding: 10px;
    }
    
    .code-content code {
        font-size: 12px;
    }
}

/* ========== 动画 ========== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========== 滚动条 ========== */
.delta-gunmod-page ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.delta-gunmod-page ::-webkit-scrollbar-track {
    background: var(--bg-medium);
}

.delta-gunmod-page ::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}

.delta-gunmod-page ::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}