/**
 * NISHOW 用户页面样式
 * 用户中心、积分充值等页面
 * 基于 common.css 的扩展
 */

/* ========== 侧边栏头部 ========== */
.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
}

.sidebar-brand:hover {
    text-decoration: none;
}

.sidebar-logo {
    width: 40px;
    height: 40px;
    border-radius: 8px;
}

.sidebar-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.sidebar-close {
    display: none;
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.sidebar-close:hover {
    background-color: var(--bg-hover);
}

@media (max-width: 768px) {
    .sidebar-close {
        display: flex;
    }
}

/* ========== 侧边栏导航分隔线 ========== */
.nav-divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 8px 16px;
}

/* ========== 侧边栏用户卡片 ========== */
.sidebar-user-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    margin: 0 12px 16px;
    background-color: var(--bg-tertiary);
    border-radius: 12px;
}

.avatar-wrapper {
    position: relative;
    flex-shrink: 0;
}

.sidebar-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color);
}

.avatar-edit {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 22px;
    height: 22px;
    background: var(--accent-gradient);
    color: #000;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 11px;
    transition: transform 0.2s;
}

[data-theme="light"] .avatar-edit {
    color: #fff;
}

.avatar-edit:hover {
    transform: scale(1.1);
}

.sidebar-user-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.sidebar-name {
    font-weight: 500;
    font-size: 14px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-email {
    font-size: 12px;
    color: var(--text-tertiary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ========== 积分卡片 ========== */
.credits-card {
    margin: 0 12px 16px;
    padding: 16px;
    background: var(--accent-gradient);
    border-radius: 12px;
    text-align: center;
}

.credits-label {
    font-size: 12px;
    color: rgba(0, 0, 0, 0.7);
}

[data-theme="light"] .credits-label {
    color: rgba(255, 255, 255, 0.8);
}

.credits-value {
    font-size: 28px;
    font-weight: 700;
    color: #000;
    margin: 4px 0 12px;
}

[data-theme="light"] .credits-value {
    color: #fff;
}

.btn-recharge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.15);
    color: #000;
    border-radius: 20px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
}

[data-theme="light"] .btn-recharge {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.btn-recharge:hover {
    background: rgba(0, 0, 0, 0.25);
}

[data-theme="light"] .btn-recharge:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ========== 侧边栏底部按钮 ========== */
.sidebar-footer {
    padding: 12px;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar-footer .btn-theme {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    height: auto;
    padding: 12px 16px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
}

.sidebar-footer .btn-theme:hover {
    background-color: var(--bg-hover);
}

.btn-logout {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    background: transparent;
    border: none;
    color: var(--danger-color);
    font-size: 14px;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
}

.btn-logout:hover {
    background-color: rgba(242, 139, 130, 0.1);
}

/* ========== 顶部栏 ========== */
.top-title {
    font-size: 18px;
    font-weight: 500;
    color: var(--text-primary);
    flex: 1;
}

.top-actions .btn-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background-color: var(--bg-tertiary);
    color: var(--text-secondary);
    border-radius: 20px;
    text-decoration: none;
    font-size: 13px;
    transition: all 0.2s;
}

.top-actions .btn-action:hover {
    background-color: var(--bg-hover);
    color: var(--text-primary);
    text-decoration: none;
}

/* ========== 内容区 ========== */
.content-body {
    max-width: 800px;
    margin: 0 auto;
}

.content-section {
    display: none;
}

.content-section.active {
    display: block;
}

/* ========== 卡片 ========== */
.card-header {
    margin-bottom: 20px;
}

.card-header h2 {
    font-size: 18px;
    font-weight: 500;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-header h2 i {
    color: var(--accent-primary);
}

/* ========== 用户表单 ========== */
.user-form {
    max-width: 480px;
}

.form-hint {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-tertiary);
}

.section-divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 32px 0;
}

.sub-title {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 16px;
    color: var(--text-primary);
}

/* ========== OAuth 绑定 ========== */
.oauth-bindings {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.binding-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background-color: var(--bg-tertiary);
    border-radius: 8px;
}

.binding-info {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
}

.binding-info i {
    font-size: 20px;
}

.binding-status {
    font-size: 13px;
    color: var(--text-tertiary);
}

/* ========== 数据表格 ========== */
.table-wrapper {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table th,
.data-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.data-table th {
    background-color: var(--bg-tertiary);
    font-weight: 500;
    color: var(--text-secondary);
}

.data-table tbody tr:hover {
    background-color: var(--bg-hover);
}

.text-success {
    color: var(--success-color);
}

.text-danger {
    color: var(--danger-color);
}

.text-muted {
    color: var(--text-tertiary);
}

.text-center {
    text-align: center;
}

/* ========== 状态标签 ========== */
.status-completed {
    color: var(--success-color);
}

.status-processing {
    color: var(--warning-color);
}

.status-failed {
    color: var(--danger-color);
}

/* ========== 分页 ========== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}

.page-btn {
    padding: 8px 14px;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.page-btn:hover,
.page-btn.active {
    background: var(--accent-gradient);
    color: #000;
    border-color: transparent;
}

[data-theme="light"] .page-btn:hover,
[data-theme="light"] .page-btn.active {
    color: #fff;
}

/* ========== 充值页面 ========== */
.recharge-page {
    max-width: 600px;
    margin: 0 auto;
}

.credits-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    padding: 20px 24px;
}

.credits-summary .credits-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.credits-summary .credits-label {
    font-size: 14px;
    color: var(--text-secondary);
}

.credits-summary .credits-value {
    font-size: 24px;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
}

.credits-rate {
    font-size: 13px;
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ========== 充值套餐 ========== */
.package-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.package-item {
    position: relative;
    padding: 20px;
    background-color: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.package-item:hover {
    border-color: var(--accent-primary);
}

.package-item.selected {
    border-color: var(--accent-primary);
    background-color: rgba(168, 199, 250, 0.1);
}

.package-item.popular {
    border-color: var(--accent-primary);
}

.package-tag {
    position: absolute;
    top: -10px;
    right: 12px;
    background: var(--accent-gradient);
    color: #000;
    padding: 2px 12px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 500;
}

[data-theme="light"] .package-tag {
    color: #fff;
}

.package-credits {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.package-price {
    font-size: 14px;
    color: var(--accent-primary);
    font-weight: 500;
}

/* ========== 自定义金额 ========== */
.custom-amount {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.custom-amount label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--text-secondary);
}

.custom-amount .input-group {
    display: flex;
    align-items: stretch;
}

.custom-amount .input-group input {
    flex: 1;
    padding: 12px 16px;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px 0 0 8px;
    color: var(--text-primary);
    font-size: 16px;
    outline: none;
}

.custom-amount .input-group input:focus {
    border-color: var(--accent-primary);
}

.custom-amount .input-group input::placeholder {
    color: var(--text-tertiary);
}

.input-suffix {
    padding: 12px 16px;
    background-color: var(--bg-hover);
    border: 1px solid var(--border-color);
    border-left: none;
    border-radius: 0 8px 8px 0;
    color: var(--text-secondary);
    font-size: 14px;
}

.custom-credits {
    margin-top: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

.custom-credits span {
    font-weight: 600;
    color: var(--accent-primary);
}

/* ========== 支付方式 ========== */
.payment-methods {
    display: flex;
    gap: 12px;
}

.payment-item {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px;
    background-color: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.payment-item:hover {
    border-color: var(--accent-primary);
}

.payment-item.active {
    border-color: var(--accent-primary);
    background-color: rgba(168, 199, 250, 0.1);
}

.payment-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.alipay-icon {
    color: #1677ff;
}

.paypal-icon {
    color: #003087;
}

.payment-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.usd-amount {
    font-size: 11px;
    color: var(--text-tertiary);
}

/* ========== 确认支付 ========== */
.confirm-card {
    padding: 24px !important;
}

.confirm-info {
    margin-bottom: 16px;
}

.confirm-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 15px;
    color: var(--text-secondary);
}

.confirm-amount,
.confirm-credits {
    font-weight: 600;
    color: var(--text-primary);
}

.btn-pay {
    width: 100%;
    padding: 16px;
    background: var(--accent-gradient);
    color: #000;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

[data-theme="light"] .btn-pay {
    color: #fff;
}

.btn-pay:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--shadow-color);
}

.btn-pay:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ========== 充值说明 ========== */
.tips-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px 20px;
}

.tips-card h4 {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin: 0 0 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tips-card h4 i {
    color: var(--text-tertiary);
}

.tips-list {
    margin: 0;
    padding-left: 20px;
    font-size: 13px;
    color: var(--text-tertiary);
}

.tips-list li {
    margin-bottom: 4px;
}

/* ========== 动画 ========== */
.spin {
    animation: spin 1s linear infinite;
}

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

/* ========== 响应式 ========== */
@media (max-width: 768px) {
    .package-grid {
        grid-template-columns: 1fr;
    }

    .payment-methods {
        flex-direction: column;
    }

    .credits-summary {
        flex-direction: column;
        align-items: flex-start;
    }
}
