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

/* 确保导航图标不会被其他元素遮挡 */
body {
    position: relative;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    background: #f5f5f5;
    min-height: 100vh;
    padding: 20px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    padding: 40px;
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.container:hover {
    transform: translateY(-2px);
    box-shadow: 0 25px 70px rgba(0,0,0,0.25);
}

header {
    text-align: center;
    margin-bottom: 30px;
    position: relative;
}

.language-switcher {
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    align-items: center;
}

.language-switcher .lang-toggle-container {
    position: relative;
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.95);
    border: 1.5px solid #e0e0e0;
    border-radius: 24px;
    padding: 4px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    min-width: 140px;
    height: 36px;
}

.language-switcher .lang-toggle-container:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    border-color: #667eea;
}

.language-switcher .lang-option {
    position: relative;
    z-index: 2;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 500;
    color: #666;
    transition: color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    padding: 0 12px;
}

.language-switcher .lang-toggle-container.lang-zh .lang-option-zh,
.language-switcher .lang-toggle-container.lang-en .lang-option-en {
    color: #667eea;
    font-weight: 600;
}

.language-switcher .lang-toggle-bg {
    position: absolute;
    top: 4px;
    left: 4px;
    width: calc(50% - 4px);
    height: calc(100% - 8px);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.3);
}

.language-switcher .lang-toggle-container.lang-en .lang-toggle-bg {
    transform: translateX(100%);
}

.language-switcher .lang-toggle-slider {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 20px;
}

@media (max-width: 768px) {
    .language-switcher {
        position: static;
        justify-content: center;
        margin-bottom: 20px;
    }
}

h1 {
    font-size: 2.5rem;
    color: #1a202c;
    margin-bottom: 12px;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.subtitle {
    color: #718096;
    font-size: 1.1rem;
    font-weight: 400;
    margin-bottom: 8px;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #2d3748;
    font-size: 0.95rem;
    letter-spacing: 0.2px;
}

input, textarea {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
    background: #fafafa;
}

input:focus, textarea:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

textarea {
    min-height: 150px;
    resize: vertical;
}

.btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    margin-right: 10px;
    margin-bottom: 10px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.btn:hover::before {
    left: 100%;
}

.btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.4);
}

.result {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    word-break: break-all;
}

.result-item {
    margin-bottom: 20px;
    padding: 20px;
    border-left: 4px solid #667eea;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    position: relative;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.result-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateX(4px);
}

.result-title {
    font-weight: 700;
    margin-bottom: 12px;
    color: #1a202c;
    font-size: 1.15rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.result-title::before {
    content: '▶';
    color: #667eea;
    font-size: 0.9em;
}

.result-value {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace;
    word-break: break-all;
    white-space: pre-wrap;
    color: #2d3748;
    font-size: 0.95rem;
    font-weight: 500;
    margin: 12px 0;
    padding: 12px 16px;
    background: #f7fafc;
    border-radius: 6px;
    overflow-x: auto;
    clear: both;
    display: block;
    min-width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    border: 1px solid #e2e8f0;
    line-height: 1.6;
}

.copy-btn {
    background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.copy-btn::before {
    content: '📋';
    font-size: 0.9em;
}

.copy-btn:hover {
    background: linear-gradient(135deg, #45a049 0%, #3d8b40 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(76, 175, 80, 0.4);
}

.copy-btn:active {
    transform: translateY(0);
}

.back-link {
    display: inline-block;
    margin-top: 20px;
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.back-link:hover {
    text-decoration: underline;
}

footer {
    text-align: center;
    color: #555;
    padding: 30px 0;
    margin-top: 30px;
    font-size: 0.9rem;
    opacity: 0.8;
}

footer a {
    color: #4a90e2;
    text-decoration: none;
    margin-left: 15px;
    transition: color 0.3s;
}

footer a:hover {
    color: #357abd;
    text-decoration: underline;
}

/* 导航图标样式 */
.nav-icon {
    position: fixed;
    top: 25px;
    right: 25px;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    border: 3px solid rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
}

.nav-icon:hover {
    transform: scale(1.15) rotate(90deg);
    box-shadow: 0 12px 32px rgba(102, 126, 234, 0.6);
}

.nav-icon:active {
    transform: scale(1.05) rotate(90deg);
}

.nav-icon::before {
    content: "☰";
    font-size: 26px;
    color: white;
    font-weight: bold;
    transition: transform 0.3s ease;
}

.nav-icon:hover::before {
    transform: rotate(-90deg);
}

/* 工具菜单样式 */
.tools-menu {
    position: fixed;
    top: 90px;
    right: 25px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    padding: 20px;
    width: 280px;
    max-height: 500px;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1000;
    display: none;
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.tools-menu.show {
    display: block;
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* 自定义滚动条 */
.tools-menu::-webkit-scrollbar {
    width: 6px;
}

.tools-menu::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.tools-menu::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
}

.tools-menu::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

.tools-menu a {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    color: #2d3748;
    text-decoration: none;
    border-radius: 10px;
    margin-bottom: 6px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 3px solid transparent;
    font-size: 14px;
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

.tools-menu a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    transition: width 0.3s ease;
    z-index: 0;
}

.tools-menu a:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
    transform: translateX(8px);
    border-left-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
    color: #667eea;
}

.tools-menu a:hover::before {
    width: 100%;
}

.tools-menu a:last-child {
    margin-bottom: 0;
}

/* 快速导航提示文字样式 */
.nav-hint {
    position: fixed;
    top: 20px;
    right: 95px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    padding: 10px 18px;
    border-radius: 24px;
    color: #667eea;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.3);
    z-index: 999;
    border: 1px solid rgba(102, 126, 234, 0.2);
    animation: fadeInHint 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-hint::before {
    content: '💡';
    font-size: 14px;
}

@keyframes fadeInHint {
    from {
        opacity: 0;
        transform: translateX(30px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

/* 二维码工具特定样式 */
.qr-section {
    margin-bottom: 40px;
    padding: 20px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #fafafa;
}

.qr-section h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.3rem;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
}

.qr-image-container {
    text-align: center;
    margin: 15px 0;
}

.qr-image-container canvas {
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.qr-actions {
    margin-top: 15px;
    text-align: center;
}

.qr-actions .copy-btn {
    margin: 0 5px;
}

select {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    background: #fafafa;
    transition: all 0.3s ease;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23667eea' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
}

select:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

input[type="file"] {
    width: 100%;
    padding: 14px 16px;
    border: 2px dashed #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    background: #fafafa;
    transition: all 0.3s ease;
    cursor: pointer;
}

input[type="file"]:hover {
    border-color: #667eea;
    background: #f0f4ff;
}

input[type="file"]:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 带宽计算器特定样式 */
.bandwidth-calculator {
    margin-bottom: 30px;
}

.mode-selector {
    display: flex;
    margin-bottom: 30px;
    border-bottom: 1px solid #e0e0e0;
}

.mode-btn {
    background: none;
    border: none;
    padding: 12px 20px;
    font-size: 1rem;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.mode-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.mode-btn:hover {
    color: #667eea;
    background-color: #f8f9fa;
}

.mode-content {
    display: none;
}

.mode-content.active {
    display: block;
}

.mode-content h3 {
    color: #333;
    margin-bottom: 10px;
    font-size: 1.3rem;
}

.mode-description {
    color: #666;
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
    font-size: 0.95rem;
}

.input-with-unit {
    display: flex;
    gap: 10px;
}

.input-with-unit input {
    flex: 1;
    min-width: 200px;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
}

.input-with-unit select {
    width: 150px;
    min-width: 120px;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
}

.calculate-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.result {
    margin-top: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.result h4 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.result-output {
    background: white;
    border-radius: 6px;
    padding: 15px;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.result-item:last-child {
    border-bottom: none;
}

.result-label {
    font-weight: 500;
    color: #555;
    font-size: 0.95rem;
}

.result-value {
    font-weight: 600;
    color: #667eea;
    font-size: 1rem;
}

.result-detail {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}

.result-detail p {
    margin: 5px 0;
    color: #666;
    font-size: 0.9rem;
    line-height: 1.4;
}

.error {
    color: #e74c3c;
    font-weight: 500;
    background: #ffeaea;
    padding: 10px;
    border-radius: 4px;
    border-left: 4px solid #e74c3c;
}

.reference-section {
    margin-top: 40px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.reference-section h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.reference-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.reference-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: white;
    border-radius: 6px;
    border-left: 3px solid #667eea;
}

.reference-item span:first-child {
    font-weight: 500;
    color: #555;
}

.reference-item span:last-child {
    color: #667eea;
    font-weight: 600;
}

/* 响应式设计 */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .container {
        padding: 20px;
        border-radius: 12px;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    .subtitle {
        font-size: 0.95rem;
    }
    
    .nav-icon {
        width: 48px;
        height: 48px;
        top: 15px;
        right: 15px;
    }
    
    .nav-icon::before {
        font-size: 22px;
    }
    
    .tools-menu {
        top: 70px;
        right: 15px;
        width: calc(100vw - 30px);
        max-width: 300px;
        max-height: calc(100vh - 100px);
    }
    
    .nav-hint {
        top: 15px;
        right: 70px;
        font-size: 11px;
        padding: 8px 14px;
    }
    
    .btn {
        width: 100%;
        margin-right: 0;
        margin-bottom: 12px;
    }
    
    .mode-selector {
        flex-direction: column;
    }
    
    .mode-btn {
        text-align: center;
        border-bottom: none;
        border-left: 3px solid transparent;
    }
    
    .mode-btn.active {
        border-left-color: #667eea;
        border-bottom-color: transparent;
    }
    
    .input-with-unit {
        flex-direction: column;
        gap: 10px;
    }
    
    .input-with-unit select {
        width: 100%;
    }
    
    .reference-grid {
        grid-template-columns: 1fr;
    }
    
    .result-item {
        padding: 16px;
    }
    
    .result-value {
        font-size: 0.85rem;
        padding: 10px 12px;
    }
    
    .copy-btn {
        width: 100%;
        margin-top: 10px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 16px;
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    .tools-menu {
        width: calc(100vw - 20px);
    }
}