/* ========== 全局重置 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #667eea;
    --primary-dark: #5568d3;
    --secondary: #764ba2;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    --bg: #f5f7fb;
    --card-bg: #ffffff;
    --text: #1f2937;
    --text-light: #6b7280;
    --border: #e5e7eb;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --shadow: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.12);
    --gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --radius: 12px;
    --radius-sm: 8px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', 'PingFang SC', sans-serif;
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ========== 用户查询页 ========== */
.page-user {
    background: var(--gradient);
    min-height: 100vh;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-container {
    width: 100%;
    max-width: 520px;
}

.user-card {
    background: white;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    padding: 40px 35px;
    margin-bottom: 20px;
}

.user-header {
    text-align: center;
    margin-bottom: 30px;
}

.logo {
    font-size: 56px;
    margin-bottom: 15px;
    display: inline-block;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.user-header h1 {
    font-size: 28px;
    color: var(--text);
    margin-bottom: 8px;
}

.subtitle {
    color: var(--text-light);
    font-size: 14px;
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
}

.label-icon {
    font-size: 16px;
}

.input-group input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 15px;
    transition: all 0.2s;
    background: #f9fafb;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

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

.btn-query:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.35);
}

.btn-query:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-icon {
    font-size: 18px;
}

.loading-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* 结果区 */
.result {
    margin-top: 25px;
    display: none;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #ecfdf5;
    color: #065f46;
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    font-weight: 600;
    font-size: 14px;
}

.result-count {
    background: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
}

.code-card {
    background: linear-gradient(135deg, #f0f4ff 0%, #faf5ff 100%);
    border: 2px solid #e0e7ff;
    border-radius: var(--radius);
    padding: 22px 20px 16px;
    margin-bottom: 12px;
    position: relative;
    transition: all 0.2s;
    cursor: pointer;
    user-select: none;
}

.code-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(102, 126, 234, 0.18);
}

.code-card:active {
    transform: translateY(0);
}

.code-card.copied {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border-color: var(--success);
}

.code-card.copied .code-number {
    color: var(--success);
}

.code-number {
    font-size: 42px;
    font-weight: 700;
    color: var(--primary);
    text-align: center;
    letter-spacing: 10px;
    margin-bottom: 12px;
    font-family: 'SF Mono', Monaco, monospace;
    transition: color 0.2s;
}

.code-time {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: var(--text-light);
    font-size: 13px;
    padding-top: 10px;
    border-top: 1px dashed #c7d2fe;
}

/* 醒目的时间条（验证码和链接共用） */
.code-time-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
    padding: 8px 14px;
    background: linear-gradient(135deg, #eef2ff 0%, #ede9fe 100%);
    border: 1px solid #c7d2fe;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    color: #4338ca;
    letter-spacing: 0.3px;
    box-shadow: inset 0 1px 2px rgba(99, 102, 241, 0.08);
}

.code-time-bar .time-icon {
    font-size: 14px;
    filter: grayscale(0.2);
}

.code-time-bar .time-text {
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 12.5px;
}

/* "最新"徽章 */
.latest-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 9px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    font-size: 11px;
    font-weight: 700;
    border-radius: 999px;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.35);
    animation: pulse-latest 2s ease-in-out infinite;
    margin-right: 2px;
}

@keyframes pulse-latest {
    0%, 100% { box-shadow: 0 2px 6px rgba(16, 185, 129, 0.35); }
    50% { box-shadow: 0 2px 10px rgba(16, 185, 129, 0.6); }
}

/* 链接卡片用的时间条使用橙色调 */
.link-card .code-time-bar {
    background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
    border-color: #fed7aa;
    color: #c2410c;
    box-shadow: inset 0 1px 2px rgba(249, 115, 22, 0.08);
}

.copy-hint {
    text-align: center;
    color: var(--primary);
    font-size: 12px;
    margin-top: 8px;
    opacity: 0.7;
    font-weight: 500;
}

.code-card.copied .copy-hint {
    color: var(--success);
    opacity: 1;
}

/* Toast 提示 */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(31, 41, 55, 0.95);
    color: white;
    padding: 12px 24px;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    z-index: 9999;
    opacity: 0;
    transition: all 0.3s;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast-error {
    background: rgba(220, 38, 38, 0.95);
}

/* Token 链接卡片 */
.link-card {
    background: linear-gradient(135deg, #fef3f2 0%, #fff7ed 100%);
    border: 2px solid #fed7aa;
    border-radius: var(--radius);
    padding: 18px 20px 14px;
    margin-bottom: 12px;
    transition: all 0.2s;
    position: relative;
}

.link-card:hover {
    border-color: #fb923c;
    box-shadow: 0 6px 18px rgba(249, 115, 22, 0.15);
}

.link-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #c2410c;
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 14px;
    letter-spacing: 0.3px;
}

.link-icon {
    font-size: 20px;
}

.link-label-text {
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 1px;
}

/* 大按钮 - 点击进入 / 复制链接 */
.link-actions-big {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.link-btn-big {
    flex: 1;
    min-width: 120px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    text-align: center;
    transition: all 0.18s;
    border: none;
    letter-spacing: 0.5px;
    user-select: none;
}

.link-btn-icon {
    font-size: 18px;
}

.link-btn-open {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.35);
}

.link-btn-open:hover {
    background: linear-gradient(135deg, #ea580c 0%, #c2410c 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(234, 88, 12, 0.45);
    color: white;
}

.link-btn-open:active {
    transform: translateY(0);
}

.link-btn-copy {
    background: white;
    color: #c2410c;
    border: 2px solid #fed7aa !important;
}

.link-btn-copy:hover {
    background: #fff7ed;
    border-color: #fb923c !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.18);
}

.link-btn-copy.copied {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border-color: transparent !important;
}

.message-box {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
}

.message-error {
    background: #fef2f2;
    color: #991b1b;
    border-left: 4px solid var(--danger);
}

.message-warn {
    background: #fffbeb;
    color: #92400e;
    border-left: 4px solid var(--warning);
}

.message-success {
    background: #ecfdf5;
    color: #065f46;
    border-left: 4px solid var(--success);
}

.message-icon {
    font-size: 18px;
}

.loading-box {
    text-align: center;
    padding: 30px;
    color: var(--primary);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e0e7ff;
    border-top-color: var(--primary);
    border-radius: 50%;
    margin: 0 auto 12px;
    animation: spin 0.8s linear infinite;
}

/* 提示卡片 */
.tips-card {
    margin-top: 25px;
    padding: 18px;
    background: #f0f4ff;
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--primary);
}

.tips-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    color: var(--primary);
    font-weight: 600;
    font-size: 14px;
}

.tips-list {
    list-style: none;
    padding-left: 24px;
}

.tips-list li {
    color: var(--text-light);
    font-size: 13px;
    line-height: 1.8;
    position: relative;
}

.tips-list li:before {
    content: "•";
    color: var(--primary);
    position: absolute;
    left: -16px;
    font-weight: bold;
}

.footer {
    text-align: center;
    color: rgba(255,255,255,0.85);
    font-size: 13px;
    padding: 20px;
}

/* ========== 登录页 ========== */
.page-login {
    background: var(--gradient);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 420px;
}

.login-card {
    background: white;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    padding: 45px 40px;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo {
    font-size: 56px;
    margin-bottom: 15px;
    display: inline-block;
}

.login-header h1 {
    font-size: 26px;
    color: var(--text);
    margin-bottom: 8px;
}

.login-header p {
    color: var(--text-light);
    font-size: 14px;
}

.alert-box {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    margin-bottom: 18px;
    font-size: 14px;
}

.alert-box.show {
    display: flex;
}

.alert-error {
    background: #fef2f2;
    color: #991b1b;
    border-left: 4px solid var(--danger);
}

.alert-success {
    background: #ecfdf5;
    color: #065f46;
    border-left: 4px solid var(--success);
}

.btn-login {
    width: 100%;
    padding: 14px;
    background: var(--gradient);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 10px;
}

.btn-login:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.35);
}

.btn-login:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.login-footer {
    text-align: center;
    margin-top: 20px;
}

.login-footer a {
    color: var(--text-light);
    text-decoration: none;
    font-size: 13px;
    transition: color 0.2s;
}

.login-footer a:hover {
    color: var(--primary);
}

/* ========== 管理后台 ========== */
.page-admin {
    background: #fafbfc;
}

.admin-layout {
    display: flex;
    min-height: 100vh;
}

/* 侧边栏 - 白色主题 */
.sidebar {
    width: 240px;
    background: #ffffff;
    color: var(--text);
    position: fixed;
    height: 100vh;
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform 0.3s;
    border-right: 1px solid #eef0f3;
}

.sidebar-header {
    padding: 22px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid #eef0f3;
}

.sidebar-logo {
    width: 40px;
    height: 40px;
    background: var(--gradient);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
    flex-shrink: 0;
}

.sidebar-title h2 {
    font-size: 15px;
    margin-bottom: 2px;
    color: var(--text);
    font-weight: 600;
}

.sidebar-title p {
    font-size: 11px;
    color: var(--text-light);
}

.sidebar-menu {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.menu-item {
    padding: 11px 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.15s;
    color: #5a6478;
    font-size: 14px;
    border-radius: 8px;
    font-weight: 500;
}

.menu-item:hover {
    background: #f5f7fb;
    color: var(--text);
}

.menu-item.active {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.08) 100%);
    color: var(--primary);
    font-weight: 600;
}

.menu-icon {
    font-size: 17px;
    width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: 14px 16px;
    border-top: 1px solid #eef0f3;
}

.btn-logout {
    width: 100%;
    padding: 10px;
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fee2e2;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-logout:hover {
    background: #fee2e2;
    border-color: #fca5a5;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 99;
}

/* 主内容区 */
.main-content {
    flex: 1;
    margin-left: 240px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.top-bar {
    background: white;
    padding: 18px 28px;
    display: flex;
    align-items: center;
    gap: 20px;
    border-bottom: 1px solid #eef0f3;
    position: sticky;
    top: 0;
    z-index: 10;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: var(--text);
}

.page-info {
    flex: 1;
}

.page-info h1 {
    font-size: 20px;
    color: var(--text);
    margin-bottom: 2px;
    font-weight: 600;
}

.page-info p {
    font-size: 13px;
    color: var(--text-light);
}

.top-bar-actions {
    display: flex;
    gap: 10px;
}

.btn-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: #f5f7fb;
    color: var(--text);
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-link:hover {
    background: var(--primary);
    color: white;
}

.content-wrapper {
    flex: 1;
    padding: 28px;
}

.content-section {
    display: none;
    animation: fadeIn 0.3s;
}

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

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 统计卡片 - 简约风 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: white;
    border-radius: var(--radius);
    padding: 22px;
    display: flex;
    align-items: center;
    gap: 16px;
    border: 1px solid #eef0f3;
    transition: all 0.2s;
}

.stat-card:hover {
    border-color: #d1d5db;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.04);
}

.stat-blue .stat-icon { background: #eff6ff; color: #3b82f6; }
.stat-green .stat-icon { background: #ecfdf5; color: #10b981; }
.stat-red .stat-icon { background: #fef2f2; color: #ef4444; }
.stat-purple .stat-icon { background: #f5f3ff; color: #8b5cf6; }

.stat-icon {
    width: 48px;
    height: 48px;
    background: var(--bg);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.stat-info {
    flex: 1;
    min-width: 0;
}

.stat-number {
    font-size: 26px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}

.stat-label {
    font-size: 13px;
    color: var(--text-light);
    margin-top: 2px;
}

/* 卡片 - 简约风 */
.card {
    background: white;
    border-radius: var(--radius);
    padding: 24px;
    border: 1px solid #eef0f3;
    margin-bottom: 18px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid #f3f4f6;
}

.card-header h3 {
    font-size: 15px;
    color: var(--text);
    font-weight: 600;
}

/* 信息列表 */
.info-grid {
    display: grid;
    gap: 10px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 13px 16px;
    background: #fafbfc;
    border-radius: var(--radius-sm);
    border: 1px solid #eef0f3;
}

.info-label {
    font-size: 13px;
    color: var(--text-light);
}

.info-value {
    font-size: 13px;
    color: var(--text);
    font-weight: 500;
    font-family: 'SF Mono', Monaco, monospace;
}

.info-value-link {
    color: var(--primary);
    cursor: pointer;
    text-decoration: underline;
}

/* 快速操作 */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
}

.quick-action-btn {
    padding: 22px;
    background: #fafbfc;
    border: 1px solid #eef0f3;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--text);
}

.quick-action-btn:hover {
    background: white;
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.qa-icon {
    font-size: 26px;
}

.qa-label {
    font-size: 13px;
    font-weight: 500;
}

/* 按钮 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--gradient);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.35);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: #0ea271;
}

.btn-warning {
    background: var(--warning);
    color: white;
}

.btn-warning:hover {
    background: #d97706;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-secondary {
    background: var(--bg);
    color: var(--text);
}

.btn-secondary:hover {
    background: var(--border);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* 查询按钮（主题色：青蓝） */
.btn-query {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    color: white;
}

.btn-query:hover {
    background: linear-gradient(135deg, #0891b2 0%, #0e7490 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.3);
}

/* 非系统账号按钮（琥珀色） */
.btn-forward {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.btn-forward:hover {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

/* 搜索栏 */
.search-bar {
    margin-bottom: 16px;
}

.search-bar input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    background: var(--bg);
    transition: all 0.2s;
}

.search-bar input:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
}

/* 筛选栏 - 搜索 + 排序 */
.filter-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.filter-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    background: var(--bg);
    transition: all 0.2s;
}

.filter-input:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
}

.filter-select {
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    background: white;
    cursor: pointer;
    color: var(--text);
    transition: all 0.2s;
    min-width: 190px;
}

.filter-select:hover {
    border-color: var(--primary);
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

@media (max-width: 640px) {
    .filter-bar {
        flex-direction: column;
    }
    .filter-select {
        min-width: 0;
        width: 100%;
    }
}

/* 数据列表 - 简约风 */
.data-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.list-item {
    background: #fafbfc;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    transition: all 0.15s;
    border: 1px solid #eef0f3;
}

.list-item:hover {
    background: white;
    border-color: #d1d5db;
}

/* 行内三段式布局：信息 | 查询结果区 | 操作 */
.list-item-row {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.list-item-info {
    flex: 1 1 280px;
    min-width: 0;
}

.list-item-middle {
    flex: 0 1 auto;
    min-width: 90px;
    min-height: 28px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.list-item-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.list-item-title {
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 15px;
}

/* 状态小圆点 */
.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 0 3px rgba(255,255,255,0.5);
}
.status-dot-green { background: #10b981; box-shadow: 0 0 0 3px #d1fae5; }
.status-dot-yellow { background: #f59e0b; box-shadow: 0 0 0 3px #fef3c7; }
.status-dot-red {
    background: #ef4444;
    box-shadow: 0 0 0 3px #fee2e2;
    animation: pulse-red 2s ease-in-out infinite;
}

@keyframes pulse-red {
    0%, 100% { box-shadow: 0 0 0 3px #fee2e2; }
    50% { box-shadow: 0 0 0 5px rgba(239, 68, 68, 0.2); }
}

/* 账号类型徽章（系统 / 转发） */
.type-badge {
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 11.5px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    white-space: nowrap;
    letter-spacing: 0.2px;
}
.type-system {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}
.type-forward {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

/* 账号项 - 邮箱 + 密钥 同行同字号 */
.account-email {
    color: var(--text);
    font-weight: 600;
}

.account-email.clickable,
.account-key.clickable {
    cursor: pointer;
    transition: all 0.15s;
}

.account-email.clickable:hover {
    color: var(--primary);
    text-decoration: underline;
}

.account-key {
    color: var(--primary);
    font-weight: 600;
    font-family: 'SF Mono', Monaco, monospace;
    background: #f0f4ff;
    padding: 2px 10px;
    border-radius: 6px;
}

.account-key.clickable:hover {
    background: #e0e7ff;
    transform: scale(1.03);
}

/* 复制闪光效果 */
.copied-flash {
    animation: copiedFlash 0.6s ease;
}
@keyframes copiedFlash {
    0% { background: #10b981 !important; color: white !important; }
    100% { }
}

/* 时间框 - 根据剩余时间用不同颜色突出 */
.time-box {
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 12.5px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    border: 1px solid transparent;
}

.time-box-green {
    background: #d1fae5;
    color: #065f46;
    border-color: #a7f3d0;
}

.time-box-yellow {
    background: #fef3c7;
    color: #92400e;
    border-color: #fde68a;
}

.time-box-red {
    background: #fee2e2;
    color: #991b1b;
    border-color: #fca5a5;
    animation: pulse-box 2s ease-in-out infinite;
}

@keyframes pulse-box {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.time-box-expired {
    background: #e5e7eb;
    color: #6b7280;
    border-color: #d1d5db;
    text-decoration: line-through;
}

.list-item-desc {
    font-size: 12.5px;
    color: var(--text-light);
    word-break: break-all;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.list-item-desc .desc-divider {
    color: #d1d5db;
}

.list-item-desc code {
    background: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'SF Mono', Monaco, monospace;
    color: var(--primary);
    border: 1px solid #eef0f3;
}

.list-item-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

/* 状态徽章 */
.status-badge {
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11.5px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.status-valid {
    background: #ecfdf5;
    color: #065f46;
}

.status-expired {
    background: #fef2f2;
    color: #991b1b;
}

.status-warn {
    background: #fffbeb;
    color: #92400e;
}

/* 剩余天数 */
.days-remaining {
    color: var(--text-light);
    font-size: 12px;
}

.days-remaining.urgent {
    color: var(--danger);
    font-weight: 600;
}

.days-remaining.warning {
    color: var(--warning);
    font-weight: 600;
}

.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: var(--text-light);
}

.empty-state-icon {
    font-size: 44px;
    margin-bottom: 12px;
    opacity: 0.4;
}

/* 表单 */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 18px;
    margin-bottom: 20px;
}

.form-group-full {
    grid-column: 1 / -1;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}

.form-group label small {
    font-weight: normal;
    color: var(--text-light);
    margin-left: 4px;
}

.form-input {
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    background: white;
    transition: all 0.2s;
    width: 100%;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-help {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 4px;
}

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

/* 输入框 + 操作按钮 */
.input-with-btn {
    display: flex;
    gap: 8px;
}

.input-with-btn .form-input {
    flex: 1;
}

.btn-icon-action {
    width: 42px;
    height: 42px;
    background: #f0f4ff;
    border: 1px solid #e0e7ff;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 18px;
    color: var(--primary);
    transition: all 0.15s;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon-action:hover {
    background: var(--primary);
    color: white;
    transform: rotate(15deg) scale(1.05);
}

.tips-edit-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* 全局提示 */
.global-alert {
    position: fixed;
    top: 80px;
    right: 30px;
    z-index: 1000;
    max-width: 400px;
}

.global-alert .alert {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
    animation: slideInRight 0.3s;
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.alert-success {
    background: white;
    border-left: 4px solid var(--success);
    color: #065f46;
}

.alert-error {
    background: white;
    border-left: 4px solid var(--danger);
    color: #991b1b;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
    animation: fadeInModal 0.2s;
}

@keyframes fadeInModal {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: var(--radius);
    max-width: 500px;
    width: 100%;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: scaleIn 0.2s;
}

.modal-content.modal-lg {
    max-width: 720px;
}

@keyframes scaleIn {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 18px;
    color: var(--text);
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--text-light);
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    transition: background 0.2s;
}

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

.modal-body {
    padding: 25px;
    overflow-y: auto;
    flex: 1;
}

.modal-body .form-group {
    margin-bottom: 18px;
}

.modal-footer {
    padding: 18px 25px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ========== 404 页面 ========== */
.page-404 {
    background: var(--gradient);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.error-container {
    background: white;
    padding: 50px 60px;
    border-radius: 20px;
    text-align: center;
    box-shadow: var(--shadow-lg);
    max-width: 400px;
}

.error-code {
    font-size: 100px;
    font-weight: 700;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
}

.error-container h1 {
    font-size: 24px;
    color: var(--text);
    margin: 15px 0 10px;
}

.error-container p {
    color: var(--text-light);
    margin-bottom: 25px;
}

/* ========== 响应式 ========== */
@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }

    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-overlay.active {
        display: block;
    }

    .main-content {
        margin-left: 0;
    }

    .top-bar {
        padding: 14px 16px;
    }

    .page-info h1 {
        font-size: 18px;
    }

    .page-info p {
        display: none;
    }

    .content-wrapper {
        padding: 16px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .stat-card {
        padding: 16px;
        gap: 12px;
    }

    .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }

    .stat-number {
        font-size: 22px;
    }

    .card {
        padding: 18px;
    }

    .card-header {
        flex-wrap: wrap;
        gap: 10px;
    }

    .list-item {
        flex-direction: column;
        align-items: stretch;
    }

    .list-item-actions {
        justify-content: flex-end;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .global-alert {
        right: 16px;
        left: 16px;
        max-width: none;
    }

    .user-card {
        padding: 30px 22px;
    }

    .code-number {
        font-size: 32px;
        letter-spacing: 5px;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .top-bar-actions {
        display: none;
    }
}

/* ========== 管理员行内查询结果 ========== */

/* loading 态 */
.inline-query-loading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: #f0f4ff;
    color: var(--primary);
    border-radius: 18px;
    font-size: 12.5px;
    font-weight: 500;
    border: 1px solid #e0e7ff;
}

.spinner-sm {
    width: 14px;
    height: 14px;
    border: 2px solid #e0e7ff;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    flex-shrink: 0;
}

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

/* 查询结果容器（行内） */
.inline-query-result {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* 行内验证码 */
.inline-code {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border: 1px solid #6ee7b7;
    border-radius: 18px;
    font-size: 13px;
    font-weight: 700;
    color: #065f46;
    cursor: pointer;
    transition: all 0.15s;
    font-family: 'SF Mono', Monaco, monospace;
    letter-spacing: 1.5px;
    user-select: none;
}

.inline-code:hover {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(16, 185, 129, 0.25);
}

.inline-code-icon {
    font-size: 12px;
    filter: grayscale(0.3);
}

.inline-code-value {
    font-size: 15px;
}

/* 行内登录链接 - 只显示按钮，不显示 URL */
.inline-link {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 2px 4px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 18px;
}

.inline-link-btn {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 14px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all 0.15s;
    white-space: nowrap;
}

.inline-link-open {
    background: linear-gradient(135deg, #fb923c 0%, #ea580c 100%);
    color: white;
}

.inline-link-open:hover {
    background: linear-gradient(135deg, #ea580c 0%, #c2410c 100%);
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(234, 88, 12, 0.3);
}

.inline-link-copy {
    background: white;
    color: #ea580c;
    border: 1px solid #fed7aa !important;
}

.inline-link-copy:hover {
    background: #fff7ed;
    border-color: #fb923c !important;
}

/* 空/错误状态 */
.inline-query-empty, .inline-query-error {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px;
    background: #fef3c7;
    border: 1px solid #fde68a;
    border-radius: 18px;
    font-size: 12px;
    color: #92400e;
}

.inline-query-error {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #991b1b;
}

.btn-retry {
    padding: 2px 10px;
    font-size: 11px;
    border: 1px solid currentColor;
    background: white;
    color: inherit;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.15s;
}

.btn-retry:hover {
    background: currentColor;
    color: white;
}

/* 行内刷新按钮 */
.inline-query-refresh {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: white;
    color: var(--text-light);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    transition: all 0.2s;
}

.inline-query-refresh:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: rotate(180deg);
}

/* ========== 账号类型提示条（模态框内顶部） ========== */
.type-hint {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 13px;
    line-height: 1.6;
}

.type-hint code {
    background: rgba(0,0,0,0.08);
    padding: 1px 6px;
    border-radius: 4px;
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 12px;
}

.type-hint-icon {
    font-size: 22px;
    line-height: 1;
    flex-shrink: 0;
}

.type-hint-system {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.type-hint-forward {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

/* 按钮文字标签（设置列表） */
.btn-text-tag {
    display: inline-block;
    padding: 4px 12px;
    background: linear-gradient(135deg, #f0f4ff 0%, #e0e7ff 100%);
    color: var(--primary);
    border-radius: 14px;
    font-weight: 600;
    font-size: 13px;
    font-family: 'SF Mono', Monaco, monospace;
}


/* ========== 侧边栏当前用户 ========== */
.sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    margin: 12px 14px;
    background: linear-gradient(135deg, #f5f7ff 0%, #faf5ff 100%);
    border-radius: var(--radius-sm);
    border: 1px solid #e0e7ff;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.user-info {
    flex: 1;
    min-width: 0;
}

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

.user-role {
    font-size: 11.5px;
    color: var(--text-light);
    margin-top: 2px;
}

.user-role.role-super {
    color: #d97706;
    font-weight: 600;
}

/* ========== 管理员列表专用徽章 ========== */
.type-super {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: white;
    border: none;
}

.type-normal {
    background: #e0e7ff;
    color: #4338ca;
    border: 1px solid #c7d2fe;
}

.type-you {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
    animation: pulse-badge 2s ease-in-out infinite;
}

@keyframes pulse-badge {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.admin-username {
    font-weight: 700;
    color: var(--text);
    font-size: 15px;
    font-family: 'SF Mono', Monaco, monospace;
}

/* 账号所属人标签（超级管理员视角） */
.owner-tag {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    background: #f0f4ff;
    color: #4338ca;
    border-radius: 10px;
    font-size: 11.5px;
    font-weight: 600;
    border: 1px solid #c7d2fe;
}

/* 复选框标签 */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 600;
    color: var(--text);
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary);
}

/* 禁用输入框 */
.form-input:disabled {
    background: #f3f4f6;
    color: #6b7280;
    cursor: not-allowed;
}


