/* 主页面样式文件 - 从main/base.html提取 */

/* 全局变量 */
:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --success-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --glass-bg: rgba(255, 255, 255, 0.25);
    --glass-border: rgba(255, 255, 255, 0.18);
    --shadow-light: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    --shadow-hover: 0 15px 35px rgba(31, 38, 135, 0.5);
}

/* 动态背景 */
body {
    background: linear-gradient(-45deg, #ee7752, #e73c7e, #23a6d5, #23d5ab);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    position: relative;
    overflow-x: hidden;
    padding-top: 80px;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="0.5" fill="%23ffffff" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>') repeat;
    pointer-events: none;
    z-index: -1;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* 玻璃态效果 */
.apple-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1030;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.2);
}

/* 主容器美化 */
.main-container {
    background: var(--glass-bg);
    backdrop-filter: blur(16px) saturate(180%);
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-light);
    margin: 20px auto 40px;
    transition: all 0.3s ease;
    max-width: 1200px;
    padding: 30px;
}

.main-container:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

/* 导航链接动画 */
.nav-link {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.nav-link:hover {
    color: rgba(255, 255, 255, 0.9);
}

/* 汉堡菜单按钮样式 */
.nav-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background: rgba(255, 255, 255, 0.8);
    margin: 3px 0;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* 桌面模式下拉菜单样式 */
.nav-dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    display: none;
    min-width: 200px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    z-index: 1000;
    padding: 8px 0;
    margin-top: 4px;
}

.nav-dropdown.active .dropdown-menu {
    display: block;
    animation: dropdownFadeIn 0.3s ease;
}

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

.dropdown-item {
    display: block;
    width: 100%;
    padding: 8px 16px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    background: none;
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.95);
    transform: translateX(4px);
}

.dropdown-item.danger {
    color: #ff6b6b;
}

.dropdown-item.danger:hover {
    background: rgba(255, 107, 107, 0.1);
    color: #ff5252;
}

/* 移动端导航菜单 */
@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }
    
    .nav-menu {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 70px);
        background: rgba(255, 255, 255, 0.85);
        backdrop-filter: blur(20px) saturate(180%);
        border-right: 1px solid rgba(0, 0, 0, 0.3);
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        transition: left 0.3s ease;
        padding-top: 50px;
        z-index: 1000;
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .nav-menu .nav-item {
        margin: 10px 0;
        width: 90%;
        text-align: center;
    }
    
    .nav-dropdown {
        width: 100%;
        position: static;
    }
    
    .dropdown-menu {
        position: static;
        display: none;
        width: 100%;
        background: rgba(255, 255, 255, 0.7);
        border: 1px solid rgba(255, 255, 255, 0.2);
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
        margin-top: 10px;
        border-radius: 8px;
        backdrop-filter: blur(10px);
    }
    
    .nav-dropdown.active .dropdown-menu {
        display: block;
    }
    
    .dropdown-item {
        padding: 12px 20px;
        text-align: center;
        color: rgba(0, 0, 0, 0.8);
    }
    
    .dropdown-item:hover {
        background: rgba(0, 0, 0, 0.1);
        color: rgba(0, 0, 0, 0.9);
    }
    
    .dropdown-item.danger {
        color: #dc3545;
    }
    
    .dropdown-item.danger:hover {
        background: rgba(220, 53, 69, 0.1);
        color: #c82333;
    }
}

/* 品牌图标动画 */
.brand-icon {
    transition: all 0.3s ease;
}

.nav-brand:hover .brand-icon {
    transform: rotate(360deg) scale(1.1);
    filter: drop-shadow(0 0 10px rgba(0, 122, 255, 0.5));
}

/* 下拉菜单美化 */
.nav-dropdown-menu {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
}

/* 页脚美化 */
.footer {
    background: var(--glass-bg);
    backdrop-filter: blur(16px) saturate(180%);
    border-top: 1px solid var(--glass-border);
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -8px 32px 0 rgba(31, 38, 135, 0.2);
    margin-top: auto;
}

.footer-content {
    padding: 40px 20px;
    text-align: center;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

.footer-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-gradient);
    transition: width 0.3s ease;
}

.footer-links a:hover {
    color: white;
    transform: translateY(-2px);
}

.footer-links a:hover::after {
    width: 100%;
}

.footer-bottom p {
    color: rgba(255, 255, 255, 0.6);
    margin: 0;
    font-size: 14px;
}

/* 提示消息美化 */
.alert {
    background: var(--glass-bg);
    backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: 15px;
    box-shadow: var(--shadow-light);
    animation: slideInDown 0.5s ease;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 滚动条美化 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-gradient);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-gradient);
}

/* 表格样式 */
table {
    width: 100%;
    background: var(--glass-bg);
    backdrop-filter: blur(16px) saturate(180%);
    border-radius: 15px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-light);
    overflow: hidden;
    margin: 20px 0;
    border-collapse: separate;
    border-spacing: 0;
}

table thead {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
}

table th {
    padding: 15px 20px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 14px;
    letter-spacing: 0.5px;
}

table td {
    padding: 15px 20px;
    color: rgba(255, 255, 255, 0.8);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

table tbody tr {
    transition: all 0.3s ease;
}

table tbody tr:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

table tbody tr:last-child td {
    border-bottom: none;
}

/* 按钮样式 */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

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

.btn-info {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    color: white;
}

.btn-warning {
    background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%);
    color: #212529;
}

.btn-danger {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
}

.btn-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    color: white;
}

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

/* 客户端ID列表样式 */
.client-ids {
    list-style: none;
    padding: 0;
    margin: 0;
}

.client-ids li {
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 8px;
    border-radius: 6px;
    margin: 2px 0;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.9);
}

/* 无数据提示样式 */
.no-data {
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    font-style: italic;
    padding: 40px 20px;
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    border-radius: 15px;
    border: 1px solid var(--glass-border);
}

/* 文本样式 */
.text-muted {
    color: rgba(255, 255, 255, 0.5) !important;
    font-style: italic;
}

/* 客户端列表容器样式 */
.client-list {
    padding: 20px;
}

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

.client-header h2 {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
    margin: 0;
    font-size: 24px;
}

/* 加载动画 */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

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

/* 响应式优化 */
@media (max-width: 768px) {
    body {
        padding-top: 70px;
    }
    
    .main-container {
        margin: 10px 10px 20px;
        border-radius: 15px;
        padding: 20px 15px;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 15px;
    }
}