:root {
    --bg-color: #ffffff;
    --sidebar-bg-color: #ffffff;
    --text-color: #222222;
    --text-color-light: #666666;
    --border-color: #eaeaea;
    --hover-bg-color: #fafafa;
    --accent-color: #222222;
    --accent-color-hover: #444444;
    --sidebar-width: 240px;
    --sidebar-width-collapsed: 60px;
    --header-height: 60px;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

/* Visually hidden class for accessibility and SEO */
.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-color);
    font-size: 14px;
    line-height: 1.5;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

@media (min-width: 769px) {
    body {
        padding-bottom: 28px;
    }
}

body::-webkit-scrollbar {
    display: none;
}

.container {
    display: flex;
    min-height: 100vh;
}

/* --- Sidebar --- */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg-color);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
}

.sidebar.collapsed {
    width: var(--sidebar-width-collapsed);
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    height: var(--header-height);
    flex-shrink: 0;
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    overflow: hidden;
}

.logo-image {
    height: 16px;
    width: auto;
    transition: opacity 0.2s ease-in-out;
    margin-left: 4px;
}

.sidebar.collapsed .logo-image {
    opacity: 0;
}

.sidebar-toggle {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-color-light);
    padding: 0.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
}
.sidebar-toggle:hover {
    color: var(--text-color);
    background-color: var(--hover-bg-color);
}

.sidebar-toggle svg {
    width: 18px;
    height: 18px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    padding: 0.5rem;
    flex: 1;
}

.sidebar-footer {
    padding: 1rem;
    margin-top: auto;
    margin-bottom: 1rem;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 0.6rem 0.8rem;
    border-radius: 10px;
    margin: 0.1rem 0.5rem;
    color: #374151;
    text-decoration: none;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
}

.nav-link:hover {
    background-color: var(--hover-bg-color);
}
.nav-link.active {
    background-color: var(--hover-bg-color);
    font-weight: 600;
    color: var(--text-color);
}

.nav-link svg {
    margin-right: 0.75rem;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: var(--text-color-light);
}

.sidebar.collapsed .nav-link span {
    display: none;
}
.sidebar.collapsed .nav-link {
    justify-content: center;
    margin: 0.1rem 0;
}
.sidebar.collapsed .nav-link svg {
    margin-right: 0;
}

.sidebar.collapsed ~ .main-content {
    margin-left: var(--sidebar-width-collapsed);
}

/* --- Main Content --- */
.main-content {
    flex: 1;
    padding: 1.5rem 2rem;
    overflow-y: auto;
    margin-left: var(--sidebar-width);
    transition: margin-left 0.3s ease;
}

.main-content::-webkit-scrollbar {
    display: none;
}

.guide-section {
    max-width: 680px;
    margin: 1.5rem auto;
    text-align: center;
}

.form-container {
    padding: 1.5rem;
    border-radius: 12px;
}

.main-logo {
    height: 36px;
    margin-bottom: 0.75rem;
}

.subtitle {
    font-size: 0.9rem;
    color: var(--text-color-light);
    margin-bottom: 1.5rem;
}

/* --- Proxy Form --- */
.proxy-form {
    display: flex;
    align-items: center;
    position: relative;
    max-width: 560px;
    margin: 0 auto;
}

.input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-color-light);
    pointer-events: none;
    z-index: 1;
    width: 16px;
    height: 16px;
}

.proxy-input {
    flex: 1;
    height: 44px;
    padding: 0 1rem 0 3rem;
    font-size: 0.95rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: #fcfcfc;
    transition: border-color 0.2s, box-shadow 0.2s;
    -webkit-appearance: none;
    appearance: none;
    position: relative;
}

.proxy-input.loading {
    background: linear-gradient(90deg, #fcfcfc 0%, #f0f0f0 50%, #fcfcfc 100%);
    background-size: 200% 100%;
    animation: inputLoading 2s ease-in-out;
    border-color: #999999;
}

@keyframes inputLoading {
    0% { 
        background-position: -200% 0;
        border-color: #999999;
    }
    50% { 
        background-position: 200% 0;
        border-color: #666666;
    }
    100% { 
        background-position: 200% 0;
        border-color: #999999;
    }
}

.proxy-input:focus {
    outline: none;
    border-color: #999999;
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}

.proxy-button {
    width: 40px;
    height: 40px;
    margin-left: 0.5rem;
    border: 1px solid transparent;
    background-color: var(--accent-color);
    color: white;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
    flex-shrink: 0;
}

.proxy-button:hover {
    background-color: var(--accent-color-hover);
}

/* --- Docs Section --- */
.docs-section {
    max-width: 680px;
    margin: 3rem auto;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    text-align: left;
}

.docs-header {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.docs-header svg {
    margin-right: 0.75rem;
    color: var(--text-color-light);
    width: 20px;
    height: 20px;
}

.docs-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
}

.docs-content p {
    margin-bottom: 1rem;
    color: var(--text-color-light);
    font-size: 0.9rem;
}

.docs-content pre {
    padding: 1rem 1.25rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    white-space: pre-wrap;
    word-break: break-all;
    margin-bottom: 1rem;
}

.docs-content code {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace;
    font-size: 0.85rem;
    color: var(--text-color);
}

/* --- Nodes Section --- */
.nodes-section {
    max-width: 680px;
    margin: 3rem auto;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    text-align: left;
}

.nodes-header {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

.nodes-header svg {
    margin-right: 0.75rem;
    color: var(--text-color-light);
    width: 20px;
    height: 20px;
}

.nodes-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
}

.nodes-content p {
    font-size: 0.9rem;
    color: var(--text-color-light);
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.node-address {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace;
    color: var(--text-color);
    text-decoration: none;
}

.node-address:hover {
    text-decoration: underline;
}

.flag-icon {
    margin: 0 0.5rem 0 0.75rem;
}

/* --- Language Switch --- */
.language-switch {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-color-light);
    padding: 0.5rem 0;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.2s;
    width: 100%;
    text-align: left;
}

/* Desktop - Hide mobile elements */
@media (min-width: 769px) {
    .mobile-header {
        display: none !important;
    }
    
    .mobile-overlay {
        display: none !important;
    }
}

.nodes-footer {
    font-size: 0.85rem;
    color: var(--text-color-light);
    text-align: center;
    margin-top: 2rem;
}

/* --- Status Page Styles --- */
.status-title {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.stats-section {
    max-width: 680px;
    margin: 3rem auto;
    text-align: left;
}

.stats-header {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

.stats-header svg {
    margin-right: 0.75rem;
    color: var(--text-color-light);
    width: 20px;
    height: 20px;
}

.stats-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
}

.stats-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.stat-row:last-child {
    border-bottom: none;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-color-light);
    font-weight: 500;
}

.stat-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace;
}

.stat-value.loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 4px;
    height: 1.5rem;
    width: 80px;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    body {
        font-size: 14px;
        padding-bottom: 0;
    }
    
    .container {
        flex-direction: column;
    }
    
    /* Mobile Sidebar */
    .sidebar {
        position: fixed !important;
        top: 0 !important;
        left: -100% !important;
        width: 280px !important;
        height: 100vh !important;
        background-color: var(--sidebar-bg-color) !important;
        border-right: 1px solid var(--border-color) !important;
        transform: translateX(0) !important;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
        z-index: 1002 !important;
        flex-direction: column !important;
        display: flex !important;
        box-shadow: 2px 0 8px rgba(0,0,0,0.1) !important;
        will-change: left !important;
    }
    
    .sidebar.mobile-open {
        left: 0 !important;
    }
    
    .sidebar.collapsed {
        width: 280px !important;
        left: -100% !important;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    }
    
    .sidebar.collapsed.mobile-open {
        left: 0 !important;
    }
    
    /* Mobile Header */
    .mobile-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 1rem;
        height: var(--header-height);
        background-color: var(--bg-color);
        border-bottom: 1px solid var(--border-color);
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        z-index: 1000;
    }
    
    .mobile-menu-btn {
        background: none;
        border: none;
        cursor: pointer;
        color: var(--text-color);
        padding: 0.5rem;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 6px;
    }
    
    .mobile-menu-btn:hover {
        background-color: var(--hover-bg-color);
    }
    
    .mobile-menu-btn svg {
        width: 20px;
        height: 20px;
    }
    
    .mobile-logo {
        display: flex;
        align-items: center;
    }
    
    .mobile-logo img {
        height: 20px;
        width: auto;
    }
    
    .language-switch-mobile {
        background: none;
        border: none;
        cursor: pointer;
        color: var(--text-color-light);
        padding: 0.5rem;
        border-radius: 6px;
        font-size: 0.8rem;
        font-weight: 500;
    }
    
    .language-switch-mobile:hover {
        background-color: var(--hover-bg-color);
        color: var(--text-color);
    }
    
    /* Mobile Overlay */
    .mobile-overlay {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
        background-color: rgba(0, 0, 0, 0.5) !important;
        z-index: 1001 !important;
        opacity: 0 !important;
        visibility: hidden !important;
        transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
        will-change: opacity !important;
    }
    
    .mobile-overlay.active {
        opacity: 1 !important;
        visibility: visible !important;
    }
    
    /* Sidebar Navigation on Mobile */
    .sidebar-nav {
        flex-direction: column;
        padding: 1rem 0.5rem;
        flex: 1;
    }
    
    .nav-link {
        padding: 0.8rem;
        margin: 0.2rem 0;
        border-radius: 8px;
    }
    
    .nav-link span {
        display: inline;
    }
    
    .nav-link svg {
        margin-right: 0.75rem;
    }
    
    .sidebar-footer {
        padding: 1rem;
        border-top: none;
    }
    
    /* Main Content */
    .main-content {
        margin-left: 0;
        margin-top: var(--header-height);
        padding: 1rem 1.5rem;
        padding-bottom: 2rem;
    }
    
    .sidebar.collapsed ~ .main-content {
        margin-left: 0;
    }
    
    /* Content Sections */
    .guide-section, .docs-section, .nodes-section, .stats-section {
        margin: 1.5rem 0;
        padding: 0;
        max-width: 100%;
        border-top: none !important;
        padding-top: 0 !important;
    }
    
    .form-container {
        padding: 1rem 0;
    }
    
    .status-title, .title {
        font-size: 1.8rem;
        text-align: center;
        margin-bottom: 1rem;
    }
    
    .subtitle {
        text-align: center;
        margin-bottom: 1.5rem;
        font-size: 0.9rem;
        padding: 0 1rem;
    }
    
    .main-logo {
        height: 32px;
        margin-bottom: 1rem;
    }
    
    /* Section Headers */
    .docs-header, .nodes-header, .stats-header {
        margin-bottom: 1rem;
    }
    
    .docs-header h2, .nodes-header h2, .stats-header h2 {
        font-size: 1rem;
    }
    
    /* Content Typography */
    .docs-content p, .nodes-content p {
        font-size: 0.9rem;
        line-height: 1.6;
        margin-bottom: 1rem;
    }
    
    .docs-content pre {
        padding: 0.75rem 1rem;
        font-size: 0.8rem;
        margin: 1rem 0;
        overflow-x: auto;
    }
    
    /* Stats Section */
    .stat-row {
        padding: 1rem 0;
        border-bottom: none !important;
    }
    
    .stat-label {
        font-size: 0.9rem;
    }
    
    /* Mobile Proxy Form - 重置所有表单样式 */
    .proxy-form {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        position: relative !important;
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 !important;
        gap: 1rem !important;
    }
    
    .proxy-input {
        flex: none !important;
        width: 100% !important;
        height: 48px !important;
        margin: 0 !important;
        padding: 0 1rem 0 3rem !important;
        font-size: 16px !important;
        border: 1px solid var(--border-color) !important;
        border-radius: 8px !important;
        background-color: #fcfcfc !important;
        box-sizing: border-box !important;
        -webkit-appearance: none !important;
        appearance: none !important;
    }
    
    .proxy-button {
        flex: none !important;
        width: 100% !important;
        height: 48px !important;
        margin: 0 !important;
        margin-left: 0 !important;
        border: 1px solid transparent !important;
        background-color: var(--accent-color) !important;
        color: white !important;
        border-radius: 8px !important;
        cursor: pointer !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    .input-icon {
        position: absolute !important;
        left: 1rem !important;
        top: 14px !important; /* (48px - 18px) / 2 = 15px，微调-1px */
        width: 18px !important;
        height: 18px !important;
        color: var(--text-color-light) !important;
        pointer-events: none !important;
        z-index: 2 !important;
        transform: none !important;
    }
    
    .stat-value {
        font-size: 1rem;
    }
    
    /* Hide Status Bar on Mobile */
    .status-bar {
        display: none !important;
    }
    
    /* Show mobile header, hide desktop sidebar header */
    .mobile-header {
        display: flex !important;
    }
    
    .sidebar-header {
        display: none;
    }
}

/* --- News Page Styles --- */
.news-section {
    max-width: 680px;
    margin: 3rem auto;
    text-align: left;
}

.news-header {
    display: flex;
    align-items: center;
    margin-bottom: 2rem;
    color: var(--text-color);
}

.news-header svg {
    margin-right: 0.75rem;
    color: var(--text-color-light);
    width: 20px;
    height: 20px;
}

.news-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
}

.news-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.news-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background-color: #fcfcfc;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.news-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border-color: #ddd;
}

.news-badge {
    flex-shrink: 0;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
}

.news-badge.performance {
    background-color: #e3f2fd;
    color: #1565c0;
}

.news-badge.feature {
    background-color: #e8f5e8;
    color: #2e7d32;
}

.news-badge.expansion {
    background-color: #fff3e0;
    color: #f57c00;
}

.news-badge.monitoring {
    background-color: #f3e5f5;
    color: #7b1fa2;
}

.news-details {
    flex: 1;
}

.news-details h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.news-date {
    font-size: 0.8rem;
    color: var(--text-color-light);
    margin-bottom: 0.75rem;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace;
}

.news-details p:last-child {
    font-size: 0.9rem;
    color: var(--text-color-light);
    line-height: 1.5;
    margin-bottom: 0;
}

/* --- Services Section --- */
.services-section {
    max-width: 680px;
    margin: 3rem auto;
    text-align: left;
}

.services-header {
    display: flex;
    align-items: center;
    margin-bottom: 2rem;
    color: var(--text-color);
}

.services-header svg {
    margin-right: 0.75rem;
    color: var(--text-color-light);
    width: 20px;
    height: 20px;
}

.services-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.service-card {
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background-color: #fcfcfc;
    text-align: center;
    transition: box-shadow 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.service-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #ddd;
    transform: translateY(-2px);
}

.service-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--hover-bg-color);
    border-radius: 12px;
}

.service-icon svg {
    width: 24px;
    height: 24px;
    color: var(--text-color);
}

.service-card h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.75rem;
}

.service-card p {
    font-size: 0.9rem;
    color: var(--text-color-light);
    line-height: 1.5;
    margin-bottom: 0;
}

/* Mobile Responsive for News Page */
@media (max-width: 768px) {
    .news-section, .services-section {
        margin: 1.5rem 0;
        padding: 0;
        max-width: 100%;
    }
    
    .news-item {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    
    .news-badge {
        align-self: flex-start;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .service-card {
        padding: 1rem;
        text-align: left;
    }
    
    .service-icon {
        margin: 0 0 1rem 0;
        width: 40px;
        height: 40px;
    }
    
    .service-icon svg {
        width: 20px;
        height: 20px;
    }
}

/* --- Status Bar --- */
.status-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 28px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid rgba(234, 234, 234, 0.5);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    font-size: 0.8rem;
    color: var(--text-color-light);
    z-index: 1000;
}

.status-bar-left,
.status-bar-right {
    display: flex;
    align-items: center;
}

.status-bar-item {
    display: flex;
    align-items: center;
    margin-right: 1.25rem;
    text-decoration: none;
    color: var(--text-color-light);
    transition: color 0.2s;
}

.status-bar-item:hover {
    color: var(--text-color);
}

.status-bar-right .status-bar-item:last-child {
    margin-right: 0;
}

.status-bar-icon {
    width: 14px;
    height: 14px;
    margin-right: 0.5rem;
} 