/* Tools page specific styles */

/* Tools Hero Section - 现代化红色主题 */
.tools-hero {
    background: linear-gradient(135deg, 
        rgba(255, 71, 66, 0.08) 0%, 
        rgba(255, 71, 66, 0.15) 50%, 
        rgba(231, 60, 71, 0.08) 100%);
    position: relative;
    padding: 120px 0 80px;
    overflow: hidden;
    border-bottom: 1px solid rgba(255, 71, 66, 0.15);
    min-height: 60vh;
    display: flex;
    align-items: center;
}

.tools-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 20%, rgba(255, 71, 66, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(231, 60, 71, 0.06) 0%, transparent 50%),
        radial-gradient(circle at 40% 70%, rgba(255, 71, 66, 0.04) 0%, transparent 50%),
        conic-gradient(from 45deg at 100% 0%, transparent 60%, rgba(255, 71, 66, 0.02) 80%, transparent),
        linear-gradient(45deg, rgba(255, 71, 66, 0.01) 0%, rgba(231, 60, 71, 0.015) 100%);
    z-index: 1;
}

.tools-hero::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 800px;
    height: 800px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 71, 66, 0.03) 0%, transparent 70%);
    z-index: 0;
    animation: heroGlow 8s ease-in-out infinite alternate;
}

@keyframes heroGlow {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 0.3;
    }
    100% {
        transform: translate(-50px, 20px) scale(1.1);
        opacity: 0.5;
    }
}

.tools-hero .hero-content {
    position: relative;
    text-align: center;
    z-index: 2;
    max-width: 900px;
    margin: 0 auto;
}

.tools-hero h1 {
    font-size: 2.75rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    line-height: 1.2;
    background: linear-gradient(135deg, var(--primary-color), #e73c47);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: var(--primary-color);
}

.tools-hero .hero-subtitle {
    font-size: 1.1rem;
    margin-bottom: 2.5rem;
    color: var(--text-gray);
    max-width: 650px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
    font-weight: 400;
}

.tools-hero .hero-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    max-width: 600px;
    margin: 0 auto;
}

.tools-hero .stat {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    padding: 1.5rem 1rem;
    border: 1px solid rgba(255, 71, 66, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.tools-hero .stat::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), #e73c47);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tools-hero .stat:hover::before {
    opacity: 1;
}

.tools-hero .stat:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 25px rgba(255, 71, 66, 0.15);
    border-color: rgba(255, 71, 66, 0.2);
}

.tools-hero .stat h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.tools-hero .stat p {
    font-size: 0.95rem;
    color: var(--text-gray);
    font-weight: 500;
}

[data-theme="dark"] .tools-hero {
    background: linear-gradient(135deg, 
        rgba(255, 71, 66, 0.08) 0%, 
        rgba(255, 71, 66, 0.12) 50%, 
        rgba(231, 60, 71, 0.08) 100%);
    border-bottom-color: rgba(255, 71, 66, 0.2);
}

[data-theme="dark"] .tools-hero .stat {
    background: rgba(31, 41, 55, 0.8);
    border-color: rgba(255, 71, 66, 0.2);
}

[data-theme="dark"] .tools-hero .stat:hover {
    border-color: rgba(255, 71, 66, 0.3);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.3);
}

/* Tools Section - 改进的内容区域 */
.tools-section {
    padding: 80px 0 100px;
    background: var(--bg-light);
    position: relative;
}

.tools-section h2 {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 1rem;
    color: var(--text-dark);
    position: relative;
}

.tools-section h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), #e73c47);
    border-radius: 2px;
}

.tools-section .section-subtitle {
    text-align: center;
    font-size: 1.1rem;
    color: var(--text-gray);
    margin-bottom: 4rem;
    margin-top: 2rem;
    max-width: 650px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

/* Tools Grid - 现代化卡片设计 */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.tool-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    border: 1px solid var(--border-color);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.tool-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(255, 71, 66, 0.15), 
                0 8px 16px rgba(0, 0, 0, 0.1);
    border-color: rgba(255, 71, 66, 0.3);
}

.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), #e73c47);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.tool-card:hover::before {
    transform: scaleX(1);
}

.tool-card::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 71, 66, 0.03) 0%, transparent 70%);
    transform: scale(0);
    transition: transform 0.6s ease;
    pointer-events: none;
}

.tool-card:hover::after {
    transform: scale(1);
}

.tool-icon {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    display: block;
    transition: transform 0.3s ease;
}

.tool-card:hover .tool-icon {
    transform: scale(1.1) rotate(5deg);
}

.tool-card h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-dark);
    line-height: 1.3;
}

.tool-card p {
    color: var(--text-gray);
    line-height: 1.6;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.tool-features {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.feature-tag {
    background: linear-gradient(135deg, 
        rgba(255, 71, 66, 0.08) 0%, 
        rgba(255, 71, 66, 0.12) 100%);
    color: var(--primary-color);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid rgba(255, 71, 66, 0.15);
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.feature-tag:hover {
    background: linear-gradient(135deg, 
        rgba(255, 71, 66, 0.15) 0%, 
        rgba(255, 71, 66, 0.2) 100%);
    border-color: rgba(255, 71, 66, 0.25);
    transform: translateY(-1px);
}

[data-theme="dark"] .feature-tag {
    background: linear-gradient(135deg, 
        rgba(255, 71, 66, 0.15) 0%, 
        rgba(255, 71, 66, 0.2) 100%);
    border-color: rgba(255, 71, 66, 0.25);
}

[data-theme="dark"] .feature-tag:hover {
    background: linear-gradient(135deg, 
        rgba(255, 71, 66, 0.25) 0%, 
        rgba(255, 71, 66, 0.3) 100%);
    border-color: rgba(255, 71, 66, 0.35);
}

[data-theme="dark"] .tool-card:hover {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3), 
                0 8px 16px rgba(255, 71, 66, 0.1);
}

.btn-use-tool {
    background: linear-gradient(135deg, var(--primary-color), #e73c47);
    color: white;
    border: none;
    padding: 0.875rem 2rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(255, 71, 66, 0.2);
}

.btn-use-tool::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.25), 
        transparent);
    transition: left 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-use-tool:hover::before {
    left: 100%;
}

.btn-use-tool:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(255, 71, 66, 0.35),
                0 4px 12px rgba(255, 71, 66, 0.2);
    background: linear-gradient(135deg, #e73c47, #d33640);
}

.btn-use-tool:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 71, 66, 0.25);
}

.btn-use-tool:focus {
    outline: none;
    box-shadow: 0 12px 30px rgba(255, 71, 66, 0.35),
                0 0 0 3px rgba(255, 71, 66, 0.2);
}

/* 特色介绍区域 - 统一设计语言 */
.tools-features {
    padding: 80px 0;
    background: linear-gradient(135deg, 
        var(--bg-white) 0%, 
        rgba(255, 71, 66, 0.02) 50%, 
        var(--bg-white) 100%);
    position: relative;
    overflow: hidden;
}

.tools-features::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 25% 25%, rgba(255, 71, 66, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(231, 60, 71, 0.03) 0%, transparent 50%);
    pointer-events: none;
}

.tools-features h2 {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 3rem;
    color: var(--text-dark);
    position: relative;
    z-index: 2;
}

.tools-features .features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    position: relative;
    z-index: 2;
}

.feature-item {
    text-align: center;
    padding: 2rem 1rem;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 71, 66, 0.08);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.feature-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), #e73c47);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.feature-item:hover {
    transform: translateY(-6px);
    box-shadow: 0 15px 30px rgba(255, 71, 66, 0.1);
    border-color: rgba(255, 71, 66, 0.15);
    background: rgba(255, 255, 255, 0.8);
}

.feature-item:hover::before {
    transform: scaleX(1);
}

.feature-item .feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
    transition: transform 0.3s ease;
}

.feature-item:hover .feature-icon {
    transform: scale(1.1);
}

.feature-item h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-dark);
    transition: color 0.3s ease;
}

.feature-item:hover h3 {
    color: var(--primary-color);
}

.feature-item p {
    color: var(--text-gray);
    line-height: 1.6;
    font-size: 0.95rem;
}

[data-theme="dark"] .feature-item {
    background: rgba(31, 41, 55, 0.6);
    border-color: rgba(255, 71, 66, 0.15);
}

[data-theme="dark"] .feature-item:hover {
    background: rgba(31, 41, 55, 0.8);
    border-color: rgba(255, 71, 66, 0.25);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
}

/* Tool Modal - 重新设计的现代化弹窗 */
.tool-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
}

.tool-modal.modal-opening {
    opacity: 1;
    visibility: visible;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.tool-modal.modal-closing {
    opacity: 0;
    visibility: visible;
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tool-modal[style*="block"], 
.tool-modal:not([style*="none"]) {
    opacity: 1;
    visibility: visible;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.tool-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    cursor: pointer;
}

.tool-modal-content {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
    position: relative;
    width: 100%;
    max-width: 900px;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: scale(0.8) translateY(40px);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(255, 71, 66, 0.1);
    will-change: transform, opacity;
}

.tool-modal.modal-opening .tool-modal-content {
    transform: scale(1) translateY(0);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
}

.tool-modal.modal-closing .tool-modal-content {
    transform: scale(0.9) translateY(20px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tool-modal[style*="block"] .tool-modal-content,
.tool-modal:not([style*="none"]) .tool-modal-content {
    transform: scale(1) translateY(0);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
}

.tool-modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, 
        rgba(255, 71, 66, 0.03) 0%, 
        rgba(255, 71, 66, 0.01) 100%);
    position: sticky;
    top: 0;
    z-index: 10;
    min-height: 70px;
}

.tool-modal-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0;
    flex: 1;
    padding-right: 1rem;
    line-height: 1.3;
}

.tool-modal-close {
    background: rgba(255, 71, 66, 0.08);
    border: 1px solid rgba(255, 71, 66, 0.15);
    font-size: 1.25rem;
    color: var(--primary-color);
    cursor: pointer;
    padding: 0;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    font-weight: 400;
    line-height: 1;
    position: relative;
    overflow: hidden;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(255, 71, 66, 0.2);
}

.tool-modal-close::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 71, 66, 0.2);
    transform: translate(-50%, -50%);
    transition: all 0.3s ease;
    z-index: -1;
}

.tool-modal-close:hover {
    background: rgba(255, 71, 66, 0.15);
    border-color: rgba(255, 71, 66, 0.25);
    color: #e73c47;
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(255, 71, 66, 0.2);
}

.tool-modal-close:hover::before {
    width: 40px;
    height: 40px;
}

.tool-modal-close:active {
    transform: scale(0.95);
    box-shadow: 0 2px 6px rgba(255, 71, 66, 0.15);
}

.tool-modal-close:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(255, 71, 66, 0.1);
}

.tool-modal-body {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 71, 66, 0.3) transparent;
}

.tool-modal-body::-webkit-scrollbar {
    width: 6px;
}

.tool-modal-body::-webkit-scrollbar-track {
    background: transparent;
}

.tool-modal-body::-webkit-scrollbar-thumb {
    background: rgba(255, 71, 66, 0.3);
    border-radius: 3px;
}

.tool-modal-body::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 71, 66, 0.5);
}

[data-theme="dark"] .tool-modal-content {
    border-color: rgba(255, 71, 66, 0.2);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.6);
}

[data-theme="dark"] .tool-modal-close {
    background: rgba(255, 71, 66, 0.15);
    border-color: rgba(255, 71, 66, 0.25);
}

[data-theme="dark"] .tool-modal-close:hover {
    background: rgba(255, 71, 66, 0.25);
    border-color: rgba(255, 71, 66, 0.35);
}

/* 导航激活状态 - 统一设计 */
.nav-menu a.active {
    color: var(--primary-color);
    font-weight: 600;
    position: relative;
}

.nav-menu a.active::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), #e73c47);
    border-radius: 2px;
}

/* 移动优先响应式设计 */

/* 大屏幕优化 (1200px+) */
@media (min-width: 1200px) {
    .tools-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2.5rem;
    }
    
    .tool-card {
        padding: 2.5rem;
    }
    
    .tools-hero {
        padding: 120px 0 80px;
    }
    
    .tools-hero h1 {
        font-size: 3rem;
    }
}

/* 平板设备 (768px - 1199px) */
@media (max-width: 1199px) and (min-width: 768px) {
    .tools-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
    
    .tools-hero .hero-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
        max-width: 550px;
    }
    
    .tool-card {
        padding: 2rem;
    }
}

/* 手机设备 (767px 及以下) */
@media (max-width: 767px) {
    .tools-hero {
        padding: 80px 0 50px;
        text-align: center;
    }
    
    .tools-hero h1 {
        font-size: 2.25rem;
        margin-bottom: 1rem;
    }
    
    .tools-hero .hero-subtitle {
        font-size: 1rem;
        margin-bottom: 2rem;
        padding: 0 1rem;
    }
    
    .tools-hero .hero-stats {
        grid-template-columns: 1fr;
        gap: 1rem;
        max-width: 280px;
    }
    
    .tools-hero .stat {
        padding: 1rem;
    }
    
    .tools-hero .stat h2 {
        font-size: 2rem;
    }
    
    .tools-hero .stat p {
        font-size: 0.85rem;
    }
    
    .tools-section {
        padding: 60px 0 80px;
    }
    
    .tools-section h2 {
        font-size: 2rem;
        margin-bottom: 0.75rem;
    }
    
    .tools-section .section-subtitle {
        font-size: 1rem;
        margin-bottom: 3rem;
        padding: 0 1rem;
    }
    
    .tools-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .tool-card {
        padding: 1.5rem;
        margin: 0 0.5rem;
    }
    
    .tool-card:hover {
        transform: translateY(-4px) scale(1.01);
    }
    
    .tool-icon {
        font-size: 3rem;
    }
    
    .tool-card h3 {
        font-size: 1.375rem;
    }
    
    .tool-features {
        gap: 0.375rem;
        margin-bottom: 1.5rem;
    }
    
    .feature-tag {
        padding: 0.3rem 0.7rem;
        font-size: 0.75rem;
    }
    
    .btn-use-tool {
        padding: 0.75rem 1.5rem;
        font-size: 0.95rem;
    }
    
    .tools-features {
        padding: 60px 0;
    }
    
    .tools-features h2 {
        font-size: 2rem;
    }
    
    .tools-features .features-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .feature-item {
        padding: 1.5rem 1rem;
    }
    
    /* 移动端弹窗优化 */
    .tool-modal {
        padding: 0.75rem;
        align-items: flex-start;
        padding-top: env(safe-area-inset-top, 1rem);
    }
    
    .tool-modal-content {
        max-height: calc(100vh - 1.5rem);
        max-height: calc(100dvh - 1.5rem); /* 支持动态视口 */
        max-width: calc(100vw - 1.5rem);
        margin-top: 0;
        border-radius: var(--radius);
        transform: scale(0.85) translateY(30px);
    }
    
    .tool-modal.modal-opening .tool-modal-content {
        transform: scale(1) translateY(0);
    }
    
    .tool-modal-header {
        padding: 1.25rem 1rem;
        min-height: 60px;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .tool-modal-header h2 {
        font-size: 1.25rem;
        line-height: 1.3;
        flex: 1;
        min-width: 0;
    }
    
    .tool-modal-close {
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
        font-size: 1.1rem;
        flex-shrink: 0;
    }
    
    .tool-modal-body {
        padding: 1rem;
        max-height: calc(100vh - 120px);
        max-height: calc(100dvh - 120px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }
    
    /* 移动端滑动手势支持 */
    .tool-modal-content {
        touch-action: pan-y;
    }
    
    /* 安全区域适配 */
    .tool-modal-header {
        padding-top: max(1.25rem, env(safe-area-inset-top));
    }
    
    .tool-modal-body {
        padding-bottom: max(1rem, env(safe-area-inset-bottom));
    }
}

/* 小屏手机 (480px 及以下) */
@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }
    
    .tools-hero {
        padding: 70px 0 40px;
    }
    
    .tools-hero h1 {
        font-size: 1.875rem;
        line-height: 1.3;
    }
    
    .tools-hero .hero-subtitle {
        font-size: 0.95rem;
        padding: 0 0.5rem;
    }
    
    .tools-hero .stat {
        padding: 0.875rem 0.75rem;
    }
    
    .tools-hero .stat h2 {
        font-size: 1.75rem;
    }
    
    .tools-section h2 {
        font-size: 1.75rem;
    }
    
    .tools-section .section-subtitle {
        font-size: 0.95rem;
        padding: 0 0.5rem;
    }
    
    .tool-card {
        padding: 1.25rem;
        margin: 0;
    }
    
    .tool-icon {
        font-size: 2.75rem;
    }
    
    .tool-card h3 {
        font-size: 1.25rem;
    }
    
    .tool-card p {
        font-size: 0.9rem;
    }
    
    .feature-tag {
        padding: 0.25rem 0.6rem;
        font-size: 0.7rem;
    }
    
    .btn-use-tool {
        padding: 0.7rem 1.25rem;
        font-size: 0.9rem;
    }
    
    .tools-features h2 {
        font-size: 1.75rem;
    }
    
    .feature-item {
        padding: 1.25rem 0.75rem;
    }
    
    .feature-item .feature-icon {
        font-size: 2.5rem;
    }
    
    .feature-item h3 {
        font-size: 1.1rem;
    }
    
    /* 小屏弹窗优化 */
    .tool-modal {
        padding: 0.25rem;
        padding-top: 1rem;
    }
    
    .tool-modal-content {
        max-height: calc(100vh - 0.5rem);
        max-width: calc(100vw - 0.5rem);
        border-radius: var(--radius-md);
    }
    
    .tool-modal-header {
        padding: 0.875rem 1rem;
        min-height: 50px;
    }
    
    .tool-modal-header h2 {
        font-size: 1.125rem;
    }
    
    .tool-modal-close {
        width: 28px;
        height: 28px;
        font-size: 0.95rem;
    }
    
    .tool-modal-body {
        padding: 1rem;
    }
}

/* 超小屏幕设备 (320px - 375px) */
@media (max-width: 375px) {
    .tools-hero h1 {
        font-size: 1.75rem;
    }
    
    .tools-hero .hero-subtitle {
        font-size: 0.9rem;
    }
    
    .tools-hero .stat h2 {
        font-size: 1.5rem;
    }
    
    .tools-section h2 {
        font-size: 1.625rem;
    }
    
    .tool-card {
        padding: 1rem;
    }
    
    .tool-icon {
        font-size: 2.5rem;
    }
}

/* Print Styles */
@media print {
    .tools-hero,
    .tool-modal,
    .navbar,
    .footer {
        display: none;
    }
    
    .tools-section {
        padding: 2rem 0;
    }
    
    .tool-card {
        break-inside: avoid;
        page-break-inside: avoid;
        margin-bottom: 1rem;
    }
}

/* 无障碍访问优化 - 统一外观 */
.tool-card:focus-within {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(255, 71, 66, 0.1);
}

.btn-use-tool:focus {
    outline: none;
    box-shadow: 0 12px 30px rgba(255, 71, 66, 0.35),
                0 0 0 3px rgba(255, 71, 66, 0.2);
}

.tool-modal-close:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 71, 66, 0.3);
    border-color: rgba(255, 71, 66, 0.4);
}

/* 高对比度模式支持 - 增强可访问性 */
@media (prefers-contrast: high) {
    .tool-card {
        border: 2px solid var(--text-dark);
    }
    
    .tool-card:hover {
        border-color: var(--primary-color);
    }
    
    .btn-use-tool {
        border: 2px solid var(--primary-color);
    }
    
    .feature-tag {
        border: 2px solid var(--primary-color);
        font-weight: 600;
    }
    
    .feature-item {
        border: 2px solid var(--border-color);
    }
    
    .feature-item:hover {
        border-color: var(--primary-color);
    }
}

/* 减少动画支持 - 无障碍访问 */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .tool-card:hover,
    .btn-use-tool:hover,
    .feature-item:hover {
        transform: none;
    }
    
    .tool-modal-content {
        transform: none !important;
    }
    
    .parallax-bg {
        transform: none !important;
    }
}

/* 现代化动画效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: calc(200px + 100%) 0;
    }
}

/* 页面加载动画 */
.tools-hero {
    animation: fadeInUp 0.8s ease-out;
}

.tool-card {
    animation: fadeInUp 0.6s ease-out;
    animation-fill-mode: both;
}

.tool-card:nth-child(1) { animation-delay: 0.1s; }
.tool-card:nth-child(2) { animation-delay: 0.2s; }
.tool-card:nth-child(3) { animation-delay: 0.3s; }
.tool-card:nth-child(4) { animation-delay: 0.4s; }
.tool-card:nth-child(5) { animation-delay: 0.5s; }
.tool-card:nth-child(6) { animation-delay: 0.6s; }
.tool-card:nth-child(7) { animation-delay: 0.7s; }
.tool-card:nth-child(8) { animation-delay: 0.8s; }

.feature-item {
    animation: fadeInUp 0.6s ease-out;
    animation-fill-mode: both;
}

.feature-item:nth-child(1) { animation-delay: 0.2s; }
.feature-item:nth-child(2) { animation-delay: 0.4s; }
.feature-item:nth-child(3) { animation-delay: 0.6s; }
.feature-item:nth-child(4) { animation-delay: 0.8s; }

/* 加载状态的shimmer效果 */
.loading-shimmer {
    background: linear-gradient(
        90deg,
        rgba(255, 71, 66, 0.1) 25%,
        rgba(255, 71, 66, 0.2) 50%,
        rgba(255, 71, 66, 0.1) 75%
    );
    background-size: 200px 100%;
    animation: shimmer 2s infinite;
}

/* 成功状态指示 */
.success-pulse {
    animation: pulse 0.6s ease-in-out;
}

/* 顶部进度条 */
.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), #e73c47);
    z-index: 9999;
    transition: width 0.3s ease;
}

/* 微交互反馈 */
.micro-interaction {
    position: relative;
    overflow: hidden;
}

.micro-interaction::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 71, 66, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease;
}

.micro-interaction:active::after {
    width: 200px;
    height: 200px;
}

/* 加载状态组件 */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.loading-overlay.show {
    opacity: 1;
    visibility: visible;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 71, 66, 0.1);
    border-left: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

.loading-text {
    color: var(--text-gray);
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 工具内容加载状态 */
.tool-content-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    min-height: 200px;
}

.tool-content-loading .loading-spinner {
    width: 32px;
    height: 32px;
    border-width: 2px;
}

/* 按钮加载状态 */
.btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.btn-loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid transparent;
    border-left: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.btn-loading .btn-text {
    opacity: 0;
}

/* 操作反馈提示 */
.feedback-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem 1.5rem;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    z-index: 3000;
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 300px;
}

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

.feedback-toast.success {
    border-left: 4px solid #10b981;
    color: #065f46;
}

.feedback-toast.error {
    border-left: 4px solid #ef4444;
    color: #991b1b;
}

.feedback-toast.info {
    border-left: 4px solid var(--primary-color);
    color: var(--primary-color);
}

/* 滚动时的视视视视差效果 */
@media (prefers-reduced-motion: no-preference) {
    .parallax-bg {
        transform: translateY(var(--scroll-y, 0));
        will-change: transform;
    }
}

/* 性能优化 */
.tool-card,
.btn-use-tool,
.feature-item {
    will-change: transform;
}

.tool-modal-content {
    will-change: transform, opacity;
}

/* Individual Tool Styles */

/* Timezone Converter */
.timezone-search {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-right: 0.5rem;
}

.btn-add-timezone {
    padding: 0.75rem 1.5rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 500;
}

.timezone-input-group {
    display: flex;
    margin-bottom: 2rem;
}

.timezone-display {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.timezone-card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.timezone-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.timezone-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.timezone-header h4 {
    margin: 0;
    color: var(--text-dark);
}

.remove-timezone {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-gray);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 50%;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.remove-timezone:hover {
    background: rgba(255, 71, 66, 0.1);
    color: var(--primary-color);
}

.timezone-time {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.timezone-date {
    color: var(--text-gray);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.timezone-info {
    font-size: 0.875rem;
    color: var(--text-gray);
    font-style: italic;
}

.preset-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.preset-buttons button {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-white);
    color: var(--text-dark);
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.preset-buttons button:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(255, 71, 66, 0.05);
}

/* Cost Calculator */
.city-input-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.city-input label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-dark);
}

.city-select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-white);
    color: var(--text-dark);
    font-size: 1rem;
}

.btn-calculate {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--primary-color), #e73c47);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 2rem;
}

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

.cost-comparison {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

.cost-city h3 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--text-dark);
    font-size: 1.5rem;
}

.cost-breakdown {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.cost-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: var(--bg-light);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.cost-item.total {
    background: linear-gradient(135deg, var(--primary-color), #e73c47);
    color: white;
    font-weight: 600;
    font-size: 1.1rem;
    border-color: var(--primary-color);
}

.cost-comparison-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
}

.comparison-result {
    background: var(--bg-white);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1rem;
    text-align: center;
    font-weight: 600;
}

.comparison-result .cheaper {
    color: #10b981;
    font-size: 1.25rem;
}

.comparison-result .expensive {
    color: #f59e0b;
    font-size: 1.25rem;
}

/* Currency Converter */
.currency-input-group {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 2rem;
    align-items: end;
    margin-bottom: 2rem;
}

.currency-input {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.currency-input label {
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.currency-input input {
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1.5rem;
    text-align: center;
    font-weight: 600;
    color: var(--text-dark);
    background: var(--bg-white);
}

.currency-input input:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 71, 66, 0.1);
}

.currency-input select {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-white);
    color: var(--text-dark);
}

.converter-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
}

.converter-arrow button {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 3.5rem;
    height: 3.5rem;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.converter-arrow button:hover {
    transform: rotate(180deg);
    background: #e73c47;
}

.exchange-rate-info {
    background: linear-gradient(135deg, var(--bg-light), var(--bg-white));
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    text-align: center;
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
}

.rate-display {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.rate-updated {
    color: var(--text-gray);
    font-size: 0.875rem;
}

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

.rate-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
}

.rate-item:hover {
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

/* Pomodoro Timer */
.timer-display {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

.timer-circle {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.progress-ring {
    transform: rotate(-90deg);
}

.progress-ring circle {
    transition: stroke-dashoffset 0.3s ease;
}

.timer-text {
    position: absolute;
    text-align: center;
}

.timer-time {
    font-size: 3rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.timer-label {
    color: var(--text-gray);
    font-size: 1.1rem;
}

.timer-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 2rem;
}

.btn-timer-control {
    padding: 0.75rem 2rem;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
}

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

.btn-timer-control.primary:hover {
    background: #e73c47;
    transform: translateY(-2px);
}

.btn-timer-control:not(.primary) {
    background: var(--bg-light);
    color: var(--text-dark);
    border: 1px solid var(--border-color);
}

.btn-timer-control:not(.primary):hover {
    background: var(--border-color);
}

.timer-settings {
    background: var(--bg-light);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    margin-bottom: 2rem;
}

.timer-settings h4 {
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.setting-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.setting-group:last-child {
    margin-bottom: 0;
}

.setting-group label {
    font-weight: 500;
    color: var(--text-dark);
}

.setting-group input {
    width: 80px;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    text-align: center;
}

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

.stat-item {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 0.875rem;
    color: var(--text-gray);
    margin-bottom: 0.5rem;
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-color);
}

/* Phase Notification */
.phase-notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--primary-color);
    color: white;
    padding: 1rem 2rem;
    border-radius: var(--radius-lg);
    font-size: 1.25rem;
    font-weight: 600;
    z-index: 3000;
    animation: fadeInOut 3s ease-in-out;
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
    20%, 80% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* Speed Test */
.speed-gauge {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

.gauge-container {
    position: relative;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    border: 8px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.gauge-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 0%;
    width: 100%;
    background: linear-gradient(0deg, var(--primary-color), #67e8f9);
    transition: height 0.3s ease;
    z-index: 1;
}

.speed-value {
    position: relative;
    z-index: 2;
    text-align: center;
}

.speed-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-dark);
}

.speed-unit {
    font-size: 1rem;
    color: var(--text-gray);
}

.speed-controls {
    text-align: center;
    margin-bottom: 2rem;
}

.btn-speed-test {
    padding: 1rem 3rem;
    background: linear-gradient(135deg, var(--primary-color), #e73c47);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 1rem;
}

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

.btn-speed-test:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.test-status {
    color: var(--text-gray);
    font-size: 1rem;
}

.speed-results {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.result-item {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    text-align: center;
}

.result-label {
    display: block;
    font-size: 0.875rem;
    color: var(--text-gray);
    margin-bottom: 0.5rem;
}

.result-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-color);
}

/* 工具内容移动端优化 */
@media (max-width: 768px) {
    /* 时区转换器 */
    .timezone-display {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .timezone-input-group {
        flex-direction: column;
        gap: 1rem;
    }
    
    .timezone-search {
        margin-right: 0;
        margin-bottom: 0.5rem;
    }
    
    .timezone-card {
        padding: 1.25rem;
    }
    
    .timezone-time {
        font-size: 2rem;
    }
    
    /* 成本计算器 */
    .city-input-group {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .cost-comparison {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .cost-comparison-arrow {
        order: 1;
        transform: rotate(90deg);
    }
    
    /* 货币转换器 */
    .currency-input-group {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .converter-arrow {
        order: 1;
        margin-bottom: 0;
    }
    
    .converter-arrow button {
        transform: rotate(90deg);
    }
    
    .converter-arrow button:hover {
        transform: rotate(270deg);
    }
    
    .currency-input input {
        padding: 0.875rem;
        font-size: 1.25rem;
    }
    
    .rates-grid {
        grid-template-columns: 1fr;
    }
    
    /* 番茄钟计时器 */
    .timer-display {
        margin-bottom: 1.5rem;
    }
    
    .timer-circle {
        transform: scale(0.9);
    }
    
    .timer-time {
        font-size: 2.5rem;
    }
    
    .timer-controls {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .btn-timer-control {
        width: 100%;
        max-width: 280px;
        padding: 0.875rem;
    }
    
    .timer-settings {
        padding: 1.25rem;
    }
    
    .pomodoro-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    /* 网速测试 */
    .speed-gauge {
        margin-bottom: 1.5rem;
    }
    
    .gauge-container {
        width: 160px;
        height: 160px;
    }
    
    .speed-number {
        font-size: 2rem;
    }
    
    .btn-speed-test {
        padding: 0.875rem 2rem;
    }
    
    .speed-results {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .result-item {
        padding: 0.875rem;
    }
}

@media (max-width: 480px) {
    /* 进一步移动端优化 */
    .timezone-card {
        padding: 1rem;
    }
    
    .timezone-time {
        font-size: 1.75rem;
    }
    
    .currency-input input {
        font-size: 1.125rem;
    }
    
    .timer-time {
        font-size: 2rem;
    }
    
    .btn-timer-control {
        max-width: 240px;
        font-size: 0.95rem;
    }
    
    .gauge-container {
        width: 140px;
        height: 140px;
    }
    
    .speed-number {
        font-size: 1.75rem;
    }
    
    .speed-results {
        grid-template-columns: 1fr;
    }
    
    .pomodoro-stats {
        grid-template-columns: 1fr;
    }
}

/* 移动端触摸目标优化 - 修复审查专家发现的问题 */
@media (max-width: 767px) {
    /* 确保所有按钮满足44px最小触摸目标 */
    .btn-use-tool,
    .remove-timezone,
    .preset-buttons button,
    .tool-modal-close,
    button,
    .btn-primary,
    .btn-secondary {
        min-width: 44px;
        min-height: 44px;
        touch-action: manipulation;
        -webkit-tap-highlight-color: rgba(255, 71, 66, 0.2);
    }

    /* 特别处理小按钮 */
    .remove-timezone {
        width: 44px;
        height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.2rem;
        line-height: 1;
        border: none;
        background: rgba(255, 71, 66, 0.1);
        color: var(--primary-color);
        border-radius: var(--radius-sm);
        cursor: pointer;
        transition: all 0.2s ease;
    }

    .remove-timezone:hover {
        background: var(--primary-color);
        color: white;
    }

    /* 工具弹窗移动端优化 */
    .tool-modal-content {
        margin: 0.5rem;
        max-height: calc(100vh - 1rem);
        max-height: calc(100dvh - 1rem); /* 支持动态视口高度 */
        border-radius: var(--radius);
    }

    .tool-modal-header {
        padding: 1.25rem 1rem 1rem;
        position: sticky;
        top: 0;
        background: var(--bg-white);
        z-index: 10;
        border-bottom: 1px solid var(--border-color);
    }

    .tool-modal-body {
        padding: 1rem;
        max-height: calc(100vh - 120px);
        max-height: calc(100dvh - 120px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* 输入框和表单元素移动端优化 */
    input[type="text"],
    input[type="number"],
    input[type="email"],
    select,
    textarea {
        min-height: 44px;
        padding: 12px 16px;
        font-size: 16px; /* 防止iOS缩放 */
        border-radius: var(--radius-sm);
    }

    /* 时区卡片移动端优化 */
    .timezone-card {
        padding: 1rem 0.875rem;
    }

    .timezone-header {
        margin-bottom: 0.75rem;
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
    }

    .timezone-header h4 {
        font-size: 1.1rem;
        margin: 0;
        flex-grow: 1;
        padding-right: 0.5rem;
    }

    /* 工具卡片移动端间距优化 */
    .tools-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 0 0.5rem;
    }

    .tool-card {
        padding: 1.25rem 1rem;
    }

    .tool-features {
        margin: 0.875rem 0;
        gap: 0.5rem;
    }

    .feature-tag {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }

    /* Hero区域移动端优化 */
    .tools-hero {
        padding: 60px 0 40px;
    }

    .tools-hero h1 {
        font-size: 2.25rem;
        margin-bottom: 1rem;
    }

    .hero-stats {
        flex-direction: row;
        justify-content: space-around;
        gap: 0.5rem;
        margin-top: 1.5rem;
    }

    .hero-stats .stat {
        min-width: auto;
        text-align: center;
    }

    .hero-stats .stat h2 {
        font-size: 1.75rem;
        margin-bottom: 0.25rem;
    }

    .hero-stats .stat p {
        font-size: 0.8rem;
    }

    /* 焦点状态优化 */
    button:focus-visible,
    input:focus-visible,
    select:focus-visible {
        outline: 2px solid var(--primary-color);
        outline-offset: 2px;
    }

    /* 减少动画以提高性能 */
    @media (prefers-reduced-motion: reduce) {
        .tool-card,
        .btn-use-tool,
        .converter-arrow button {
            transition: none;
            transform: none !important;
        }
    }
}

/* 超小屏设备（320px-375px）专门优化 */
@media (max-width: 375px) {
    .tools-hero {
        padding: 40px 0 30px;
    }

    .tools-hero h1 {
        font-size: 1.875rem;
        line-height: 1.1;
    }

    .tools-hero .hero-subtitle {
        font-size: 0.95rem;
        padding: 0 1rem;
    }

    .hero-stats {
        margin-top: 1.25rem;
        padding: 0 0.5rem;
    }

    .tool-card {
        padding: 1rem 0.75rem;
    }

    .tool-modal-content {
        margin: 0.25rem;
        border-radius: var(--radius-sm);
    }

    .tool-modal-header {
        padding: 1rem 0.75rem 0.75rem;
    }

    .tool-modal-body {
        padding: 0.75rem;
    }
}

/* 可访问性增强 */
@media (prefers-contrast: high) {
    .tool-card {
        border: 2px solid var(--border-color);
    }

    .btn-use-tool {
        border: 2px solid var(--primary-color);
    }

    .feature-tag {
        border: 1px solid var(--text-light);
    }
}

/* 深色模式支持 */
[data-theme="dark"] .tools-hero {
    background: linear-gradient(135deg, 
        rgba(255, 71, 66, 0.08) 0%, 
        rgba(255, 71, 66, 0.12) 50%, 
        rgba(231, 60, 71, 0.08) 100%);
}

[data-theme="dark"] .tool-modal-header {
    background: var(--bg-dark);
    border-bottom-color: var(--border-color-dark);
}