/* 用户信息悬浮面板 - 扁平样式 */

/* 容器 - 包含按钮和面板 */
.user-panel-container {
    position: relative;
}

/* 悬浮面板 */
.user-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 220px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.08);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: all 0.2s ease;
    z-index: 2000;
    overflow: hidden;
}

.user-panel-container:hover .user-panel,
.user-panel.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* 面板头部 - 用户信息 */
.user-panel-header {
    padding: 12px 14px;
    border-bottom: 1px solid #f0f0f0;
}

.user-panel-email {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #333;
    word-break: break-all;
}

.user-panel-email .material-icons {
    font-size: 18px;
    color: #666;
    flex-shrink: 0;
}

/* 点数显示 - 扁平 */
.user-panel-credits {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    padding: 6px 10px;
    background: #fafafa;
    border: 1px solid #f0f0f0;
    border-radius: 4px;
    font-size: 12px;
    color: #666;
}

.user-panel-credits .material-icons {
    font-size: 16px;
    color: #faad14;
}

.user-panel-credits-value {
    font-weight: 500;
    color: #333;
}

/* 面板菜单 */
.user-panel-menu {
    padding: 4px 0;
}

.user-panel-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 14px;
    background: transparent;
    border: none;
    font-size: 13px;
    color: #333;
    cursor: pointer;
    transition: background 0.15s;
    text-align: left;
    font-family: inherit;
}

.user-panel-item:hover {
    background: #f5f5f5;
}

.user-panel-item .material-icons {
    font-size: 18px;
    color: #666;
}

/* 登出按钮特殊样式 */
.user-panel-item.logout {
    color: #ff4d4f;
}

.user-panel-item.logout .material-icons {
    color: #ff4d4f;
}

/* 分隔线 */
.user-panel-divider {
    height: 1px;
    background: #f0f0f0;
    margin: 4px 0;
}

/* 工单入口 - 带未读标记 */
.user-panel-item.tickets {
    position: relative;
}

.user-panel-badge {
    position: absolute;
    right: 14px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    background: #ff4d4f;
    color: white;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-panel-badge:empty {
    display: none;
}


/* ============ 点数记录模态窗口 ============ */

.credit-logs-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

.credit-logs-modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.credit-logs-modal {
    width: 380px;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: scale(0.95);
    transition: transform 0.2s ease;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
}

.credit-logs-modal-overlay.show .credit-logs-modal {
    transform: scale(1);
}

/* 模态窗口头部 - 白色背景 */
.credit-logs-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: white;
    border-bottom: 1px solid #e8eaed;
}

.credit-logs-header-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.credit-logs-header-title svg {
    width: 20px;
    height: 20px;
    fill: #1a73e8;
}

.credit-logs-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
    color: #202124;
}

.credit-logs-close {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #5f6368;
}

.credit-logs-close .material-icons {
    font-size: 18px;
}

/* Tab 切换 - 紧凑风格 */
.credit-logs-tabs {
    display: flex;
    background: #f8f9fa;
    padding: 4px;
    margin: 8px 12px;
    border-radius: 8px;
    gap: 4px;
}

.credit-logs-tab {
    flex: 1;
    padding: 6px 12px;
    border: none;
    background: transparent;
    font-size: 13px;
    font-weight: 500;
    color: #5f6368;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.15s;
}

.credit-logs-tab:hover {
    color: #1a73e8;
}

.credit-logs-tab.active {
    background: white;
    color: #1a73e8;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* 记录列表 */
.credit-logs-content {
    flex: 1;
    overflow: hidden;
    padding: 0 12px 12px;
}

.credit-logs-list {
    display: none;
}

.credit-logs-list.active {
    display: block;
}

.credit-logs-empty {
    padding: 32px 16px;
    text-align: center;
    color: #9aa0a6;
    font-size: 13px;
}

/* 记录项 - 紧凑三列布局 */
.credit-log-item {
    display: grid;
    grid-template-columns: 120px 1fr 40px;
    gap: 8px;
    padding: 0 12px;
    height: 36px;
    border-bottom: 1px solid #f1f3f4;
    align-items: center;
    font-size: 13px;
}

.credit-log-item:last-child {
    border-bottom: none;
}

.credit-log-item:hover {
    background: #f8f9fa;
}

/* 固定列表高度 (10行 x 36px + padding) */
.credit-logs-list {
    min-height: 360px;
}

.credit-log-date {
    font-size: 12px;
    color: #5f6368;
    white-space: nowrap;
}

.credit-log-action {
    font-size: 13px;
    color: #3c4043;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.credit-log-amount {
    font-size: 13px;
    font-weight: 600;
    text-align: right;
}

.credit-log-amount.negative {
    color: #d93025;
}

.credit-log-amount.positive {
    color: #1e8e3e;
}

.credit-log-amount.zero {
    color: #5f6368;
}

/* 分页控件 */
.credit-logs-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid #e8eaed;
    background: #f8f9fa;
}

.credit-logs-pagination button {
    width: 32px;
    height: 32px;
    border: 1px solid #dadce0;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #5f6368;
    font-size: 13px;
    transition: all 0.15s;
}

.credit-logs-pagination button:hover:not(:disabled) {
    background: #f1f3f4;
    border-color: #1a73e8;
    color: #1a73e8;
}

.credit-logs-pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.credit-logs-pagination button.active {
    background: #1a73e8;
    border-color: #1a73e8;
    color: white;
}

.credit-logs-pagination .material-icons {
    font-size: 18px;
}

.credit-logs-page-info {
    font-size: 12px;
    color: #5f6368;
    margin: 0 8px;
}
