/* 
 * 兑换码商城样式
 * 现代渐变风格设计
 */

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #ec4899;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --dark: #1e1e2e;
    --light: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gradient: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --radius: 12px;
    --radius-lg: 16px;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--gray-800);
    line-height: 1.6;
}

/* 容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 导航栏 */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
}

.navbar-nav {
    display: flex;
    gap: 20px;
    list-style: none;
}

.navbar-nav a {
    color: var(--gray-600);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    padding: 8px 16px;
    border-radius: var(--radius);
}

.navbar-nav a:hover {
    color: var(--primary);
    background: var(--gray-100);
}

/* 主要内容区 */
.main {
    padding: 60px 0;
}

/* 标题区 */
.hero {
    text-align: center;
    margin-bottom: 60px;
    color: white;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 16px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.hero p {
    font-size: 1.25rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

/* 卡片网格 */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

/* 卡片样式 */
.card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.card-header {
    background: var(--gradient);
    color: white;
    padding: 30px;
    text-align: center;
}

.card-header .amount {
    font-size: 3rem;
    font-weight: 800;
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 4px;
}

.card-header .amount .currency {
    font-size: 1.5rem;
    font-weight: 600;
}

.card-header .label {
    font-size: 0.875rem;
    opacity: 0.9;
    margin-top: 8px;
}

.card-body {
    padding: 24px;
}

.card-body .stock {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--gray-200);
    margin-bottom: 20px;
}

.card-body .stock-label {
    color: var(--gray-500);
}

.card-body .stock-value {
    font-weight: 600;
    color: var(--success);
}

.card-body .stock-value.low {
    color: var(--warning);
}

.card-body .stock-value.out {
    color: var(--danger);
}

/* 按钮样式 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    width: 100%;
}

.btn-primary {
    background: var(--gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.btn-primary:disabled {
    background: var(--gray-300);
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
}

.btn-secondary:hover {
    background: var(--gray-200);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

/* 表单样式 */
.form-container {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    padding: 40px;
    max-width: 480px;
    margin: 0 auto;
}

.form-title {
    text-align: center;
    margin-bottom: 30px;
}

.form-title h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 8px;
}

.form-title p {
    color: var(--gray-500);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--gray-700);
}

.form-control {
    width: 100%;
    padding: 14px 16px;
    font-size: 1rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    transition: var(--transition);
    outline: none;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-control::placeholder {
    color: var(--gray-400);
}

.form-hint {
    font-size: 0.875rem;
    color: var(--gray-500);
    margin-top: 6px;
}

/* 订单信息卡片 */
.order-card {
    background: var(--gray-50);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 24px;
}

.order-card .order-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px dashed var(--gray-200);
}

.order-card .order-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.order-card .order-item.total {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    margin-top: 10px;
    padding-top: 15px;
    border-top: 2px solid var(--gray-200);
    border-bottom: none;
}

/* 支付页面 */
.pay-container {
    text-align: center;
}

.qrcode-box {
    background: white;
    padding: 30px;
    border-radius: var(--radius-lg);
    display: inline-block;
    margin: 20px 0;
    box-shadow: var(--shadow);
}

.qrcode-box img {
    max-width: 200px;
    height: auto;
}

.pay-tips {
    color: var(--gray-500);
    margin-top: 20px;
}

.pay-tips .icon {
    font-size: 2rem;
    color: var(--success);
    margin-bottom: 10px;
}

/* 结果页面 */
.result-container {
    text-align: center;
    padding: 40px;
}

.result-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    margin: 0 auto 24px;
}

.result-icon.success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.result-icon.error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.result-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.result-message {
    color: var(--gray-500);
    margin-bottom: 30px;
}

/* 兑换码显示 */
.code-display {
    background: linear-gradient(135deg, #1e1e2e 0%, #2d2d44 100%);
    color: white;
    padding: 30px;
    border-radius: var(--radius);
    margin: 24px 0;
}

.code-display .label {
    font-size: 0.875rem;
    opacity: 0.7;
    margin-bottom: 10px;
}

.code-display .code {
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: 2px;
    word-break: break-all;
    user-select: all;
}

.copy-btn {
    margin-top: 15px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 10px 20px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
}

.copy-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* 查询结果列表 */
.order-list {
    margin-top: 30px;
}

.order-list-item {
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}

.order-list-item .order-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--gray-200);
}

.order-list-item .order-no {
    font-size: 0.875rem;
    color: var(--gray-500);
}

.order-list-item .order-amount {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s ease infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 提示消息 */
.alert {
    padding: 16px 20px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.alert-info {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    border: 1px solid rgba(99, 102, 241, 0.2);
}

/* 页脚 */
.footer {
    text-align: center;
    padding: 30px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.875rem;
}

.footer a {
    color: white;
    text-decoration: none;
}

/* 响应式 */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .card-grid {
        grid-template-columns: 1fr;
    }
    
    .form-container {
        margin: 0 15px;
        padding: 30px 20px;
    }
    
    .navbar .container {
        flex-direction: column;
        gap: 15px;
    }
    
    .navbar-nav {
        width: 100%;
        justify-content: center;
    }
}

/* 动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

/* 脉冲动画 */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.pulse {
    animation: pulse 2s ease-in-out infinite;
}
