:root {
    --bg: #f0f4f8;
    --surface: #ffffff;
    --surface-hover: #f8fafc;
    --text: #1a202c;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --primary-light: rgba(59, 130, 246, 0.1);
    --download: #3b82f6;
    --upload: #8b5cf6;
    --ping: #10b981;
    --jitter: #f59e0b;
    --border: #e2e8f0;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 12px 48px rgba(0, 0, 0, 0.1);
    --radius: 16px;
    --radius-sm: 12px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
}

[data-theme="dark"] {
    --bg: #0f172a;
    --surface: #1e293b;
    --surface-hover: #334155;
    --text: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border: #334155;
    --primary-light: rgba(59, 130, 246, 0.15);
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 12px 48px rgba(0, 0, 0, 0.4);
}

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background var(--transition), color var(--transition);
    line-height: 1.6;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    inset: 0;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}
.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
.loading-content { text-align: center; }
.loader-ring {
    width: 56px; height: 56px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 1rem;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-content h3 { font-size: 1.25rem; margin-bottom: 0.25rem; }
.loading-content p { color: var(--text-secondary); font-size: 0.9rem; }

/* Header */
.header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
    background: rgba(255,255,255,0.85);
}
[data-theme="dark"] .header {
    background: rgba(30,41,59,0.85);
}
.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.875rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.logo { text-decoration: none; display: flex; align-items: center; gap: 0.5rem; }
.logo-svg { display: block; flex-shrink: 0; color: var(--text); }
.logo-accent { color: var(--primary); }
.main-nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}
.main-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all var(--transition);
}
.main-nav .nav-link:hover {
    background: var(--primary-light);
    color: var(--primary);
}
.main-nav .nav-link.active {
    background: var(--primary-light);
    color: var(--primary);
}
.main-nav .nav-link i { font-size: 0.85rem; }
.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}
.status-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
    transition: background 0.3s;
}
.status.connected .status-dot { background: var(--ping); box-shadow: 0 0 8px var(--ping); }
.status.testing .status-dot { background: var(--primary); animation: pulse 1s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

.theme-toggle {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    width: 36px; height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition);
    font-size: 1rem;
}
.theme-toggle:hover {
    background: var(--surface-hover);
    color: var(--text);
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem 3rem;
    flex: 1;
}

/* Hero */
.hero {
    text-align: center;
    margin-bottom: 2rem;
}
.hero h1 {
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--upload));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero-sub {
    color: var(--text-secondary);
    font-size: 1.05rem;
    margin-top: 0.5rem;
}

/* Control Panel */
.control-panel {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    margin-bottom: 2rem;
    flex-wrap: wrap;
}
.server-select-wrap {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    flex: 1;
    min-width: 200px;
}
.server-select-wrap i { color: var(--primary); font-size: 1rem; }
.server-select {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    color: var(--text);
    font-size: 0.875rem;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: all var(--transition);
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    min-width: 180px;
}
.server-select:hover { border-color: var(--primary); }
.server-select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.server-location {
    color: var(--text-muted);
    font-size: 0.8rem;
    white-space: nowrap;
}
.test-button {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.8rem 2rem;
    border: none;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition);
    font-family: var(--font);
    white-space: nowrap;
}
.test-button:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(59,130,246,0.35); }
.test-button:active { transform: scale(0.97); }
.test-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}
.test-button.testing {
    background: linear-gradient(135deg, var(--text-muted), var(--text-secondary));
}

/* Big Metric Display */
.big-metric-display {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 2.5rem 2rem;
    text-align: center;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    margin-bottom: 2rem;
    transition: all var(--transition);
}
.big-metric-display.active {
    border-color: var(--download);
    box-shadow: 0 0 30px rgba(59,130,246,0.1);
}
.big-metric-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}
.big-metric-icon { font-size: 2rem; color: var(--download); }
.big-metric-title { font-size: 1.4rem; font-weight: 700; color: var(--text); }
.big-metric-display .metric-display {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.25rem;
    margin-bottom: 1.5rem;
}
.big-metric-value {
    font-size: 4rem;
    font-weight: 800;
    line-height: 1;
    color: var(--text);
    transition: all 0.2s;
}
.big-metric-unit {
    font-size: 1.25rem;
    color: var(--text-secondary);
    font-weight: 600;
}
.progress-visual {
    height: 8px;
    background: var(--border);
    border-radius: 99px;
    overflow: hidden;
    margin-bottom: 0.75rem;
}
.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--download), var(--upload));
    border-radius: 99px;
    transition: width 0.3s ease;
}
.progress-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

/* Other Metrics */
.other-metrics {
    display: none;
    margin-bottom: 2rem;
}
.other-metrics.show { display: block; animation: fadeSlideUp 0.5s ease; }
.section-title {
    text-align: center;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text);
}
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}
.metric-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1.75rem 1.5rem;
    text-align: center;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    transition: all var(--transition);
    opacity: 0;
    transform: translateY(20px);
}
.metric-card.visible {
    opacity: 1;
    transform: translateY(0);
}
.metric-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.metric-card.upload { border-top: 4px solid var(--upload); }
.metric-card.ping { border-top: 4px solid var(--ping); }
.metric-card.jitter { border-top: 4px solid var(--jitter); }
.metric-icon-wrap {
    width: 48px; height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.3rem;
}
.metric-card.upload .metric-icon-wrap { background: rgba(139,92,246,0.12); color: var(--upload); }
.metric-card.ping .metric-icon-wrap { background: rgba(16,185,129,0.12); color: var(--ping); }
.metric-card.jitter .metric-icon-wrap { background: rgba(245,158,11,0.12); color: var(--jitter); }
.metric-card h3 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.metric-card .metric-display {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
}
.metric-card .metric-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text);
    transition: all 0.2s;
}
.metric-card .metric-unit {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
}
.metric-card p {
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* Results Panel */
.results-panel {
    display: none;
    background: var(--surface);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    box-shadow: var(--shadow);
    border: 2px solid var(--ping);
    margin-bottom: 2rem;
}
.results-panel.show { display: block; animation: fadeSlideUp 0.5s ease; }
.results-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}
.results-header i { font-size: 2rem; color: var(--ping); }
.results-header h2 { font-size: 1.5rem; font-weight: 800; color: var(--text); }
.result-timestamp, .isp-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}
.action-buttons {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}
.secondary-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.25rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    font-family: var(--font);
}
.secondary-button:hover {
    background: var(--surface-hover);
    border-color: var(--primary);
    color: var(--primary);
}

/* Footer */
.footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 1.5rem;
    text-align: center;
}
.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
}
.footer p {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
}
.footer-links {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}
.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: color var(--transition);
}
.footer-links a:hover { color: var(--primary); }

/* Modals */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: fadeIn 0.2s ease;
}
.modal-overlay.open { display: flex; }
.modal-container {
    background: var(--surface);
    border-radius: var(--radius);
    max-width: 520px;
    width: 100%;
    box-shadow: var(--shadow-lg);
    animation: scaleIn 0.25s ease;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes scaleIn { from { transform: scale(0.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes fadeSlideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

.modal-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
}
.modal-icon {
    font-size: 1.5rem;
    color: var(--primary);
}
.modal-header h2 {
    flex: 1;
    font-size: 1.15rem;
    font-weight: 700;
}
.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 8px;
    transition: all var(--transition);
}
.modal-close:hover { background: var(--surface-hover); color: var(--text); }
.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    color: var(--text-secondary);
    line-height: 1.7;
}
.modal-body p { margin-bottom: 1rem; }
.privacy-list, .tips-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.privacy-list li, .tips-list li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--primary-light);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    color: var(--text);
}
.privacy-list li i, .tips-list li i {
    color: var(--primary);
    font-size: 1.1rem;
    width: 1.25rem;
    text-align: center;
}
.help-steps {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding-left: 1.25rem;
}
.help-steps li {
    padding: 0.5rem 0;
    color: var(--text);
    font-size: 0.95rem;
}
.help-steps li strong { color: var(--primary); }
.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
}
.modal-btn {
    padding: 0.6rem 1.5rem;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    font-family: var(--font);
    font-size: 0.9rem;
}
.modal-btn.primary {
    background: var(--primary);
    color: #fff;
}
.modal-btn.primary:hover { background: var(--primary-dark); }

/* Responsive - Mobile First */
@media (max-width: 1024px) {
    .sidebar { width: 200px; }
}

@media (max-width: 900px) {
    .sidebar { display: none; }
    .main-layout { flex-direction: column; }
    .ad-container.ad-left-top,
    .ad-container.ad-left-bottom,
    .ad-container.ad-sidebar-top,
    .ad-container.ad-sidebar-bottom { display: none; }
}

@media (max-width: 768px) {
    .header-inner { padding: 0.6rem 1rem; flex-wrap: wrap; gap: 0.4rem; }
    .logo { font-size: 1.1rem; }
    .main-nav { order: 3; width: 100%; justify-content: center; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .main-nav .nav-link { font-size: 0.8rem; padding: 0.4rem 0.7rem; white-space: nowrap; }
    .status span:last-child { display: none; }
    .status-dot { width: 10px; height: 10px; }
    .theme-toggle { width: 40px; height: 40px; font-size: 1.1rem; }
    .container { padding: 1rem 0.75rem 2rem; }
    .hero { margin-bottom: 1.25rem; }
    .hero h1 { font-size: 1.4rem; }
    .hero-sub { font-size: 0.85rem; }
    .control-panel { flex-direction: column; align-items: stretch; padding: 1rem; gap: 0.75rem; }
    .server-select-wrap { flex-wrap: wrap; justify-content: center; min-width: 0; }
    .server-select { min-width: 0; width: 100%; }
    .server-location { display: none; }
    .test-button { justify-content: center; padding: 0.85rem 1.5rem; font-size: 1.05rem; min-height: 48px; }
    .big-metric-display { padding: 1.5rem 1rem; }
    .big-metric-value { font-size: 2.75rem; }
    .big-metric-title { font-size: 1.15rem; }
    .big-metric-header .big-metric-icon { font-size: 1.5rem; }
    .metrics-grid { grid-template-columns: 1fr; }
    .metric-card { padding: 1.25rem 1rem; }
    .metric-card .metric-value { font-size: 1.75rem; }
    .metric-card .metric-icon-wrap { width: 40px; height: 40px; font-size: 1.1rem; }
    .results-panel { padding: 1.25rem; }
    .action-buttons { flex-direction: column; align-items: center; }
    .secondary-button { width: 100%; justify-content: center; min-height: 44px; }
    .network-grid { grid-template-columns: repeat(2, 1fr); gap: 0.6rem; }
    .network-info { padding: 1.25rem; }
    .network-card { padding: 1rem 0.75rem; }
    .network-card-icon { width: 36px; height: 36px; font-size: 0.95rem; }
    .section-title { font-size: 1.1rem; margin-bottom: 1rem; }
    .footer { padding: 1.25rem 0.75rem; }
    .footer-links { gap: 0.75rem; }
    .footer-links a { font-size: 0.8rem; }
    .modal-container { margin: 0.5rem; max-width: 100%; width: calc(100% - 1rem); }
    .modal-header { padding: 1rem; }
    .modal-body { padding: 1rem; }
    .modal-footer { padding: 0.75rem 1rem; }
    .wide-modal { max-width: 100% !important; }
    .article-content h2 { font-size: 1.15rem; }
    .article-content h3 { font-size: 1rem; }
    .blog-grid { grid-template-columns: 1fr; gap: 1rem; }
    .blog-section { margin: 1.5rem 0; }
    .blog-card { padding: 1.25rem; }
    .blog-card h3 { font-size: 1rem; }
    .ad-container.ad-header-top { margin-bottom: 1rem; }
    .ad-container.ad-between-results { margin: 1rem 0; }
}

@media (max-width: 480px) {
    .header-inner { padding: 0.5rem 0.75rem; }
    .logo { font-size: 1rem; }
    .main-nav .nav-link { font-size: 0.75rem; padding: 0.35rem 0.5rem; }
    .container { padding: 0.75rem 0.5rem 1.5rem; }
    .hero h1 { font-size: 1.2rem; }
    .hero-sub { font-size: 0.8rem; }
    .control-panel { padding: 0.75rem; border-radius: 12px; }
    .test-button { padding: 0.75rem 1rem; font-size: 0.95rem; }
    .big-metric-display { padding: 1.25rem 0.75rem; border-radius: 12px; }
    .big-metric-value { font-size: 2.25rem; }
    .big-metric-unit { font-size: 0.9rem; }
    .big-metric-title { font-size: 1rem; }
    .metric-card { padding: 1rem 0.75rem; }
    .metric-card .metric-value { font-size: 1.5rem; }
    .network-grid { grid-template-columns: 1fr; }
    .results-panel { padding: 1rem; }
    .results-header h2 { font-size: 1.2rem; }
    .results-header i { font-size: 1.5rem; }
    .modal-container { margin: 0.25rem; width: calc(100% - 0.5rem); border-radius: 12px; }
    .modal-header h2 { font-size: 1rem; }
    .footer p { font-size: 0.75rem; }
    .footer-links a { font-size: 0.75rem; }
    .blog-card { padding: 1rem; }
    .blog-card h3 { font-size: 0.95rem; }
    .blog-card p { font-size: 0.85rem; }
}

@media (max-width: 360px) {
    .hero h1 { font-size: 1.05rem; }
    .big-metric-value { font-size: 1.8rem; }
    .main-nav .nav-link { font-size: 0.7rem; padding: 0.3rem 0.4rem; }
}

/* Network Info */
.network-info {
    display: none;
    background: var(--surface);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    margin-bottom: 2rem;
}
.network-info.show { display: block; animation: fadeSlideUp 0.5s ease; }
.network-info .section-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    margin-bottom: 1.5rem;
}
.network-info .section-title i { color: var(--primary); }
.network-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.875rem;
}
.network-card {
    background: var(--bg);
    border-radius: var(--radius-sm);
    padding: 1.25rem 1rem;
    text-align: center;
    border: 1px solid var(--border);
    transition: all var(--transition);
}
.network-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    border-color: var(--primary);
}
.network-card-icon {
    width: 40px; height: 40px;
    border-radius: 12px;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.75rem;
    font-size: 1.1rem;
}
.network-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}
.network-value {
    display: block;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
    word-break: break-all;
}
/* Main Layout - Blog + Sidebars */
.main-layout {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}
.main-content {
    flex: 1;
    min-width: 0;
}
.sidebar {
    width: 260px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Ad Containers */
.ad-container {
    text-align: center;
    overflow: hidden;
    border-radius: var(--radius-sm);
    background: var(--surface);
    border: 1px solid var(--border);
    margin-bottom: 1.5rem;
    padding: 0.5rem;
}
.ad-container img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
}
.sidebar .ad-container {
    max-width: 100%;
    overflow: hidden;
}
.sidebar .ad-container img {
    max-width: 100%;
    width: 100%;
    height: auto;
    object-fit: contain;
}
.ad-container.ad-header-top { margin-bottom: 1.5rem; }
.ad-container.ad-between-results { margin: 1.5rem 0; }

.ad-container.ad-sidebar-top, .ad-container.ad-sidebar-bottom { margin-bottom: 1rem; }
.ad-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}

/* Blog Section */
.blog-section {
    margin: 2.5rem 0;
}
.blog-section .section-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
}
.blog-section .section-title i { color: var(--primary); }
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
    margin-top: 1.5rem;
}
.blog-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1.5rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: all var(--transition);
}
.blog-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.blog-card-date {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}
.blog-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}
.blog-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.blog-card .blog-read-more {
    color: var(--primary);
    font-weight: 600;
    font-size: 0.85rem;
    margin-top: 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

/* Article Modal */
.wide-modal { max-width: 720px !important; }
.article-content { line-height: 1.8; }
.article-content h2 { font-size: 1.3rem; margin: 1.5rem 0 0.75rem; color: var(--text); }
.article-content h3 { font-size: 1.1rem; margin: 1.25rem 0 0.5rem; color: var(--text); }
.article-content p { margin-bottom: 1rem; color: var(--text-secondary); }
.article-content a { color: var(--primary); }
.article-content ul, .article-content ol { margin: 0 0 1rem 1.5rem; color: var(--text-secondary); }
.article-content li { margin-bottom: 0.35rem; }
.article-content img { max-width: 100%; border-radius: 8px; margin: 1rem 0; }

.blog-grid-ad {
    grid-column: 1 / -1;
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1rem;
    border: 1px solid var(--border);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.blog-grid-ad img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
}
.blog-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}
.blog-empty i { font-size: 3rem; margin-bottom: 1rem; display: block; }

/* Utility */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
.skeleton {
    background: linear-gradient(90deg, var(--border) 25%, var(--surface-hover) 50%, var(--border) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}