* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 全局滚动条样式优化 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

::-webkit-scrollbar-thumb:active {
    background: #818181;
}

/* Firefox 滚动条 */
body {
    scrollbar-width: thin;
    scrollbar-color: #c1c1c1 #f1f1f1;
}

.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 1000;
    pointer-events: none;
}

.toast {
    padding: 12px 24px;
    border-radius: 10px;
    color: white;
    font-size: 14px;
    margin-bottom: 10px;
    opacity: 0;
    transform: translateX(100%);
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: auto;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast.success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.toast.error {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.toast.info {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f7fa;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.navbar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 0 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.navbar-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.navbar-logo {
    color: white;
    font-size: 24px;
    font-weight: 700;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.navbar-logo-img {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.navbar-logo-text {
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

.navbar-links {
    display: flex;
    gap: 20px;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.navbar-links a {
    color: white;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 8px;
    transition: background-color 0.3s;
}

.navbar-links a:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.navbar-links a.active {
    background-color: rgba(255, 255, 255, 0.3);
}

.navbar-group {
    position: relative;
}

.navbar-group > a {
    color: white;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 8px;
    transition: background-color 0.3s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.navbar-group > a:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.navbar-submenu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    min-width: 180px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
    overflow: hidden;
}

.navbar-group:hover .navbar-submenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.navbar-submenu a {
    display: block;
    padding: 10px 16px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    transition: background-color 0.2s;
}

.navbar-submenu a:hover {
    background-color: rgba(102, 126, 234, 0.1);
}

.navbar-submenu a.active {
    background-color: rgba(102, 126, 234, 0.2);
    color: #667eea;
}

.navbar-submenu a {
    display: flex;
    align-items: center;
    gap: 8px;
}

.submenu-icon {
    font-size: 14px;
    flex-shrink: 0;
}

.submenu-favicon {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    flex-shrink: 0;
}

.submenu-text {
    flex: 1;
}

.navbar-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 10px;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.navbar-toggle span {
    width: 25px;
    height: 3px;
    background-color: white;
    margin: 3px 0;
    border-radius: 2px;
    transition: all 0.3s;
}

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

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

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

.sidebar {
    position: fixed;
    top: 0;
    left: -200px;
    right: auto;
    width: 200px;
    height: 100vh;
    background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
    box-shadow: 2px 0 15px rgba(0, 0, 0, 0.1);
    z-index: 99;
    display: flex;
    flex-direction: column;
    transition: left 0.35s cubic-bezier(0.4, 0, 0.2, 1), right 0.35s cubic-bezier(0.4, 0, 0.2, 1), width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar.show {
    left: 0;
}

.sidebar.right {
    left: auto;
    right: -200px;
    box-shadow: -2px 0 15px rgba(0, 0, 0, 0.1);
}

.sidebar.right.show {
    right: 0;
}

.sidebar.collapsed {
    width: 60px;
}

.sidebar.collapsed.show {
    left: 0;
}

.sidebar.right.collapsed.show {
    left: auto;
    right: 0;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px;
    color: white;
    font-size: 18px;
    font-weight: 700;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar.collapsed .sidebar-logo {
    justify-content: center;
    gap: 0;
}

.sidebar-logo img {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    flex-shrink: 0;
}

.sidebar-logo span {
    white-space: nowrap;
    overflow: hidden;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar.collapsed .sidebar-logo span {
    opacity: 0;
    width: 0;
}

.sidebar-links {
    flex: 1;
    padding: 5px 5px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    overflow-y: auto;
}

.sidebar-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 0;
    color: white;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.3s;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-links a:hover {
    background-color: rgba(255, 255, 255, 0.15);
}

.sidebar-links a.active {
    background-color: rgba(255, 255, 255, 0.3);
}

.sidebar-group {
    margin-bottom: 3px;
}

.sidebar-group > a {
    display: flex;
    align-items: center;
    justify-content: space-evenly;
    padding: 5px 0;
    color: white;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.3s;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-group > a:hover {
    background-color: rgba(255, 255, 255, 0.15);
}

.sidebar-group > a::after {
    content: '▾';
    font-size: 12px;
    transition: transform 0.3s;
}

.sidebar-group.expanded > a::after {
    transform: rotate(180deg);
}

.sidebar-submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.sidebar-group.expanded .sidebar-submenu {
    max-height: 500px;
}

.sidebar-submenu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 15px 10px 45px;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 14px;
    border-radius: 8px;
    transition: all 0.3s;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-submenu a:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.sidebar-submenu a.active {
    background-color: rgba(255, 255, 255, 0.2);
}

.sidebar.collapsed .sidebar-group > a::after {
    display: none;
}

.sidebar.collapsed .sidebar-submenu {
    opacity: 0;
    visibility: hidden;
}

.sidebar-links a span {
    flex-shrink: 0;
}

.sidebar-links a .link-text {
    overflow: hidden;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar.collapsed .sidebar-links a .link-text {
    opacity: 0;
    width: 0;
    display: none;
}

.sidebar.collapsed .sidebar-links .sidebar-group.expanded .sidebar-submenu a .link-text {
    opacity: 1;
    width: auto;
    display: block;
}

.sidebar-links a .link-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.sidebar-links a .link-icon.initial-letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 16px;
    font-weight: 600;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.sidebar-favicon {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    flex-shrink: 0;
}

.sidebar-links::-webkit-scrollbar {
    width: 6px;
}

.sidebar-links::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.sidebar-links::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.sidebar-links::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.sidebar-links {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) rgba(255, 255, 255, 0.05);
}

body.sidebar-mode .navbar {
    display: none;
}

body.sidebar-mode .sidebar.show {
    left: 0;
}

body.sidebar-mode .sidebar.right.show {
    left: auto;
    right: 0;
}

body.sidebar-mode .main-content {
    padding-left: 200px;
    padding-top: 30px;
}

body.sidebar-mode .sidebar.right ~ .main-content {
    padding-left: 0;
    padding-right: 200px;
}

body.sidebar-mode .sidebar.collapsed ~ .main-content {
    padding-left: 60px;
}

/* 侧边栏收缩状态下的悬浮子菜单 */
body.sidebar-mode .sidebar.collapsed .sidebar-group {
    position: relative;
}

body.sidebar-mode .sidebar.collapsed .sidebar-submenu {
    position: fixed;
    left: 70px;
    right: auto;
    min-width: 200px;
    max-height: none;
    max-height: 400px;
    overflow-y: auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    padding: 8px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

body.sidebar-mode .sidebar.collapsed.right .sidebar-submenu {
    left: auto;
    right: 70px;
}

body.sidebar-mode .sidebar.collapsed .sidebar-group.expanded .sidebar-submenu {
    opacity: 1;
    visibility: visible;
}

body.sidebar-mode .sidebar.collapsed .sidebar-submenu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    color: #333;
    font-size: 14px;
    border-radius: 8px;
    white-space: nowrap;
}

body.sidebar-mode .sidebar.collapsed .sidebar-submenu a:hover {
    background-color: rgba(102, 126, 234, 0.1);
}

body.sidebar-mode .sidebar.collapsed .sidebar-submenu a.active {
    background-color: rgba(102, 126, 234, 0.2);
    color: #667eea;
}

body.sidebar-mode .sidebar.collapsed .sidebar-submenu .submenu-text {
    color: #333;
}

body.sidebar-mode .sidebar.collapsed .sidebar-group > a::after {
    display: none;
}

body.sidebar-mode .sidebar.right.collapsed ~ .main-content {
    padding-left: 0;
    padding-right: 60px;
}

.sidebar-toggle {
    padding: 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    gap: 10px;
}

.sidebar-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.sidebar.collapsed .sidebar-toggle {
    padding: 10px 0;
    gap: 8px;
}

.sidebar-toggle .toggle-collapse,
.sidebar-toggle .toggle-position {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    object-fit: contain;
    background-color: rgba(255, 255, 255, 0.1);
    padding: 6px;
}

.sidebar-toggle .toggle-collapse:hover,
.sidebar-toggle .toggle-position:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.sidebar.collapsed .sidebar-toggle .toggle-collapse {
    transform: rotate(180deg);
}

.sidebar.right .sidebar-toggle .toggle-collapse {
    transform: rotate(180deg);
}

.sidebar.right.collapsed .sidebar-toggle .toggle-collapse {
    transform: rotate(0deg);
}

.main-content {
    flex: 1;
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
    padding: 80px 10px 30px;
    transition: padding-top 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.footer {
    text-align: center;
    padding: 15px 30px;
    color: #999;
    font-size: 14px;
    margin-top: auto;
    background: #fff;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
    position: relative;
    transition: all 0.3s ease;
}

.footer-content {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
}

.contact-trigger {
    cursor: pointer;
    color: #667eea;
    font-weight: 500;
    transition: color 0.2s;
    margin-left: 20px;
}

.contact-trigger:hover {
    color: #764ba2;
}

.footer-link {
    cursor: pointer;
    color: #667eea;
    font-weight: 500;
    transition: color 0.2s;
    margin-left: 20px;
}

.footer-link:hover {
    color: #764ba2;
}

.qr-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    display: flex;
    justify-content: center;
    gap: 60px;
    padding: 0 20px;
}

.footer.expanded .qr-panel {
    max-height: 250px;
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.qr-group {
    display: flex;
    flex-direction: row;
    gap: 40px;
}

.qr-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.qr-item img {
    width: 120px;
    height: 120px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.qr-item span {
    font-size: 14px;
    color: #666;
}

.hero-section {
    text-align: center;
    padding: 60px 0;
}

.hero-section h1 {
    font-size: 42px;
    color: #333;
    margin-bottom: 20px;
}

.hero-section p {
    font-size: 18px;
    color: #666;
    margin-bottom: 40px;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.tool-card {
    background: white;
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    text-align: center;
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.tool-icon {
    font-size: 50px;
    margin-bottom: 20px;
}

.tool-card h3 {
    font-size: 20px;
    color: #333;
    margin-bottom: 10px;
}

.tool-card p {
    font-size: 14px;
    color: #888;
    line-height: 1.6;
}

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #667eea;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 8px;
}

.local-tool-notice {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeeba 100%);
    border: 2px solid #f59e0b;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 20px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

.local-tool-notice strong {
    color: #b45309;
    font-size: 16px;
}

.local-tool-notice a {
    color: #dc2626;
    font-weight: 700;
    text-decoration: none;
    padding: 6px 16px;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    border-radius: 8px;
    margin: 0 10px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.local-tool-notice a:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.4);
}

.local-tool-notice .notice-desc {
    color: #92400e;
    font-size: 14px;
    margin-left: 8px;
}

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

.back-to-top {
    position: fixed;
    bottom: 100px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 20%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    font-size: 24px;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s, transform 0.3s;
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.back-to-top:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

body.sidebar-mode .sidebar.right ~ .back-to-top {
    right: 220px;
}

body.sidebar-mode .sidebar.right.collapsed ~ .back-to-top {
    right: 80px;
}

@media (max-width: 768px) {
    .navbar {
        padding: 0 15px;
    }
    
    .navbar-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        padding: 15px;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
        z-index: 99;
        overflow: hidden;
    }
    
    .navbar-links.active {
        display: flex;
    }
    
    .navbar-links a {
        padding: 12px 16px;
        border-radius: 8px;
        margin-bottom: 5px;
    }
    
    .navbar-group {
        margin-bottom: 5px;
    }
    
    .navbar-group > a {
        padding: 12px 16px;
        border-radius: 8px;
    }
    
    .navbar-submenu {
        position: static;
        background: rgba(0, 0, 0, 0.1);
        box-shadow: none;
        min-width: auto;
        opacity: 1;
        visibility: visible;
        transform: none;
        margin-top: 5px;
        margin-left: 10px;
        border-radius: 8px;
        overflow: hidden;
        max-height: 0;
        transition: max-height 0.3s ease;
    }
    
    .navbar-group.expanded .navbar-submenu {
        max-height: 500px;
    }
    
    .navbar-submenu a {
        padding: 10px 16px;
        color: rgba(255, 255, 255, 0.9);
    }
    
    .navbar-submenu a:hover {
        background-color: rgba(255, 255, 255, 0.1);
    }
    
    .navbar-submenu a.active {
        background-color: rgba(255, 255, 255, 0.2);
        color: white;
    }
    
    .navbar-toggle {
        display: flex;
    }
    
    .main-content {
        padding: 80px 15px 30px;
    }

    body.sidebar-mode .sidebar {
        width: 100%;
        left: 0;
        z-index: 1001;
    }

    body.sidebar-mode .sidebar.collapsed {
        width: 60px;
    }
    
    body.sidebar-mode .main-content {
        padding-left: 0;
        padding-top: 30px;
    }
    
    body.sidebar-mode .sidebar.collapsed ~ .main-content {
        padding-left: 60px;
    }
    
    .hero-section h1 {
        font-size: 28px;
    }
    
    .hero-section p {
        font-size: 16px;
    }

    .footer-content {
        flex-direction: column;
        gap: 10px;
    }

    .qr-panel {
        gap: 20px;
        flex-wrap: wrap;
    }

    .qr-group {
        gap: 8px;
    }

    .qr-item img {
        width: 100px;
        height: 100px;
    }
}