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

body {
    background: #0b0f14;
    color: #c8d6e5;
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 40px 24px;
}

header {
    text-align: center;
    margin-bottom: 40px;
}

header h1 {
    color: #00d4ff;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.tagline {
    color: #6b7b8d;
    font-size: 14px;
    margin-top: 6px;
}

.search-box {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 32px;
}

.search-box input {
    background: #111826;
    border: 1px solid #1f2a3a;
    border-radius: 8px;
    color: #e0e0e0;
    font-size: 16px;
    padding: 14px 20px;
    width: 340px;
    outline: none;
    transition: border-color 0.2s;
}

.search-box input::placeholder {
    color: #4a5568;
}

.search-box input:focus {
    border-color: #00d4ff;
}

.search-box button {
    background: #00d4ff;
    color: #0b0f14;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    padding: 14px 28px;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    letter-spacing: 0.5px;
}

.search-box button:hover {
    background: #00bce0;
}

.search-box button:active {
    transform: scale(0.97);
}

.search-box button:disabled {
    background: #2a3a4a;
    color: #5a6a7a;
    cursor: not-allowed;
}

.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 40px 0;
    color: #6b7b8d;
    font-size: 15px;
}

.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #1f2a3a;
    border-top-color: #00d4ff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.asn-info {
    background: #111826;
    border: 1px solid #1f2a3a;
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 24px;
}

.asn-info-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.asn-info-row + .asn-info-row {
    margin-top: 6px;
}

.asn-info-name {
    color: #00d4ff;
    font-size: 18px;
    font-weight: 700;
}

.asn-info-org {
    color: #6b7b8d;
    font-size: 13px;
}

.asn-info-stat {
    color: #8899aa;
    font-size: 13px;
}

.hidden {
    display: none !important;
}

.error-box {
    background: rgba(255, 59, 48, 0.1);
    border: 1px solid rgba(255, 59, 48, 0.3);
    color: #ff6b6b;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 24px;
    text-align: center;
    font-size: 14px;
}

.cache-info {
    text-align: center;
    color: #4a5568;
    font-size: 12px;
    margin-bottom: 20px;
    padding: 8px;
    background: rgba(0, 212, 255, 0.05);
    border-radius: 6px;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.card {
    background: #111826;
    border: 1px solid #1f2a3a;
    border-radius: 12px;
    overflow: hidden;
    transition: border-color 0.2s;
}

.card:hover {
    border-color: #2a3a4a;
}

.card-header {
    background: #0d1420;
    color: #8899aa;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 14px 20px;
    border-bottom: 1px solid #1f2a3a;
}

.card-body {
    padding: 20px;
}

.badge {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.badge-valid {
    background: rgba(0, 200, 83, 0.15);
    color: #00c853;
    border: 1px solid rgba(0, 200, 83, 0.3);
}

.badge-invalid {
    background: rgba(255, 59, 48, 0.15);
    color: #ff3b30;
    border: 1px solid rgba(255, 59, 48, 0.3);
}

.badge-mixed, .badge-unknown {
    background: rgba(255, 204, 0, 0.15);
    color: #ffcc00;
    border: 1px solid rgba(255, 204, 0, 0.3);
}

.card-detail {
    margin-top: 12px;
    color: #6b7b8d;
    font-size: 13px;
    line-height: 1.5;
}

.prefix-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #1a2332;
}

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

.prefix-stat .label {
    color: #6b7b8d;
    font-size: 13px;
    flex: 1;
}

.prefix-stat .value {
    color: #e0e0e0;
    font-size: 16px;
    font-weight: 600;
    margin-right: 12px;
}

.incele-link {
    color: #00d4ff;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    padding: 4px 10px;
    border-radius: 4px;
    background: rgba(0, 212, 255, 0.08);
    transition: all 0.2s;
    white-space: nowrap;
}

.incele-link:hover {
    background: rgba(0, 212, 255, 0.18);
    color: #33e0ff;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal.hidden {
    display: none;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: #111826;
    border: 1px solid #1f2a3a;
    border-radius: 12px;
    width: 90%;
    max-width: 700px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #1f2a3a;
    background: #0d1420;
    border-radius: 12px 12px 0 0;
}

.modal-header h3 {
    color: #00d4ff;
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    color: #6b7b8d;
    font-size: 24px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    transition: color 0.2s;
}

.modal-close:hover {
    color: #ff3b30;
}

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

.modal-search {
    margin-bottom: 12px;
}

.modal-search input {
    width: 100%;
    background: #0b0f14;
    border: 1px solid #1f2a3a;
    border-radius: 6px;
    color: #e0e0e0;
    font-size: 13px;
    padding: 10px 14px;
    outline: none;
    transition: border-color 0.2s;
}

.modal-search input::placeholder {
    color: #4a5568;
}

.modal-search input:focus {
    border-color: #00d4ff;
}

.modal-count {
    color: #6b7b8d;
    font-size: 12px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #1a2332;
}

.prefix-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.prefix-item {
    background: #0b0f14;
    border: 1px solid #1a2332;
    border-radius: 4px;
    padding: 8px 12px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 13px;
    color: #c8d6e5;
    transition: background 0.15s;
}

.prefix-item:hover {
    background: #111826;
    border-color: #2a3a4a;
}

.prefix-list-empty {
    color: #4a5568;
    text-align: center;
    padding: 32px 0;
    font-size: 14px;
}

@media (max-width: 640px) {
    .modal-content {
        width: 95%;
        max-height: 85vh;
    }

    .prefix-stat {
        flex-wrap: wrap;
        gap: 4px;
    }

    .incele-link {
        margin-left: auto;
    }
}

.card-score .card-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 28px 20px;
}

.score-circle {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 4px solid #1f2a3a;
    transition: border-color 0.3s;
}

.score-circle.score-safe {
    border-color: #00c853;
    box-shadow: 0 0 20px rgba(0, 200, 83, 0.2);
}

.score-circle.score-medium {
    border-color: #ffcc00;
    box-shadow: 0 0 20px rgba(255, 204, 0, 0.2);
}

.score-circle.score-high-risk {
    border-color: #ff3b30;
    box-shadow: 0 0 20px rgba(255, 59, 48, 0.2);
}

.score-value {
    font-size: 32px;
    font-weight: 800;
    color: #e0e0e0;
}

.score-label {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.score-label.score-safe {
    color: #00c853;
}

.score-label.score-medium {
    color: #ffcc00;
}

.score-label.score-high-risk {
    color: #ff3b30;
}

.card-summary .card-body {
    padding: 20px;
}

.card-summary p {
    color: #a0b0c0;
    font-size: 14px;
    line-height: 1.7;
}

footer {
    text-align: center;
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid #1f2a3a;
    color: #3a4a5a;
    font-size: 12px;
}

@media (max-width: 640px) {
    .container {
        padding: 24px 16px;
    }

    header h1 {
        font-size: 22px;
    }

    .search-box {
        flex-direction: column;
        align-items: center;
    }

    .search-box input {
        width: 100%;
    }

    .search-box button {
        width: 100%;
    }

    .cards-grid {
        grid-template-columns: 1fr;
    }
}
