/* ==========================================================================
   授权管理系统样式表
   版本: 1.0.0
   ========================================================================== */

/* ==================== 基础样式 ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 14px;
}

@font-face {
    font-family: 'Alibaba PuHuiTi';
    src: url('../assets/fonts/AlibabaPuHuiTi-3-55-Regular.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

body {
    font-family: "Alibaba PuHuiTi", "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
    background-color: #fcfcfc;
    min-height: 100vh;
    color: #333;
}

/* ==================== CSS 变量 ==================== */
:root {
    --primary-color: #FF6901;
    --primary-bg: rgba(255, 105, 1, 0.1);
    --success-color: #22c55e;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --card-bg: rgba(255, 255, 255, 0.85);
    --border-color: rgba(0, 0, 0, 0.08);
    --text-color: #333;
    --text-muted: #666;
    --bg-secondary: rgba(0, 0, 0, 0.03);
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}

/* ==================== 动态背景 ==================== */
.bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    background: #fcfcfc;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    animation: float 20s ease-in-out infinite;
}

.orb-1 { width: 500px; height: 500px; background: linear-gradient(135deg, #FF6901, #FFB366); top: -150px; left: -150px; }
.orb-2 { width: 400px; height: 400px; background: linear-gradient(135deg, #FFD4B3, #FF8C42); bottom: -100px; right: -100px; animation-delay: -7s; }
.orb-3 { width: 300px; height: 300px; background: linear-gradient(135deg, #FFF0E6, #FFCC99); top: 50%; left: 50%; transform: translate(-50%, -50%); animation-delay: -14s; }

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -30px) scale(1.05); }
    50% { transform: translate(-20px, 20px) scale(0.95); }
    75% { transform: translate(20px, 10px) scale(1.02); }
}

/* ==================== 登录页 ==================== */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.login-box {
    width: 100%;
    max-width: 400px;
    padding: 3rem;
    border-radius: 20px;
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    text-align: center;
}

.login-logo {
    width: 64px;
    height: 64px;
    margin-bottom: 20px;
}

.login-box h1 {
    font-size: 1.8rem;
    color: #333;
    margin-bottom: 8px;
}

.login-box h1 span {
    color: var(--primary-color);
}

.login-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 2rem;
}

.login-box .form-group {
    text-align: left;
}

/* ==================== 管理页容器 ==================== */
.admin-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 30px 20px;
}

/* ==================== 头部 ==================== */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.header h1 {
    font-size: 1.5rem;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.header h1 span {
    color: var(--primary-color);
}

/* ==================== 卡片 ==================== */
.card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    margin-bottom: 24px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 105, 1, 0.03);
}

.card-header h2 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-body {
    padding: 1.5rem;
}

/* ==================== 表单 ==================== */
.form-group {
    margin-bottom: 1.2rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.6rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 0.85rem 1rem;
    font-size: 0.95rem;
    color: var(--text-color);
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    transition: all 0.3s;
    height: 44px;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 105, 1, 0.12);
    background: #fff;
}

.form-control::placeholder {
    color: #aaa;
}

.form-row {
    display: flex;
    gap: 15px;
}

.form-row .form-group {
    flex: 1;
}

/* ==================== 按钮 ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.7rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, #FF6901, #FF8534);
    color: #fff;
    box-shadow: 0 4px 15px rgba(255, 105, 1, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #E55D00, #FF6901);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 105, 1, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: #fff;
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.3);
}

.btn-success:hover {
    transform: translateY(-2px);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background: var(--danger-color);
    color: #fff;
}

.btn-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.btn-warning:hover {
    background: var(--warning-color);
    color: #fff;
}

.btn-outline {
    background: rgba(255, 105, 1, 0.08);
    color: var(--primary-color);
    border: 1px solid rgba(255, 105, 1, 0.3);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: #fff;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    border-radius: 6px;
}

.btn-block {
    width: 100%;
}

/* ==================== 表格 ==================== */
.table-container {
    overflow-x: auto;
}

.node-table {
    width: auto;
    min-width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    table-layout: auto;
}

.node-table th,
.node-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.node-table th:first-child,
.node-table td:first-child {
    padding-left: 20px;
}

.node-table th:last-child,
.node-table td:last-child {
    padding-right: 20px;
}

.node-table th {
    background: rgba(0, 0, 0, 0.02);
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.85rem;
    padding: 12px;
}

.node-table tbody tr:hover {
    background: rgba(0, 0, 0, 0.02);
}

.node-table .table-empty {
    text-align: center !important;
    color: var(--text-muted);
    padding: 40px 20px !important;
    font-size: 0.85rem;
}

/* ==================== 复选框 ==================== */
.styled-checkbox {
    width: 16px;
    height: 16px;
    cursor: pointer;
    appearance: none;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    background: #fff;
    position: relative;
    transition: all 0.2s;
}

.styled-checkbox:hover {
    border-color: var(--primary-color);
}

.styled-checkbox:checked {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.styled-checkbox:checked::after {
    content: '';
    position: absolute;
    top: 1px;
    left: 4px;
    width: 4px;
    height: 8px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* ==================== 工具栏 ==================== */
.guest-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 18px 15px;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.guest-toolbar .search-box {
    flex: 1;
    min-width: 200px;
    display: flex;
    gap: 8px;
}

.guest-toolbar .search-box input {
    flex: 1;
    padding: 0.6rem 0.9rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-color);
    font-size: 0.85rem;
    transition: all 0.3s;
    height: 38px;
}

.guest-toolbar .search-box input:focus {
    outline: 0;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 105, 1, .15);
}

.guest-toolbar .filter-select {
    padding: 0.6rem 0.9rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-color);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s;
    height: 38px;
}

.guest-toolbar .filter-select:focus {
    outline: 0;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 105, 1, .15);
}

/* ==================== 底部操作栏 ==================== */
.table-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
}

.table-footer .batch-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.table-footer .batch-info {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.text-primary {
    color: var(--primary-color) !important;
}

/* 批量操作下拉菜单 */
.batch-dropdown {
    position: relative;
}

.batch-trigger {
    font-size: 0.85rem;
    color: var(--primary-color);
    cursor: pointer;
}

.batch-menu {
    display: none;
    position: absolute;
    bottom: 100%;
    right: 0;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    min-width: 100px;
    margin-bottom: 6px;
}

.batch-dropdown:hover .batch-menu {
    display: block;
}

.batch-menu-item {
    display: block;
    width: 100%;
    padding: 8px 14px;
    border: none;
    background: none;
    text-align: left;
    font-size: 0.8rem;
    color: var(--text-color);
    cursor: pointer;
    transition: background 0.2s;
}

.batch-menu-item:hover {
    background: var(--bg-secondary);
}

.batch-menu-danger {
    color: var(--danger-color);
}

.batch-menu-danger:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* ==================== 状态标签 ==================== */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success {
    background: rgba(34, 197, 94, 0.15);
    color: #16a34a;
}

.badge-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #dc2626;
}

.badge-warning {
    background: rgba(245, 158, 11, 0.15);
    color: #d97706;
}

/* ==================== 密钥样式 ==================== */
.license-key {
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    font-size: 0.85rem;
    color: var(--text-color);
    letter-spacing: 0.5px;
}

/* ==================== 操作按钮组 ==================== */
.action-btns {
    display: flex;
    gap: 6px;
}

/* ==================== 弹窗 ==================== */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: #fff;
    padding: 2rem;
    border-radius: 16px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-header h3 {
    font-size: 1.1rem;
    color: var(--text-color);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #999;
    line-height: 1;
}

.modal-close:hover {
    color: var(--danger-color);
}

.key-display {
    background: #f8f9fa;
    border: 2px dashed var(--border-color);
    border-radius: 10px;
    padding: 1rem;
    text-align: center;
    margin-bottom: 1.5rem;
}

.key-display input {
    width: 100%;
    border: none;
    background: transparent;
    font-family: 'SF Mono', monospace;
    font-size: 1.1rem;
    text-align: center;
    color: var(--primary-color);
    font-weight: 600;
    letter-spacing: 1px;
}

/* ==================== Toast 提示 ==================== */
.toast {
    position: fixed;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 30px;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
    background: rgba(34, 197, 94, 0.95);
    box-shadow: 0 8px 20px rgba(34, 197, 94, 0.3);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    z-index: 9999;
}

.toast.show {
    opacity: 1;
}

.toast.error {
    background: rgba(239, 68, 68, 0.95);
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.3);
}

/* ==================== 统计卡片 ==================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    padding: 1rem 1.2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 105, 1, 0.1);
    border-color: var(--primary-color);
}

.stat-info {
    text-align: left;
}

.stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1.2;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.stat-icon {
    width: 36px;
    height: 36px;
    opacity: 0.8;
}

.header-icon {
    width: 28px;
    height: 28px;
}

/* ==================== 工具类 ==================== */
.hidden { display: none !important; }
.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mb-10 { margin-bottom: 10px; }
.flex { display: flex; }
.gap-10 { gap: 10px; }
.items-center { align-items: center; }

/* ==================== 响应式 ==================== */
@media (max-width: 768px) {
    .admin-container {
        padding: 20px 15px;
    }
    
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .header h1 {
        font-size: 1.2rem;
    }
    
    th, td {
        padding: 0.75rem 0.5rem;
        font-size: 0.8rem;
    }
    
    .action-btns {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .login-box {
        padding: 1.5rem;
    }
}

.text-muted {
    color: #999;
    font-size: 0.8rem;
}
