﻿/* =====================================================
   AccountManage.css - 账号管理页面样式
   依赖 site.css 的 CSS 变量
   ===================================================== */

/* =====================================================
   1. 信息容器
   ===================================================== */
.info-container {
    margin: var(--space-lg) 0;
    padding: var(--space-lg);
    background: var(--color-bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border-light);
}

/* =====================================================
   2. 信息展示
   ===================================================== */
.info-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--color-text-primary);
    padding-bottom: var(--space-md);
    margin-bottom: var(--space-md);
    border-bottom: 1px solid var(--color-divider);
}

.info-row {
    display: flex;
    align-items: baseline;
    margin-bottom: 10px;
    line-height: 1.6;
    gap: var(--space-sm);
}

.info-key {
    width: 110px;
    font-weight: 500;
    color: var(--color-text-muted);
    flex-shrink: 0;
    font-size: 13px;
}

.info-value {
    color: var(--color-text-primary);
    word-break: break-all;
    font-size: 14px;
}

/* =====================================================
   3. 表单样式
   ===================================================== */
.modal-form {
    padding: var(--space-sm);
}

.invalid-feedback {
    color: var(--color-danger);
    font-size: 12px;
    margin-top: 4px;
    display: block;
}

/* =====================================================
   4. 表格控件区
   ===================================================== */
.table-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
    padding: var(--space-sm) var(--space-md);
    background-color: var(--color-bg-light);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border-light);
}

.filter-section {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.filter-input {
    padding: 7px 12px;
    border: 1px solid #d0d7de;
    border-radius: var(--radius-sm);
    font-size: var(--font-size-base);
    font-family: var(--font-family);
    color: var(--color-text-primary);
    background-color: var(--color-bg-white);
    min-width: 220px;
    height: 36px;
    outline: none;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.filter-input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(26, 125, 232, 0.1);
}

/* =====================================================
   5. 账号列表表格
   ===================================================== */
.account-table-container {
    width: 100%;
    overflow-x: auto;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.table-accounts {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--font-size-base);
    table-layout: fixed;
}

/* 覆盖全局 th/td，保证精确控制 */
.table-accounts th {
    background-color: var(--color-bg-light);
    color: var(--color-text-primary);
    font-weight: 600;
    font-size: 13px;
    padding: 11px 14px;
    text-align: left;
    border-bottom: 2px solid var(--color-primary-light);
    white-space: nowrap;
    vertical-align: middle;
}

.table-accounts td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--color-border-light);
    color: var(--color-text-primary);
    vertical-align: middle;
    overflow: hidden;
    text-overflow: ellipsis;
}

.table-accounts tbody tr:hover td {
    background-color: #f7f9fc;
}

/* =====================================================
   6. 操作按钮
   ===================================================== */
.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 12px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-decoration: none;
    font-size: 13px;
    font-family: var(--font-family);
    font-weight: 500;
    transition: background var(--transition-fast), transform var(--transition-fast);
    white-space: nowrap;
    height: 30px;
    line-height: 1;
}

.action-btn:hover {
    text-decoration: none;
    transform: translateY(-1px);
}

.action-btn.success {
    background-color: var(--color-success);
    color: #fff;
}

.action-btn.success:hover {
    background-color: var(--color-success-hover);
    color: #fff;
}

.action-btn.primary {
    background-color: var(--color-primary);
    color: #fff;
}

.action-btn.primary:hover {
    background-color: var(--color-primary-hover);
    color: #fff;
}

.action-btn.secondary {
    background-color: #6c757d;
    color: #fff;
}

.action-btn.secondary:hover {
    background-color: #5a6268;
    color: #fff;
}

.action-btn.danger {
    background-color: var(--color-danger);
    color: #fff;
}

.action-btn.danger:hover {
    background-color: var(--color-danger-hover);
    color: #fff;
}

/* =====================================================
   7. 账号管理首页（Index）深度优化样式
   ===================================================== */

/* 标题区 */
.div-title-actions {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-wrap: wrap;
    margin-left: auto;
}

.page-subtitle {
    width: 100%;
    margin: 6px 0 0;
    font-size: 13px;
    color: var(--color-text-muted);
}

.verify-result {
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-secondary);
    white-space: nowrap;
}

/* 统计卡片条 */
.accounts-stats {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
}

.stat-card {
    flex: 1 1 130px;
    min-width: 120px;
    padding: 16px 18px;
    background: linear-gradient(135deg, var(--color-bg-white) 0%, #f3f8ff 100%);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: relative;
    overflow: hidden;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.stat-card::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 4px;
    background: var(--color-primary);
    opacity: 0.85;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-label {
    font-size: 12px;
    color: var(--color-text-secondary);
    font-weight: 500;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--color-text-primary);
    line-height: 1.1;
}

.stat-value.primary { color: var(--color-primary); }
.stat-value.success { color: var(--color-success); }
.stat-value.warning { color: var(--color-warning); }

/* 筛选区 */
.accounts-filter {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
    padding: var(--space-md) var(--space-lg);
    background: var(--color-bg-light);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-md);
}

.filter-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-field label {
    font-size: 12px;
    font-weight: 500;
    color: var(--color-text-secondary);
}

.accounts-filter .filter-input,
.accounts-filter select {
    height: 36px;
    padding: 7px 12px;
    border: 1px solid #d0d7de;
    border-radius: var(--radius-sm);
    font-size: var(--font-size-base);
    font-family: var(--font-family);
    color: var(--color-text-primary);
    background: var(--color-bg-white);
    outline: none;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    min-width: 200px;
}

.accounts-filter .filter-input:focus,
.accounts-filter select:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(26, 125, 232, 0.12);
}

.filter-spacer { flex: 1; }

/* 账号表格 */
.accounts-table thead tr.sticky-thead {
    position: sticky;
    top: 56px;
    z-index: 2;
}

.accounts-table thead th {
    background-color: var(--color-bg-light);
}

/* 排序表头 */
.accounts-table th.sortable {
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    transition: background var(--transition-fast);
}

.accounts-table th.sortable:hover {
    background-color: #eef2f7;
}

.sort-indicator {
    margin-left: 6px;
    font-size: 11px;
    color: var(--color-primary);
    opacity: 0.9;
}

.sort-indicator.asc::after { content: "\2191"; }
.sort-indicator.desc::after { content: "\2193"; }
.sort-indicator.none::after { content: "\2195"; opacity: 0.35; }

/* 行样式 + 悬浮抬升 + 入场动画 */
.accounts-table tbody tr {
    transition: background var(--transition-fast), box-shadow var(--transition-fast);
    animation: rowIn 0.35s ease both;
}

.accounts-table tbody tr:hover {
    background: #f7f9fc;
    box-shadow: inset 3px 0 0 var(--color-primary);
}

/* 账号名列 */
.account-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.account-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary), #6fb4ff);
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.account-name {
    font-weight: 600;
    color: var(--color-text-primary);
}

/* 小号操作按钮 */
.action-btn.xs {
    height: 26px;
    padding: 3px 10px;
    font-size: 12px;
    border-radius: var(--radius-sm);
}

/* 角色 chip 内的操作按钮 — 图标风格 */
.character-actions .action-btn.xs {
    width: 20px;
    height: 20px;
    padding: 0;
    font-size: 11px;
    border-radius: 5px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* 空状态 */
.empty-hint {
    color: var(--color-text-muted);
    font-size: 13px;
}

/* 授权角色 chips — 横向流式布局，每行多个 */
.auth-characters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.character-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px 4px 4px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    transition: all 0.2s ease;
    position: relative;
}

.character-chip:hover {
    border-color: #cbd5e1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transform: translateY(-1px);
}

.character-avatar {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background: linear-gradient(135deg, var(--color-primary), #4a9eff);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(26, 125, 232, 0.25);
}

.character-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 1px;
    flex: 1;
}

.character-name {
    font-weight: 600;
    font-size: 12px;
    color: var(--color-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: 0.01em;
}

.character-id {
    font-size: 10px;
    color: #94a3b8;
    font-family: 'Consolas', 'SF Mono', monospace;
}

/* 状态指示器 — 改为右侧竖条 + 文字标签 */
.status-dot {
    width: 4px;
    height: 18px;
    border-radius: 2px;
    flex-shrink: 0;
    background: #cbd5e1;
    transition: all 0.25s ease;
    position: relative;
}

.status-dot::after {
    content: attr(title);
    position: absolute;
    right: calc(100% + 6px);
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.15s ease;
    color: #64748b;
    pointer-events: none;
}

.status-dot:hover::after {
    opacity: 1;
}

.status-dot.valid {
    background: linear-gradient(180deg, var(--color-success), #22c55e);
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.3);
}

.status-dot.invalid {
    background: linear-gradient(180deg, var(--color-danger), #ef4444);
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.3);
}

.status-dot.pending {
    background: linear-gradient(180deg, var(--color-warning), #f59e0b);
    animation: dot-pulse 0.8s ease-in-out infinite;
}

@keyframes dot-pulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 8px rgba(245, 158, 11, 0.3); }
    50% { opacity: 0.45; box-shadow: none; }
}

/* 操作按钮 — 默认显示，图标风格 */
.character-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

/* 验证进度条 */
.verify-progress {
    height: 6px;
    width: 200px;
    background: var(--color-border);
    border-radius: 9999px;
    overflow: hidden;
    display: none;
    vertical-align: middle;
}

.verify-progress.active { display: inline-block; }

.verify-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--color-primary), #6fb4ff);
    border-radius: 9999px;
    transition: width 0.25s ease;
}

/* 按钮内加载动画 */
.btn-spinner {
    display: inline-block;
    width: 13px;
    height: 13px;
    margin-right: 6px;
    border: 2px solid rgba(255, 255, 255, 0.45);
    border-top-color: #fff;
    border-radius: 50%;
    animation: btn-spin 0.6s linear infinite;
    vertical-align: middle;
}

@keyframes btn-spin {
    to { transform: rotate(360deg); }
}

/* 行入场动画 */
@keyframes rowIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.accounts-table tbody tr:nth-child(1) { animation-delay: 0.02s; }
.accounts-table tbody tr:nth-child(2) { animation-delay: 0.04s; }
.accounts-table tbody tr:nth-child(3) { animation-delay: 0.06s; }
.accounts-table tbody tr:nth-child(4) { animation-delay: 0.08s; }
.accounts-table tbody tr:nth-child(5) { animation-delay: 0.10s; }
.accounts-table tbody tr:nth-child(6) { animation-delay: 0.12s; }
.accounts-table tbody tr:nth-child(7) { animation-delay: 0.14s; }
.accounts-table tbody tr:nth-child(8) { animation-delay: 0.16s; }
.accounts-table tbody tr:nth-child(9) { animation-delay: 0.18s; }
.accounts-table tbody tr:nth-child(10) { animation-delay: 0.20s; }
.accounts-table tbody tr:nth-child(n+11) { animation-delay: 0.22s; }
