/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 40px 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* 用户导航栏 */
.user-navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.95);
    padding: 15px 25px;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.logo a {
    font-size: 1.3rem;
    font-weight: bold;
    color: #667eea;
    text-decoration: none;
}

.user-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.welcome {
    color: #555;
    font-size: 0.95rem;
}

.user-link {
    color: #667eea;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 6px;
    transition: background 0.3s ease;
}

.user-link:hover {
    background: rgba(102, 126, 234, 0.1);
}

.user-link.logout {
    color: #f44336;
}

.user-link.register {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.user-link.register:hover {
    opacity: 0.9;
}

/* 认证卡片 */
.auth-card {
    background: white;
    border-radius: 16px;
    padding: 40px;
    max-width: 420px;
    margin: 50px auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

.auth-card h1 {
    text-align: center;
    color: #333;
    margin-bottom: 10px;
}

.auth-card .subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 25px;
}

.auth-card .subtitle a {
    color: #667eea;
    text-decoration: none;
}

.error-message {
    background: #ffebee;
    color: #c62828;
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.success-message {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.auth-form {
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    color: #333;
    font-weight: 500;
    margin-bottom: 8px;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"] {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

.checkbox-group {
    display: flex;
    align-items: center;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: #555;
    font-size: 0.95rem;
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #667eea;
}

.submit-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.submit-btn:hover {
    opacity: 0.9;
}

.auth-footer {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.auth-footer a {
    color: #666;
    text-decoration: none;
    font-size: 0.95rem;
}

.auth-footer a:hover {
    color: #667eea;
}

/* 邮箱验证码输入框样式 */
.input-with-btn {
    display: flex;
    gap: 10px;
}

.input-with-btn input {
    flex: 1;
}

.send-code-btn {
    padding: 12px 20px;
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: bold;
    cursor: pointer;
    transition: opacity 0.3s ease;
    white-space: nowrap;
}

.send-code-btn:hover {
    opacity: 0.9;
}

.send-code-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.7;
}

/* 用户中心样式 */
.user-nav {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
}

.nav-btn {
    padding: 10px 25px;
    background: white;
    color: #667eea;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: translateY(-2px);
}

.nav-btn.logout {
    color: #f44336;
}

.user-info-card {
    background: white;
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.user-info-card h2 {
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.info-row {
    display: flex;
    padding: 12px 0;
    border-bottom: 1px solid #f5f5f5;
}

.info-row:last-child {
    border-bottom: none;
}

.info-row .label {
    width: 100px;
    color: #666;
}

.info-row .value {
    color: #333;
    font-weight: 500;
}

.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: bold;
}

.badge-web {
    background: #e3f2fd;
    color: #1976d2;
}

.badge-app {
    background: #f3e5f5;
    color: #7b1fa2;
}

.login-type-options {
    display: flex;
    gap: 20px;
}

.login-type-option {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 10px 20px;
    border: 2px solid #ddd;
    border-radius: 8px;
    transition: border-color 0.3s ease;
}

.login-type-option:hover {
    border-color: #667eea;
}

.login-type-option input[type="radio"] {
    accent-color: #667eea;
}

.login-notice {
    color: #888;
    font-size: 0.85rem;
    margin-bottom: 10px;
}

.session-notice {
    margin-top: 15px;
    padding: 10px 15px;
    background: #fff3cd;
    border-radius: 8px;
    color: #856404;
    font-size: 0.9rem;
}

/* 套餐信息区域 */
.subscription-section {
    background: white;
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.subscription-section h2 {
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.subscription-info {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 25px;
    color: white;
}

.package-name-large {
    font-size: 1.8rem;
    font-weight: bold;
    margin-bottom: 15px;
    text-align: center;
}

.expiry-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.15);
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.expiry-info span:first-child {
    font-size: 0.95rem;
    opacity: 0.9;
}

.days-left {
    background: rgba(255, 255, 255, 0.25);
    padding: 6px 15px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.9rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.feature-item {
    background: rgba(255, 255, 255, 0.15);
    padding: 12px 15px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.feature-name {
    font-size: 0.9rem;
    opacity: 0.9;
}

.feature-value {
    font-weight: bold;
    font-size: 0.95rem;
}

.no-subscription {
    text-align: center;
    padding: 40px 20px;
    background: #f8f9fa;
    border-radius: 12px;
}

.no-subscription p {
    color: #666;
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.orders-section {
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.orders-section h2 {
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.orders-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.order-item {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    transition: box-shadow 0.3s ease;
}

.order-item:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e9ecef;
}

.order-no {
    color: #555;
    font-size: 0.9rem;
    font-family: monospace;
}

.order-status {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: bold;
}

.status-pending {
    background: #fff3cd;
    color: #856404;
}

.status-paid {
    background: #d4edda;
    color: #155724;
}

.order-body {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
}

.package-name {
    color: #333;
    font-weight: 500;
}

.order-amount {
    color: #667eea;
    font-weight: bold;
    font-size: 1.1rem;
}

.order-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    font-size: 0.85rem;
    color: #888;
}

.trade-no {
    font-family: monospace;
}

.delete-btn {
        background: #f87171;
        border: none;
        color: #fff;
        padding: 8px 14px;
        border-radius: 8px;
        font-size: 0.9rem;
        cursor: pointer;
        transition: background 0.2s ease;
    }
.delete-btn:hover {
    background: #dc2626;
    text-align: center;
    padding: 50px 20px;
}

.site-footer {
    margin-top: 30px;
    padding: 20px 0;
    text-align: center;
    font-size: 0.9rem;
    color: white;
    border-top: 1px solid #e9ecef;
}
.empty-state {
    text-align: center;
    padding: 50px 20px;
}

.empty-state p {
    color: #888;
    margin-bottom: 20px;
}

/* 套餐卡片 */
.package-card {
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.package-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.package-header {
    text-align: center;
    margin-bottom: 20px;
}

.package-header h2 {
    color: #333;
    font-size: 1.5rem;
    margin-bottom: 15px;
}

.price {
    display: flex;
    align-items: baseline;
    justify-content: center;
    color: #667eea;
}

.currency {
    font-size: 1.5rem;
    font-weight: bold;
}

.amount {
    font-size: 3rem;
    font-weight: bold;
}

.package-description {
    text-align: center;
    color: #666;
    padding: 15px 0;
    border-bottom: 1px solid #eee;
    margin-bottom: 20px;
}

.features {
    list-style: none;
    margin-bottom: 25px;
}

.features li {
    padding: 10px 0;
    color: #555;
    border-bottom: 1px dashed #eee;
}

.features li:last-child {
    border-bottom: none;
}

.features li::before {
    content: '✓';
    color: #4CAF50;
    font-weight: bold;
    margin-right: 10px;
}

/* 购买按钮 */
.buy-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.buy-btn:hover {
    opacity: 0.9;
}

/* 弹窗样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
    /* 使用 flexbox 居中 */
    justify-content: center;
    align-items: center;
}

.modal.show {
    display: flex;
}

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

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 16px;
    max-width: 450px;
    width: 90%;
    /* 限制最大高度，防止超出屏幕 */
    max-height: 90vh;
    /* 内容过多时显示滚动条 */
    overflow-y: auto;
    position: relative;
    animation: slideIn 0.3s ease;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.3);
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover {
    color: #333;
}

.modal-content h2 {
    text-align: center;
    color: #333;
    margin-bottom: 25px;
}

.order-info {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 25px;
}

.order-info p {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    color: #555;
}

.order-info span {
    font-weight: bold;
    color: #333;
}

.payment-methods {
    margin-bottom: 25px;
}

.payment-title {
    color: #333;
    margin-bottom: 15px;
    font-weight: bold;
}

.payment-options {
    display: flex;
    gap: 20px;
}

.payment-option {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 10px 20px;
    border: 2px solid #ddd;
    border-radius: 8px;
    transition: border-color 0.3s ease;
}

.payment-option:hover {
    border-color: #667eea;
}

.payment-option input[type="radio"] {
    accent-color: #667eea;
}

/* 确认按钮 */
.confirm-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.confirm-btn:hover {
    opacity: 0.9;
}

/* 加载动画 */
.loading {
    display: none;
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    justify-content: center;
    align-items: center;
    flex-direction: column;
    color: white;
}

.loading.show {
    display: flex;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 结果页面样式 */
.result-card {
    background: white;
    border-radius: 16px;
    padding: 50px;
    text-align: center;
    max-width: 500px;
    margin: 50px auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

.result-card.success .result-icon {
    background: #4CAF50;
}

.result-card.failed .result-icon {
    background: #f44336;
}

.result-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 25px;
    font-size: 40px;
    color: white;
    font-weight: bold;
}

.result-card h1 {
    color: #333;
    margin-bottom: 15px;
}

.result-card > p {
    color: #666;
    margin-bottom: 25px;
}

.order-details {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 25px;
    text-align: left;
}

.order-details p {
    padding: 8px 0;
    color: #555;
    font-size: 0.95rem;
}

.back-btn {
    display: inline-block;
    padding: 12px 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: bold;
    transition: opacity 0.3s ease;
}

.back-btn:hover {
    opacity: 0.9;
}

/* 响应式设计 */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.8rem;
    }

    .packages-container {
        grid-template-columns: 1fr;
    }

    .amount {
        font-size: 2.5rem;
    }

    .modal-content {
        padding: 30px 20px;
    }

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