/* assets/css/main.css - 核心样式 */

/* ============ CSS变量定义 ============ */
:root {
    --primary-color: #667eea;
    --primary-dark: #5a67d8;
    --secondary-color: #764ba2;
    --success-color: #28a745;
    --success-dark: #218838;
    --danger-color: #dc3545;
    --danger-dark: #c82333;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --gray-color: #6c757d;
    --gray-dark: #545b62;
    --border-color: #e9ecef;
    --shadow-light: rgba(0, 0, 0, 0.1);
    --shadow-medium: rgba(0, 0, 0, 0.2);
    --shadow-dark: rgba(0, 0, 0, 0.3);
    --transition-speed: 0.3s;
    --border-radius-sm: 6px;
    --border-radius-md: 8px;
    --border-radius-lg: 15px;
    --border-radius-xl: 20px;
    --font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
}

/* ============ 基础重置 ============ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-family);
}

body {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

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

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

header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
    width: 100%;
}

header h1 {
    font-size: 2.8rem;
    margin-bottom: 10px;
    text-shadow: 0 2px 5px var(--shadow-medium);
}

header h1 i {
    margin-right: 10px;
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* 通用 header 固定 */
.global-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: linear-gradient(135deg, #677BE5 0%, #6F63C2 100%);
    color: white;
    padding: 15px 20px;
    text-align: center;
}

footer {
    text-align: center;
    margin-top: 40px;
    color: white;
    opacity: 0.8;
    font-size: 14px;
    padding: 20px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

footer a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
}

footer a:hover {
    color: white;
    text-decoration: underline;
}

/* ============ 登录状态区域（完整版） ============ */
.login-status-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1002;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* 用户信息和访客信息容器 */
#userInfo,
#guestInfo {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(248, 247, 252, 0.8);
    padding: 6px 15px;
    border-radius: 10px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    width: auto;
}

#userInfo i.fa-user {
    color: #667eea;
    font-size: 0.9rem;
}

.username-display {
    font-weight: 600;
    color: #6880EA;
    font-size: 0.9rem;
    white-space: nowrap;
}

.guest-text {
    color: #94a3b8;
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
}

/* 按钮通用样式 */
.logout-btn,
.change-password-btn,
.token-manager-btn {
    color: white;
    border: none;
    padding: 6px 12px;
    font-size: 0.9rem;
    font-weight: 700;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s ease;
    white-space: nowrap;
    text-decoration: none;
    background: rgba(108, 117, 125, 0.8);
}

.logout-btn:hover,
.change-password-btn:hover {
    background: rgba(108, 117, 125, 1);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(61, 69, 78, 0.3);
}

/* 令牌管理按钮样式 */
.token-manager-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.token-manager-btn:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46a1 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* 登录按钮样式 */
.login-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 6px 16px;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

/* 排序按钮（在访客模式中用的） */
.sort-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s ease;
}

.sort-btn:hover {
    background: #5a6268;
}

/* 访客消息 */
#guestMessage {
    color: white;
    font-weight: 600;
    margin-top: 10px;
    font-size: 1rem;
}

/* 管理员控制区域 */
#adminControls {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .login-status-container {
        position: relative;
        top: 0;
        right: 0;
        margin: 0 auto 15px auto;
        width: fit-content;
        justify-content: center;
    }

    #userInfo,
    #guestInfo {
        padding: 4px 10px;
    }

    .logout-btn,
    .change-password-btn,
    .token-manager-btn,
    .login-btn {
        padding: 4px 10px;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .login-status-container {
        flex-direction: column;
        align-items: center;
    }

    #userInfo,
    #guestInfo {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* ============ 登录/注册标签样式 ============ */
.auth-tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 1px solid #e9ecef;
}

.auth-tab {
    flex: 1;
    padding: 12px 0;
    background: none;
    border: none;
    font-size: 16px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

.auth-tab.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.auth-tab:hover:not(.active) {
    color: #333;
}

/* ============ 容器 ============ */
.container {
    max-width: 1600px;
    margin: 0 auto;
    position: relative;
}

/* ============ 消息提示 ============ */
.message {
    position: fixed;
    top: 80px;
    right: 20px;
    padding: 12px 24px;
    border-radius: var(--border-radius-md);
    z-index: 9999;
    box-shadow: 0 5px 15px var(--shadow-medium);
    animation: slideIn 0.3s ease;
    color: white;
    font-weight: 500;
    backdrop-filter: blur(10px);
}

.message.success {
    background: rgba(40, 167, 69, 0.95);
}

.message.error {
    background: rgba(220, 53, 69, 0.95);
}

.message.info {
    background: rgba(23, 162, 184, 0.95);
}

/* ============ 加载动画 ============ */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
}

.loading.show {
    opacity: 1;
    visibility: visible;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(243, 243, 243, 0.5);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* ============ 浮动帮助按钮 ============ */
.floating-help-button {
    position: fixed;
    top: 80px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.25), rgba(255, 255, 255, 0.15));
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    font-size: 30px;
    transition: all var(--transition-speed) ease;
    z-index: 1002;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.floating-help-button:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0.25));
    border-color: rgba(255, 255, 255, 0.6);
    transform: translateY(-2px) scale(1.1) rotate(15deg);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.floating-help-button:active {
    transform: translateY(0) scale(1) rotate(15deg);
}

/* ============ 通用 tooltip 样式 ============ */
.help-tooltip,
.IconSidebar-tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 6px 12px;
    border-radius: var(--border-radius-sm);
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    transition: all var(--transition-speed) ease;
    pointer-events: none;
    z-index: 101;
}

/* 帮助按钮的 tooltip */
.floating-help-button .help-tooltip {
    top: 50px;
    right: 0;
    transform: translateY(-10px);
}

.floating-help-button:hover .help-tooltip {
    opacity: 1;
    transform: translateY(0);
}

/* ============ 控制栏（右下角图标库按钮） ============ */
.controls {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 1000;
}

.control-btn {
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 5px 15px var(--shadow-medium);
    transition: all var(--transition-speed) ease;
    position: relative;
}

.control-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px) scale(1.1) rotate(-15deg);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

/* 图标库按钮的 tooltip */
.control-btn .IconSidebar-tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 6px 12px;
    border-radius: var(--border-radius-sm);
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    transition: all var(--transition-speed) ease;
    pointer-events: none;
    z-index: 101;
    top: -30px;
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
}

.control-btn:hover .IconSidebar-tooltip {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ============ 模态框 ============ */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1006;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    animation: fadeIn 0.3s ease;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 25px;
    padding: 35px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-title {
    font-size: 1.8rem;
    color: #2d3748;
    display: flex;
    align-items: center;
    gap: 15px;
    font-weight: 700;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #718096;
    transition: color 0.3s ease;
}

.close-btn:hover {
    color: #4a5568;
}

/* ============ 表单 ============ */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2d3748;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-label i {
    color: #667eea;
    width: 18px;
    text-align: center;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-md);
    font-size: 15px;
    transition: all var(--transition-speed) ease;
    background: #f8fafc;
}

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

.form-hint {
    color: #718096;
    font-size: 12px;
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 30px;
    justify-content: flex-end;
}

/* ============ 按钮 ============ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 30px;
    border: none;
    border-radius: var(--border-radius-md);
    cursor: pointer;
    font-weight: 600;
    font-size: 16px;
    transition: all var(--transition-speed) ease;
    text-decoration: none;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
}

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

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

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

.btn-success:hover {
    background: var(--success-dark);
}

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

.btn-danger:hover {
    background: var(--danger-dark);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.9rem;
}

.btn-lg {
    padding: 14px 36px;
    font-size: 1.1rem;
}

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

/* ============ 徽章 ============ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-primary {
    background: #dbeafe;
    color: #1e40af;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

/* ============ 卡片 ============ */
.card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius-xl);
    padding: 28px 32px;
    box-shadow: 0 12px 28px var(--shadow-medium);
    border: 1px solid rgba(255, 255, 255, 0.5);
    transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.25);
}

.section-title {
    font-size: 1.5rem;
    font-weight: 650;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #124076;
    border-left: 8px solid var(--primary-color);
    padding-left: 18px;
}

.section-title i {
    color: var(--primary-color);
    font-size: 1.6rem;
}

/* ============ 新添加：令牌管理页面快捷操作面板 ============ */

/* 快捷操作面板容器 */
.quick-actions-panel {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 16px 20px;
    margin: 0 0 30px 0;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    width: 100%;
}

/* 面板头部 */
.quick-actions-panel .panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.quick-actions-panel .panel-title {
    font-size: 1rem;
    font-weight: 500;
    color: white;
    display: flex;
    align-items: center;
    gap: 6px;
    opacity: 0.9;
}

.quick-actions-panel .panel-title i {
    font-size: 1rem;
    color: #FFD700;
}

.quick-actions-panel .panel-badge {
    background: rgba(9, 255, 0, 0.5);
    color: rgba(255, 255, 255, 0.9);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 400;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

/* 操作按钮容器 - 横向排列 */
.quick-actions-panel .action-buttons {
    display: flex;
    flex-direction: row;
    gap: 12px;
    flex-wrap: wrap;
    padding: 0 200px;
    /*justify-content: flex-end;  /* 按钮靠右对齐 */
    justify-content: space-between;
    /* 均匀分布 */
    /*justify-content: center;  /* 居中 */
}

/* 操作按钮样式 - 横向布局 */
.quick-actions-panel .action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 40px;
    color: white;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
    white-space: nowrap;
    min-width: 150px;
}

.quick-actions-panel .action-btn i {
    font-size: 1rem;
    transition: transform 0.2s ease;
}

.quick-actions-panel .action-btn span {
    line-height: 1;
}

.quick-actions-panel .action-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.quick-actions-panel .action-btn:hover i {
    transform: scale(1.05);
}

.quick-actions-panel .action-btn:active {
    transform: translateY(0);
}

/* 主要操作按钮（迁移工具）- 稍微突出 */
.quick-actions-panel .action-btn.migration {
    background: linear-gradient(135deg, rgba(217, 230, 102, 0.4), rgba(199, 216, 43, 0.4));
    border-color: rgba(255, 255, 255, 0.25);
}

.quick-actions-panel .action-btn.migration:hover {
    background: linear-gradient(135deg, rgba(217, 230, 102, 0.6), rgba(199, 216, 43, 0.6));
    border-color: rgba(255, 255, 255, 0.35);
}

/* 生成新令牌 - 稍微突出 */
.quick-actions-panel .action-btn.primary {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.4), rgba(118, 75, 162, 0.4));
    border-color: rgba(255, 255, 255, 0.25);
}

.quick-actions-panel .action-btn.primary:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.6), rgba(118, 75, 162, 0.6));
    border-color: rgba(255, 255, 255, 0.35);
}

/* 退出按钮 - 轻微警示 */
.quick-actions-panel .action-btn.danger {
    background: rgba(220, 53, 69, 0.2);
    border-color: rgba(220, 53, 69, 0.25);
}

.quick-actions-panel .action-btn.danger:hover {
    background: rgba(220, 53, 69, 0.3);
    border-color: rgba(220, 53, 69, 0.35);
}

/* ============ 原有响应式样式 ============ */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    .card {
        padding: 20px;
    }

    .section-title {
        font-size: 1.3rem;
    }

    .floating-help-button {
        top: 15px;
        right: 15px;
        width: 40px;
        height: 40px;
        font-size: 18px;
        z-index: 1000;
    }

    .help-tooltip {
        display: none;
    }

    .modal-content {
        padding: 25px 20px;
    }

    .form-actions {
        flex-direction: column;
    }

    /* 新添加的快捷操作面板响应式 */
    .quick-actions-panel {
        padding: 15px;
    }

    .quick-actions-panel .action-buttons {
        flex-direction: column;
        gap: 8px;
    }

    .quick-actions-panel .action-btn {
        width: 100%;
        justify-content: flex-start;
        padding: 12px 16px;
    }

    .quick-actions-panel .panel-header {
        flex-direction: row;
        align-items: center;
    }
}

@media (max-width: 480px) {
    .btn {
        padding: 10px 20px;
        font-size: 14px;
    }

    .modal-title {
        font-size: 1.5rem;
    }

    /* 新添加的快捷操作面板响应式 */
    .quick-actions-panel {
        padding: 12px;
    }

    .quick-actions-panel .action-btn {
        padding: 10px 14px;
        font-size: 0.9rem;
    }
}