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

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #ec4899;
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --bg-input: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --border: #475569;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
}

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

/* 星空背景 */
.stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1;
    pointer-events: none;
}

.star {
    position: absolute;
    background: white;
    border-radius: 50%;
    animation: twinkle 2s ease-in-out infinite;
}

@keyframes twinkle {
    0%, 100% {
        opacity: 0.3;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.2);
    }
}

/* 头部 */
.header {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    padding: 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav {
    display: flex;
    gap: 1.5rem;
}

.nav a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s;
}

.nav a:hover,
.nav a.active {
    color: var(--primary);
}

/* 主要内容 */
.main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
}

/* 卡片通用样式 */
.card {
    background: rgba(30, 41, 59, 0.7);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(99, 102, 241, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.card:hover {
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: 0 12px 40px rgba(99, 102, 241, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.card-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
}

/* 角色信息 */
.role-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.input-group {
    position: relative;
}

.input-group input {
    width: 100%;
    padding: 0.875rem 1rem;
    background: var(--bg-input);
    border: 2px solid var(--border);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.input-group label {
    position: absolute;
    left: 1rem;
    top: -0.625rem;
    background: var(--bg-card);
    padding: 0 0.5rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.verify-btn {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 50%, #4338ca 100%);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
    position: relative;
    overflow: hidden;
}

.verify-btn::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent);
    transform: rotate(45deg);
    transition: all 0.5s;
}

.verify-btn:hover::before {
    left: 100%;
}

.verify-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.6);
}

.verify-btn:active {
    transform: translateY(0);
}

.verify-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.role-info {
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid var(--primary);
    border-radius: 12px;
    padding: 1rem;
    margin-top: 1rem;
    display: none;
}

.role-info.show {
    display: block;
}

.role-info.error {
    border-color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

.role-info-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.role-avatar {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.role-details {
    flex: 1;
}

.role-name {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.role-server {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* 商品列表 */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

/* 隐藏区域 */
.hidden {
    display: none !important;
}

.product-card {
    background: rgba(51, 65, 85, 0.6);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 1rem;
    border: 2px solid rgba(99, 102, 241, 0.15);
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.product-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.product-card:hover::after {
    opacity: 1;
}

.product-card:hover {
    transform: translateY(-4px) scale(1.02);
    border-color: rgba(99, 102, 241, 0.5);
    box-shadow: 0 12px 32px rgba(99, 102, 241, 0.3), 0 0 20px rgba(236, 72, 153, 0.2);
}

.product-card.selected {
    border-color: #6366f1;
    background: rgba(99, 102, 241, 0.2);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4), 0 0 15px rgba(236, 72, 153, 0.3);
}

.product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    opacity: 0;
    transition: opacity 0.3s;
}

.product-card.selected::before {
    opacity: 1;
}

.product-image {
    width: 100%;
    height: 180px;
    border-radius: 8px;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    overflow: hidden;
}

.product-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.product-name {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.product-description {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.product-price {
    color: var(--secondary);
    font-weight: bold;
    font-size: 1.125rem;
}

/* 隐藏的礼包项 */
.hidden-item {
    display: none;
}

/* 月亮切换按钮 */
.moon-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0 14px;
    /* background: rgba(51, 65, 85, 0.4); */
    /* border: 2px dashed rgba(99, 102, 241, 0.3); */
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s;
}

.moon-toggle:hover {
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.5);
    transform: translateY(-2px);
}

.moon-icon {
    font-size: 1.5rem;
    animation: moonPulse 2s ease-in-out infinite;
}

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

.moon-text {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
}

.moon-toggle:hover .moon-text {
    color: var(--primary);
}

/* 月亮按钮容器 */
.moon-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding-top: 1rem;
    margin-top: 0.5rem;
    border-top: 1px dashed rgba(99, 102, 241, 0.2);
}

.product-original {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-decoration: line-through;
    margin-left: 0.5rem;
}

.product-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: linear-gradient(135deg, var(--secondary), var(--danger));
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* 支付方式 */
.payment-methods {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.payment-option {
    background: rgba(51, 65, 85, 0.6);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(99, 102, 241, 0.15);
    border-radius: 16px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
    overflow: hidden;
}

.payment-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.payment-option:hover::before {
    opacity: 1;
}

.payment-option:hover {
    border-color: rgba(99, 102, 241, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.2);
}

.payment-option.selected {
    border-color: #6366f1;
    background: rgba(99, 102, 241, 0.15);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.3), 0 0 10px rgba(236, 72, 153, 0.2);
}

.payment-icon {
    width: 48px;
    height: 48px;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.payment-info {
    flex: 1;
}

.payment-name {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.payment-desc {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.payment-check {
    width: 24px;
    height: 24px;
    border: 2px solid var(--border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.payment-option.selected .payment-check {
    background: var(--primary);
    border-color: var(--primary);
}

.payment-check::after {
    content: '✓';
    color: white;
    font-size: 0.875rem;
    display: none;
}

.payment-option.selected .payment-check::after {
    display: block;
}

/* 底部提交栏 */
.submit-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    padding: 1rem 1.5rem;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1000;
}

.submit-bar-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.total-info {
    flex: 1;
}

.total-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.total-amount {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--secondary);
}

.total-note {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.submit-btn {
    padding: 1rem 2.5rem;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 50%, #4338ca 100%);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
    position: relative;
    overflow: hidden;
}

.submit-btn::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.2), transparent);
    transform: rotate(45deg);
    transition: all 0.5s;
}

.submit-btn:hover::before {
    left: 100%;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.6);
}

.submit-btn:active {
    transform: translateY(0);
}

.submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }

    .nav {
        gap: 1rem;
    }

    .role-form {
        grid-template-columns: 1fr;
    }

    .product-grid {
        grid-template-columns: 1fr;
    }

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

    .submit-bar-content {
        flex-direction: column;
    }

    .submit-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .main {
        padding: 1rem 0.75rem;
    }

    .card {
        padding: 1rem;
        border-radius: 12px;
    }

    .product-image {
        height: 120px;
        font-size: 2.5rem;
    }

    .total-amount {
        font-size: 1.25rem;
    }
}

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

.card {
    animation: fadeIn 0.5s ease-out;
}

.card:nth-child(2) {
    animation-delay: 0.1s;
}

.card:nth-child(3) {
    animation-delay: 0.2s;
}

.card:nth-child(4) {
    animation-delay: 0.3s;
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 弹窗样式 */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    justify-content: center;
    align-items: center;
    z-index: 10000;
    padding: 1rem;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-radius: 20px;
    width: 100%;
    max-width: 420px;
    max-height: 80vh;
    overflow: hidden;
    border: 1px solid rgba(99, 102, 241, 0.3);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 30px rgba(99, 102, 241, 0.2);
    animation: slideUp 0.3s ease;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(99, 102, 241, 0.2);
    background: rgba(99, 102, 241, 0.05);
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 50%;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.modal-close:hover {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
}

.modal-body {
    padding: 1.5rem;
    max-height: 40vh;
    overflow-y: auto;
}

.modal-image {
    width: 100%;
    height: 120px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(236, 72, 153, 0.2));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    margin-bottom: 1rem;
}

.modal-body p {
    color: var(--text-primary);
    line-height: 1.8;
    font-size: 1rem;
    white-space: pre-wrap;
}

.modal-footer {
    display: flex;
    gap: 1rem;
    padding: 1rem 1.5rem 1.5rem;
}

.modal-cancel {
    flex: 1;
    padding: 0.875rem;
    background: rgba(71, 85, 105, 0.5);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.modal-cancel:hover {
    background: rgba(71, 85, 105, 0.7);
}

.modal-confirm {
    flex: 1;
    padding: 0.875rem;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.modal-confirm:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.6);
}