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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f5f7fa;
    color: #333;
    line-height: 1.6
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px
}

.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,.1)
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px
}

.logo-icon {
    font-size: 28px
}

.logo h1 {
    font-size: 22px;
    font-weight: 600
}

.nav {
    display: flex;
    gap: 25px
}

.nav a {
    color: rgba(255,255,255,.9);
    text-decoration: none;
    font-size: 15px;
    transition: all .3s;
    padding: 5px 12px;
    border-radius: 20px
}

.nav a:hover,
.nav a.active {
    background: rgba(255,255,255,.2);
    color: white
}

.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 60px 0 50px;
    text-align: center
}

.hero h2 {
    font-size: 32px;
    margin-bottom: 12px;
    font-weight: 700
}

.hero p {
    font-size: 16px;
    opacity: .9;
    margin-bottom: 30px
}

.search-box input {
    width: 100%;
    max-width: 500px;
    padding: 14px 24px;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    outline: none;
    box-shadow: 0 4px 20px rgba(0,0,0,.15)
}

.main-content {
    padding: 40px 0 60px
}

.tool-section {
    margin-bottom: 45px
}

.section-title {
    font-size: 22px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #333
}

.section-title .icon {
    font-size: 26px
}

.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 18px
}

.tool-card {
    background: white;
    border-radius: 14px;
    padding: 26px 20px;
    cursor: pointer;
    transition: all .3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
    border: 1px solid #eee;
    text-align: center
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(102,126,234,.2);
    border-color: #667eea
}

.tool-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    margin: 0 auto 14px
}

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

.tool-card p {
    font-size: 13px;
    color: #888
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px
}

.modal.show {
    display: flex
}

.modal-content {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 900px;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: modalIn .3s ease
}

@keyframes modalIn {
    from { transform: scale(.9); opacity: 0 }
    to { transform: scale(1); opacity: 1 }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    border-bottom: 1px solid #eee
}

.modal-header h2 {
    font-size: 18px;
    color: #333
}

.close-btn {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #999;
    line-height: 1;
    padding: 0 4px
}

.close-btn:hover {
    color: #333
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1
}

.tool-input-area {
    width: 100%;
    min-height: 180px;
    padding: 14px;
    border: 1px solid #ddd;
    border-radius: 10px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 14px;
    resize: vertical;
    outline: none;
    transition: border-color .3s
}

.tool-input-area:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102,126,234,.1)
}

.btn-group {
    display: flex;
    gap: 10px;
    margin-top: 14px;
    flex-wrap: wrap
}

.btn {
    padding: 10px 22px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all .3s;
    font-weight: 500
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white
}

.btn-primary:hover {
    opacity: .9;
    transform: translateY(-1px)
}

.btn-secondary {
    background: #f0f0f0;
    color: #555
}

.btn-secondary:hover {
    background: #e0e0e0
}

.output-area {
    margin-top: 18px;
    padding: 14px;
    background: #f8f9fa;
    border-radius: 10px;
    min-height: 80px;
    max-height: 350px;
    overflow: auto;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 13px;
    white-space: pre-wrap;
    word-break: break-all;
    border: 1px solid #eee
}

.stat-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 14px
}

.stat-item {
    background: #f8f9fa;
    padding: 12px 20px;
    border-radius: 10px;
    text-align: center;
    min-width: 100px
}

.stat-item .num {
    font-size: 24px;
    font-weight: bold;
    color: #667eea
}

.stat-item .label {
    font-size: 13px;
    color: #888;
    margin-top: 4px
}

.footer {
    background: #2d3748;
    color: rgba(255,255,255,.7);
    text-align: center;
    padding: 24px 0;
    font-size: 14px
}

.hidden-tool {
    display: none !important
}

@media (max-width: 768px) {
    .nav { display: none }
    
    .hero h2 { font-size: 24px }
    
    .tool-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr))
    }
    
    .modal-content {
        max-height: 90vh;
        border-radius: 12px
    }
}
