/* ==========================================================================
   Senflare 公共主题样式库
   版本: 3.2.21 | 更新: 2026-01-17

   本文件包含所有页面通用的样式组件:
   - CSS 变量 (浅色/深色主题)
   - 字体定义
   - 全局基础样式
   - 动态背景
   - 通用工具类
   - 卡片组件
   - 表单组件
   - 按钮组件
   - 弹窗组件
   - Toast 提示
   - 复选框组件
   - 标签组件
   ========================================================================== */

/* CSS 变量 - 主题配色 */
:root {
    /* 色彩系统 */
    --c-primary: #FF6901;
    --c-success: #2cc76a;
    --c-warning: #f59e0b;
    --c-danger: #ef4444;
    --c-info: #3b82f6;

    /* 全局主题变量 (默认浅色) */
    --primary-color: #FF6901;
    --primary-bg: rgba(255, 105, 1, 0.1);

    /* 侧边栏相关 */
    --sidebar-bg: rgba(255, 255, 255, 0.90);
    --sidebar-text: #555;
    --sidebar-active-bg: rgba(255, 105, 1, 0.08);
    --sidebar-active-text: #FF6901;
    --sidebar-width: 60px;
    --sidebar-expanded-width: 220px;
    --sidebar-shadow: 1px 0 20px rgba(0, 0, 0, 0.03);

    /* 头部高度 */
    --header-height: 64px;

    /* 卡片与布局 */
    --card-bg: rgba(255, 255, 255, 0.82);
    --bg-color: #fcfcfc;
    --text-color: #333;
    --text-muted: #666;
    --text-muted-light: #999;
    --bg-secondary: rgba(0, 0, 0, 0.03);
    --border-color: rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.04);

    /* 动态背景 Orb 颜色 */
    --orb-1: #fff5e6;
    --orb-2: #fff0e0;
    --orb-3: #ffeadd;
}

/* 深色模式 */
[data-theme="dark"] {
    --sidebar-bg: rgba(20, 20, 20, 0.6);
    --sidebar-text: rgba(255, 255, 255, 0.8);
    --sidebar-active-bg: rgba(255, 255, 255, 0.1);
    --sidebar-active-text: #FF6901;
    --card-bg: rgba(30, 30, 30, 0.4);
    --bg-color: #050505;
    --text-color: #f7fafc;
    --text-muted: rgba(255, 255, 255, 0.6);
    --text-muted-light: rgba(255, 255, 255, 0.4);
    --bg-secondary: rgba(255, 255, 255, 0.05);
    --border-color: rgba(255, 255, 255, 0.05);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    --sidebar-shadow: 4px 0 24px rgba(0, 0, 0, 0.4);
    --orb-1: #4a1c03;
    --orb-2: #2c1e0b;
    --orb-3: #662200;
}

/* 字体定义 */
@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;
}

/* 全局基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Alibaba PuHuiTi", "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
}

html {
    font-size: 14px;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: color 0.3s, background-color 0.3s;
}

/* 滚动条美化 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
}

/* 通用工具类 */
.hidden {
    display: none !important;
}

.text-muted {
    color: var(--text-muted) !important;
}

.text-muted-light {
    color: var(--text-muted-light) !important;
}

.text-sm {
    font-size: 0.85rem !important;
}

.text-xs {
    font-size: 0.75rem !important;
}

.font-normal {
    font-weight: 400 !important;
}

.desc {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.hint {
    display: block;
    margin-top: 6px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* 动态背景 */
.bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    background: var(--bg-color);
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.6;
    animation: float 20s ease-in-out infinite;
}

.orb-1 {
    width: 500px;
    height: 500px;
    background: var(--orb-1);
    top: -100px;
    left: -100px;
    animation-delay: 0s;
}

.orb-2 {
    width: 400px;
    height: 400px;
    background: var(--orb-2);
    top: 50%;
    right: -100px;
    animation-delay: -5s;
}

.orb-3 {
    width: 350px;
    height: 350px;
    background: var(--orb-3);
    bottom: -50px;
    left: 30%;
    animation-delay: -10s;
}

@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);
    }
}

/* 卡片组件 */
.card {
    background: var(--card-bg);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    margin-bottom: 20px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: var(--shadow);
}

.card-header {
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0;
    color: var(--text-color);
}

.card-body {
    padding: 1.5rem;
    overflow-x: auto;
    transition: all 0.3s ease;
}

/* 卡片折叠按钮 */
.card-toggle-btn {
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 1.2rem;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
    padding: 0;
    line-height: 1;
}

.card-toggle-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--primary-color);
}

/* 表单组件 */
.form-group {
    margin-bottom: 1.2rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.8rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
}

.form-control {
    display: block;
    width: 100%;
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    color: var(--text-color);
    background-color: rgba(255, 255, 255, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.3s;
    height: 40px;
}

textarea.form-control {
    height: auto;
    min-height: 80px;
    resize: vertical;
}

.form-control:focus {
    outline: 0;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 105, 1, .15);
    background-color: #fff;
}

.form-control-sm {
    height: 30px;
    padding: 0.3rem 0.75rem;
    font-size: 0.8rem;
}

/* 表单 - 深色模式 */
[data-theme="dark"] .form-control {
    background-color: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.1);
    color: #fff;
}

[data-theme="dark"] .form-control:focus {
    background-color: rgba(255, 255, 255, 0.12);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 105, 1, 0.2);
}

/* 下拉菜单 - 深色模式 */
[data-theme="dark"] select.form-control,
[data-theme="dark"] select.filter-select,
[data-theme="dark"] .form-control-sm {
    color-scheme: dark;
    background-color: rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

[data-theme="dark"] select.form-control option,
[data-theme="dark"] select.filter-select option,
[data-theme="dark"] .form-control-sm option {
    background: #2a2a2a !important;
    color: #fff !important;
}

[data-theme="dark"] select.form-control option:checked,
[data-theme="dark"] select.filter-select option:checked,
[data-theme="dark"] .form-control-sm option:checked {
    background: #3a3a3a !important;
    color: #fff !important;
}

/* 按钮组件 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    border: 1px solid transparent;
    padding: 0 1.25rem;
    font-size: 0.9rem;
    border-radius: 8px;
    transition: all 0.3s;
    letter-spacing: 0.5px;
    line-height: 1;
}

.btn-primary {
    background: #FF6901;
    color: #fff;
}

.btn-primary:hover {
    background: #f3690d;
    transform: translateY(-2px);
}

.btn-outline {
    background: rgba(255, 105, 1, 0.05);
    border: 1px solid rgba(255, 105, 1, 0.5);
    color: #FF6901;
    backdrop-filter: blur(5px);
    box-shadow: 0 0 10px rgba(255, 105, 1, 0.1), inset 0 0 5px rgba(255, 105, 1, 0.05);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn-outline:hover {
    background: #FF6901;
    color: #fff;
}

.btn-sm {
    padding: 0 1rem;
    font-size: 0.85rem;
    min-width: 40px;
}

.btn-xs {
    height: 30px;
    padding: 0 0.75rem;
    font-size: 0.8rem;
    min-width: 30px;
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn-danger {
    background: rgba(220, 53, 69, .1);
    color: #ef4444;
    border: 1px solid rgba(220, 53, 69, .4);
}

.btn-danger:hover {
    background: rgba(220, 53, 69, .2);
}

.btn-danger-solid {
    background: #ef4444;
    color: #fff;
    border: 1px solid #ef4444;
}

.btn-danger-solid:hover {
    background: #dc2626;
}

/* 弹窗组件 */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    width: 100%;
    max-width: 400px;
    overflow: hidden;
    position: relative;
    z-index: 1;
}

.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    border-radius: 8px;
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--bg-secondary);
}

.modal-body {
    padding: 20px;
}

.modal-body p {
    color: var(--text-muted);
    line-height: 1.6;
}

.modal-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 12px;
}

.modal-footer .btn {
    flex: 1;
    position: relative;
    z-index: 1;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 0;
}

/* 复选框组件 */
.checkmark {
    width: 18px;
    height: 18px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-secondary);
    position: relative;
    transition: all 0.2s ease;
}

.checkbox-label:hover .checkmark {
    border-color: #FF6901;
}

.checkbox-label input:checked~.checkmark {
    background: #FF6901;
    border-color: #FF6901;
}

.checkbox-label input:checked~.checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

/* 带 label 的复选框容器 */
.checkbox-label {
    display: inline-flex;
    align-items: center;
    position: relative;
    padding-left: 28px;
    cursor: pointer;
    font-size: 0.9rem;
    user-select: none;
    color: var(--text-color);
    margin-right: 20px;
}

.checkbox-label input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkbox-label .checkmark {
    position: absolute;
    top: 0;
    left: 0;
}

/* 标签组件 */
/* 会员类型专用标签 */
.tag-member-permanent {
    background: rgba(255, 105, 1, 0.15);
    color: #FF6901;
    border: 1px solid rgba(255, 105, 1, 0.3);
}

.tag-member-temp {
    background: rgba(236, 72, 153, 0.15);
    color: #ec4899;
    border: 1px solid rgba(236, 72, 153, 0.3);
}

.tag-member-daily {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.tag-member-weekly {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.tag-member-monthly {
    background: rgba(255, 0, 0, 0.15);
    color: #ff0000;
    border: 1px solid rgba(255, 0, 0, 0.3);
}

.tag-member-quarterly {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.tag-member-yearly {
    background: rgba(139, 92, 246, 0.15);
    color: #8b5cf6;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.tag-member-default {
    background: rgba(156, 163, 175, 0.15);
    color: #9ca3af;
    border: 1px solid rgba(156, 163, 175, 0.3);
}

/* 文本颜色辅助类 */
.text-success {
    color: var(--c-success);
}

.text-warning {
    color: var(--c-warning);
}

.text-danger {
    color: var(--c-danger);
}

.text-primary {
    color: var(--primary-color) !important;
}

/* 下拉菜单组件 */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-toggle {
    cursor: pointer;
    user-select: none;
}

.dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 8px;
    min-width: 80px;
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    overflow: hidden;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-menu.dropdown-up {
    top: auto;
    bottom: 100%;
    margin-top: 0;
    margin-bottom: 5px;
}

.dropdown-item {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 12px;
    color: var(--text-color);
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}

.dropdown-item:hover {
    background: var(--bg-secondary);
}

/* 通用表格组件 */
.node-list-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: 8px 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.8rem;
}

.node-table tbody tr:hover {
    background: rgba(0, 0, 0, 0.02);
}

.node-table .node-type {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

.node-table .node-type.node {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
}

.node-table .node-type.proxy {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.node-table .ping-good {
    color: #22c55e;
    font-weight: 600;
}

.node-table .ping-medium {
    color: #f59e0b;
    font-weight: 600;
}

.node-table .ping-bad {
    color: #ef4444;
    font-weight: 600;
}

.node-table .ping-fail {
    color: var(--text-muted);
}

.node-table .ping-testing {
    color: var(--c-info);
}

.table-empty {
    text-align: center !important;
    color: var(--text-muted);
    padding: 60px 20px !important;
    font-size: 0.9rem;
}

[data-theme="dark"] .node-table th {
    background: rgba(255, 255, 255, 0.03);
}

[data-theme="dark"] .node-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

/* 网络检测卡片 */
.latency-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.latency-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1rem;
    border: 1px solid var(--border-color);
    transition: all 0.3s;
}

.latency-card:hover {
    box-shadow: 0 8px 24px rgba(255, 105, 1, 0.1);
    transform: translateY(-2px);
    border-color: var(--primary-color);
}

.latency-card-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.latency-card-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.latency-card-icon svg {
    width: 100%;
    height: 100%;
}

.latency-card-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-color);
}

.latency-value {
    margin-left: auto;
    font-size: 0.75rem;
    font-weight: 600;
}

.latency-card-region {
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
}

.latency-card-region-domestic {
    background: rgba(255, 105, 1, 0.1);
    color: var(--primary-color);
}

.latency-card-region-international {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.latency-card-content {
    margin-top: 1rem;
}

.latency-bars {
    display: flex;
    gap: 3px;
    height: 6px;
    align-items: flex-end;
}

.latency-bar {
    flex: 1;
    height: 100%;
    border-radius: 2px;
    background: var(--border-color);
    transition: background-color 0.3s;
}

.latency-bar.loading {
    animation: latencyPulse 1s ease-in-out infinite;
    background: rgba(250, 171, 65, 0.4);
}

@keyframes latencyPulse {
    0%, 100% {
        opacity: 0.4;
    }
    50% {
        opacity: 0.8;
    }
}

/* 延迟颜色 */
.latency-0-49 {
    color: #22c55e;
}

.latency-50-99 {
    color: #84cc16;
}

.latency-100-149 {
    color: #eab308;
}

.latency-150-199 {
    color: #f97316;
}

.latency-200-plus {
    color: #ef4444;
}

.latency-error {
    color: #9ca3af;
}

/* IP 可点击 */
.latency-ip {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 6px;
    word-break: break-all;
}

.latency-ip.clickable {
    cursor: pointer;
    color: var(--primary-color);
}

.latency-ip.clickable:hover {
    opacity: 0.8;
}

/* 原子工具类 */
/* Flex */
.flex {
    display: flex;
}

.flex-col {
    display: flex;
    flex-direction: column;
}

.flex-wrap {
    flex-wrap: wrap;
}

.flex-1 {
    flex: 1;
}

.flex-center {
    display: flex;
    align-items: center;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.flex-end {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

/* Gap */
.gap-5 {
    gap: 5px;
}

.gap-8 {
    gap: 8px;
}

.gap-10 {
    gap: 10px;
}

.gap-15 {
    gap: 15px;
}

.gap-20 {
    gap: 20px;
}

/* Margin */
.m-0 {
    margin: 0;
}

.ml-auto {
    margin-left: auto;
}

.mr-auto {
    margin-right: auto;
}

.mt-5 {
    margin-top: 5px;
}

.mt-10 {
    margin-top: 10px;
}

.mt-15 {
    margin-top: 15px;
}

.mt-20 {
    margin-top: 20px;
}

.mb-5 {
    margin-bottom: 5px;
}

.mb-10 {
    margin-bottom: 10px;
}

.mb-15 {
    margin-bottom: 15px;
}

.mb-20 {
    margin-bottom: 20px;
}

/* Padding */
.p-0 {
    padding: 0;
}

.p-10 {
    padding: 10px;
}

.p-15 {
    padding: 15px;
}

.p-20 {
    padding: 20px;
}

/* Width/Height */
.w-auto {
    width: auto;
}

.w-full {
    width: 100%;
}

/* Text */
.text-center {
    text-align: center;
}

.font-medium {
    font-weight: 500;
}

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Border Radius */
.rounded {
    border-radius: 8px;
}

.rounded-lg {
    border-radius: 12px;
}

.rounded-full {
    border-radius: 9999px;
}

/* Display */
.block {
    display: block;
}

.inline-block {
    display: inline-block;
}

.inline-flex {
    display: inline-flex;
}

/* Position */
.relative {
    position: relative;
}

.absolute {
    position: absolute;
}

/* Cursor */
.cursor-pointer {
    cursor: pointer;
}

/* 警告提示框 */
.alert {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.alert-warning {
    background: rgba(255, 176, 80, .1);
    color: rgb(255, 176, 80);
    padding: 10px 12px;
    border-radius: 6px;
    border: 1px solid rgba(255, 176, 80, .2);
}

/* 危险卡片 */
.card-danger {
    border-color: rgba(220, 53, 69, .3);
}

.card-danger .card-header {
    background: rgba(220, 53, 69, .1);
}

/* 响应式适配 - 网络检测卡片 */
@media (max-width: 900px) {
    .latency-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .latency-card {
        padding: 0.85rem;
    }

    .latency-card-title {
        gap: 0.4rem;
        margin-bottom: 0.5rem;
    }

    .latency-card-icon {
        width: 18px;
        height: 18px;
    }

    .latency-card-name {
        font-size: 0.8rem;
    }

    .latency-value {
        font-size: 0.7rem;
    }

    .latency-card-region {
        font-size: 0.6rem;
        padding: 1px 5px;
    }
}

@media (max-width: 600px) {
    .latency-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.6rem;
    }

    .latency-card {
        padding: 0.65rem;
        border-radius: 8px;
    }

    .latency-card-title {
        gap: 0.35rem;
        margin-bottom: 0.4rem;
    }

    .latency-card-icon {
        width: 16px;
        height: 16px;
    }

    .latency-card-name {
        font-size: 0.72rem;
    }

    .latency-value {
        font-size: 0.65rem;
    }

    .latency-card-region {
        font-size: 0.55rem;
        padding: 1px 4px;
    }

    .latency-card-content {
        margin-top: 0.35rem;
    }

    .latency-bars {
        height: 4px;
        gap: 2px;
    }
}

@media (max-width: 400px) {
    .latency-cards {
        gap: 0.5rem;
    }

    .latency-card {
        padding: 0.5rem;
    }

    .latency-card-icon {
        width: 14px;
        height: 14px;
    }

    .latency-card-name {
        font-size: 0.65rem;
    }

    .latency-value {
        font-size: 0.6rem;
    }

    .latency-card-region {
        font-size: 0.5rem;
    }
}

/* 密码输入框组件 */
.password-wrapper {
    position: relative;
}

.password-wrapper input {
    padding-right: 40px;
}

.eye-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    color: var(--text-muted);
    padding: 5px;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.eye-btn:hover {
    opacity: 1;
}

/* 搜索框组件 */
.search-box {
    flex: 1;
    min-width: 200px;
    display: flex;
    gap: 8px;
}

.search-box input {
    flex: 1;
    height: 38px;
    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;
}

.search-box input:focus {
    outline: 0;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 105, 1, .15);
}

[data-theme="dark"] .search-box input {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* 筛选下拉框 */
.filter-select {
    height: 38px;
    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;
}

.filter-select:focus {
    outline: 0;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 105, 1, .15);
}

[data-theme="dark"] .filter-select {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.1);
    color: #fff;
}

[data-theme="dark"] .filter-select option {
    background-color: #2a2a2a;
    color: #fff;
}

[data-theme="dark"] .filter-select option:checked {
    background-color: #3a3a3a;
    color: #fff;
}

/* 加载动画 - Spinner */
.loading-spinner {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 滚动进入动画 */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.fade-in-left {
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.fade-in-right {
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in-right.visible {
    opacity: 1;
    transform: translateX(0);
}

/* 延迟动画 */
.delay-1 {
    transition-delay: 0.1s;
}

.delay-2 {
    transition-delay: 0.2s;
}

.delay-3 {
    transition-delay: 0.3s;
}

.delay-4 {
    transition-delay: 0.4s;
}

.delay-5 {
    transition-delay: 0.5s;
}

/* 操作反馈动画 */
@keyframes count-up {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-count {
    animation: count-up 0.4s ease-out;
}

/* 帮助链接 */
.help-link {
    display: inline-block;
    font-size: 0.85rem;
    color: var(--primary-color);
    margin-top: 6px;
    text-decoration: none;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.help-link:hover {
    opacity: 1;
    text-decoration: underline;
}

/* 二维码容器 */
#qrcode-container,
#guest-qrcode-container,
#user-qrcode-container {
    background: #fff;
    padding: 12px;
    border-radius: 12px;
    width: fit-content;
    margin: 0 auto;
}

#qrcode-container canvas,
#guest-qrcode-container canvas,
#user-qrcode-container canvas,
#qrcode-container img {
    display: block;
}
