* {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    box-sizing: border-box;
}

html, body {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    color: #1d1d1f;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
    overflow-x: hidden;
}
        
/* macOS style scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
        
::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
}
        
::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}
        
::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* DNS resolution animation */
[data-adnl] {
    transition: background-color 0.3s ease, color 0.3s ease;
}

[data-adnl].dns-resolved {
    background-color: rgba(52, 199, 89, 0.1);
    color: #34C759;
    animation: dns-resolved-flash 0.5s ease;
}

@keyframes dns-resolved-flash {
    0% {
        background-color: rgba(52, 199, 89, 0.3);
    }
    100% {
        background-color: rgba(52, 199, 89, 0.1);
    }
}

.container {
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin-top: 20px;
    margin-bottom: 20px;
}

.header {
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.9) 0%, rgba(88, 86, 214, 0.9) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: white;
    padding: 35px 30px;
    text-align: center;
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="white" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="white" opacity="0.1"/><circle cx="50" cy="10" r="0.5" fill="white" opacity="0.1"/><circle cx="10" cy="60" r="0.5" fill="white" opacity="0.1"/><circle cx="90" cy="40" r="0.5" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

.header h1 {
    margin: 0;
    font-size: 2.8em;
    font-weight: 600;
    text-shadow: 0 2px 8px rgba(0,0,0,0.2);
    position: relative;
    z-index: 1;
}

.header .subtitle {
    margin: 10px 0 0 0;
    font-size: 1.2em;
    opacity: 0.9;
    font-weight: 400;
    position: relative;
    z-index: 1;
}

.nav-buttons {
    margin-top: 25px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
    min-height: 60px; /* 確保有足夠高度 */
}

.nav-button {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: white;
    padding: 12px 20px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.nav-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.nav-button:hover::before {
    left: 100%;
}

.nav-button:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.nav-button.active {
    background: rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    font-weight: 600;
}

.network-selector {
    display: flex;
    align-items: center;
    margin-left: 20px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* 大螢幕優化 - 所有頁面導航按鈕保持居中 */
@media (min-width: 1200px) {
    .nav-buttons {
        max-width: 1000px;
        margin-left: auto;
        margin-right: auto;
        justify-content: center;
        align-items: center;
    }
    
    .nav-buttons > a {
        flex: 0 0 auto;
    }
    
    /* 網路切換器單獨一行，置於導航按鈕下方 */
    .network-selector {
        order: 10;
        margin-left: 0;
        margin-top: 15px;
        flex-basis: 100%;
        justify-content: center;
    }
    
    /* 優化過濾器在大螢幕上的佈局 */
    .filter-row {
        gap: 20px;
    }
    
    .filter-row .filter-group {
        min-width: 160px;
        max-width: 280px;
    }
    
    .filter-row .filter-group:nth-child(4) {
        min-width: 200px;
        max-width: 320px;
    }
}

/* 中等螢幕調整 - 所有頁面導航按鈕保持居中 */
@media (max-width: 1199px) and (min-width: 769px) {
    .nav-buttons {
        justify-content: center;
    }
    
    /* 網路切換器單獨一行，置於導航按鈕下方 */
    .network-selector {
        order: 10;
        margin-left: 0;
        margin-top: 15px;
        flex-basis: 100%;
        justify-content: center;
    }
    
    /* 中等螢幕過濾器優化 */
    .filter-row {
        gap: 12px;
    }
    
    .filter-row .filter-group {
        min-width: 140px;
        max-width: 220px;
    }
    
    .filter-row .filter-group:nth-child(4) {
        min-width: 160px;
        max-width: 250px;
    }
}

.network-switch {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    color: white;
    padding: 8px 12px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.network-switch:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.4);
}

.network-switch:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2);
}

.network-switch option {
    background: #1d1d1f;
    color: white;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    padding: 30px;
    background: rgba(248, 249, 250, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.stat-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    padding: 25px;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #007AFF, #5856D6);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.12);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-card h3 {
    margin: 0 0 12px 0;
    color: #6e6e73;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 600;
    flex-shrink: 0;
}

.stat-card .value {
    font-size: 2.2em;
    font-weight: 700;
    color: #1d1d1f;
    margin: 0;
    line-height: 1.2;
    word-break: break-all;
    overflow-wrap: break-word;
    hyphens: auto;
    -webkit-hyphens: auto;
    font-variant-numeric: tabular-nums;
    flex: 1;
    display: flex;
    align-items: center;
}
        
/* Special handling for long numbers */
.stat-card .value.long-number {
    font-size: 1.8em;
}

.controls {
    padding: 25px 30px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.search-container {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 25px;
}

.search-input {
    background: rgba(248, 249, 250, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    padding: 16px 20px;
    font-size: 15px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex: 1;
    min-width: 300px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    min-height: 44px;
}

.search-input:focus {
    outline: none;
    border-color: #007AFF;
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
    background: rgba(255, 255, 255, 0.95);
}

.filter-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    align-items: stretch;
    margin-bottom: 15px;
    justify-content: flex-start;
}
        
.filter-row .filter-group {
    flex: 1;
    min-width: 150px;
    max-width: 250px;
}

/* Special width for geographic location filter */
.filter-row .filter-group:has(#geoFilter) {
    min-width: 180px;
    max-width: 280px;
}

/* Fallback for browsers that don't support :has() */
.filter-row .filter-group:nth-child(4) {
    min-width: 180px;
    max-width: 280px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.filter-group label {
    font-size: 13px;
    color: #6e6e73;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
        
/* Special styles for validation cycle area */
.cycle-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 200px;
    flex: 1.5; /* 給驗證週期區域更多空間 */
}
        
.cycle-group label {
    font-size: 13px;
    color: #6e6e73;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
        
.cycle-selector {
    background: rgba(248, 249, 250, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    padding: 14px 16px;
    font-size: 14px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    min-width: 200px;
    cursor: pointer;
    width: 100%;
    max-width: 100%;
    min-height: 44px;
    width: -webkit-fill-available;
    padding-right: 36px; /* 留出空間給 iOS/翻譯浮動圖示 */
}
        
.cycle-selector:focus {
    outline: none;
    border-color: #007AFF;
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
    background: rgba(255, 255, 255, 0.95);
}
        
.cycle-info {
    font-size: 13px;
    color: #8e8e93;
    margin-top: 6px;
    font-weight: 500;
    line-height: 1.4;
    word-break: break-word;
    overflow-wrap: break-word;
    padding: 10px 12px;
    background: rgba(248, 249, 250, 0.6);
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.filter-select {
    background: rgba(248, 249, 250, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 14px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    min-width: 150px;
    width: 100%;
    max-width: 100%;
    min-height: 44px;
    width: -webkit-fill-available;
    padding-right: 36px; /* 留出空間給 iOS/翻譯浮動圖示 */
}

.filter-select:focus {
    outline: none;
    border-color: #007AFF;
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
    background: rgba(255, 255, 255, 0.95);
}

.clear-dns-cache-btn {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.2);
    text-transform: none;
    letter-spacing: 0.3px;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    min-width: auto;
}

.clear-dns-cache-btn:hover {
    background: linear-gradient(135deg, #ff5252 0%, #e53e3e 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

.clear-dns-cache-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(255, 107, 107, 0.4);
}
        
/* iPhone mobile optimization - validation cycle and filter areas */
@media (max-width: 768px) {
    .controls {
        padding: 20px;
        background: rgba(255, 255, 255, 0.95);
    }
            
    .search-container {
        flex-direction: column;
        gap: 16px;
        margin-bottom: 20px;
    }
            
    .search-input {
        min-width: 100%;
        padding: 18px 20px;
        font-size: 16px;
        border-radius: 16px;
        /* Prevent iOS zoom */
        font-size: 16px;
        /* Improve touch experience */
        transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    }
            
    .search-input:focus {
        transform: scale(1.02);
        box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.15);
    }
            
    .filter-row { flex-direction: column; gap: 12px; margin-bottom: 0; }
            
    .filter-group, .cycle-group { margin-bottom: 0; min-width: 100%; max-width: none; }
            
    .filter-group label, .cycle-group label { font-size: 13px; font-weight: 700; color: #1d1d1f; margin-bottom: 6px; text-transform: none; letter-spacing: 0.2px; }
            
    .cycle-selector, .filter-select { min-width: 100%; padding: 16px 18px; font-size: 16px; border-radius: 16px; transition: all 0.2s cubic-bezier(0.4,0,0.2,1); background: rgba(248,249,250,0.95); border: 1.5px solid rgba(0,0,0,0.06); }
            
    .cycle-selector:focus, .filter-select:focus {
        transform: scale(1.02);
        box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.15);
        border-color: #007AFF;
        background: rgba(255, 255, 255, 0.95);
    }
            
    .cycle-info { font-size: 13px; padding: 10px 12px; margin-top: 6px; border-radius: 12px; background: rgba(248, 249, 250, 0.85); border: 1px solid rgba(0, 122, 255, 0.08); color: #1d1d1f; font-weight: 500; line-height: 1.45; }
            
    /* Improve selector visual effects on mobile */
    .cycle-selector, .filter-select {
        position: relative;
        overflow: hidden;
    }
            
    .cycle-selector::after, .filter-select::after { content: '▼'; position: absolute; right: 16px; top: 50%; transform: translateY(-50%); color: #8e8e93; font-size: 12px; pointer-events: none; transition: color 0.2s ease; }
            
    .cycle-selector:focus::after, .filter-select:focus::after {
        color: #007AFF;
    }
            
    /* Improve touch experience */
    .cycle-selector, .filter-select {
        -webkit-appearance: none;
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }
            
    /* Improve option display */
    .cycle-selector option, .filter-select option {
        padding: 12px;
        font-size: 16px;
        background: white;
        color: #1d1d1f;
    }
}
        
@media (max-width: 480px) {
    .controls {
        padding: 16px;
    }
            
    .search-container {
        gap: 12px;
        margin-bottom: 16px;
    }
            
    .search-input, .cycle-selector, .filter-select {
        padding: 16px 18px;
        font-size: 16px;
    }
            
    .filter-row {
        gap: 12px;
    }
            
    .filter-group label, .cycle-group label {
        font-size: 13px;
        margin-bottom: 6px;
    }
            
    .cycle-info {
        font-size: 12px;
        padding: 10px 14px;
        margin-top: 6px;
    }
}
        
@media (max-width: 375px) {
    .controls {
        padding: 12px;
    }
            
    .search-container {
        gap: 10px;
        margin-bottom: 12px;
    }
            
    .search-input, .cycle-selector, .filter-select {
        padding: 14px 16px;
        font-size: 16px;
    }
            
    .filter-row {
        gap: 10px;
    }
            
    .filter-group label, .cycle-group label {
        font-size: 12px;
        margin-bottom: 4px;
    }
            
    .cycle-info {
        font-size: 11px;
        padding: 8px 12px;
        margin-top: 4px;
    }
}

#tableContainer {
    overflow-x: auto;
    margin: 0;
    box-shadow: none;
    border: none;
    width: 100%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
}

table {
    width: 100%;
    min-width: 1200px;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
    background: transparent;
}

thead {
    background: rgba(248, 249, 250, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 10;
}

th {
    padding: 18px 12px;
    text-align: left;
    font-weight: 600;
    color: #1d1d1f;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    cursor: pointer;
    user-select: none;
    position: relative;
    white-space: nowrap;
    transition: all 0.2s ease;
}

th:hover {
    background: rgba(0, 122, 255, 0.05);
}

th.sortable::after {
    content: ' ⇅';
    color: #8e8e93;
    font-size: 12px;
}

th.sort-asc::after {
    content: ' ↑';
    color: #007AFF;
}

th.sort-desc::after {
    content: ' ↓';
    color: #007AFF;
}

td {
    padding: 16px 12px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    white-space: nowrap;
    transition: background-color 0.2s ease;
}

tr:hover {
    background-color: rgba(0, 122, 255, 0.02);
}

/* Optimize column width */
th:nth-child(1), td:nth-child(1) { width: 35px; } /* Star */
th:nth-child(2), td:nth-child(2) { width: 50px; } /* Index */
th:nth-child(3), td:nth-child(3) { width: 120px; } /* Label */
th:nth-child(4), td:nth-child(4) { width: 80px; } /* Efficiency */
th:nth-child(5), td:nth-child(5) { width: 70px; } /* Weight */
th:nth-child(6), td:nth-child(6) { width: 90px; } /* Stake */
th:nth-child(7), td:nth-child(7) { width: 70px; } /* Geography */
th:nth-child(8), td:nth-child(8) { width: 70px; } /* Node Version */
th:nth-child(9), td:nth-child(9) { width: 80px; } /* MyTonCtrl Version */
th:nth-child(10), td:nth-child(10) { width: 100px; } /* Type */
th:nth-child(11), td:nth-child(11) { width: 50px; } /* Complaints */
th:nth-child(12), td:nth-child(12) { width: 150px; } /* ADNL Address */
th:nth-child(13), td:nth-child(13) { width: 150px; } /* Wallet Address */
th:nth-child(14), td:nth-child(14) { width: 80px; } /* Details */

.green {
    color: #34C759;
    font-weight: 600;
}

.red {
    color: #FF3B30;
    font-weight: 600;
}

.yellow {
    color: #FF9500;
}

.grey {
    color: #8e8e93;
}

.tr-red {
    background-color: rgba(255, 59, 48, 0.05);
}

.tr-red:hover {
    background-color: rgba(255, 59, 48, 0.08);
}

.tr-green {
    background-color: rgba(52, 199, 89, 0.05);
}

.tr-green:hover {
    background-color: rgba(52, 199, 89, 0.08);
}

.mono, .mono a {
    font-family: 'SF Mono', 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 11px;
    word-break: break-all;
    overflow-wrap: anywhere;
}

a, a:focus, a:active {
    color: #007AFF;
    text-decoration: none;
}

a:hover {
    text-decoration: none;
}

.start {
    cursor: pointer;
    font-size: 18px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.start:hover {
    transform: scale(1.2);
}

.badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.badge-success {
    background: rgba(52, 199, 89, 0.1);
    color: #34C759;
}

.badge-warning {
    background: rgba(255, 149, 0, 0.1);
    color: #FF9500;
}

.badge-danger {
    background: rgba(255, 59, 48, 0.1);
    color: #FF3B30;
}

.badge-info {
    background: rgba(0, 122, 255, 0.1);
    color: #007AFF;
}

.badge-label {
    background: rgba(52, 199, 89, 0.1);
    color: #34C759;
    font-weight: 600;
    font-size: 12px;
}

.complaints-indicator {
    background: #FF3B30;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
}

.country-flag {
    font-size: 16px;
    margin-right: 5px;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-spinner {
    border: 3px solid rgba(0, 122, 255, 0.1);
    border-top: 3px solid #007AFF;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

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

.cycle-info {
    font-size: 12px;
    color: #8e8e93;
    margin-top: 8px;
    font-weight: 500;
    line-height: 1.4;
    word-break: break-word;
    overflow-wrap: break-word;
}

.api-status {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: white;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 12px;
    z-index: 1001;
    display: none;
    min-width: 250px;
    max-width: 350px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.api-status.show {
    display: block;
    animation: slideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.api-status .api-name {
    font-weight: 600;
    color: #34C759;
}

.api-status .api-performance {
    font-size: 11px;
    opacity: 0.9;
    margin-top: 4px;
    word-wrap: break-word;
    white-space: normal;
    line-height: 1.4;
}

/* Responsive design for API status */
@media (max-width: 768px) {
    .api-status {
        top: 10px;
        right: 10px;
        left: 10px;
        min-width: unset;
        max-width: unset;
        width: auto;
        font-size: 11px;
        padding: 10px 12px;
    }
    
    .api-status .api-performance {
        font-size: 10px;
    }
}

.detail-btn {
    background: linear-gradient(135deg, #007AFF, #5856D6);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
}

.detail-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
}

.validator-detail-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.validator-modal-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 30px;
    max-width: 90%;
    max-height: 80%;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.validator-modal-close {
    position: absolute;
    top: 20px;
    right: 25px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #8e8e93;
    transition: color 0.2s ease;
}

.validator-modal-close:hover {
    color: #1d1d1f;
}

.validator-detail-item {
    background: rgba(248, 249, 250, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 20px;
    margin: 15px 0;
    border-radius: 12px;
    border: 1px solid rgba(0, 122, 255, 0.1);
    transition: all 0.3s ease;
}

.validator-detail-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.validator-detail-item h4 {
    margin: 0 0 12px 0;
    color: #1d1d1f;
    font-weight: 600;
}

.validator-detail-item p {
    margin: 6px 0;
    color: #6e6e73;
    font-size: 14px;
    line-height: 1.4;
    word-break: break-word;
}

/* Responsive Design Optimization */
@media (max-width: 1500px) {
    .container {
        max-width: 1200px;
        margin: 20px auto;
    }
}
        
@media (max-width: 1200px) {
    .container {
        max-width: 1000px;
        margin: 15px auto;
    }
            
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 15px;
        padding: 25px;
    }
}
        
@media (max-width: 768px) {
    body {
        padding: 0;
        background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
        /* iPhone Safe Area Support */
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
        padding-bottom: env(safe-area-inset-bottom);
    }
            
    .container {
        max-width: 100%;
        margin: 0;
        border-radius: 0;
        box-shadow: none;
        background: rgba(255, 255, 255, 0.95);
        /* iPhone Safe Area Support */
        padding-top: env(safe-area-inset-top);
    }
            
    .header {
        padding: 24px 20px;
        position: relative;
        border-radius: 0;
        /* Improve Visual Effects on iPhone */
        background: linear-gradient(135deg, rgba(0, 122, 255, 0.95) 0%, rgba(88, 86, 214, 0.95) 100%);
    }
            
    .header h1 {
        font-size: 2.2em;
        margin-bottom: 12px;
        line-height: 1.2;
        font-weight: 700;
    }
            
    .header .subtitle {
        font-size: 1.1em;
        margin: 12px 0 0 0;
        opacity: 0.95;
    }
            
    .nav-buttons {
        flex-direction: column;
        align-items: center;
        gap: 12px;
        margin-top: 24px;
    }
    
    .network-selector {
        margin-left: 0;
        margin-top: 12px;
        width: 100%;
        max-width: 320px;
        justify-content: center;
    }
    
    .network-selector label {
        font-size: 16px;
        margin-right: 12px;
    }
    
    .network-switch {
        padding: 12px 16px;
        font-size: 16px;
        min-height: 48px;
        flex: 1;
    }
            
    .nav-button {
        width: 100%;
        max-width: 320px;
        text-align: center;
        padding: 16px 20px;
        font-size: 16px;
        border-radius: 16px;
        touch-action: manipulation;
        min-height: 52px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: 600;
        /* Improve Touch Feedback */
        transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    }
            
    .nav-button:active {
        transform: scale(0.98);
        background: rgba(255, 255, 255, 0.35);
    }
            
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
        padding: 20px;
        background: rgba(248, 249, 250, 0.3);
    }
            
    .stat-card {
        padding: 20px;
        min-height: 120px;
        border-radius: 16px;
        /* Improve Touch Experience */
        touch-action: manipulation;
    }
            
    .stat-card h3 {
        font-size: 0.8em;
        margin-bottom: 10px;
        font-weight: 700;
    }
            
    .stat-card .value {
        font-size: 1.6em;
        line-height: 1.1;
        font-weight: 800;
    }
            
    .stat-card .value.long-number {
        font-size: 1.4em;
    }
            
    .controls {
        padding: 20px;
        background: rgba(255, 255, 255, 0.95);
    }
            
    .search-container, .filter-row {
        flex-direction: column;
        gap: 16px;
    }
            
    .filter-group, .cycle-group {
        margin-bottom: 0;
        min-width: 100%;
        max-width: none;
    }
            
    .search-input, .filter-select, .cycle-selector {
        min-width: 100%;
        padding: 18px 20px;
        font-size: 16px;
        border-radius: 16px;
        touch-action: manipulation;
        /* Prevent iOS Zoom */
        font-size: 16px;
        /* Improve Touch Experience */
        transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    }
            
    .search-input:focus, .filter-select:focus, .cycle-selector:focus {
        transform: scale(1.02);
        box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.15);
    }
            
    .cycle-info {
        font-size: 12px;
        padding: 12px;
        margin-top: 8px;
        border-radius: 12px;
    }
            
    /* Use Card Layout for Tables on Mobile */
    #tableContainer {
        padding: 20px;
        background: rgba(255, 255, 255, 0.95);
    }
            
    table {
        display: none;
    }
            
    .mobile-table {
        display: block;
    }
            
    /* Hide Desktop Table, Show Mobile Cards */
    .mobile-card {
        display: block;
    }
}
        
/* Hide Mobile Cards on Desktop */
@media (min-width: 769px) {
    .mobile-table {
        display: none;
    }
            
    .mobile-card {
        display: none;
    }
}
        
.mobile-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    margin-bottom: 16px;
    padding: 20px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    touch-action: manipulation;
    /* Improve Touch Experience */
    position: relative;
    overflow: hidden;
}
            
.mobile-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #007AFF, #5856D6);
    opacity: 0;
    transition: opacity 0.3s ease;
}
            
.mobile-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}
        
.mobile-card:active {
    transform: scale(0.98);
}
        
.mobile-card:hover::before {
    opacity: 1;
}
            
.mobile-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}
            
.mobile-card-title {
    font-weight: 700;
    color: #1d1d1f;
    font-size: 16px;
    flex: 1;
    line-height: 1.3;
}
            
.mobile-card-index {
    background: linear-gradient(135deg, #007AFF, #5856D6);
    color: white;
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    margin-left: 12px;
    min-width: 40px;
    text-align: center;
}
            
.mobile-card-content {
    font-size: 14px;
    line-height: 1.5;
}
            
.mobile-card-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    align-items: center;
    padding: 6px 0;
    min-height: 24px;
}
            
.mobile-card-label {
    color: #6e6e73;
    font-weight: 600;
    font-size: 14px;
    min-width: 70px;
}
            
.mobile-card-value {
    color: #1d1d1f;
    text-align: right;
    flex: 1;
    margin-left: 16px;
    font-weight: 600;
    font-size: 14px;
    font-variant-numeric: tabular-nums;
}
            
.mobile-card-value.mono {
    font-family: 'SF Mono', 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 11px;
    word-break: break-all;
}
        
@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 16px;
    }
            
    .header h1 {
        font-size: 2em;
    }
            
    .header .subtitle {
        font-size: 1em;
    }
            
    .nav-button {
        max-width: 300px;
        padding: 14px 18px;
        font-size: 15px;
    }
            
    .mobile-card {
        padding: 16px;
        margin-bottom: 12px;
    }
            
    .mobile-card-content { font-size: 14px; }
            
    .mobile-card-row {
        margin-bottom: 6px;
    }
            
    .mobile-card-label { font-size: 13px; min-width: 60px; }
            
    .mobile-card-value { font-size: 13px; }
            
    .controls {
        padding: 16px;
    }
            
    .search-input, .filter-select, .cycle-selector {
        padding: 16px 18px;
        font-size: 16px;
    }
}
        
@media (max-width: 375px) {
    .header {
        padding: 20px 16px;
    }
            
    .header h1 {
        font-size: 1.8em;
    }
            
    .header .subtitle {
        font-size: 0.95em;
    }
            
    .nav-button {
        max-width: 280px;
        padding: 12px 16px;
        font-size: 14px;
    }
            
    .stats-grid {
        padding: 12px;
        gap: 10px;
    }
            
    .stat-card {
        padding: 16px;
        min-height: 100px;
    }
            
    .stat-card h3 {
        font-size: 0.75em;
    }
            
    .stat-card .value {
        font-size: 1.4em;
    }
            
    .mobile-card {
        padding: 14px;
    }
            
    .mobile-card-header {
        margin-bottom: 12px;
        padding-bottom: 12px;
    }
            
    .mobile-card-title {
        font-size: 15px;
    }
            
    .mobile-card-content {
        font-size: 12px;
    }
            
    .mobile-card-row {
        margin-bottom: 4px;
        padding: 4px 0;
    }
            
    .mobile-card-label {
        font-size: 11px;
        min-width: 55px;
    }
            
    .mobile-card-value {
        font-size: 11px;
    }
}
        
/* iPhone Safe Area Support - More Complete Implementation */
@supports (padding: max(0px)) {
    @media (max-width: 768px) {
        body {
            padding-left: max(0px, env(safe-area-inset-left));
            padding-right: max(0px, env(safe-area-inset-right));
            padding-bottom: max(0px, env(safe-area-inset-bottom));
        }
                
        .container {
            padding-top: max(0px, env(safe-area-inset-top));
        }
                
        /* Ensure content is not blocked by safe area */
        .header {
            padding-top: max(24px, env(safe-area-inset-top) + 12px);
            padding-bottom: max(24px, env(safe-area-inset-bottom) + 12px);
        }
                
        /* Safe area support for bottom button area */
        .nav-buttons {
            padding-bottom: max(0px, env(safe-area-inset-bottom));
        }
    }
}
        
/* Touch Optimization - More Complete Implementation */
@media (max-width: 768px) {
    /* 確保所有可點擊元素都有足夠的觸控區域 */
    .start {
        min-height: 48px;
        min-width: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
        touch-action: manipulation;
        border-radius: 50%;
        transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    }
            
    .start:active {
        transform: scale(0.9);
    }
            
    .detail-btn {
        min-height: 48px;
        padding: 14px 18px;
        font-size: 15px;
        touch-action: manipulation;
        border-radius: 12px;
        font-weight: 600;
        transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    }
            
    .detail-btn:active {
        transform: scale(0.95);
    }
            
    .nav-button {
        min-height: 52px;
        touch-action: manipulation;
        /* 防止雙擊縮放 */
        -webkit-tap-highlight-color: transparent;
    }
            
    /* 改善滾動體驗 */
    .container {
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
    }
            
    /* 改善輸入框體驗 */
    .search-input, .filter-select, .cycle-selector {
        -webkit-appearance: none;
        -webkit-tap-highlight-color: transparent;
        /* 防止 iOS 自動縮放 */
        font-size: 16px;
    }
            
    /* 改善表格滾動 */
    #tableContainer {
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
    }
}
        
/* Loading animation optimization */
.loading-overlay {
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}
        
/* Improve loading animation display on mobile */
@media (max-width: 768px) {
    .loading-overlay {
        background: rgba(255, 255, 255, 0.95);
    }
            
    .loading-spinner {
        width: 60px;
        height: 60px;
        border-width: 4px;
    }
}

.error-message {
    background: rgba(255, 59, 48, 0.1);
    color: #FF3B30;
    padding: 16px;
    border-radius: 12px;
    border: 1px solid rgba(255, 59, 48, 0.2);
    margin: 16px;
    font-weight: 500;
    text-align: center;
}

.success-message {
    background: rgba(52, 199, 89, 0.1);
    color: #34C759;
    padding: 16px;
    border-radius: 12px;
    border: 1px solid rgba(52, 199, 89, 0.2);
    margin: 16px;
    font-weight: 500;
    text-align: center;
}


/* Anchor styled action chip (unified with .detail-btn) */
.detail-link {
    background: linear-gradient(135deg, #007AFF, #5856D6);
    color: white !important;
    padding: 6px 12px;
    border-radius: 8px;
    text-decoration: none !important;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-block;
    border: none;
}

.detail-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
    text-decoration: none !important;
}

/* Nominators: address column monospace block */
.address-cell {
    font-family: 'SF Mono', 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 11px;
    line-height: 1.3;
    word-break: break-all;
    overflow-wrap: break-word;
}

/* Nominators: page-specific table column widths override */
body.page-nominators table thead th:nth-child(1),
body.page-nominators table tbody td:nth-child(1) { width: 60px; }
body.page-nominators table thead th:nth-child(2),
body.page-nominators table tbody td:nth-child(2) { width: 400px; }
body.page-nominators table thead th:nth-child(3),
body.page-nominators table tbody td:nth-child(3) { width: 150px; }
body.page-nominators table thead th:nth-child(4),
body.page-nominators table tbody td:nth-child(4) { width: 100px; }

/* Nominators: modal styles */
.detail-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 30px;
    max-width: 90%;
    max-height: 80%;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.modal-close {
    position: absolute;
    top: 20px; right: 25px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #8e8e93;
    transition: color 0.2s ease;
}

.modal-close:hover { color: #1d1d1f; }

.stake-breakdown { margin-top: 20px; }

.stake-item {
    background: rgba(248, 249, 250, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 20px;
    margin: 15px 0;
    border-radius: 12px;
    border: 1px solid rgba(0, 122, 255, 0.1);
    transition: all 0.3s ease;
}

.stake-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.address-link {
    cursor: pointer;
    color: #007AFF;
    text-decoration: underline;
    transition: color 0.2s ease;
}

.address-link:hover { color: #0056CC; }

/* KTON Viewer: container and React root sizing */
.ktonviewer-container {
    width: 100%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    padding: 20px;
}

#root { width: 100%; min-height: 600px; }

/* KTON Viewer: Tailwind utility overrides to match macOS design */
.bg-gray-100, .bg-gradient-to-br { background: transparent !important; }

.bg-blue-600 {
    background: linear-gradient(135deg, #007AFF, #5856D6) !important;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
}

.bg-blue-600:hover, .hover\:bg-blue-700:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 122, 255, 0.4);
    background: linear-gradient(135deg, #0056CC, #4A44B8) !important;
}

.bg-green-600 {
    background: linear-gradient(135deg, #34C759, #30B950) !important;
    border: none;
    box-shadow: 0 4px 12px rgba(52, 199, 89, 0.3);
}

.bg-green-600:hover, .hover\:bg-green-700:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(52, 199, 89, 0.4);
    background: linear-gradient(135deg, #28A745, #268238) !important;
}

.bg-purple-600 {
    background: linear-gradient(135deg, #8E44AD, #9B59B6) !important;
    border: none;
    box-shadow: 0 4px 12px rgba(142, 68, 173, 0.3);
}

.bg-purple-600:hover, .hover\:bg-purple-700:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(142, 68, 173, 0.4);
    background: linear-gradient(135deg, #7D3C98, #8A4FBE) !important;
}

.border-gray-300 { border-color: rgba(0, 0, 0, 0.1) !important; }
.bg-gray-50 {
    background: rgba(248, 250, 252, 0.8) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.focus\:ring-2:focus, .focus\:ring-blue-500:focus {
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1) !important;
    border-color: #007AFF !important;
}
.rounded-lg, .rounded-xl { border-radius: 12px !important; }
.text-white { color: #fff !important; }
.bg-white {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
}
.shadow-lg { box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08) !important; }
.border-gray-100 { border-color: rgba(0, 0, 0, 0.05) !important; }

/* KTON Viewer: text color utilities alignment */
.text-green-800 { color: #1e7e34 !important; }
.text-yellow-800 { color: #856404 !important; }
.text-red-800 { color: #721c24 !important; }
.text-blue-800 { color: #003d82 !important; }
.text-blue-600 { color: #007AFF !important; }
.text-green-600 { color: #34C759 !important; }
.text-purple-600 { color: #8E44AD !important; }
.text-gray-800 { color: #1d1d1f !important; }
.text-gray-600 { color: #86868b !important; }
.text-gray-500 { color: #a1a1aa !important; }
.text-gray-900 { color: #000 !important; }

/* KTON Viewer: JSON viewer */
.react-json-view {
    background: rgba(248, 249, 250, 0.8) !important;
    border-radius: 12px !important;
    padding: 15px !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
}


