*{
    margin:0;
    padding:0;
    box-sizing:border-box;
    font-family:Inter,system-ui,sans-serif;
}

html, body{
    width:100%;
    margin:0;
    padding:0;
}

body{
    background:#0f1130;
    color:#fff;
    overflow-x:hidden;
    min-height:100vh;
    display:flex;
    flex-direction:column;
}

:root{
    --blue:#14d8ff;
    --blue2:#2f7cff;
    --line:rgba(255,255,255,0.08);
    --muted:#8b90b2;
}

.main{
    width:100%;
    max-width:1100px;
    margin:auto;
    display:grid;
    grid-template-columns:180px 1fr 180px;
    gap:40px;
    padding:10px 30px 60px;
    flex:1;
}

.ad-box,
.ad-slot-wrapper#ad-left-sidebar{
    width:160px;
    height:600px;
    border-radius:4px;
    overflow:hidden;
    border:1px solid rgba(255,255,255,0.05);
}

.right-ads{
    display:flex;
    flex-direction:column;
    gap:20px;
}

.right-ad,
.ad-slot-wrapper#ad-right-top,
.ad-slot-wrapper#ad-right-bottom{
    width:300px;
    height:250px;
    border-radius:4px;
    border:1px solid rgba(255,255,255,0.05);
}

.center{
    display:flex;
    flex-direction:column;
    align-items:center;
}

.top-banner,
.ad-slot-wrapper#ad-top-banner{
    width:100%;
    max-width:728px;
    height:auto;
    aspect-ratio:728 / 90;
    border-radius:4px;
    border:1px solid rgba(255,255,255,0.08);
    margin-bottom:14px;
}

.page-title{
    font-size:28px;
    font-weight:700;
    margin-bottom:20px;
    text-align:center;
}

.top-actions{
    display:flex;
    gap:30px;
    margin-bottom:50px;
}

.top-actions button{
    background:none;
    border:none;
    color:#fff;
    font-size:15px;
    cursor:pointer;
    opacity:.9;
}

.speed-area{
    display:flex;
    flex-direction:column;
    align-items:center;
}

.circle-wrap{
    position:relative;
    width:240px;
    height:240px;
    overflow:visible;
}

.circle-bg{
    position:absolute;
    inset:0;
    border-radius:50%;
    border:4px solid rgba(255,255,255,0.07);
}

.circle-progress{
    position:absolute;
    inset:0;
    border-radius:50%;
    background:
        conic-gradient(
            from -90deg,
            #14d8ff 0deg,
            #2f7cff 0deg,
            transparent 0deg
        );
    -webkit-mask:
        radial-gradient(
            transparent 69%,
            #000 70%
        );
    mask:
        radial-gradient(
            transparent 69%,
            #000 70%
        );
    transition:.05s linear;
}

.go-btn{
    position:absolute;
    inset:0;
    width:100%;
    height:100%;
    border:none;
    background:none;
    color:#fff;
    font-size:48px;
    cursor:pointer;
    z-index:5;
}

.retest-btn{
    position:absolute;
    inset:0;
    width:100%;
    height:100%;
    border:none;
    background:rgba(20, 216, 255, 0.2);
    color:#14d8ff;
    font-size:20px;
    font-weight:600;
    cursor:pointer;
    z-index:5;
    border-radius:50%;
    transition:all 0.2s;
}

.retest-btn:hover{
    background:rgba(20, 216, 255, 0.3);
}

.ripple-container{
    position:absolute;
    inset:0;
    pointer-events:none;
}

.ripple{
    position:absolute;
    top:50%;
    left:50%;
    transform:translate(-50%, -50%);
    border-radius:50%;
    border:2px solid rgba(20, 216, 255, 0.6);
    animation:rippleEffect 3s ease-out infinite;
}

.ripple-1{
    width:100%;
    height:100%;
    animation-delay:0s;
}

.ripple-2{
    width:100%;
    height:100%;
    animation-delay:1s;
}

.ripple-3{
    width:100%;
    height:100%;
    animation-delay:2s;
}

@keyframes rippleEffect{
    0%{
        transform:translate(-50%, -50%) scale(0.8);
        opacity:1;
        border-color:rgba(20, 216, 255, 0.8);
    }
    100%{
        transform:translate(-50%, -50%) scale(1.5);
        opacity:0;
        border-color:rgba(20, 216, 255, 0);
    }
}

.speed-read{
    margin-top:24px;
    text-align:center;
}

.speed-num{
    font-size:64px;
    font-weight:700;
    line-height:1;
}

.speed-unit{
    margin-top:8px;
    color:var(--muted);
    letter-spacing:4px;
    font-size:12px;
}

.phase{
    margin-top:10px;
    color:#14d8ff;
    letter-spacing:3px;
    font-size:11px;
}

.connection-row{
    margin-top:36px;
    display:flex;
    align-items:center;
    justify-content:center;
    gap:50px;
}

.connection-box{
    display:flex;
    align-items:center;
    gap:18px;
}

.icon{
    width:40px;
    height:40px;
    border-radius:50%;
    border:1px solid rgba(255,255,255,0.15);
    display:flex;
    align-items:center;
    justify-content:center;
    color:#fff;
    font-size:16px;
}

.conn-title{
    font-size:15px;
    line-height:1.4;
}

.conn-sub{
    margin-top:4px;
    color:var(--muted);
    font-size:12px;
}

.change-server{
    margin-top:6px;
    color:#14d8ff;
    font-size:13px;
    cursor:pointer;
}

.bottom-stats{
    margin-top:50px;
    width:100%;
    max-width:700px;
    display:grid;
    grid-template-columns:repeat(4,1fr);
    gap:16px;
}

.stat-card{
    background:rgba(255,255,255,0.03);
    border:1px solid rgba(255,255,255,0.05);
    border-radius:14px;
    padding:18px;
}

.stat-label{
    color:var(--muted);
    font-size:11px;
    letter-spacing:2px;
}

.stat-value{
    margin-top:10px;
    font-size:32px;
    font-weight:700;
}

.stat-unit{
    margin-top:4px;
    color:var(--muted);
    font-size:12px;
}

.history{
    margin-top:40px;
    width:100%;
    max-width:800px;
}

.history-title{
    margin-bottom:16px;
    color:var(--muted);
    letter-spacing:3px;
    font-size:11px;
}

table{
    width:100%;
    border-collapse:collapse;
}

th{
    padding-bottom:16px;
    text-align:left;
    color:var(--muted);
    border-bottom:1px solid rgba(255,255,255,0.08);
    font-size:12px;
}

td{
    padding:18px 0;
    border-bottom:1px solid rgba(255,255,255,0.04);
    font-size:14px;
}

.calculator-section{
    width:100%;
    max-width:1100px;
    margin:0 auto;
    padding:40px 30px;
}

.calc-container{
    display:grid;
    grid-template-columns:380px 1fr;
    gap:40px;
}

.calc-main{
    background:rgba(255,255,255,0.03);
    border:1px solid rgba(255,255,255,0.08);
    border-radius:16px;
    padding:24px;
}

.calc-display{
    background:#0a0a15;
    border:1px solid rgba(255,255,255,0.1);
    border-radius:12px;
    padding:20px;
    margin-bottom:20px;
    text-align:right;
}

.calc-label{
    font-size:11px;
    color:var(--muted);
    letter-spacing:2px;
    margin-bottom:8px;
}

.calc-value{
    font-size:42px;
    font-weight:700;
    font-family:'Courier New', monospace;
    color:#14d8ff;
    text-shadow:0 0 20px rgba(20,216,255,0.3);
    letter-spacing:2px;
    overflow:hidden;
    text-overflow:ellipsis;
}

.calc-variables{
    display:flex;
    justify-content:flex-end;
    gap:16px;
    margin-top:12px;
    font-size:11px;
    color:var(--muted);
}

.calc-var span{
    color:#fff;
    font-family:monospace;
    margin-left:4px;
}

.calc-mode{
    display:flex;
    justify-content:flex-end;
    align-items:center;
    gap:10px;
    margin-top:12px;
}

#calcModeLabel{
    font-size:12px;
    color:var(--muted);
    padding:4px 12px;
    background:rgba(255,255,255,0.05);
    border-radius:6px;
}

.mode-toggle-btn{
    background:linear-gradient(135deg, #2f7cff, #14d8ff);
    border:none;
    color:#fff;
    font-size:11px;
    padding:6px 14px;
    border-radius:6px;
    cursor:pointer;
    transition:all 0.2s;
}

.mode-toggle-btn:hover{
    transform:scale(1.05);
    box-shadow:0 4px 20px rgba(20,216,255,0.3);
}

.calc-keypad{
    display:flex;
    flex-direction:column;
    gap:8px;
}

.calc-row{
    display:grid;
    grid-template-columns:repeat(5, 1fr);
    gap:8px;
}

.calc-btn{
    height:52px;
    border:none;
    border-radius:10px;
    font-size:16px;
    font-weight:600;
    cursor:pointer;
    transition:all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

.calc-btn:active{
    transform:scale(0.95);
}

.calc-btn.num{
    background:rgba(255,255,255,0.08);
    color:#fff;
    border:1px solid rgba(255,255,255,0.1);
}

.calc-btn.num:hover{
    background:rgba(255,255,255,0.12);
    border-color:rgba(255,255,255,0.2);
}

.calc-btn.func{
    background:rgba(255,255,255,0.05);
    color:var(--muted);
    border:1px solid rgba(255,255,255,0.08);
    font-size:13px;
}

.calc-btn.func:hover{
    background:rgba(255,255,255,0.1);
    color:#fff;
}

.calc-btn.tvm{
    background:linear-gradient(135deg, #42108f, #7b2cff);
    color:#fff;
    border:1px solid rgba(123,44,255,0.3);
}

.calc-btn.tvm:hover{
    box-shadow:0 4px 20px rgba(123,44,255,0.4);
    transform:scale(1.02);
}

.calc-btn.tvm.active{
    background:linear-gradient(135deg, #14d8ff, #2f7cff);
    border-color:rgba(20,216,255,0.5);
    box-shadow:0 0 20px rgba(20,216,255,0.4);
}

.calc-btn.enter{
    background:linear-gradient(135deg, #14d8ff, #2f7cff);
    color:#fff;
    border:1px solid rgba(20,216,255,0.3);
    font-size:14px;
}

.calc-btn.enter:hover{
    box-shadow:0 4px 25px rgba(20,216,255,0.5);
    transform:scale(1.02);
}

.calc-guide{
    background:rgba(255,255,255,0.03);
    border:1px solid rgba(255,255,255,0.08);
    border-radius:16px;
    padding:24px;
}

.guide-header{
    font-size:16px;
    font-weight:600;
    color:#fff;
    margin-bottom:20px;
    padding-bottom:12px;
    border-bottom:1px solid rgba(255,255,255,0.08);
}

.guide-item{
    margin-bottom:12px;
}

.guide-title{
    padding:14px 16px;
    background:rgba(255,255,255,0.05);
    border:1px solid rgba(255,255,255,0.08);
    border-radius:10px;
    cursor:pointer;
    font-size:14px;
    color:#fff;
    transition:all 0.2s;
}

.guide-title:hover{
    background:rgba(255,255,255,0.08);
    border-color:rgba(20,216,255,0.3);
}

.guide-content{
    display:none;
    padding:16px;
    background:rgba(0,0,0,0.2);
    border:1px solid rgba(255,255,255,0.05);
    border-top:none;
    border-radius:0 0 10px 10px;
    font-size:13px;
    color:var(--muted);
    line-height:1.8;
}

.guide-content.open{
    display:block;
}

.guide-content ol{
    margin:10px 0 0 20px;
    padding-left:0;
}

.guide-content li{
    margin-bottom:6px;
}

.faq-section{
    width:100%;
    max-width:800px;
    margin:60px auto 40px;
    padding:0 20px;
}

.faq-container{
    background:rgba(255,255,255,0.03);
    border:1px solid rgba(255,255,255,0.08);
    border-radius:16px;
    padding:32px;
}

.faq-title{
    font-size:24px;
    font-weight:700;
    margin-bottom:28px;
    text-align:left;
}

.faq-items{
    display:flex;
    flex-direction:column;
    gap:12px;
}

.faq-item{
    border-bottom:1px solid rgba(255,255,255,0.05);
    padding-bottom:12px;
}

.faq-item:last-child{
    border-bottom:none;
    padding-bottom:0;
}

.faq-question{
    width:100%;
    display:flex;
    align-items:center;
    background:none;
    border:none;
    color:#fff;
    font-size:15px;
    font-weight:500;
    cursor:pointer;
    padding:16px 0;
    text-align:left;
}

.faq-icon{
    width:24px;
    height:24px;
    display:flex;
    align-items:center;
    justify-content:center;
    background:rgba(20,216,255,0.1);
    color:#14d8ff;
    border-radius:50%;
    font-size:18px;
    font-weight:300;
    flex-shrink:0;
    margin-right:12px;
    transition:all 0.2s;
}

.faq-item.open .faq-icon{
    background:#14d8ff;
    color:#0f1130;
}

.faq-answer{
    max-height:0;
    overflow:hidden;
    transition:max-height 0.3s ease;
    padding:0 40px;
    color:var(--muted);
    font-size:14px;
    line-height:1.7;
}

.faq-answer p{
    margin-bottom:0;
    padding-bottom:16px;
}

.popular-tools-section{
    padding:60px 20px;
    background:linear-gradient(180deg, rgba(15, 17, 48, 1) 0%, rgba(20, 23, 58, 1) 100%);
}

.popular-tools-container{
    max-width:1200px;
    margin:0 auto;
}

.popular-tools-header{
    text-align:center;
    margin-bottom:50px;
}

.popular-tools-title{
    font-size:32px;
    font-weight:700;
    color:#fff;
    margin-bottom:12px;
}

.popular-tools-desc{
    color:rgba(255,255,255,0.6);
    font-size:16px;
}

.popular-tools-grid{
    display:grid;
    grid-template-columns:repeat(auto-fit, minmax(180px, 1fr));
    gap:20px;
}

.tool-card{
    display:flex;
    flex-direction:column;
    align-items:center;
    padding:28px 20px;
    background:rgba(255,255,255,0.03);
    border:1px solid rgba(255,255,255,0.08);
    border-radius:16px;
    backdrop-filter:blur(10px);
    transition:all 0.3s ease;
    text-decoration:none;
    color:inherit;
}

.tool-card:hover{
    transform:translateY(-5px);
    box-shadow:0 10px 30px rgba(0,0,0,0.3);
}

.tool-icon{
    width:60px;
    height:60px;
    display:flex;
    align-items:center;
    justify-content:center;
    border-radius:14px;
    margin-bottom:16px;
    font-size:28px;
}

.tool-name{
    font-size:15px;
    font-weight:600;
    color:#fff;
    text-align:center;
}

.tool-desc{
    font-size:12px;
    color:rgba(255,255,255,0.5);
    margin-top:4px;
}

.view-all-btn{
    display:inline-block;
    padding:14px 32px;
    background:linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border-radius:30px;
    color:#fff;
    text-decoration:none;
    font-weight:600;
    font-size:15px;
    box-shadow:0 4px 15px rgba(99,102,241,0.3);
    transition:all 0.3s ease;
}

.view-all-btn:hover{
    transform:scale(1.05);
    box-shadow:0 6px 20px rgba(99,102,241,0.4);
}

.view-all-container{
    text-align:center;
    margin-top:40px;
}

@media(max-width:900px){
    .calc-container{
        grid-template-columns:1fr;
    }
}

@media(max-width:500px){
    .calc-row{
        grid-template-columns:repeat(4, 1fr);
    }
    .calc-btn{
        height:48px;
        font-size:14px;
    }
    .calc-value{
        font-size:32px;
    }
    .calc-variables{
        flex-wrap:wrap;
        gap:8px;
    }
}

@media(max-width:1300px){
    .main{
        grid-template-columns:1fr;
    }
    .ad-box,
    .right-ads,
    .ad-slot-wrapper#ad-left-sidebar{
        display:none;
    }
}

@media(max-width:768px){
    .connection-row{
        flex-direction:column;
        gap:24px;
    }
    .bottom-stats{
        grid-template-columns:1fr 1fr;
    }
    .circle-wrap{
        width:200px;
        height:200px;
    }
    .speed-num{
        font-size:52px;
    }
}
