/**
 * 会员中心 + 登录/注册/忘记密码 - 统一样式（一个文件）
 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #4F46E5;
    --primary-dark: #4338CA;
    --secondary-color: #10B981;
    --text-primary: #1F2937;
    --text-secondary: #6B7280;
    --bg-white: #FFFFFF;
    --gradient-1: linear-gradient(135deg, #667EEA 0%, #764BA2 100%);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* ---------- 认证页（登录/注册/忘记密码）---------- */
body.auth-page {
    background: linear-gradient(135deg, #667EEA 0%, #764BA2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-container,
.register-container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 420px;
    padding: 2rem;
}

.forgot-container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 420px;
    padding: 3rem;
}

.auth-page .logo-section {
    text-align: center;
    margin-bottom: 1.5rem;
}

.forgot-container .logo-section {
    margin-bottom: 2.5rem;
}

.auth-page .logo-section .logo {
    font-size: 1.8rem;
    font-weight: 700;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.forgot-container .logo-section .logo {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.auth-page .logo-section .subtitle {
    color: #6B7280;
    font-size: 0.9rem;
}

.forgot-container .logo-section .subtitle {
    font-size: 0.95rem;
}

.auth-page .form-group {
    margin-bottom: 1rem;
}

.forgot-container .form-group {
    margin-bottom: 1.5rem;
}

.auth-page .form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #1F2937;
    font-weight: 500;
    font-size: 0.9rem;
}

.forgot-container .form-group label {
    font-size: 0.95rem;
}

.auth-page .form-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1.5px solid #E5E7EB;
    border-radius: 10px;
    font-size: 0.95rem;
    transition: all 0.3s;
    background: #F9FAFB;
    box-sizing: border-box;
}

.register-container .form-group input {
    height: 42px;
}

.forgot-container .form-group input {
    padding: 0.875rem 1rem;
    font-size: 1rem;
}

.auth-page .form-group input:focus {
    outline: none;
    border-color: #667EEA;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.auth-page .btn-primary {
    width: 100%;
    padding: 0.75rem;
    background: var(--gradient-1);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 0.25rem;
}

.forgot-container .btn-primary {
    padding: 0.875rem;
    font-size: 1rem;
    margin-top: 0.5rem;
}

.auth-page .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.auth-page .btn-primary:active {
    transform: translateY(0);
}

.form-footer {
    text-align: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #E5E7EB;
    font-size: 0.9rem;
}

.forgot-container .form-footer {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
}

.form-footer a {
    color: #667EEA;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.form-footer a:hover {
    color: #764BA2;
}

.error-message {
    background: #FEF2F2;
    color: #DC2626;
    padding: 0.625rem 1rem;
    border-radius: 8px;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
    display: none;
}

.error-message.show {
    display: block;
}

.success-message {
    background: #F0FDF4;
    color: #16A34A;
    padding: 0.625rem 1rem;
    border-radius: 8px;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
    display: none;
}

.success-message.show {
    display: block;
}

.info-box {
    background: #F0F9FF;
    border: 1px solid #BAE6FD;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.info-box .icon {
    color: #0284C7;
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

.info-box h3 {
    color: #0C4A6E;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.info-box p {
    color: #075985;
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 0.75rem;
}

.info-box .contact-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #0284C7;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.info-box .contact-link:hover {
    color: #0369A1;
}

.back-link {
    position: absolute;
    top: 20px;
    left: 20px;
    color: white;
    text-decoration: none;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: opacity 0.3s;
}

.back-link:hover {
    opacity: 0.8;
}

@media (max-width: 480px) {
    .login-container,
    .register-container {
        padding: 2rem 1.5rem;
    }

    .forgot-container {
        padding: 2rem 1.5rem;
    }

    .auth-page .back-link {
        position: relative;
        top: 0;
        left: 0;
        margin-bottom: 1rem;
        color: #667EEA;
    }
}

/* ---------- 会员中心 ---------- */
body.dashboard-page {
    background: #F9FAFB;
    line-height: 1.6;
}

.dashboard-page .navbar {
    background: linear-gradient(135deg, #FFFFFF 0%, #FAFBFC 100%);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12), 0 1px 3px rgba(0, 0, 0, 0.08);
    padding: 0.65rem 4%;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(79, 70, 229, 0.1);
}

.dashboard-page .nav-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dashboard-page .logo {
    font-size: 1.25rem;
    font-weight: 700;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
}

.nav-right {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-right a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-right a:hover {
    color: var(--primary-color);
}

.btn-logout {
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #F3F4F6 0%, #E5E7EB 100%);
    color: var(--text-primary);
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.btn-logout:hover {
    background: linear-gradient(135deg, #E5E7EB 0%, #D1D5DB 100%);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
}

.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 4%;
}

.balance-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.balance-card {
    background: linear-gradient(135deg, #FFFFFF 0%, #FAFBFC 100%);
    border-radius: 5px;
    padding: 1rem 1.25rem;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.1), 0 2px 6px rgba(0, 0, 0, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.06);
    transition: all 0.3s;
}

.balance-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 4px 8px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.balance-card h3 {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.balance-amount {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
}

.balance-unit {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1rem;
}
.dashboard-left {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 0;
}

.dashboard-card {
    background: white;
    border-radius: 5px;
    padding: 1rem 1.25rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.dashboard-card h2 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.product-item {
    border: 2px solid #E5E7EB;
    border-radius: 5px;
    padding: 1rem;
    transition: all 0.3s;
    cursor: pointer;
}

.product-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.1);
}

.product-item.selected {
    border-color: var(--primary-color);
    background: #EEF2FF;
}

.product-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 0.5rem;
}

.product-name {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
}

.product-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}

.product-desc {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.product-features {
    list-style: none;
    margin-bottom: 0.5rem;
}

.product-features li {
    padding: 0.15rem 0;
    color: var(--text-secondary);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.product-features li i {
    color: var(--secondary-color);
    font-size: 0.85rem;
}

.btn-buy {
    width: 100%;
    padding: 0.5rem 0.75rem;
    background: var(--gradient-1);
    color: white;
    border: none;
    border-radius: 5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.btn-buy::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
    transition: left 0.5s;
}

.btn-buy:hover::before {
    left: 100%;
}

.btn-buy:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.45), 0 2px 8px rgba(102, 126, 234, 0.3);
}

.btn-buy:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.dashboard-card .form-group {
    margin-bottom: 0.75rem;
}

.dashboard-card .form-group label {
    display: block;
    margin-bottom: 0.35rem;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.875rem;
}

.dashboard-card .form-group input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1.5px solid #E5E7EB;
    border-radius: 5px;
    font-size: 0.95rem;
    transition: all 0.3s;
    background: linear-gradient(135deg, #FFFFFF 0%, #FAFBFC 100%);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

.dashboard-card .form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1), inset 0 2px 4px rgba(0, 0, 0, 0.02);
    background: #FFFFFF;
}

.dashboard-card .btn-primary {
    padding: 0.75rem 1.5rem;
    background: var(--gradient-1);
    color: white;
    border: none;
    border-radius: 5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.dashboard-card .btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
    transition: left 0.5s;
}

.dashboard-card .btn-primary:hover::before {
    left: 100%;
}

.dashboard-card .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.45), 0 2px 8px rgba(102, 126, 234, 0.3);
}

.message {
    padding: 0.5rem 0.75rem;
    border-radius: 5px;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
    display: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.message.show {
    display: block;
}

.message-success {
    background: #F0FDF4;
    color: #16A34A;
    border: 1px solid #BBF7D0;
}

.message-error {
    background: #FEF2F2;
    color: #DC2626;
    border: 1px solid #FECACA;
}

.user-info {
    background: linear-gradient(135deg, #FFFFFF 0%, #FAFBFC 100%);
    border-radius: 5px;
    padding: 1rem 1.25rem;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.1), 0 2px 6px rgba(0, 0, 0, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.9);
    margin-bottom: 1rem;
    border: 1px solid rgba(0, 0, 0, 0.06);
    transition: all 0.3s;
}

.user-info:hover {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 4px 8px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.user-info h2 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.info-item {
    display: flex;
    justify-content: space-between;
    padding: 0.4rem 0;
    border-bottom: 1px solid #F3F4F6;
}

.info-item:last-child {
    border-bottom: none;
}

.info-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.info-value {
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.875rem;
}

/* ---------- 订单管理表格 ---------- */
.dashboard-card-orders .order-list-wrap {
    overflow-x: auto;
    margin: 0 -0.25rem;
}
.order-list-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}
.order-list-table th,
.order-list-table td {
    padding: 0.4rem 0.5rem;
    text-align: left;
    border-bottom: 1px solid #F3F4F6;
}
.order-list-table th {
    color: var(--text-secondary);
    font-weight: 600;
}
.order-list-table td {
    color: var(--text-primary);
}
.order-list-table .order-no {
    font-family: monospace;
    max-width: 5.5em;
    overflow: hidden;
    text-overflow: ellipsis;
}
.order-list-empty {
    color: var(--text-secondary);
    text-align: center;
    padding: 0.75rem !important;
}
.order-list-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.75rem;
    padding-top: 0.5rem;
    border-top: 1px solid #F3F4F6;
    font-size: 0.8rem;
}
.order-list-total { color: var(--text-secondary); }
.order-list-pager { display: inline-flex; align-items: center; gap: 0.5rem; }
.order-list-page-info { color: var(--text-secondary); margin: 0 0.25rem; }
.btn-order-page {
    padding: 0.25rem 0.6rem;
    font-size: 0.8rem;
    border: 1px solid #E5E7EB;
    background: #fff;
    color: var(--text-primary);
    border-radius: 4px;
    cursor: pointer;
}
.btn-order-page:hover:not(:disabled) { background: #F3F4F6; border-color: #D1D5DB; }
.btn-order-page:disabled { opacity: 0.5; cursor: not-allowed; }
.order-status { font-weight: 500; }
.order-status-pending { color: #D97706; }
.order-status-paid { color: #059669; }
.order-status-cancelled { color: var(--text-secondary); }
.order-cell-actions { white-space: nowrap; }
.order-actions { display: inline-flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; }
.btn-order-pay,
.btn-order-cancel {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    border-radius: 4px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s;
}
.btn-order-pay {
    background: var(--gradient-1);
    color: white;
    border: none;
}
.btn-order-pay:hover { opacity: 0.9; }
.btn-order-cancel {
    background: #F3F4F6;
    color: var(--text-primary);
    border-color: #E5E7EB;
}
.btn-order-cancel:hover { background: #E5E7EB; }

/* ---------- 套餐订购：支付方式与支付信息弹层 ---------- */
.order-overlay {
    display: none;
    position: fixed !important;
    left: 0 !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    margin: 0 !important;
    background: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
    z-index: 99999 !important;
    padding: 20px;
    box-sizing: border-box;
}
.order-overlay.is-open {
    display: flex !important;
}
.order-modal {
    background: white;
    border-radius: 12px;
    padding: 1.5rem 2rem;
    max-width: 420px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}
.order-modal-wide {
    max-width: 520px;
}
.order-modal h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}
.order-modal-tip {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
}
.payment-methods {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}
.payment-method-opt {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.6rem 1rem;
    border: 1.5px solid #E5E7EB;
    border-radius: 8px;
    transition: border-color 0.2s, background 0.2s;
}
.payment-method-opt:hover { border-color: var(--primary-color); }
.payment-method-opt:has(input:checked) { border-color: var(--primary-color); background: #EEF2FF; }
.payment-method-opt input { margin-right: 0.5rem; }
.order-modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}
.btn-secondary {
    padding: 0.6rem 1.25rem;
    background: #F3F4F6;
    color: var(--text-primary);
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-secondary:hover {
    background: #E5E7EB;
}
/* 弹层内主按钮（确认并创建订单、我已支付） */
.order-modal .btn-primary {
    padding: 0.75rem 1.5rem;
    background: var(--gradient-1);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}
.order-modal .btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
    transition: left 0.5s;
}
.order-modal .btn-primary:hover::before {
    left: 100%;
}
.order-modal .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.45), 0 2px 8px rgba(102, 126, 234, 0.3);
}
.payment-info-with-qr {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 1rem;
}
.payment-qr-wrap {
    flex-shrink: 0;
    padding: 10px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    border: 1px solid #E5E7EB;
}
.payment-qr-img {
    width: 160px;
    height: 160px;
    display: block;
    border-radius: 6px;
}
.payment-qr-img[src=""] { display: none; }
.payment-qr-tip {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 6px;
    text-align: center;
}
.payment-info-with-qr .payment-info-box {
    flex: 1;
    min-width: 0;
    margin-bottom: 0;
}
.payment-info-box {
    background: #F9FAFB;
    border: 1px solid #E5E7EB;
    border-radius: 10px;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
}
.payment-info-row {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}
.payment-info-row:last-child { margin-bottom: 0; }
.payment-info-row .label {
    flex-shrink: 0;
    width: 80px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}
.payment-info-row .value {
    flex: 1;
    word-break: break-all;
    font-size: 0.9rem;
    color: var(--text-primary);
}
.payment-info-row .value.copyable { font-family: monospace; }
.btn-copy {
    flex-shrink: 0;
    padding: 0.35rem 0.75rem;
    font-size: 0.85rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}
.btn-copy:hover { opacity: 0.9; }
.payment-tip {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
    line-height: 1.5;
}

@media (max-width: 968px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}
