/*
Theme Name: SJXTheme
Theme URI: https://www.sjsxw.cn
Author: 小宇
Author URI: https://www.sjsxw.cn
Description: 现代化资源下载商城主题，支持会员系统、订单管理、下载防盗链
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: sjxtheme
Tags: e-commerce, custom-header, custom-menu, featured-images
*/

/* CSS变量 */
:root {
    --primary-color: #1890ff;
    --primary-hover: #40a9ff;
    --success-color: #52c41a;
    --warning-color: #faad14;
    --danger-color: #ff4d4f;
    --text-color: #333;
    --text-secondary: #666;
    --text-light: #999;
    --bg-color: #f5f5f5;
    --bg-white: #fff;
    --border-color: #e8e8e8;
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-hover: 0 4px 16px rgba(0,0,0,0.15);
    --radius: 8px;
    --radius-sm: 4px;
    --transition: all 0.3s ease;
}

/* 主题颜色 */
.theme-blue { --primary-color: #1890ff; }
.theme-green { --primary-color: #52c41a; }
.theme-red { --primary-color: #ff4d4f; }
.theme-purple { --primary-color: #722ed1; }
.theme-orange { --primary-color: #fa8c16; }

/* 重置 */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; line-height: 1.6; color: var(--text-color); background: var(--bg-color); }
a { color: var(--primary-color); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-hover); }
img { max-width: 100%; height: auto; }
ul, ol { list-style: none; }
input, button, textarea, select { font-family: inherit; font-size: inherit; }
button { cursor: pointer; border: none; background: none; }

/* 通用类 */
.container { max-width: 1200px; margin: 0 auto; padding: 0 15px; }
.clearfix::after { content: ""; display: block; clear: both; }
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.hidden { display: none; }
.visible { display: block; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.grid { display: grid; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

/* 按钮 */
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 10px 24px; font-size: 14px; font-weight: 500; border-radius: var(--radius); transition: var(--transition); cursor: pointer; }
.btn-primary { background: var(--primary-color); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-2px); box-shadow: var(--shadow); }
.btn-secondary { background: #fff; color: var(--text-color); border: 1px solid var(--border-color); }
.btn-secondary:hover { border-color: var(--primary-color); color: var(--primary-color); }
.btn-danger { background: var(--danger-color); color: #fff; }
.btn-success { background: var(--success-color); color: #fff; }
.btn-sm { padding: 6px 16px; font-size: 12px; }
.btn-lg { padding: 14px 32px; font-size: 16px; }
.btn-block { display: block; width: 100%; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* 卡片 */
.card { background: var(--bg-white); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; transition: var(--transition); }
.card:hover { box-shadow: var(--shadow-hover); transform: translateY(-4px); }
.card-body { padding: 20px; }
.card-header { padding: 15px 20px; border-bottom: 1px solid var(--border-color); font-weight: 600; }
.card-footer { padding: 15px 20px; border-top: 1px solid var(--border-color); background: #fafafa; }

/* 表单 */
.form-group { margin-bottom: 20px; }
.form-label { display: block; margin-bottom: 8px; font-weight: 500; color: var(--text-color); }
.form-control { width: 100%; padding: 10px 15px; border: 1px solid var(--border-color); border-radius: var(--radius-sm); background: #fff; transition: var(--transition); }
.form-control:focus { outline: none; border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(24,144,255,0.1); }
.form-control::placeholder { color: var(--text-light); }
textarea.form-control { resize: vertical; min-height: 100px; }
.form-hint { margin-top: 6px; font-size: 12px; color: var(--text-light); }
.form-error { color: var(--danger-color); font-size: 12px; margin-top: 6px; }

/* 导航 */
.navbar { background: var(--bg-white); box-shadow: var(--shadow); position: sticky; top: 0; z-index: 1000; }
.navbar-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.navbar-brand { font-size: 20px; font-weight: 700; color: var(--primary-color); }
.navbar-menu { display: flex !important; align-items: center; gap: 0 !important; }
.navbar-menu ul { display: flex !important; align-items: center; gap: 0 !important; margin: 0 !important; padding: 0 !important; list-style: none !important; }
.navbar-menu li { display: inline-block !important; margin: 0 !important; list-style: none !important; float: none !important; }
.navbar-menu li a { display: block !important; padding: 10px 15px !important; white-space: nowrap !important; }
.navbar-menu a { color: var(--text-color); font-weight: 500; position: relative; }
.navbar-menu a:hover { color: var(--primary-color); }
.navbar-menu a::after { content: ""; position: absolute; bottom: -4px; left: 0; width: 0; height: 2px; background: var(--primary-color); transition: var(--transition); }
.navbar-menu a:hover::after { width: 100%; }

/* 用户菜单 */
.user-menu { position: relative; }
.user-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--primary-color); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 600; cursor: pointer; }
.user-dropdown { position: absolute; top: 100%; right: 0; margin-top: 10px; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-hover); min-width: 180px; opacity: 0; visibility: hidden; transform: translateY(-10px); transition: var(--transition); }
.user-menu:hover .user-dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
.user-dropdown a { display: block; padding: 12px 20px; color: var(--text-color); }
.user-dropdown a:hover { background: #f5f5f5; color: var(--primary-color); }

/* 搜索框 */
.search-box { display: flex; background: #f0f0f0; border-radius: 20px; overflow: hidden; }
.search-box input { flex: 1; border: none; background: transparent; padding: 8px 16px; outline: none; }
.search-box button { padding: 8px 20px; background: var(--primary-color); color: #fff; }

/* 幻灯片/轮播 */
.swiper { position: relative; overflow: hidden; }
.swiper-slide { display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--primary-color), #722ed1); height: 400px; }
.swiper-content { text-align: center; color: #fff; }
.swiper-content h2 { font-size: 36px; margin-bottom: 16px; }
.swiper-content p { font-size: 18px; opacity: 0.9; }

/* 商品网格 */
.goods-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.goods-card { background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: var(--transition); }
.goods-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.goods-image { position: relative; height: 200px; overflow: hidden; }
.goods-image img { width: 100%; height: 100%; object-fit: cover; }
.goods-tag { position: absolute; top: 10px; left: 10px; padding: 4px 12px; background: var(--danger-color); color: #fff; font-size: 12px; border-radius: 12px; }
.goods-info { padding: 15px; }
.goods-title { font-size: 16px; font-weight: 500; margin-bottom: 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.goods-price { font-size: 20px; font-weight: 700; color: var(--danger-color); }
.goods-price del { font-size: 14px; color: var(--text-light); font-weight: 400; margin-left: 8px; }
.goods-meta { display: flex; justify-content: space-between; margin-top: 10px; font-size: 12px; color: var(--text-light); }

/* 用户中心 */
.user-panel { display: flex; gap: 20px; min-height: 600px; }
.user-sidebar { width: 220px; background: #fff; border-radius: var(--radius); padding: 20px; }
.user-sidebar h3 { padding-bottom: 15px; border-bottom: 1px solid var(--border-color); margin-bottom: 15px; }
.user-sidebar a { display: block; padding: 12px 15px; color: var(--text-color); border-radius: var(--radius-sm); margin-bottom: 5px; }
.user-sidebar a:hover, .user-sidebar a.active { background: rgba(24,144,255,0.1); color: var(--primary-color); }
.user-content { flex: 1; background: #fff; border-radius: var(--radius); padding: 30px; }
.user-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 30px; }
.stat-card { background: linear-gradient(135deg, var(--primary-color), #722ed1); padding: 20px; border-radius: var(--radius); color: #fff; }
.stat-card h4 { font-size: 14px; opacity: 0.9; }
.stat-card .num { font-size: 28px; font-weight: 700; margin-top: 8px; }

/* 下载区域 */
.download-area { background: #f8f9fa; border-radius: var(--radius); padding: 20px; margin: 20px 0; }
.download-item { display: flex; align-items: center; padding: 15px; background: #fff; border-radius: var(--radius-sm); margin-bottom: 10px; }
.download-icon { width: 40px; height: 40px; background: var(--primary-color); color: #fff; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 20px; margin-right: 15px; }
.download-info { flex: 1; }
.download-name { font-weight: 500; margin-bottom: 4px; }
.download-code { font-size: 12px; color: var(--text-light); }
.copy-btn { padding: 8px 16px; background: var(--primary-color); color: #fff; border-radius: var(--radius-sm); font-size: 12px; }

/* 页脚 */
.site-footer { background: #1a1a2e; color: #fff; padding: 60px 0 30px; }
.footer-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 40px; margin-bottom: 40px; }
.footer-section h4 { font-size: 18px; margin-bottom: 20px; color: var(--primary-color); }
.footer-section ul li { margin-bottom: 12px; }
.footer-section a { color: #999; }
.footer-section a:hover { color: #fff; }
.footer-bottom { padding-top: 30px; border-top: 1px solid rgba(255,255,255,0.1); text-align: center; color: #666; }

/* 徽章 */
.badge { display: inline-block; padding: 2px 8px; font-size: 12px; border-radius: 10px; background: var(--primary-color); color: #fff; }
.badge-success { background: var(--success-color); }
.badge-warning { background: var(--warning-color); }
.badge-danger { background: var(--danger-color); }

/* 标签 */
.tag { display: inline-block; padding: 4px 12px; font-size: 12px; background: #f0f0f0; color: var(--text-secondary); border-radius: 12px; margin-right: 8px; margin-bottom: 8px; }
.tag:hover { background: var(--primary-color); color: #fff; }

/* 加载 */
.loading { display: flex; align-items: center; justify-content: center; padding: 40px; }
.loading::after { content: ""; width: 30px; height: 30px; border: 3px solid #f3f3f3; border-top: 3px solid var(--primary-color); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* 模态框 */
.modal { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; z-index: 9999; opacity: 0; visibility: hidden; transition: var(--transition); }
.modal.active { opacity: 1; visibility: visible; }
.modal-content { background: #fff; border-radius: var(--radius); max-width: 500px; width: 90%; max-height: 90vh; overflow: auto; transform: scale(0.9); transition: var(--transition); }
.modal.active .modal-content { transform: scale(1); }
.modal-header { padding: 20px; border-bottom: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: center; }
.modal-close { width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 20px; }
.modal-body { padding: 20px; }
.modal-footer { padding: 20px; border-top: 1px solid var(--border-color); display: flex; justify-content: flex-end; gap: 10px; }

/* 提示消息 */
.alert { padding: 15px 20px; border-radius: var(--radius-sm); margin-bottom: 20px; }
.alert-success { background: #f6ffed; color: #52c41a; border: 1px solid #b7eb8f; }
.alert-error { background: #fff2f0; color: #ff4d4f; border: 1px solid #ffccc7; }
.alert-warning { background: #fffbe6; color: #faad14; border: 1px solid #ffe58f; }
.alert-info { background: #e6f7ff; color: #1890ff; border: 1px solid #91d5ff; }

/* 分页 */
.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 30px; }
.pagination a, .pagination span { display: inline-flex; align-items: center; justify-content: center; min-width: 36px; height: 36px; padding: 0 12px; background: #fff; border: 1px solid var(--border-color); border-radius: var(--radius-sm); color: var(--text-color); }
.pagination a:hover { border-color: var(--primary-color); color: var(--primary-color); }
.pagination .current { background: var(--primary-color); border-color: var(--primary-color); color: #fff; }

/* 响应式 */
@media (max-width: 768px) {
    .navbar-menu { display: none; }
    .footer-grid { grid-template-columns: 1fr; }
    .user-panel { flex-direction: column; }
    .user-sidebar { width: 100%; }
    .user-stats { grid-template-columns: repeat(2, 1fr); }
    .goods-grid { grid-template-columns: repeat(2, 1fr); }
    .swiper-slide { height: 250px; }
    .swiper-content h2 { font-size: 24px; }
}

@media (max-width: 480px) {
    .goods-grid { grid-template-columns: 1fr; }
    .user-stats { grid-template-columns: 1fr; }
}

/* 动画 */
@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.5s ease; }
.slide-up { animation: slideUp 0.5s ease; }