/* å…¨å±€æ ·å¼é‡ç½® */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* åŸºç¡€æ ·å¼ */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background: #f9fafb;
    min-height: 100vh;
    padding: 2rem 1rem;
    line-height: 1.6;
}

.container {
    max-width: 80rem;
    margin: 0 auto;
}

/* æ ‡é¢˜åŒºåŸŸ */
.header {
    text-align: center;
    margin-bottom: 2rem;
}

.title {
    font-size: 2.5rem;
    font-weight: bold;
    color: #dc2626;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(220, 38, 38, 0.1);
}

.subtitle {
    color: #6b7280;
    font-size: 1rem;
}

/* çº¿è·¯ç½‘æ ¼å¸ƒå±€ */
.routes-grid {
    max-width: 660px; /* 5æŒ‰é’® * 120px + 4é—´éš™ * 8px */
    margin: 0 auto 2rem auto;
}

/* æ™®é€šçº¿è·¯å’Œé˜²å°çº¿è·¯å®¹å™¨ */
.normal-routes,
.defensive-routes {
    display: flex;
    flex-wrap: wrap;
    justify-content: center; /* æ°´å¹³å±…ä¸­ */
    gap: 0.5rem;
    margin-bottom: 1rem;
    width: 100%;
}

/* ç§»åŠ¨ç«¯å¸ƒå±€ - 2åˆ—æ•´æ´æŽ’åˆ— */
@media (max-width: 1023px) {
    .routes-grid {
        max-width: 20rem;
        margin: 0 auto 3rem;
    }

    .normal-routes,
    .defensive-routes {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
        margin-bottom: 1rem;
        width: 100%;
    }

    .title {
        font-size: 2rem;
    }
}

/* çº¿è·¯æŒ‰é’®æ ·å¼ - å›ºå®šå®½é«˜ */
.route-btn {
    width: 120px !important;
    min-height: 55px !important;
    padding: 0.625rem;
    border-radius: 0.5rem;
    border: 2px solid #d1d5db;
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-size: 0.75rem;
    transition: all 0.2s ease;
}

.route-btn:hover:not(:disabled) {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.route-btn:active:not(:disabled) {
    background-color: #dcfce7;
    transform: translateY(0);
}

.route-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.route-btn.detecting {
    animation: pulse 2s infinite;
    border-color: #a78bfa;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* çº¿è·¯ä¿¡æ¯æ ·å¼ - å°å­—ä½“ */
.route-name {
    font-weight: 600;
    margin-bottom: 0.25rem;
    font-size: 0.75rem;
}

.route-name.normal {
    color: #15803d;
}

.route-name.defensive {
    color: #1d4ed8;
}

.route-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    margin-bottom: 0.25rem;
}

.status-dot {
    width: 0.375rem;
    height: 0.375rem;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-dot.excellent {
    background-color: #10b981;
}

.status-dot.fair {
    background-color: #f59e0b;
}

.status-dot.poor {
    background-color: #ef4444;
}

.response-time {
    font-size: 0.75rem;
    font-weight: 500;
}

.response-time.excellent {
    color: #059669;
}

.response-time.fair {
    color: #d97706;
}

.response-time.poor {
    color: #dc2626;
}

.node-count {
    font-size: 0.75rem;
    color: #9ca3af;
}

/* åŠŸèƒ½æŒ‰é’®åŒºåŸŸ */
.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    justify-content: center;
    align-items: center;
    max-width: 32rem;
    margin: 0 auto 2rem;
}

@media (min-width: 640px) {
    .action-buttons {
        flex-direction: row;
    }
}

.action-btn {
    width: 100%;
    padding: 1rem 2.5rem;
    font-weight: bold;
    border-radius: 0.75rem;
    transition: all 0.2s ease;
    font-size: 1.125rem;
    min-width: 9.375rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

@media (min-width: 640px) {
    .action-btn {
        width: auto;
    }
}

.action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.action-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.btn-redetect {
    background-color: #10b981;
    color: white;
}

.btn-redetect:hover:not(:disabled) {
    background-color: #059669;
}

.btn-download {
    background-color: #3b82f6;
    color: white;
}

.btn-download:hover:not(:disabled) {
    background-color: #2563eb;
}

.btn-service {
    background-color: #f97316;
    color: white;
}

.btn-service:hover:not(:disabled) {
    background-color: #ea580c;
}

.btn-text {
    position: relative;
    z-index: 1;
}

/* çŠ¶æ€ä¿¡æ¯ */
.status-info {
    text-align: center;
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-size: 0.75rem;
    color: #6b7280;
    line-height: 1.5;
}

.status-row {
    margin-bottom: 0.25rem;
}

.status-label {
    font-weight: 500;
}

/* çŠ¶æ€å›¾ä¾‹ */
.status-legend {
    text-align: center;
    font-size: 0.75rem;
    color: #9ca3af;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    white-space: nowrap;
}

.legend-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    flex-shrink: 0;
}

.legend-dot.excellent {
    background-color: #10b981;
}

.legend-dot.fair {
    background-color: #f59e0b;
}

.legend-dot.poor {
    background-color: #ef4444;
}

/* å“åº”å¼è°ƒæ•´ */
@media (max-width: 640px) {
    body {
        padding: 1rem 0.5rem;
    }

    .container {
        padding: 0;
    }

    .title {
        font-size: 1.75rem;
    }

    .route-btn {
        min-height: 3.5rem;
        padding: 0.5rem;
        width: 100% !important;
    }

    .action-btn {
        font-size: 1rem;
        padding: 0.875rem 2rem;
    }

    .status-legend {
        gap: 0.5rem;
        font-size: 0.625rem;
    }
}

/* åŠ è½½çŠ¶æ€ */
.loading {
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 1rem;
    height: 1rem;
    margin: -0.5rem 0 0 -0.5rem;
    border: 2px solid #e5e7eb;
    border-top: 2px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
.title-small {
  font-size: 0.5rem;
  color: inherit; /* ç»§æ‰¿åŽŸæ¥çš„é¢œè‰² */
}