.user-page {
    width: 100%;
    max-width: 1300px;
    margin: 0 auto;
    padding: 32px 24px
}

.user-page__title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 24px
}

.user-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-bottom: 24px
}

.user-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px
}

.user-card__title {
    font-size: 14px;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 16px
}

.user-info-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border)
}

.user-info-row:last-child {
    border-bottom: none
}

.user-info-label {
    color: var(--text-secondary)
}

.user-info-value {
    font-weight: 500
}

.user-card .btn {
    width: 100%;
    text-align: center
}

.subscription-section {
    margin-top: 32px
}

.subscription-section__title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px
}

.plan-card--active {
    box-shadow: 0 0 0 2px rgba(37, 99, 235, .2)
}

.plan-card__features {
    font-size: 14px
}

.plan-card__feature {
    padding: 6px 0;
    color: var(--text-secondary)
}

.plan-card .btn {
    width: 100%
}

.history-section {
    margin-top: 32px
}

.history-section__title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px
}

.history-card__input-label {
    color: var(--text-muted)
}

.history-card__output-label {
    color: var(--text-muted);
    margin-left: 16px
}

@media (max-width:768px) {

    .plan-grid,
    .user-grid {
        grid-template-columns: 1fr
    }
}

.user-layout {
    display: flex;
    gap: 24px;
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 24px 0;
    align-items: flex-start
}

.user-sidebar {
    width: 220px;
    flex-shrink: 0;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden
}

.user-sidebar__header {
    padding: 20px 16px;
    background: var(--bg-surface-alt);
    border-bottom: 1px solid var(--border);
    text-align: center
}

.user-sidebar__name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
    word-break: break-all
}

.user-sidebar__level {
    font-size: 13px;
    color: var(--accent);
    font-weight: 500;
    margin-bottom: 4px
}

.user-sidebar__expire {
    font-size: 12px;
    color: var(--text-muted)
}

.user-sidebar__nav {
    padding: 4px 0;
    border-top: 1px solid var(--border)
}

.user-nav-item {
    width: 100%;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    background: 0 0;
    border: 0;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    text-align: left;
    transition: background .15s, color .15s;
    display: flex;
    align-items: center
}

.data-table tr:last-child td,
.user-nav-item:last-child {
    border-bottom: none
}

.user-nav-item:hover {
    background: var(--bg-surface-alt);
    color: var(--text-primary)
}

.user-nav-item.active {
    background: var(--accent-light);
    color: var(--accent);
    font-weight: 600
}

.user-content {
    flex: 1;
    min-width: 0
}

.section-header {
    margin-bottom: 16px
}

.section-header h2 {
    font-size: 18px;
    font-weight: 600;
    margin: 0
}

.level-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    justify-content: center
}

.level-tab {
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all .2s
}

.level-tab:hover {
    border-color: var(--accent);
    color: var(--accent)
}

.level-tab.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent)
}

.plan-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px
}

.plan-guide {
    margin-top: 24px;
    padding: 16px 20px;
    background: var(--bg-surface-alt);
    border: 1px solid var(--border);
    border-radius: 10px
}

.plan-guide h3 {
    font-size: 15px;
    margin: 0 0 12px;
    color: var(--text-primary)
}

.plan-guide ul {
    margin: 0;
    padding-left: 20px
}

#guide-content .guide-text,
.plan-guide li {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.8
}

.plan-announcement {
    background: #fff8e6;
    border-color: #ffeaa0
}

.plan-announcement h3 {
    color: #b37600
}

.plan-announcement .announcement-content {
    font-size: 14px;
    color: #7a5c00;
    line-height: 1.8
}

.plan-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    transition: border-color .2s
}

.plan-card--active,
.plan-card:hover {
    border-color: var(--accent)
}

.plan-card--active {
    background: var(--accent-light)
}

.plan-card__name {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 8px
}

.plan-card__price {
    font-size: 32px;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 4px
}

.plan-card__period {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0 0 16px
}

.plan-card__features {
    list-style: none;
    padding: 0;
    margin: 0 0 20px;
    text-align: left
}

.plan-card__features li {
    font-size: 13px;
    color: var(--text-secondary);
    padding: 4px 0
}

.history-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 12px
}

.history-card__header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px
}

.history-card__date {
    font-size: 12px;
    color: var(--text-muted)
}

.form-group label,
.history-card__details {
    color: var(--text-secondary)
}

.history-card__label {
    color: var(--text-muted);
    margin-right: 4px
}

.profile-form-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px
}

.form-card-title {
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 16px
}

.form-group {
    margin-bottom: 12px
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 4px
}

.form-input {
    width: 100%;
    padding: 8px 12px;
    font-size: 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-surface);
    color: var(--text-primary);
    outline: 0;
    box-sizing: border-box
}

.form-input:focus {
    border-color: var(--accent)
}

.form-input:disabled {
    opacity: .6
}

.msg-layout {
    display: flex;
    gap: 16px;
    height: 600px
}

.msg-list {
    width: 280px;
    flex-shrink: 0;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column
}

.msg-item,
.msg-list-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border)
}

.msg-list-header {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-surface-alt)
}

#msg-list-container {
    flex: 1;
    overflow-y: auto
}

.msg-item {
    cursor: pointer;
    transition: background .15s
}

.msg-item:hover {
    background: var(--bg-surface-alt)
}

.msg-item.unread {
    background: var(--accent-light)
}

.msg-item__who {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px
}

.msg-item__preview {
    font-size: 12px;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap
}

.msg-item__time {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px
}

.msg-chat-body,
.msg-detail {
    flex: 1;
    display: flex;
    flex-direction: column
}

.msg-detail {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden
}

.msg-chat-body {
    overflow-y: auto;
    padding: 16px;
    gap: 12px
}

.msg-chat-bubble {
    max-width: 75%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.6;
    word-break: break-all
}

.msg-chat-bubble--other {
    align-self: flex-start;
    background: var(--bg-surface-alt);
    border-bottom-left-radius: 4px
}

.msg-chat-bubble--mine {
    align-self: flex-end;
    background: var(--accent);
    color: #fff;
    border-bottom-right-radius: 4px
}

.msg-chat-bubble__time {
    font-size: 11px;
    opacity: .7;
    margin-top: 4px
}

.msg-chat-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 8px;
    align-items: flex-end
}

.msg-chat-footer textarea {
    flex: 1;
    resize: none
}

.badge-red {
    background: var(--danger);
    color: #fff;
    border-radius: 10px;
    padding: 1px 6px;
    font-size: 11px
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden
}

.data-table td,
.data-table th {
    padding: 10px 16px;
    border-bottom: 1px solid var(--border)
}

.data-table th {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-surface-alt);
    text-align: left
}

.data-table td {
    font-size: 14px;
    color: var(--text-primary)
}

.fav-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px
}

.fav-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px
}

.fav-card__name {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px
}

.fav-card__sub {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 12px
}

.fav-card__actions {
    display: flex;
    gap: 8px
}

.history-card__formula {
    font-size: 13px;
    color: var(--text-secondary);
    background: var(--bg-surface-alt);
    padding: 6px 10px;
    border-radius: 6px;
    margin-bottom: 8px;
    font-family: monospace
}

.history-card__details {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 13px
}

.history-card__kv {
    color: var(--text-primary)
}

.history-card__name {
    font-weight: 600;
    font-size: 14px;
    color: var(--accent);
    text-decoration: none
}

.history-card__name:hover {
    text-decoration: underline
}

.pagination {
    display: flex;
    justify-content: center;
    margin-top: 16px
}

.pagination-inner {
    display: flex;
    align-items: center;
    gap: 12px
}

.pagination-info {
    font-size: 13px;
    color: var(--text-muted)
}

.history-header-info {
    display: flex;
    align-items: center;
    gap: 12px
}

.history-info-text {
    font-size: 13px;
    color: var(--text-muted)
}

@media (max-width:900px) {
    .user-layout {
        flex-direction: column
    }

    .user-sidebar {
        width: 100%
    }

    .plan-grid {
        grid-template-columns: 1fr
    }

    .msg-layout {
        flex-direction: column;
        height: auto
    }

    .msg-list {
        width: 100%;
        height: 300px
    }

    .fav-grid {
        grid-template-columns: repeat(2, 1fr)
    }
}

@media (max-width: 768px) {
    .fav-grid {
        grid-template-columns: repeat(2, 1fr)
    }
}

/* /user 页面弹窗 toast */
.user-toast-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}
.user-toast-box {
    background: #fff;
    border-radius: 12px;
    padding: 28px 36px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    box-shadow: 0 4px 24px rgba(0,0,0,0.15);
}
.user-toast-msg {
    font-size: 15px;
    color: #333;
    margin-bottom: 20px;
    line-height: 1.6;
}
.user-toast-btn {
    padding: 9px 32px;
    border-radius: 6px;
    border: none;
    font-size: 14px;
    cursor: pointer;
    color: #fff;
}
.user-toast-btn--ok { background: #2563eb; }
.user-toast-btn--err { background: #dc2626; }