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

:root {
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --primary-light: #eef2ff;
    --accent: #7c3aed;
    --danger: #dc2626;
    --success: #16a34a;
    --bg: #f8fafc;
    --card-bg: #ffffff;
    --text: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --shadow: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.1);
    --radius: 14px;
    --gradient: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container { max-width: 1140px; margin: 0 auto; padding: 0 20px; }
a { color: inherit; text-decoration: none; }

/* ============ 头部 ============ */
.site-header {
    background: #fff;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    position: sticky; top: 0; z-index: 100;
}
.header-inner { display: flex; justify-content: space-between; align-items: center; height: 64px; }
.logo { display: flex; align-items: center; gap: 8px; font-size: 1.2rem; font-weight: 700; color: var(--primary); }
.logo-icon { font-size: 1.4rem; }
.site-header nav a { margin-left: 22px; color: var(--text-muted); font-size: 0.92rem; transition: color 0.2s; }
.site-header nav a:hover, .site-header nav a.active { color: var(--primary); }

/* ============ Hero 横幅 ============ */
.hero-banner {
    background: var(--gradient);
    color: #fff;
    padding: 60px 0 70px;
    position: relative;
    overflow: hidden;
}
.hero-banner::before {
    content: ''; position: absolute; top: -50%; right: -10%;
    width: 500px; height: 500px; border-radius: 50%;
    background: rgba(255,255,255,0.08);
}
.hero-banner::after {
    content: ''; position: absolute; bottom: -30%; left: -5%;
    width: 400px; height: 400px; border-radius: 50%;
    background: rgba(255,255,255,0.06);
}
.hero-content { display: flex; align-items: center; justify-content: space-between; gap: 40px; position: relative; z-index: 1; }
.hero-text h1 { font-size: 2.6rem; font-weight: 800; line-height: 1.2; margin-bottom: 16px; }
.hero-text p { font-size: 1.1rem; opacity: 0.9; margin-bottom: 28px; max-width: 480px; }
.hero-actions .btn-primary { background: #fff; color: var(--primary); border: none; }
.hero-actions .btn-primary:hover { background: #f0f0ff; }

.hero-visual { position: relative; width: 280px; height: 240px; flex-shrink: 0; }
.floating-card {
    position: absolute; background: #fff; border-radius: 16px;
    padding: 16px 22px; display: flex; align-items: center; gap: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15); animation: float 3s ease-in-out infinite;
}
.floating-1 { top: 0; left: 0; animation-delay: 0s; }
.floating-2 { top: 60px; right: 0; animation-delay: 0.5s; }
.floating-3 { bottom: 0; left: 40px; animation-delay: 1s; }
.fc-icon { font-size: 1.8rem; }
.fc-text { color: var(--text); font-weight: 600; font-size: 0.9rem; }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

/* ============ 分类导航 ============ */
.category-nav {
    display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 28px;
    padding: 16px; background: #fff; border-radius: var(--radius);
    border: 1px solid var(--border); box-shadow: var(--shadow);
}
.cat-tag {
    padding: 7px 18px; border-radius: 20px; background: var(--bg);
    color: var(--text-muted); font-size: 0.9rem; transition: all 0.2s;
    border: 1px solid transparent;
}
.cat-tag:hover { background: var(--primary-light); color: var(--primary); }
.cat-tag.active { background: var(--gradient); color: #fff; }

/* ============ 区块标题 ============ */
.section-header { display: flex; align-items: center; margin: 40px 0 20px; }
.section-header h2 { font-size: 1.5rem; }
.badge {
    display: inline-block; background: var(--primary-light); color: var(--primary);
    font-size: 0.85rem; padding: 2px 12px; border-radius: 20px;
    margin-left: 10px; font-weight: 600;
}

/* ============ 卡片网格 ============ */
.card-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
    gap: 22px; margin-bottom: 50px;
}
.card {
    display: flex; flex-direction: column; background: var(--card-bg);
    border: 1px solid var(--border); border-radius: var(--radius);
    padding: 22px; transition: all 0.25s; box-shadow: var(--shadow);
    cursor: pointer;
}
.card:hover {
    transform: translateY(-4px); box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}
.card-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 14px; }
.card-icon {
    width: 52px; height: 52px; border-radius: 14px;
    background: var(--gradient); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; font-weight: 700; flex-shrink: 0;
}
.cat-badge {
    font-size: 0.75rem; background: var(--primary-light); color: var(--primary);
    padding: 3px 10px; border-radius: 6px; font-weight: 500;
}
.card-body { flex: 1; margin-bottom: 16px; }
.card-body h3 { font-size: 1.15rem; margin-bottom: 6px; }
.card-body .version {
    display: inline-block; font-size: 0.8rem; color: var(--text-muted);
    background: var(--bg); padding: 1px 8px; border-radius: 6px; margin-bottom: 10px;
}
.card-body p { color: var(--text-muted); font-size: 0.88rem; line-height: 1.6; }
.card-footer {
    display: flex; justify-content: space-between; align-items: center;
    padding-top: 14px; border-top: 1px solid var(--border);
}
.price { font-size: 1.3rem; font-weight: 700; color: var(--primary); }
.card-arrow { font-size: 0.85rem; color: var(--text-muted); }
.card:hover .card-arrow { color: var(--primary); }
.empty { grid-column: 1 / -1; text-align: center; padding: 50px; color: var(--text-muted); }

/* ============ 详情页 ============ */
.detail-page { padding-top: 28px; padding-bottom: 60px; }
.back-link { display: inline-block; color: var(--text-muted); font-size: 0.9rem; margin-bottom: 20px; transition: color 0.2s; }
.back-link:hover { color: var(--primary); }

.software-detail { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--border); overflow: hidden; }

.detail-hero {
    display: flex; justify-content: space-between; align-items: center;
    padding: 32px; background: linear-gradient(135deg, #f8f9ff 0%, #f0f4ff 100%);
    border-bottom: 1px solid var(--border); gap: 20px;
}
.detail-hero-left { display: flex; align-items: center; gap: 20px; }
.detail-icon {
    width: 76px; height: 76px; border-radius: 18px;
    background: var(--gradient); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 2.2rem; font-weight: 700; box-shadow: 0 6px 16px rgba(79,70,229,0.3);
}
.detail-meta { display: flex; gap: 8px; margin-bottom: 8px; }
.version-tag {
    display: inline-block; background: var(--primary-light); color: var(--primary);
    font-size: 0.82rem; padding: 3px 12px; border-radius: 8px; font-weight: 600;
}
.detail-title-group h1 { font-size: 1.7rem; }
.detail-hero-right { text-align: center; }
.price-tag {
    font-size: 2rem; font-weight: 800; color: var(--primary); margin-bottom: 12px;
}

.detail-grid { display: grid; grid-template-columns: 1fr 320px; gap: 0; }
.detail-main { padding: 32px; }
.detail-section { margin-bottom: 28px; }
.detail-section:last-child { margin-bottom: 0; }
.detail-section h2 { font-size: 1.15rem; margin-bottom: 14px; padding-left: 0; }
.section-content {
    color: var(--text-muted); line-height: 1.9; padding: 18px 22px;
    background: var(--bg); border-radius: 10px; border: 1px solid var(--border);
}
.instructions { font-family: inherit; }

.detail-sidebar { padding: 32px; background: #fafbff; border-left: 1px solid var(--border); }
.sidebar-card {
    background: #fff; border: 1px solid var(--border); border-radius: 12px;
    padding: 20px; margin-bottom: 16px;
}
.sidebar-card h3 { font-size: 1rem; margin-bottom: 14px; }
.download-url {
    font-family: "Consolas", monospace; font-size: 0.82rem; color: var(--text-muted);
    word-break: break-all; background: var(--bg); padding: 10px 12px;
    border-radius: 8px; margin-bottom: 12px; border: 1px solid var(--border);
}
.btn-block { display: block; width: 100%; text-align: center; }
.feature-list { list-style: none; }
.feature-list li { padding: 6px 0; font-size: 0.9rem; color: var(--text-muted); }

/* ============ 支付弹窗 ============ */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5);
    align-items: center; justify-content: center; z-index: 1000; padding: 20px;
}
.modal {
    background: #fff; border-radius: 18px; width: 100%; max-width: 420px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3); overflow: hidden; animation: modalIn 0.25s ease;
}
@keyframes modalIn { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 18px 24px; border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 1.1rem; }
.modal-close { background: none; border: none; font-size: 1.6rem; color: var(--text-muted); cursor: pointer; line-height: 1; }
.modal-body { padding: 28px 24px; text-align: center; }
.pay-amount { margin-bottom: 8px; }
.pay-label { font-size: 0.85rem; color: var(--text-muted); display: block; margin-bottom: 4px; }
.pay-price { font-size: 2.2rem; font-weight: 800; color: var(--primary); }
.pay-product { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 20px; }
.qrcode-wrapper {
    display: flex; justify-content: center; align-items: center;
    width: 220px; height: 220px; margin: 0 auto 16px;
    background: #fff; border: 2px solid var(--border); border-radius: 12px;
}
#qrcode { display: flex; align-items: center; justify-content: center; }
#qrcode img, #qrcode canvas { border-radius: 4px; }
.qrcode-placeholder { color: var(--text-muted); font-size: 0.9rem; }
.pay-tip { color: var(--text-muted); font-size: 0.88rem; margin-bottom: 12px; }
.pay-status { font-size: 0.85rem; color: var(--primary); font-weight: 500; }

.success-icon { font-size: 3rem; margin-bottom: 12px; }
.success-title { font-size: 1.4rem; color: var(--success); margin-bottom: 8px; }
.success-sub { color: var(--text-muted); margin-bottom: 20px; }
.activation-code {
    background: var(--bg); border: 2px dashed var(--primary); border-radius: 10px;
    padding: 16px; font-family: "Consolas", monospace; font-size: 1.2rem;
    font-weight: 700; color: var(--primary); letter-spacing: 2px; margin-bottom: 16px;
    word-break: break-all;
}
.error-icon { font-size: 2.5rem; margin-bottom: 12px; }
.error-msg { color: var(--danger); margin-bottom: 16px; }

/* ============ 按钮 ============ */
.btn {
    display: inline-block; padding: 9px 20px; background: #fff; color: var(--text);
    border: 1px solid var(--border); border-radius: 8px; cursor: pointer;
    font-size: 0.9rem; font-family: inherit; transition: all 0.2s; text-align: center;
}
.btn:hover { background: var(--bg); border-color: #cbd5e1; }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-large { padding: 13px 32px; font-size: 1rem; font-weight: 600; }
.btn-danger { color: var(--danger); border-color: #fecaca; }
.btn-danger:hover { background: #fef2f2; border-color: var(--danger); }
.btn-sm { padding: 5px 14px; font-size: 0.82rem; }
.btn-block { display: block; width: 100%; }

/* ============ 登录页 ============ */
.login-body {
    background: var(--gradient);
    display: flex; align-items: center; justify-content: center;
    min-height: 100vh; padding: 20px;
}
.login-container { width: 100%; max-width: 400px; }
.login-card {
    background: #fff; border-radius: 20px; padding: 40px 36px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2); text-align: center;
}
.login-logo { font-size: 3rem; margin-bottom: 12px; }
.login-card h1 { font-size: 1.5rem; margin-bottom: 6px; }
.login-sub { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 28px; }
.login-form .form-group { text-align: left; margin-bottom: 18px; }
.login-form input {
    width: 100%; padding: 12px 16px; border: 1px solid var(--border);
    border-radius: 10px; font-size: 0.95rem; font-family: inherit;
    transition: border-color 0.2s;
}
.login-form input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.back-to-site { display: inline-block; margin-top: 20px; color: var(--text-muted); font-size: 0.88rem; }
.back-to-site:hover { color: var(--primary); }

/* ============ 后台管理 ============ */
.page-title { font-size: 1.6rem; margin: 28px 0 20px; }
.admin-header { display: flex; justify-content: space-between; align-items: center; margin: 28px 0 8px; }
.admin-header h1 { font-size: 1.6rem; }
.muted { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 18px; }
.table-wrapper { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
.data-table th { background: var(--bg); font-weight: 600; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: var(--bg); }
.data-table .actions { display: flex; gap: 8px; align-items: center; }

.admin-add-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; margin-bottom: 20px; box-shadow: var(--shadow); }
.inline-form { display: flex; gap: 10px; }
.inline-input { flex: 1; padding: 9px 14px; border: 1px solid var(--border); border-radius: 8px; font-size: 0.9rem; font-family: inherit; }
.inline-input:focus { outline: none; border-color: var(--primary); }

/* ============ 表单 ============ */
.form-title { font-size: 1.6rem; margin: 16px 0 24px; }
.software-form {
    background: #fff; padding: 32px; border-radius: var(--radius);
    border: 1px solid var(--border); box-shadow: var(--shadow); max-width: 780px;
}
.form-group { margin-bottom: 20px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 8px; font-size: 0.9rem; }
.required { color: var(--danger); }
.form-group input[type="text"],
.form-group input[type="number"],
.form-group textarea,
.form-group select {
    width: 100%; padding: 10px 14px; border: 1px solid var(--border);
    border-radius: 8px; font-size: 0.95rem; font-family: inherit;
    transition: border-color 0.2s; background: #fff;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
    outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light);
}
.form-group textarea { resize: vertical; min-height: 100px; }
.form-hint { display: block; font-size: 0.8rem; color: var(--text-muted); margin-top: 6px; line-height: 1.5; }
.form-actions { display: flex; gap: 12px; margin-top: 24px; }

/* ============ 页脚 ============ */
.site-footer {
    margin-top: auto; padding: 28px 0; text-align: center;
    color: var(--text-muted); font-size: 0.85rem;
    border-top: 1px solid var(--border); background: #fff;
}

/* ============ 响应式 ============ */
@media (max-width: 768px) {
    .hero-content { flex-direction: column; text-align: center; }
    .hero-text h1 { font-size: 1.8rem; }
    .hero-visual { display: none; }
    .detail-hero { flex-direction: column; text-align: center; }
    .detail-hero-left { flex-direction: column; }
    .detail-grid { grid-template-columns: 1fr; }
    .detail-sidebar { border-left: none; border-top: 1px solid var(--border); }
    .form-row { grid-template-columns: 1fr; }
    .software-form { padding: 20px; }
    .login-card { padding: 30px 22px; }
}
