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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: #0a0a0f;
    color: #fff;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* 简洁渐变背景 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 20% 30%, rgba(167, 139, 250, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 70%, rgba(236, 72, 153, 0.15) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* 网格背景 */
.grid-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: 0;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 60px 40px;
    position: relative;
    z-index: 1;
}

/* 顶部导航栏 */
.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 80px;
    padding: 20px 0;
}

.logo {
    font-size: 1.8em;
    font-weight: 700;
    background: linear-gradient(135deg, #a78bfa 0%, #ec4899 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

.nav-links {
    display: flex;
    gap: 30px;
    align-items: center;
}

.nav-link {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.95em;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #a78bfa, #ec4899);
    transition: width 0.3s ease;
}

.nav-link:hover {
    color: #fff;
}

.nav-link:hover::after {
    width: 100%;
}

/* 主题切换按钮 */
.theme-toggle {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.3em;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.05);
}

.theme-icon {
    transition: transform 0.3s ease;
}

.theme-toggle:hover .theme-icon {
    transform: rotate(20deg);
}

/* 亮色主题 */
body.light-theme {
    background: #f5f7fa;
    color: #1a1a1a;
}

body.light-theme::before {
    background:
        radial-gradient(ellipse at 20% 30%, rgba(167, 139, 250, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 70%, rgba(236, 72, 153, 0.1) 0%, transparent 50%);
}

body.light-theme .grid-background {
    background-image:
        linear-gradient(rgba(0, 0, 0, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 0, 0, 0.03) 1px, transparent 1px);
}

body.light-theme .nav-link {
    color: rgba(0, 0, 0, 0.6);
}

body.light-theme .nav-link:hover {
    color: #1a1a1a;
}

body.light-theme .theme-toggle {
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

body.light-theme .theme-toggle:hover {
    background: rgba(0, 0, 0, 0.1);
}

body.light-theme .subtitle {
    color: rgba(0, 0, 0, 0.5);
}

body.light-theme .package-card {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.08);
}

body.light-theme .package-card:hover {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(167, 139, 250, 0.3);
}

body.light-theme .package-stock {
    color: rgba(0, 0, 0, 0.5);
}

body.light-theme .modal-content {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: #1a1a1a;
}

body.light-theme .close {
    color: #666;
}

body.light-theme .close:hover {
    color: #000;
}

body.light-theme input {
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: #1a1a1a;
}

body.light-theme input:focus {
    background: rgba(255, 255, 255, 0.9);
    border-color: #a78bfa;
}

body.light-theme .payment-method {
    background: rgba(0, 0, 0, 0.02);
    border: 2px solid rgba(0, 0, 0, 0.08);
}

body.light-theme .payment-method:hover {
    background: rgba(167, 139, 250, 0.05);
    border-color: #a78bfa;
}

body.light-theme .info-tip {
    color: rgba(0, 0, 0, 0.5);
}

body.light-theme footer {
    color: rgba(0, 0, 0, 0.5);
}

body.light-theme footer a {
    color: #667eea;
}

body.light-theme footer a:hover {
    color: #5a67d8;
}

body.light-theme .query-form input {
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: #1a1a1a;
}

/* 页面标题 */
header {
    text-align: center;
    margin-bottom: 80px;
}

header h1 {
    font-size: 4.5em;
    font-weight: 800;
    background: linear-gradient(135deg, #ffffff 0%, #a78bfa 50%, #ec4899 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 20px;
    letter-spacing: -2px;
    line-height: 1.1;
}

.subtitle {
    font-size: 1.3em;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 400;
    letter-spacing: 0.5px;
}

/* 套餐卡片网格 */
.packages {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 25px;
    margin-bottom: 80px;
}

.package-card {
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 45px 30px;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

/* 自定义提示样式 */
.custom-toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: rgba(20, 20, 30, 0.95);
    backdrop-filter: blur(10px);
    color: #fff;
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
    font-weight: 500;
    z-index: 10000;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    min-width: 300px;
    max-width: 500px;
}

.custom-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.custom-toast.error {
    background: rgba(239, 68, 68, 0.95);
    border-color: rgba(255, 100, 100, 0.3);
}

.custom-toast.success {
    background: rgba(16, 185, 129, 0.95);
    border-color: rgba(100, 255, 200, 0.3);
}

.custom-toast .toast-icon {
    font-size: 20px;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .custom-toast {
        min-width: auto;
        max-width: calc(100% - 40px);
        font-size: 14px;
        padding: 14px 20px;
    }
}

.package-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #a78bfa, #ec4899);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.package-card:hover::before {
    opacity: 1;
}

.package-card:hover {
    transform: translateY(-8px);
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(167, 139, 250, 0.3);
}

.package-card.popular {
    background: linear-gradient(135deg, rgba(167, 139, 250, 0.08) 0%, rgba(236, 72, 153, 0.08) 100%);
    border-color: rgba(236, 72, 153, 0.3);
}

.package-card.popular::before {
    opacity: 1;
}

.package-badge {
    display: inline-block;
    padding: 8px 20px;
    background: linear-gradient(135deg, rgba(167, 139, 250, 0.2) 0%, rgba(236, 72, 153, 0.2) 100%);
    border: 1px solid rgba(167, 139, 250, 0.3);
    border-radius: 20px;
    font-size: 0.75em;
    font-weight: 700;
    margin-bottom: 25px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #a78bfa;
}

.package-badge.hot {
    background: linear-gradient(135deg, #ec4899 0%, #f59e0b 100%);
    border-color: #f59e0b;
    color: #fff;
}

.package-amount {
    font-size: 4.5em;
    font-weight: 900;
    margin: 30px 0;
    background: linear-gradient(135deg, #fff 0%, #a78bfa 50%, #ec4899 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -3px;
}

.package-desc {
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 20px;
    font-size: 0.95em;
    font-weight: 500;
}

.package-stock {
    margin: 15px 0;
    font-size: 0.85em;
    color: rgba(255, 255, 255, 0.4);
    font-weight: 500;
}

.package-stock span {
    color: #10b981;
    font-weight: 700;
}

.package-stock.low-stock span {
    color: #f59e0b;
}

.package-stock.out-of-stock span {
    color: #ef4444;
}

.buy-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #a78bfa 0%, #ec4899 100%);
    border: none;
    border-radius: 14px;
    color: white;
    font-size: 1.05em;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 15px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.buy-btn:hover {
    transform: scale(1.03);
}

.buy-btn:disabled {
    background: rgba(255, 255, 255, 0.1);
    cursor: not-allowed;
    opacity: 0.5;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: linear-gradient(135deg, #1a1a24 0%, #0f0f16 100%);
    margin: 3% auto;
    padding: 50px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 28px;
    width: 90%;
    max-width: 650px;
    position: relative;
    animation: slideUp 0.4s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.close {
    position: absolute;
    right: 25px;
    top: 25px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 32px;
    font-weight: 300;
    cursor: pointer;
    transition: all 0.3s;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.close:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(90deg);
}

.modal-content h2 {
    text-align: center;
    margin-bottom: 30px;
    font-size: 2em;
    font-weight: 700;
    background: linear-gradient(135deg, #fff 0%, #a78bfa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.selected-package {
    text-align: center;
    font-size: 1.1em;
    margin-bottom: 35px;
    color: rgba(255, 255, 255, 0.6);
}

#selectedAmount {
    color: #ec4899;
    font-weight: 700;
    font-size: 1.3em;
}

/* 数量选择 */
.quantity-section {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 35px;
}

.quantity-section label {
    display: block;
    margin-bottom: 20px;
    font-size: 1em;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 600;
}

.quantity-control {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    margin-bottom: 20px;
}

.quantity-btn {
    width: 48px;
    height: 48px;
    border: none;
    background: linear-gradient(135deg, #a78bfa 0%, #ec4899 100%);
    color: white;
    font-size: 1.5em;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.quantity-btn:hover {
    transform: scale(1.1);
}

.quantity-btn:active {
    transform: scale(0.95);
}

.quantity-display {
    font-size: 2.5em;
    font-weight: 700;
    color: #fff;
    min-width: 80px;
    text-align: center;
}

.total-amount {
    text-align: center;
    font-size: 1.1em;
    color: rgba(255, 255, 255, 0.6);
}

.total-amount span {
    color: #ec4899;
    font-size: 1.6em;
    font-weight: 700;
    margin-left: 8px;
}

/* 支付方式 */
.payment-methods {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 35px;
}

.payment-method {
    background: rgba(255, 255, 255, 0.03);
    border: 2px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 25px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.payment-method:hover {
    border-color: rgba(167, 139, 250, 0.4);
    background: rgba(167, 139, 250, 0.05);
    transform: translateY(-3px);
}

.payment-icon {
    font-size: 3em;
    margin-bottom: 12px;
}

.payment-name {
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 1.05em;
}

.payment-desc {
    font-size: 0.85em;
    color: rgba(255, 255, 255, 0.5);
}

/* 用户信息 */
.user-info input {
    width: 100%;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: white;
    font-size: 1em;
    margin-bottom: 18px;
    transition: all 0.3s ease;
}

.user-info input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.user-info input:focus {
    outline: none;
    border-color: #a78bfa;
    background: rgba(167, 139, 250, 0.05);
}

.password-field {
    position: relative;
    width: 100%;
}

.user-info .password-field {
    margin-bottom: 18px;
}

.user-info .password-field input {
    margin-bottom: 0;
    padding-right: 56px;
}

.query-form .password-field input {
    padding-right: 56px;
}

.password-toggle {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.65);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.password-toggle:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

body.light-theme .password-toggle {
    color: rgba(0, 0, 0, 0.55);
}

body.light-theme .password-toggle:hover {
    color: #111827;
    background: rgba(0, 0, 0, 0.06);
}

.info-tip {
    font-size: 0.85em;
    color: #f59e0b;
    text-align: center;
    margin-top: 12px;
}

/* 订单查询表单 */
.query-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.query-form input {
    width: 100%;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: white;
    font-size: 1em;
    transition: all 0.3s ease;
}

.query-form input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.query-form input:focus {
    outline: none;
    border-color: #a78bfa;
    background: rgba(167, 139, 250, 0.05);
}

.query-result {
    margin-top: 30px;
    padding: 25px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
}

.query-result h3 {
    margin-bottom: 20px;
    color: #a78bfa;
    font-size: 1.3em;
}

.query-result .code-item {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 10px;
}

.query-result .code-text {
    flex: 1;
    font-family: 'Courier New', monospace;
    font-size: 0.95em;
    color: #ec4899;
    font-weight: 600;
}

.query-result .code-status {
    padding: 5px 12px;
    border-radius: 8px;
    font-size: 0.85em;
    font-weight: 600;
}

.query-result .code-status.unused {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.query-result .code-status.used {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

/* 成功模态框 */
.success-modal {
    max-width: 600px;
    text-align: center;
}

.success-icon {
    font-size: 5em;
    margin-bottom: 25px;
    animation: bounceIn 0.6s ease;
}

@keyframes bounceIn {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

.codes-list {
    max-height: 400px;
    overflow-y: auto;
    margin: 35px 0;
    padding: 10px;
}

.code-item {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 18px;
    margin-bottom: 12px;
    transition: all 0.3s ease;
}

.code-item:hover {
    border-color: rgba(167, 139, 250, 0.3);
    background: rgba(167, 139, 250, 0.05);
}

.code-number {
    font-size: 1.1em;
    font-weight: 700;
    color: #a78bfa;
    min-width: 35px;
}

.code-text {
    flex: 1;
    font-family: 'Courier New', monospace;
    font-size: 1em;
    color: #ec4899;
    font-weight: 600;
    word-break: break-all;
}

.copy-btn {
    padding: 10px 24px;
    background: linear-gradient(135deg, #a78bfa 0%, #ec4899 100%);
    border: none;
    border-radius: 10px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    font-size: 0.9em;
}

.copy-btn:hover {
    transform: scale(1.05);
}

.success-tip {
    color: rgba(255, 255, 255, 0.6);
    margin: 25px 0;
    font-size: 0.95em;
}

.success-tip a {
    color: #a78bfa;
    font-weight: 600;
    text-decoration: none;
}

.success-tip a:hover {
    text-decoration: underline;
}

.success-actions {
    display: flex;
    gap: 15px;
    margin-top: 35px;
}

.btn-primary, .btn-secondary {
    flex: 1;
    padding: 16px;
    border: none;
    border-radius: 12px;
    font-size: 1.05em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #a78bfa 0%, #ec4899 100%);
    color: white;
}

.btn-primary:hover {
    transform: scale(1.02);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
}

/* 页脚 */
footer {
    text-align: center;
    margin-top: 80px;
    padding: 30px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.95em;
}

footer a {
    color: #a78bfa;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

footer a:hover {
    color: #ec4899;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .packages {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .container {
        padding: 40px 20px;
    }

    header h1 {
        font-size: 3em;
    }

    .packages {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .package-card {
        padding: 30px 20px;
    }

    .package-amount {
        font-size: 2.5em;
    }

    .payment-methods {
        grid-template-columns: 1fr;
    }

    .modal-content {
        padding: 35px 25px;
    }

    .top-nav {
        flex-direction: column;
        gap: 20px;
    }
}

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

    header h1 {
        font-size: 2.2em;
    }
}
