/* ============ CSS Reset & Variables ============ */
:root {
    --bg-primary: #060d0a;
    --bg-secondary: #0a1510;
    --bg-card: rgba(10, 25, 18, 0.85);
    --bg-card-hover: rgba(14, 32, 22, 0.9);
    --border-color: rgba(46, 213, 115, 0.12);
    --border-glow: rgba(46, 213, 115, 0.25);
    --text-primary: #d1fae5;
    --text-secondary: #86efac;
    --text-muted: #4ade80;
    --accent-cyan: #2ed573;
    --accent-blue: #34d399;
    --accent-purple: #6ee7b7;
    --accent-green: #2ed573;
    --accent-yellow: #fbbf24;
    --accent-red: #f87171;
    --gradient-primary: linear-gradient(135deg, #2ed573, #6ee7b7);
    --gradient-danger: linear-gradient(135deg, #f87171, #fca5a5);
    --shadow-glow: 0 0 20px rgba(46, 213, 115, 0.08);
    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.4);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    --font-sans: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

/* ============ Particle Canvas ============ */
#particleCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* ============ Container ============ */
.container {
    position: relative;
    z-index: 1;
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
    background: rgba(10, 14, 23, 0.6);
    backdrop-filter: blur(8px);
}

/* ============ Hero ============ */
.hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 24px 4px;
}

.hero.compact {
    padding: 4px 24px 0;
}

/* ============ Header ============ */
.header {
    text-align: center;
    padding: 0 0 4px;
    position: relative;
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

.lang-toggle {
    background: rgba(56, 189, 248, 0.15);
    color: var(--accent-cyan);
    border: 1px solid rgba(56, 189, 248, 0.4);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--font-mono);
    letter-spacing: 1px;
    z-index: 10;
    flex-shrink: 0;
    margin-left: auto;
}

.lang-toggle:hover {
    background: rgba(56, 189, 248, 0.3);
    border-color: var(--accent-cyan);
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.3);
    transform: scale(1.05);
}
.user-center-link {
    color: var(--accent-green);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    padding: 6px 14px;
    border: 1px solid rgba(0, 255, 136, 0.3);
    border-radius: 20px;
    transition: all 0.3s;
    margin-left: 8px;
}
.user-center-link:hover {
    background: rgba(0, 255, 136, 0.1);
    border-color: var(--accent-green);
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.2);
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.logo-icon {
    width: 32px;
    height: 32px;
    color: var(--accent-cyan);
    animation: pulse-glow 3s ease-in-out infinite;
    filter: drop-shadow(0 0 8px rgba(56, 189, 248, 0.4));
}

@keyframes pulse-glow {
    0%, 100% { filter: drop-shadow(0 0 6px rgba(56, 189, 248, 0.3)); }
    50% { filter: drop-shadow(0 0 16px rgba(56, 189, 248, 0.7)); }
}

.logo-text h1 {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #38bdf8 0%, #00e5ff 40%, #00ff88 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 3px;
    text-shadow: none;
    position: relative;
}

.logo-text p {
    display: none;
}

/* ============ Search Section ============ */
.search-section {
    margin: 4px 0;
}

/* ============ Engine Banner ============ */
.engine-banner {
    background: linear-gradient(135deg, rgba(56,189,248,0.08) 0%, rgba(0,229,255,0.04) 50%, rgba(0,255,136,0.06) 100%);
    border: 1px solid rgba(56,189,248,0.15);
    border-radius: 14px;
    padding: 18px 24px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    animation: engine-glow 3s ease-in-out infinite;
}
@keyframes engine-glow {
    0%, 100% { border-color: rgba(56,189,248,0.15); box-shadow: 0 0 0 rgba(56,189,248,0); }
    50% { border-color: rgba(56,189,248,0.3); box-shadow: 0 0 20px rgba(56,189,248,0.06); }
}
.engine-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #e0e6ed;
    font-size: 0.92rem;
    font-weight: 600;
}
.engine-badge svg {
    color: #38bdf8;
    flex-shrink: 0;
}
.engine-features {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.engine-tag {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 500;
    color: #38bdf8;
    background: rgba(56,189,248,0.1);
    border: 1px solid rgba(56,189,248,0.2);
    white-space: nowrap;
}
@media (max-width: 768px) {
    .engine-banner { flex-direction: column; align-items: flex-start; padding: 14px 18px; }
    .engine-features { width: 100%; }
}

/* ============ Tab 切换 ============ */
.tab-bar {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 4px;
    border: 1px solid var(--border-color);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.tab-bar::-webkit-scrollbar { display: none; }

.tab-btn {
    flex: 1;
    min-width: max-content;
    padding: 10px 16px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.25s;
    font-family: inherit;
}

.tab-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
}

.tab-btn.active {
    background: rgba(46, 213, 115, 0.12);
    color: var(--accent-cyan);
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(46, 213, 115, 0.1);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.search-box {
    max-width: 800px;
    margin: 0 auto;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 3px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.search-input-wrapper:focus-within {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 30px rgba(56, 189, 248, 0.15), inset 0 0 20px rgba(56, 189, 248, 0.05);
}

.search-icon {
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    margin-left: 12px;
    flex-shrink: 0;
}

.search-input-wrapper input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: var(--font-mono);
    padding: 10px 12px;
    letter-spacing: 0.5px;
}

.search-input-wrapper input::placeholder {
    color: var(--text-muted);
    font-family: var(--font-sans);
}

.clear-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s;
    display: none;
}

.clear-btn.visible {
    display: flex;
}

.clear-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
}

.clear-btn svg {
    width: 18px;
    height: 18px;
}

.search-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    justify-content: center;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--font-sans);
    letter-spacing: 0.5px;
}

.btn svg {
    width: 18px;
    height: 18px;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 15px rgba(56, 189, 248, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(56, 189, 248, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: rgba(56, 189, 248, 0.1);
    color: var(--accent-cyan);
    border: 1px solid rgba(56, 189, 248, 0.2);
}

.btn-secondary:hover {
    background: rgba(56, 189, 248, 0.2);
    border-color: rgba(56, 189, 248, 0.4);
}

/* ============ Loading ============ */
.loading {
    text-align: center;
    padding: 60px 0;
}

.loading.hidden {
    display: none;
}

.loading-spinner {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
}

.spinner-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 3px solid transparent;
    animation: spin 1.5s linear infinite;
}

.spinner-ring:nth-child(1) {
    border-top-color: var(--accent-cyan);
    animation-duration: 1.5s;
}

.spinner-ring:nth-child(2) {
    border-right-color: var(--accent-purple);
    animation-duration: 2s;
    animation-direction: reverse;
    width: 65%;
    height: 65%;
    top: 17.5%;
    left: 17.5%;
}

.spinner-ring:nth-child(3) {
    border-bottom-color: var(--accent-blue);
    animation-duration: 2.5s;
    width: 40%;
    height: 40%;
    top: 30%;
    left: 30%;
}

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

.loading-text {
    color: var(--text-muted);
    font-size: 0.9rem;
    animation: blink 1.5s ease-in-out infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* ============ Results ============ */
.results {
    animation: fadeInUp 0.6s ease-out;
    padding: 0 24px 16px;
    max-width: 600px;
    margin: 0 auto;
}

.results.hidden {
    display: none;
}

/* ============ AI Assistant ============ */
.ai-assistant-card {
    margin-top: 12px;
    border: 1px solid rgba(56, 189, 248, 0.25);
}
.ai-title-row {
    position: relative;
    background: linear-gradient(90deg, rgba(56, 189, 248, 0.10), rgba(46, 213, 115, 0.06));
}
.ai-refresh-btn {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.15s;
    display: flex;
    align-items: center;
}
.ai-refresh-btn:hover {
    color: var(--accent-cyan);
    background: rgba(56, 189, 248, 0.10);
}
.ai-assistant-body {
    padding: 16px;
    min-height: 80px;
    max-height: 320px;
    overflow-y: auto;
}
.ai-assistant-footer {
    display: flex;
    gap: 10px;
    padding: 12px 16px;
    border-top: 1px solid var(--border-color);
    background: rgba(56, 189, 248, 0.03);
}
.ai-question-tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.78rem;
    font-weight: 600;
    background: rgba(56, 189, 248, 0.12);
    color: var(--accent-cyan);
    border: 1px solid rgba(56, 189, 248, 0.25);
    margin-bottom: 10px;
}
.ai-question-text {
    font-size: 0.92rem;
    color: var(--text-primary);
    margin-bottom: 14px;
    line-height: 1.5;
}
.ai-answer-section {
    font-size: 0.88rem;
    color: var(--text-primary);
    line-height: 1.65;
}
.ai-answer-section p {
    margin: 0 0 10px 0;
}
.ai-answer-section p:last-child {
    margin-bottom: 0;
}
.ai-answer-section strong {
    color: var(--accent-cyan);
}
.ai-answer-section .ai-section-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 14px 0 8px 0;
}
.ai-answer-section .ai-section-label:first-child {
    margin-top: 0;
}
.ai-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px;
    color: var(--text-muted);
    font-size: 0.88rem;
}
.ai-loading-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-cyan);
    animation: aiPulse 1.2s ease-in-out infinite;
}
@keyframes aiPulse {
    0%, 100% { opacity: 0.3; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1); }
}

/* ============ Result Card (表格布局) ============ */
.result-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.result-title {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: rgba(56, 189, 248, 0.06);
    border-bottom: 1px solid var(--border-color);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.result-table {
    padding: 0;
}

.result-row {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    transition: background 0.15s;
}

.result-row:nth-child(even) {
    background: rgba(255, 255, 255, 0.02);
}

.result-row:last-child {
    border-bottom: none;
}

.result-row:hover {
    background: rgba(56, 189, 248, 0.04);
}

.r-label {
    color: var(--text-muted);
    font-size: 0.88rem;
    flex-shrink: 0;
    width: 90px;
}

.r-value {
    flex: 1;
    color: var(--text-primary);
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    gap: 8px;
    word-break: break-all;
}

.r-ip {
    font-family: var(--font-mono);
    font-size: 0.95rem;
    color: var(--accent-cyan);
    font-weight: 500;
}

.r-mono {
    font-family: var(--font-mono);
}

.r-copy {
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 4px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
}

.r-copy:hover {
    background: rgba(56, 189, 248, 0.1);
    color: var(--accent-cyan);
    border-color: var(--accent-cyan);
}

/* 标签 */
.r-tag {
    display: inline-block;
    padding: 5px 14px;
    border-radius: 12px;
    font-size: 0.92rem;
    font-weight: 500;
    line-height: 1.6;
}

.r-tag.residential {
    background: rgba(46, 213, 115, 0.15);
    color: #2ed573;
    border: 1px solid rgba(46, 213, 115, 0.3);
}

.r-tag.datacenter {
    background: rgba(255, 107, 129, 0.15);
    color: #ff6b81;
    border: 1px solid rgba(255, 107, 129, 0.3);
}

.r-tag.proxy {
    background: rgba(255, 107, 129, 0.15);
    color: #ff6b81;
    border: 1px solid rgba(255, 107, 129, 0.3);
}

.r-tag.mobile {
    background: rgba(255, 165, 2, 0.15);
    color: #ffa502;
    border: 1px solid rgba(255, 165, 2, 0.3);
}

.r-tag.native {
    background: rgba(46, 213, 115, 0.15);
    color: #2ed573;
    border: 1px solid rgba(46, 213, 115, 0.3);
}

.r-tag.broadcast {
    background: rgba(255, 165, 2, 0.15);
    color: #ffa502;
    border: 1px solid rgba(255, 165, 2, 0.3);
}

.r-tag.idc {
    background: rgba(255, 107, 129, 0.15);
    color: #ff6b81;
    border: 1px solid rgba(255, 107, 129, 0.3);
    margin-right: 6px;
    font-size: 0.7rem;
    padding: 1px 6px;
}

.r-tag.yes {
    background: rgba(46, 213, 115, 0.15);
    color: #2ed573;
    border: 1px solid rgba(46, 213, 115, 0.3);
}

.r-tag.no {
    background: rgba(255, 107, 129, 0.1);
    color: #ff6b81;
    border: 1px solid rgba(255, 107, 129, 0.2);
}

.r-tag.warning {
    background: rgba(255, 165, 2, 0.15);
    color: #ffa502;
    border: 1px solid rgba(255, 165, 2, 0.3);
}

/* 风控条 */
.risk-bar {
    display: inline-block;
    width: 180px;
    height: 12px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    overflow: hidden;
    vertical-align: middle;
}

.risk-bar-fill {
    display: block;
    height: 100%;
    border-radius: 6px;
    transition: width 0.6s ease;
}

.risk-text {
    font-size: 1rem;
    font-weight: 600;
}

/* ============ 流媒体解锁检测 ============ */
.streaming-section {
    margin-top: 16px;
}

.streaming-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
    padding: 12px 16px;
}

.streaming-card {
    background: rgba(46, 213, 115, 0.04);
    border: 1px solid rgba(46, 213, 115, 0.1);
    border-radius: 10px;
    padding: 14px 12px;
    text-align: center;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}
.streaming-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(46, 213, 115, 0.3), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}
.streaming-card:hover::before { opacity: 1; }
.streaming-card:hover {
    border-color: rgba(46, 213, 115, 0.25);
    background: rgba(46, 213, 115, 0.08);
}
.streaming-card .streaming-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.streaming-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}
.streaming-badge.yes {
    background: rgba(46, 213, 115, 0.15);
    color: #2ed573;
    border: 1px solid rgba(46, 213, 115, 0.3);
    box-shadow: 0 0 8px rgba(46, 213, 115, 0.1);
}
.streaming-badge.no {
    background: rgba(248, 113, 113, 0.1);
    color: #f87171;
    border: 1px solid rgba(248, 113, 113, 0.2);
}
.streaming-badge.warn {
    background: rgba(251, 191, 36, 0.1);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.2);
}
.streaming-badge.testing {
    background: rgba(46, 213, 115, 0.08);
    color: var(--text-muted);
    border: 1px solid rgba(46, 213, 115, 0.15);
    animation: pulse-glow 1.5s ease-in-out infinite;
}
@keyframes pulse-glow {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* ============ 本机 IP 流媒体解锁检测加载动画 ============ */
.streaming-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-right: 6px;
    border-radius: 50%;
    background: currentColor;
    vertical-align: middle;
    animation: pulse-glow 1s ease-in-out infinite;
}

.myip-loading {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    gap: 14px;
    text-align: center;
}
.myip-spinner {
    width: 42px;
    height: 42px;
    border: 4px solid rgba(46, 213, 115, 0.15);
    border-top-color: #2ed573;
    border-radius: 50%;
    animation: myip-spin 0.9s linear infinite;
}
@keyframes myip-spin { to { transform: rotate(360deg); } }
.myip-loading-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
}
.myip-progress {
    width: 100%;
    max-width: 320px;
    height: 8px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 20px;
    overflow: hidden;
}
.myip-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #2ed573, var(--accent-cyan, #0ea5e9));
    border-radius: 20px;
    transition: width 0.4s ease;
}
.myip-progress-label {
    color: var(--text-muted);
    font-size: 0.8rem;
    font-family: monospace;
}
.myip-summary {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 0 4px;
    font-size: 0.9rem;
}
.myip-summary .streaming-badge {
    font-size: 0.85rem;
    padding: 6px 16px;
}
.myip-card-enter {
    opacity: 0;
    transform: translateY(14px);
}
.myip-card-show {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

/* ============ IP 分类标签（蓝皮书规范）============ */
.tag-native-dc {
    background: rgba(46, 213, 115, 0.15);
    color: #2ed573;
    border: 1px solid rgba(46, 213, 115, 0.3);
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
}
.tag-broadcast-dc {
    background: rgba(251, 146, 60, 0.15);
    color: #fb923c;
    border: 1px solid rgba(251, 146, 60, 0.3);
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
}
.tag-native-res {
    background: rgba(96, 165, 250, 0.15);
    color: #60a5fa;
    border: 1px solid rgba(96, 165, 250, 0.3);
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
}
.tag-broadcast-res {
    background: rgba(250, 204, 21, 0.15);
    color: #facc15;
    border: 1px solid rgba(250, 204, 21, 0.3);
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
}
.tag-mobile {
    background: rgba(168, 85, 247, 0.15);
    color: #a855f7;
    border: 1px solid rgba(168, 85, 247, 0.3);
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
}
.tag-cdn {
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.3);
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
}

.stream-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    transition: all 0.2s;
}

.stream-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

.stream-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.stream-info {
    flex: 1;
    min-width: 0;
}

.stream-name {
    font-size: 0.85rem;
    color: var(--text-primary);
    font-weight: 500;
}

.stream-status {
    font-size: 0.75rem;
    margin-top: 2px;
}

.stream-status.yes {
    color: #2ed573;
}

.stream-status.no {
    color: #ff6b81;
}

.stream-status.error {
    color: var(--text-muted);
}

.stream-status.loading {
    color: var(--accent-cyan);
}

.stream-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    flex-shrink: 0;
}

.stream-badge.yes {
    background: rgba(46, 213, 115, 0.15);
    color: #2ed573;
    border: 1px solid rgba(46, 213, 115, 0.3);
}

.stream-badge.no {
    background: rgba(255, 107, 129, 0.15);
    color: #ff6b81;
    border: 1px solid rgba(255, 107, 129, 0.3);
}

.stream-badge.error {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

.stream-badge.loading {
    background: rgba(56, 189, 248, 0.1);
    color: var(--accent-cyan);
    border: 1px solid rgba(56, 189, 248, 0.3);
}

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

.stream-badge.loading svg {
    animation: stream-spin 1s linear infinite;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============ Overview Card ============ */
.overview-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 16px 20px;
    margin-bottom: 12px;
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-card);
}

.ip-display {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.ip-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.ip-value {
    font-family: var(--font-mono);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--accent-cyan);
    text-shadow: 0 0 20px rgba(56, 189, 248, 0.3);
}

.copy-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: all 0.2s;
}

.copy-btn:hover {
    color: var(--accent-cyan);
    background: rgba(56, 189, 248, 0.1);
}

.copy-btn svg {
    width: 18px;
    height: 18px;
}

.quick-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tag {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.tag-type {
    background: rgba(56, 189, 248, 0.15);
    color: var(--accent-cyan);
    border: 1px solid rgba(56, 189, 248, 0.3);
}

.tag-country {
    background: rgba(139, 92, 246, 0.15);
    color: var(--accent-purple);
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.tag-connection {
    background: rgba(46, 213, 115, 0.15);
    color: var(--accent-green);
    border: 1px solid rgba(46, 213, 115, 0.3);
}

.tag-risk {
    background: rgba(46, 213, 115, 0.15);
    color: var(--accent-green);
    border: 1px solid rgba(46, 213, 115, 0.3);
}

.tag-risk.medium {
    background: rgba(255, 165, 2, 0.15);
    color: var(--accent-yellow);
    border-color: rgba(255, 165, 2, 0.3);
}

.tag-risk.high {
    background: rgba(255, 71, 87, 0.15);
    color: var(--accent-red);
    border-color: rgba(255, 71, 87, 0.3);
}

/* ============ Risk Card ============ */
.risk-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 16px 20px;
    margin-bottom: 12px;
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-card);
}

.risk-header h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.risk-header h3 svg {
    width: 22px;
    height: 22px;
    color: var(--accent-cyan);
}

.risk-content {
    display: flex;
    gap: 40px;
    align-items: flex-start;
}

.risk-gauge {
    flex-shrink: 0;
    width: 200px;
    height: 200px;
}

.gauge-svg {
    width: 100%;
    height: 100%;
}

.gauge-progress {
    transition: stroke-dashoffset 1.5s ease-out;
}

.risk-factors {
    flex: 1;
}

.risk-factors h4 {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
    font-weight: 500;
}

.factor-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.factor-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.2s;
}

.factor-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
}

.factor-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    font-family: var(--font-mono);
    flex-shrink: 0;
}

.factor-icon.safe {
    background: rgba(46, 213, 115, 0.15);
    color: var(--accent-green);
}

.factor-icon.warning {
    background: rgba(255, 165, 2, 0.15);
    color: var(--accent-yellow);
}

.factor-icon.danger {
    background: rgba(255, 71, 87, 0.15);
    color: var(--accent-red);
}

.factor-info {
    flex: 1;
}

.factor-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
}

.factor-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ============ Info Grid ============ */
.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 12px;
}

.info-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 14px 16px;
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-card);
    transition: all 0.3s ease;
}

.info-card:hover {
    border-color: var(--border-glow);
    box-shadow: var(--shadow-card), var(--shadow-glow);
    transform: translateY(-2px);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.card-header svg {
    width: 20px;
    height: 20px;
    color: var(--accent-cyan);
}

.card-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.card-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
}

.info-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

.info-value {
    font-size: 0.85rem;
    color: var(--text-primary);
    font-family: var(--font-mono);
    text-align: right;
    word-break: break-all;
    max-width: 60%;
}

.info-value.status-yes {
    color: var(--accent-red);
}

.info-value.status-no {
    color: var(--accent-green);
}

/* ============ Map Card ============ */
.map-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 16px 20px;
    margin-bottom: 12px;
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-card);
}

/* ============ Ping / Connectivity ============ */
.ping-card .card-header {
    flex-wrap: wrap;
    gap: 8px;
}

.btn-sm {
    padding: 6px 16px;
    font-size: 0.8rem;
}

.ping-status {
    text-align: center;
    padding: 16px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.ping-status.loading {
    color: var(--accent-cyan);
}

.ping-status.loading::before {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid var(--accent-cyan);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

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

.ping-results {
    margin-top: 12px;
}

.ping-table-header {
    display: grid;
    grid-template-columns: 2fr 2fr 1fr 1fr 1fr;
    gap: 8px;
    padding: 8px 12px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
    font-family: var(--font-mono);
}

.ping-list {
    max-height: 400px;
    overflow-y: auto;
}

.ping-row {
    display: grid;
    grid-template-columns: 2fr 2fr 1fr 1fr 1fr;
    gap: 8px;
    padding: 10px 12px;
    font-size: 0.85rem;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    transition: background 0.2s;
    align-items: center;
}

.ping-row:hover {
    background: rgba(56, 189, 248, 0.05);
}

.ping-row .flag {
    font-size: 1.1rem;
    margin-right: 6px;
}

.ping-latency-good { color: #2ed573; }
.ping-latency-medium { color: #ffa502; }
.ping-latency-bad { color: #ff4757; }

.ping-status-ok { color: #2ed573; font-weight: 600; }
.ping-status-fail { color: #ff4757; font-weight: 600; }

.ping-bar {
    height: 4px;
    border-radius: 2px;
    background: rgba(255,255,255,0.05);
    margin-top: 4px;
    overflow: hidden;
}

.ping-bar-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.5s ease;
}

.map-container {
    display: flex;
    gap: 24px;
    align-items: stretch;
}

.map-display {
    flex: 1;
    min-height: 250px;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.map-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 250px;
    color: var(--text-muted);
    gap: 12px;
}

.map-placeholder p {
    font-size: 0.9rem;
}

.map-info {
    display: flex;
    flex-direction: column;
    gap: 16px;
    justify-content: center;
    min-width: 140px;
}

.map-info.hidden {
    display: none;
}

.map-coords {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.coord-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.coord-value {
    font-family: var(--font-mono);
    font-size: 1rem;
    color: var(--accent-cyan);
}

/* ============ Toast ============ */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 24px;
    background: rgba(255, 71, 87, 0.95);
    color: white;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    z-index: 1000;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.toast.visible {
    transform: translateX(-50%) translateY(0);
}

.toast.hidden {
    display: flex;
}

/* Cloudflare Turnstile 隐藏容器 */
.cf-turnstile {
    display: none;
}

.toast svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.toast-success {
    background: rgba(46, 213, 115, 0.95);
}

.toast-info {
    background: rgba(56, 189, 248, 0.95);
}

/* ============ Footer ============ */
.footer {
    text-align: center;
    padding: 30px 0 20px;
    color: var(--text-muted);
    font-size: 0.8rem;
}
.footer a {
    color: var(--accent-cyan);
    text-decoration: none;
    transition: color 0.2s;
}
.footer a:hover {
    color: #fff;
    text-decoration: underline;
}

/* 自定义菜单链接 */
.tab-btn.tab-link {
    color: var(--text-secondary);
    text-decoration: none;
    cursor: pointer;
    transition: color 0.2s;
    white-space: nowrap;
}
.tab-btn.tab-link:hover {
    color: #00c851;
}

/* 底部友情链接 */
.friend-links {
    margin-top: 12px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 4px;
    font-size: 0.78rem;
}
.friend-links a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}
.friend-links a:hover {
    color: #00c851;
}
.fl-sep {
    color: var(--text-muted);
    opacity: 0.4;
    margin: 0 4px;
}

/* ============ Responsive ============ */
@media (max-width: 768px) {
    .container {
        padding: 0;
    }

    .hero {
        padding: 12px 16px;
    }

    .results {
        padding: 0 16px 16px;
    }

    .header {
        padding: 0 0 4px;
    }

    .logo-text h1 {
        font-size: 1.5rem;
    }

    .logo-text p {
        font-size: 0.75rem;
        letter-spacing: 2px;
    }

    .lang-toggle {
        padding: 5px 12px;
        font-size: 0.75rem;
    }

    .search-section {
        margin: 8px 0;
    }

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

    .search-actions {
        flex-direction: column;
        gap: 8px;
    }

    .btn {
        justify-content: center;
    }

    .overview-card {
        padding: 16px 20px;
    }

    .risk-card {
        padding: 16px 20px;
    }

    .risk-content {
        flex-direction: column;
        align-items: center;
    }

    .risk-gauge {
        width: 140px;
        height: 140px;
    }

    .info-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .info-card {
        padding: 16px 18px;
    }

    .map-card {
        padding: 16px 20px;
    }

    .map-container {
        flex-direction: column;
    }

    .map-info {
        flex-direction: row;
        min-width: auto;
    }

    /* Ping 表格横向滚动 */
    .ping-table-header,
    .ping-row {
        grid-template-columns: 2fr 2fr 1fr 1fr 1fr;
        min-width: 520px;
    }

    .ping-results {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .ping-card .card-header {
        flex-wrap: wrap;
    }

    .footer {
        padding: 20px 0 12px;
    }

    .streaming-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 6px !important;
    }

    .streaming-card {
        padding: 12px !important;
    }

    .streaming-card .streaming-name {
        font-size: 0.82rem !important;
    }

    .streaming-card .streaming-status {
        font-size: 0.72rem !important;
    }

    .stream-item {
        padding: 10px 12px !important;
    }

    #env-score-ring {
        width: 90px !important;
        height: 90px !important;
        font-size: 1.5rem !important;
    }

    .tab-btn {
        font-size: 0.78rem !important;
        padding: 8px 10px !important;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0;
    }

    .header {
        padding: 16px 0 8px;
    }

    .logo-text h1 {
        font-size: 1.3rem;
    }

    .lang-toggle {
        font-size: 0.65rem;
        padding: 3px 8px;
    }

    .search-input-wrapper {
        padding: 3px;
    }

    .search-input {
        font-size: 0.9rem;
        padding: 10px 12px;
    }

    .quick-tags {
        gap: 6px;
    }

    .tag {
        font-size: 0.7rem;
        padding: 3px 8px;
    }

    .overview-card {
        padding: 12px 14px;
    }

    .ip-value {
        font-size: 1.1rem;
    }

    .risk-card {
        padding: 12px 14px;
    }

    .risk-gauge {
        width: 120px;
        height: 120px;
    }

    .info-card {
        padding: 12px 14px;
    }

    .info-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }

    .info-label {
        font-size: 0.75rem;
    }

    .info-value {
        max-width: 100%;
        text-align: left;
        font-size: 0.85rem;
    }

    .card-header h3 {
        font-size: 0.9rem;
    }

    .map-card {
        padding: 12px 14px;
    }

    .ping-card .btn-sm {
        padding: 4px 12px;
        font-size: 0.7rem;
    }

    .ping-status {
        font-size: 0.8rem;
        padding: 12px 8px;
    }

    .ping-row {
        font-size: 0.78rem;
        padding: 8px 10px;
    }

    .ping-table-header {
        font-size: 0.68rem;
        padding: 6px 10px;
    }
}

/* ============ Scrollbar ============ */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: rgba(56, 189, 248, 0.3);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(56, 189, 248, 0.5);
}

/* ============ Selection ============ */
::selection {
    background: rgba(56, 189, 248, 0.3);
    color: white;
}

/* ============ Analysis Path Animation ============ */
.analysis-path {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 20px 0 8px;
    flex-wrap: nowrap;
}
.path-step {
    display: flex;
    align-items: center;
    gap: 6px;
    opacity: 0.3;
    transition: opacity 0.5s;
}
.path-step.active { opacity: 1; }
.path-step.done { opacity: 0.7; }
.path-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #38bdf8;
    transition: all 0.5s;
    flex-shrink: 0;
}
.path-step.active .path-dot {
    background: #00ff88;
    box-shadow: 0 0 12px rgba(0,255,136,0.6);
    transform: scale(1.3);
}
.path-step.done .path-dot { background: #2ed573; }
.path-label {
    font-size: 0.78rem;
    color: #8b9dc3;
    white-space: nowrap;
}
.path-step.active .path-label { color: #e0e6ed; }
.path-line {
    width: 30px;
    height: 2px;
    background: rgba(56,189,248,0.15);
    margin: 0 6px;
    flex-shrink: 0;
    transition: background 0.5s;
}
.path-line.done { background: #2ed573; }
@media(max-width:600px) {
    .analysis-path { gap: 0; padding: 16px 0 4px; }
    .path-label { font-size: 0.68rem; }
    .path-line { width: 16px; margin: 0 3px; }
}

/* ============ Conclusion Card ============ */
.conclusion-card {
    background: rgba(20,28,40,0.8);
    border: 1px solid rgba(56,189,248,0.15);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 16px;
    animation: fadeInUp 0.5s ease;
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}
.conclusion-card.safe { border-color: rgba(46,213,115,0.3); }
.conclusion-card.warning { border-color: rgba(255,165,2,0.3); }
.conclusion-card.danger { border-color: rgba(255,71,87,0.3); }
.conclusion-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}
.conclusion-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}
.conclusion-card.safe .conclusion-icon { background: rgba(46,213,115,0.15); }
.conclusion-card.warning .conclusion-icon { background: rgba(255,165,2,0.15); }
.conclusion-card.danger .conclusion-icon { background: rgba(255,71,87,0.15); }
.conclusion-verdict {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 6px;
}
.conclusion-card.safe .conclusion-verdict { color: #2ed573; }
.conclusion-card.warning .conclusion-verdict { color: #ffa502; }
.conclusion-card.danger .conclusion-verdict { color: #ff4757; }
.conclusion-suggestion {
    font-size: 0.9rem;
    color: #8b9dc3;
    line-height: 1.6;
}
.scenario-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(255,255,255,0.06);
}
.scenario-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.82rem;
    background: rgba(56,189,248,0.08);
    border: 1px solid rgba(56,189,248,0.15);
    color: #b0bec5;
    transition: all 0.2s;
}
.scenario-tag:hover { border-color: rgba(56,189,248,0.3); background: rgba(56,189,248,0.12); }
.scenario-tag .tag-icon { font-size: 1rem; }

/* ============ Dashboard Card ============ */
.dashboard-card {
    background: rgba(20,28,40,0.6);
    border: 1px solid rgba(56,189,248,0.1);
    border-radius: 16px;
    padding: 20px 24px;
    margin-bottom: 16px;
    animation: fadeInUp 0.5s ease 0.15s both;
}
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}
.dash-item {
    text-align: center;
    padding: 12px 8px;
    background: rgba(0,0,0,0.2);
    border-radius: 10px;
    min-width: 0;
    overflow: hidden;
}
.dash-label {
    display: block;
    font-size: 0.75rem;
    color: #5a6a7a;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.dash-value {
    display: block;
    font-size: 0.9rem;
    color: #e0e6ed;
    font-weight: 600;
    word-break: break-word;
    overflow-wrap: break-word;
    line-height: 1.3;
}
@media(max-width:600px) {
    .dashboard-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}
.risk-dashboard {
    padding-top: 16px;
    border-top: 1px solid rgba(255,255,255,0.05);
}
.risk-dash-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 0.85rem;
    color: #8b9dc3;
}
.risk-dash-text {
    font-weight: 700;
    font-size: 0.95rem;
}

/* ============ Radar Chart (Cyberpunk) ============ */
.radar-container {
    position: relative;
    width: 100%;
    max-width: 380px;
    margin: 16px auto 0;
    aspect-ratio: 1;
}
#radarChart {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 20px rgba(0, 255, 127, 0.08));
}
.radar-tooltip {
    position: absolute;
    background: rgba(10, 15, 13, 0.95);
    border: 1px solid rgba(0, 255, 127, 0.3);
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 0.82rem;
    color: #b0bec5;
    pointer-events: none;
    z-index: 10;
    min-width: 180px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5), 0 0 15px rgba(0, 255, 127, 0.1);
    backdrop-filter: blur(10px);
}
.radar-tooltip .tt-title {
    font-weight: 700;
    color: #00ff7f;
    margin-bottom: 6px;
    font-size: 0.88rem;
}
.radar-tooltip .tt-score {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 6px;
}
.radar-tooltip .tt-bar {
    height: 4px;
    background: rgba(255,255,255,0.06);
    border-radius: 2px;
    margin: 4px 0;
    overflow: hidden;
}
.radar-tooltip .tt-bar-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s;
}
.radar-tooltip .tt-factors {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid rgba(255,255,255,0.06);
}
.radar-tooltip .tt-factor {
    padding: 2px 0;
    font-size: 0.78rem;
    color: #8b9dc3;
}
.radar-tooltip .tt-factor::before {
    content: '▸ ';
    color: #00ff7f;
}

/* ============ SEO Content Section ============ */
.seo-content {
    margin: 40px 0 0;
    padding: 32px 0 0;
    border-top: 1px solid rgba(56, 189, 248, 0.1);
    max-width: 960px;
    margin-left: auto;
    margin-right: auto;
}
.seo-intro {
    margin-bottom: 32px;
    padding: 0 8px;
}
.seo-intro h2 {
    color: #fff;
    font-size: 1.5rem;
    margin-bottom: 12px;
    font-weight: 700;
}
.seo-intro p {
    color: #8b9dc3;
    line-height: 1.8;
    font-size: 0.95rem;
}
.seo-section {
    margin: 32px 0;
    padding: 0 8px;
}
.seo-section h2 {
    color: #fff;
    font-size: 1.3rem;
    margin-bottom: 12px;
    font-weight: 700;
}
.seo-section p {
    color: #8b9dc3;
    line-height: 1.8;
    margin-bottom: 12px;
    font-size: 0.9rem;
}
.seo-section a {
    color: var(--accent-cyan);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}
.seo-section a:hover {
    color: #00e5ff;
}
.seo-list {
    color: #8b9dc3;
    line-height: 2;
    margin: 12px 0 16px 20px;
    font-size: 0.9rem;
}
.seo-list li strong {
    color: #fff;
}
/* Cards */
.seo-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
    margin: 16px 0;
}
.seo-card {
    background: rgba(46, 213, 115, 0.04);
    border: 1px solid rgba(46, 213, 115, 0.12);
    border-radius: 12px;
    padding: 16px;
    transition: all 0.3s;
}
.seo-card:hover {
    border-color: rgba(46, 213, 115, 0.25);
    background: rgba(46, 213, 115, 0.06);
    transform: translateY(-2px);
}
.seo-card-icon {
    font-size: 1.4rem;
    margin-bottom: 8px;
}
.seo-card h3 {
    color: var(--accent-cyan);
    font-size: 0.95rem;
    margin-bottom: 6px;
    font-weight: 700;
}
.seo-card p {
    color: #6b7b8d;
    font-size: 0.82rem;
    line-height: 1.6;
}
/* Tables */
.seo-table-wrap {
    overflow-x: auto;
    margin: 16px 0;
    border-radius: 8px;
    border: 1px solid rgba(56, 189, 248, 0.1);
}
.seo-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}
.seo-table th {
    background: rgba(46, 213, 115, 0.08);
    color: var(--accent-cyan);
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    border-bottom: 1px solid rgba(56, 189, 248, 0.15);
}
.seo-table td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    color: #8b9dc3;
    vertical-align: top;
}
.seo-table td:first-child {
    color: #fff;
    font-weight: 600;
}
.seo-table tr:last-child td {
    border-bottom: none;
}
.difficulty-hard { color: #f87171; font-weight: 600; }
.difficulty-medium { color: #fbbf24; font-weight: 600; }
.difficulty-easy { color: #2ed573; font-weight: 600; }
/* IP Type Cards */
.ip-types {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin: 12px 0;
}
.ip-type-card {
    background: rgba(46, 213, 115, 0.04);
    border-left: 3px solid var(--accent-cyan);
    padding: 12px 14px;
    border-radius: 0 8px 8px 0;
}
.ip-type-card h4 {
    color: var(--accent-cyan);
    font-size: 0.88rem;
    margin-bottom: 4px;
    font-weight: 600;
}
.ip-type-card p {
    color: #6b7b8d;
    font-size: 0.8rem;
    line-height: 1.5;
    margin-bottom: 0;
}
/* FAQ */
.faq-section {
    margin: 12px 0;
}
.faq-item {
    margin: 14px 0;
    padding: 14px 18px;
    background: rgba(56, 189, 248, 0.04);
    border-radius: 10px;
    border-left: 2px solid rgba(56, 189, 248, 0.2);
}
.faq-item h3 {
    color: var(--accent-cyan);
    font-size: 0.95rem;
    margin-bottom: 6px;
    font-weight: 700;
}
.faq-item p {
    color: #8b9dc3;
    font-size: 0.88rem;
    line-height: 1.6;
    margin-bottom: 0;
}
/* Related Resources */
.seo-resources {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0 16px;
}
.seo-resources a {
    background: rgba(46, 213, 115, 0.08);
    color: var(--accent-cyan);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.82rem;
    text-decoration: none;
    border: 1px solid rgba(46, 213, 115, 0.15);
    transition: all 0.2s;
    font-weight: 500;
}
.seo-resources a:hover {
    background: rgba(46, 213, 115, 0.15);
    border-color: rgba(46, 213, 115, 0.3);
    transform: translateY(-1px);
}
@media (max-width: 600px) {
    .seo-content {
        margin-top: 24px;
        padding: 20px 0 0;
    }
    .seo-cards {
        grid-template-columns: 1fr;
    }
    .ip-types {
        grid-template-columns: 1fr;
    }
    .seo-section h2 {
        font-size: 1.1rem;
    }
    .seo-intro h2 {
        font-size: 1.3rem;
    }
}

/* ============ Minimalist Mode ============ */
body.minimalist-mode .seo-content,
body.minimalist-mode .faq-section,
body.minimalist-mode .related-articles,
body.minimalist-mode .articles-section { display: none !important; }

body.minimalist-mode .hero { padding: 8px 24px 4px; }
body.minimalist-mode .search-section { padding: 8px 0; }

/* In minimalist mode, collapse the SEO tool table to just essential tools.
   Rows tagged with data-minimal="optional" are hidden. */
body.minimalist-mode .seo-table tbody tr[data-minimal="optional"] { display: none !important; }

.minimalist-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--accent-cyan);
    cursor: pointer;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-card);
    transition: all 0.3s;
}
.minimalist-toggle:hover {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 15px rgba(46, 213, 115, 0.2);
}
.minimalist-toggle svg {
    width: 20px;
    height: 20px;
}
.minimalist-toggle .toggle-label {
    position: absolute;
    right: 54px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}
.minimalist-toggle:hover .toggle-label { opacity: 1; }
.minimalist-toggle.active {
    background: rgba(46, 213, 115, 0.15);
    border-color: var(--accent-cyan);
}

/* ===================================================================
 * Tools Navigation Grid
 * =================================================================== */
.tools-nav-section {
    width: 100%;
    max-width: 1200px;
    margin: 32px auto;
    padding: 0 24px;
    box-sizing: border-box;
}
.tools-nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.tools-nav-header h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.5px;
}
.tools-nav-header .tools-nav-count {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}
.tools-nav-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.tool-nav-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-left: 3px solid var(--accent-cyan);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.25s ease;
    backdrop-filter: blur(8px);
}
.tool-nav-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-glow);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}
.tool-nav-card .tool-nav-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}
.tool-nav-card .tool-nav-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.4;
}
/* Category border colors */
.tool-nav-card.cat-ip { border-left-color: var(--accent-green); }
.tool-nav-card.cat-net { border-left-color: var(--accent-cyan); }
.tool-nav-card.cat-sec { border-left-color: var(--accent-yellow); }
.tool-nav-card.cat-ai { border-left-color: var(--accent-purple); }
@media (max-width: 768px) {
    .tools-nav-grid { grid-template-columns: repeat(2, 1fr); }
    .tools-nav-section { margin: 20px auto; padding: 0 16px; }
    .tool-nav-card { padding: 10px 12px; }
    .tool-nav-card .tool-nav-name { font-size: 0.82rem; }
    .tool-nav-card .tool-nav-desc { font-size: 0.7rem; }
}

/* ===================================================================
 * AI Widget Section (inline iframe from AI.IPIPai.com)
 * =================================================================== */
.ai-widget-section {
    width: 100%;
    max-width: 1600px;
    margin: 40px auto;
    padding: 0 24px;
    box-sizing: border-box;
    animation: fadeInUp 0.6s ease-out;
}
.ai-widget-section .ai-widget-title {
    text-align: center;
    margin-bottom: 16px;
}
.ai-widget-section .ai-widget-title h2 {
    font-size: 1.3rem;
    font-weight: 700;
    background: linear-gradient(135deg, #2ed573, #6ee7b7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.ai-widget-section .ai-widget-title h2 .ai-icon {
    display: inline-flex;
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, rgba(46,213,115,0.15), rgba(46,213,115,0.05));
    border: 1px solid rgba(46,213,115,0.25);
    border-radius: 8px;
    align-items: center;
    justify-content: center;
    color: var(--accent-cyan);
}
.ai-widget-iframe-wrap {
    position: relative;
    width: 100%;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    box-shadow: var(--shadow-card), 0 0 40px rgba(46,213,115,0.04);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.ai-widget-iframe-wrap:hover {
    border-color: var(--border-glow);
    box-shadow: var(--shadow-card), 0 0 50px rgba(46,213,115,0.08);
}
.ai-widget-iframe-wrap iframe {
    width: 100%;
    height: 75vh;
    min-height: 600px;
    border: none;
    display: block;
}
.ai-widget-caption {
    margin: 12px 0 0;
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
}
.ai-widget-caption a {
    color: var(--accent-cyan);
    text-decoration: none;
    transition: color 0.2s;
}
.ai-widget-caption a:hover {
    text-decoration: underline;
}
@media (max-width: 768px) {
    .ai-widget-section {
        margin: 24px auto;
        padding: 0 16px;
    }
    .ai-widget-iframe-wrap iframe {
        height: 60vh;
        min-height: 400px;
    }
    .ai-widget-section .ai-widget-title h2 {
        font-size: 1.1rem;
    }
}

/* ===================================================================
 * AI Chat Widget (floating button + panel)
 * =================================================================== */

/* Floating button */
#aiChatBtn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9998;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    background: linear-gradient(135deg, #1a5d3a, #2ed573);
    border: 1px solid rgba(46, 213, 115, 0.3);
    border-radius: 28px;
    cursor: pointer;
    box-shadow: 0 4px 24px rgba(46, 213, 115, 0.25), 0 0 0 1px rgba(46, 213, 115, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
}
#aiChatBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(46, 213, 115, 0.4), 0 0 0 1px rgba(46, 213, 115, 0.2);
}
#aiChatBtn.hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.8) translateY(20px);
}
.ai-chat-btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}
.ai-chat-btn-label {
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
}
.ai-chat-btn-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 12px;
    height: 12px;
    background: #2ed573;
    border-radius: 50%;
    border: 2px solid var(--bg-main, #060d0a);
}
.ai-chat-btn-badge.pulse {
    animation: aiChatPulse 2s infinite;
}
@keyframes aiChatPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(46, 213, 115, 0.5); }
    50% { box-shadow: 0 0 0 8px rgba(46, 213, 115, 0); }
}

/* Chat panel */
#aiChatPanel {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    width: 400px;
    max-width: calc(100vw - 48px);
    height: 580px;
    max-height: calc(100vh - 48px);
    background: rgba(8, 16, 12, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(46, 213, 115, 0.15);
    border-radius: 20px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(46, 213, 115, 0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: scale(0.92) translateY(20px);
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
#aiChatPanel.open {
    opacity: 1;
    transform: scale(1) translateY(0);
    pointer-events: auto;
}

/* Header */
.ai-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(46, 213, 115, 0.1);
    background: linear-gradient(180deg, rgba(46, 213, 115, 0.04), transparent);
}
.ai-chat-header-info {
    display: flex;
    align-items: center;
    gap: 10px;
}
.ai-chat-header-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(46, 213, 115, 0.15), rgba(46, 213, 115, 0.05));
    border: 1px solid rgba(46, 213, 115, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-cyan, #2ed573);
}
.ai-chat-header-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary, #e8f5e9);
}
.ai-chat-header-subtitle {
    font-size: 0.72rem;
    color: var(--text-muted, #4ade80);
    opacity: 0.7;
}
.ai-chat-header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}
.ai-chat-new-btn, .ai-chat-close {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--text-muted, #4ade80);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.ai-chat-new-btn:hover, .ai-chat-close:hover {
    background: rgba(46, 213, 115, 0.1);
    color: var(--accent-cyan, #2ed573);
}

/* Model selector bar */
.ai-chat-model-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-bottom: 1px solid rgba(46, 213, 115, 0.08);
    background: rgba(0, 0, 0, 0.2);
}
.ai-chat-model-label {
    font-size: 0.72rem;
    color: var(--text-muted, #4ade80);
    opacity: 0.6;
}
.ai-chat-model-select {
    flex: 1;
    background: rgba(46, 213, 115, 0.06);
    color: var(--text-primary, #e8f5e9);
    border: 1px solid rgba(46, 213, 115, 0.15);
    border-radius: 8px;
    padding: 5px 10px;
    font-size: 0.78rem;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s;
}
.ai-chat-model-select:hover {
    border-color: rgba(46, 213, 115, 0.3);
}
.ai-chat-model-select option {
    background: #0a1410;
    color: #e8f5e9;
}

/* Messages area */
.ai-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    scrollbar-width: thin;
    scrollbar-color: rgba(46, 213, 115, 0.2) transparent;
}
.ai-chat-messages::-webkit-scrollbar {
    width: 5px;
}
.ai-chat-messages::-webkit-scrollbar-thumb {
    background: rgba(46, 213, 115, 0.2);
    border-radius: 3px;
}

/* Welcome screen */
.ai-chat-welcome {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 20px 8px;
}
.ai-chat-welcome-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(46, 213, 115, 0.12), rgba(46, 213, 115, 0.04));
    border: 1px solid rgba(46, 213, 115, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-cyan, #2ed573);
    margin-bottom: 14px;
    box-shadow: 0 0 24px rgba(46, 213, 115, 0.1);
}
.ai-chat-welcome-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary, #e8f5e9);
    margin-bottom: 6px;
}
.ai-chat-welcome-desc {
    font-size: 0.78rem;
    color: var(--text-muted, #4ade80);
    opacity: 0.7;
    line-height: 1.5;
    margin-bottom: 18px;
    max-width: 320px;
}
.ai-chat-prompts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
}
.ai-chat-prompt {
    padding: 10px 12px;
    background: rgba(46, 213, 115, 0.05);
    border: 1px solid rgba(46, 213, 115, 0.12);
    border-radius: 10px;
    font-size: 0.76rem;
    color: var(--text-secondary, #a5d6a7);
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    line-height: 1.4;
}
.ai-chat-prompt:hover {
    background: rgba(46, 213, 115, 0.1);
    border-color: rgba(46, 213, 115, 0.25);
    color: var(--accent-cyan, #2ed573);
    transform: translateY(-1px);
}

/* Message bubbles */
.ai-chat-message {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    animation: aiChatFadeIn 0.3s ease;
}
@keyframes aiChatFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
.ai-chat-msg-avatar {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ai-chat-msg-user .ai-chat-msg-avatar {
    background: rgba(56, 189, 248, 0.12);
    color: #38bdf8;
}
.ai-chat-msg-ai .ai-chat-msg-avatar {
    background: rgba(46, 213, 115, 0.12);
    color: var(--accent-cyan, #2ed573);
}
.ai-chat-msg-bubble {
    flex: 1;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 0.83rem;
    line-height: 1.5;
    word-break: break-word;
}
.ai-chat-msg-user .ai-chat-msg-bubble {
    background: rgba(56, 189, 248, 0.08);
    border: 1px solid rgba(56, 189, 248, 0.12);
    color: var(--text-primary, #e8f5e9);
}
.ai-chat-msg-ai .ai-chat-msg-bubble {
    background: rgba(46, 213, 115, 0.06);
    border: 1px solid rgba(46, 213, 115, 0.1);
    color: var(--text-primary, #e8f5e9);
}
.ai-chat-msg-bubble p {
    margin: 0 0 8px 0;
}
.ai-chat-msg-bubble p:last-child {
    margin-bottom: 0;
}

/* Code blocks */
.ai-chat-code {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(46, 213, 115, 0.1);
    border-radius: 8px;
    padding: 10px 12px;
    overflow-x: auto;
    font-size: 0.78rem;
    margin: 8px 0;
}
.ai-chat-inline-code {
    background: rgba(46, 213, 115, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.78rem;
}

/* Link button */
.ai-chat-link-btn {
    display: inline-block;
    margin-top: 6px;
    padding: 8px 16px;
    background: linear-gradient(135deg, rgba(46, 213, 115, 0.2), rgba(46, 213, 115, 0.1));
    border: 1px solid rgba(46, 213, 115, 0.3);
    border-radius: 8px;
    color: var(--accent-cyan, #2ed573);
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}
.ai-chat-link-btn:hover {
    background: linear-gradient(135deg, rgba(46, 213, 115, 0.3), rgba(46, 213, 115, 0.15));
    transform: translateY(-1px);
}

/* Typing indicator */
.ai-chat-typing {
    display: flex;
    gap: 4px;
    padding: 4px 0;
}
.ai-chat-typing span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent-cyan, #2ed573);
    opacity: 0.4;
    animation: aiChatTyping 1.4s infinite;
}
.ai-chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.ai-chat-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes aiChatTyping {
    0%, 60%, 100% { opacity: 0.3; transform: scale(0.8); }
    30% { opacity: 1; transform: scale(1); }
}

/* Input bar */
.ai-chat-input-bar {
    padding: 12px 16px;
    border-top: 1px solid rgba(46, 213, 115, 0.1);
    background: rgba(0, 0, 0, 0.2);
}
.ai-chat-input-wrap {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    background: rgba(46, 213, 115, 0.05);
    border: 1px solid rgba(46, 213, 115, 0.15);
    border-radius: 14px;
    padding: 8px 10px;
    transition: border-color 0.2s;
}
.ai-chat-input-wrap:focus-within {
    border-color: rgba(46, 213, 115, 0.35);
}
.ai-chat-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary, #e8f5e9);
    font-size: 0.83rem;
    font-family: inherit;
    resize: none;
    line-height: 1.5;
    max-height: 120px;
}
.ai-chat-input::placeholder {
    color: var(--text-muted, #4ade80);
    opacity: 0.4;
}
.ai-chat-send-btn {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    border: none;
    background: linear-gradient(135deg, #2ed573, #1a5d3a);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.ai-chat-send-btn:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 2px 12px rgba(46, 213, 115, 0.3);
}
.ai-chat-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.ai-chat-footer {
    margin-top: 8px;
    text-align: center;
}
.ai-chat-fullpage {
    font-size: 0.72rem;
    color: var(--text-muted, #4ade80);
    opacity: 0.5;
    text-decoration: none;
    cursor: pointer;
    transition: opacity 0.2s;
}
.ai-chat-fullpage:hover {
    opacity: 1;
    color: var(--accent-cyan, #2ed573);
}

/* ---------- AI 健康指示灯 ---------- */
.ai-chat-health-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
    background: #8b8b8b;
    vertical-align: middle;
    transition: background 0.3s, box-shadow 0.3s;
}
.ai-chat-health-dot.healthy {
    background: #2ed573;
    box-shadow: 0 0 6px rgba(46, 213, 115, 0.7);
}
.ai-chat-health-dot.degraded {
    background: #f5a623;
    box-shadow: 0 0 6px rgba(245, 166, 35, 0.7);
}
.ai-chat-health-dot.unavailable {
    background: #ff4757;
    box-shadow: 0 0 6px rgba(255, 71, 87, 0.8);
    animation: ai-health-pulse 1.2s ease-in-out infinite;
}
.ai-chat-health-dot.unknown {
    background: #8b8b8b;
}
@keyframes ai-health-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
}

/* ---------- AI 错误详情面板（点击右侧箭头展开） ---------- */
.ai-chat-msg-avatar-error {
    color: #ff4757;
}
.ai-chat-error-bubble {
    border: 1px solid rgba(255, 71, 87, 0.35);
    background: rgba(255, 71, 87, 0.08);
}
.ai-chat-error-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.ai-chat-error-title {
    font-weight: 600;
    color: #ff6b7a;
    font-size: 0.86rem;
}
.ai-chat-error-toggle {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    padding: 0;
    border: none;
    background: transparent;
    color: #ff6b7a;
    cursor: pointer;
    border-radius: 4px;
    transition: transform 0.2s, background 0.2s;
}
.ai-chat-error-toggle:hover {
    background: rgba(255, 71, 87, 0.15);
}
.ai-chat-error-bubble.expanded .ai-chat-error-toggle {
    transform: rotate(90deg);
}
.ai-chat-error-body {
    display: none;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed rgba(255, 71, 87, 0.3);
}
.ai-chat-error-bubble.expanded .ai-chat-error-body {
    display: block;
}
.ai-chat-error-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: 0.76rem;
    line-height: 1.7;
    color: var(--text-muted, #9aa0a6);
}
.ai-chat-error-row b {
    color: #ffd0d5;
    font-weight: 600;
}
.ai-chat-error-detail {
    margin-top: 6px;
    padding: 6px 8px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.25);
    font-family: monospace;
    font-size: 0.72rem;
    line-height: 1.5;
    color: #ffb3ba;
    word-break: break-all;
}
.ai-chat-error-link {
    display: inline-block;
    margin-top: 8px;
    font-size: 0.75rem;
    color: var(--accent-cyan, #2ed573);
    text-decoration: none;
}
.ai-chat-error-link:hover {
    text-decoration: underline;
}
.ai-chat-retry-note {
    font-size: 0.76rem;
    color: var(--text-muted, #9aa0a6);
    margin-top: 4px;
}

/* Mobile responsive */
@media (max-width: 480px) {
    #aiChatBtn {
        bottom: 16px;
        right: 16px;
        padding: 10px 14px;
    }
    .ai-chat-btn-label {
        display: none;
    }
    #aiChatPanel {
        bottom: 0;
        right: 0;
        width: 100vw;
        max-width: 100vw;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }
    .ai-chat-prompts {
        grid-template-columns: 1fr;
    }
}

/* ============ MCP Docs: Endpoints Choice Section ============ */
.endpoints-sec {
    padding: 40px 0 28px;
    border-bottom: 1px solid #30363d;
}
.endpoints-sec h2 {
    font-size: 1.6rem;
    color: #f0f6fc;
    margin-bottom: 12px;
}
.endpoints-sec > p {
    color: #8b949e;
    margin-bottom: 24px;
    max-width: 720px;
}
.endpoints-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
}
.endpoint-card {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 10px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.endpoint-card.open { border-top: 3px solid #3fb950; }
.endpoint-card.secured { border-top: 3px solid #f0883e; }
.ep-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.ep-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: #f0f6fc;
}
.ep-tag {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 999px;
    letter-spacing: 0.03em;
}
.ep-tag-open {
    background: rgba(63,185,80,0.15);
    color: #3fb950;
    border: 1px solid rgba(63,185,80,0.4);
}
.ep-tag-secure {
    background: rgba(240,136,62,0.15);
    color: #f0883e;
    border: 1px solid rgba(240,136,62,0.4);
}
.ep-meta {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
    font-size: 0.85rem;
    color: #c9d1d9;
}
.ep-meta strong { color: #f0f6fc; margin-right: 6px; }
.ep-tools { font-size: 0.82rem; color: #8b949e; }
.ep-tools ol {
    margin: 8px 0 8px 18px;
    padding: 0;
    columns: 2;
    column-gap: 18px;
}
.ep-tools li { margin: 2px 0; color: #c9d1d9; }
.ep-jsonref { font-size: 0.78rem; color: #8b949e; }
.ep-jsonref a { color: #58a6ff; text-decoration: none; }
.ep-jsonref a:hover { text-decoration: underline; }
.ep-config pre {
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 6px;
    padding: 12px 14px;
    font-size: 0.78rem;
    overflow-x: auto;
}

/* ============ MCP Docs: SDK CTA Box ============ */
.cta-box {
    margin-top: 24px;
    background: linear-gradient(135deg, #0d1117 0%, #161b22 100%);
    border: 1px solid #30363d;
    border-left: 4px solid #58a6ff;
    border-radius: 10px;
    padding: 20px 24px;
}
.cta-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #f0f6fc;
    margin-bottom: 8px;
}
.cta-box p {
    color: #8b949e;
    font-size: 0.9rem;
    margin-bottom: 14px;
    max-width: 620px;
}
.cta-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid transparent;
    transition: all 0.15s ease;
}
.cta-btn-primary {
    background: #58a6ff;
    color: #0d1117;
}
.cta-btn-primary:hover { background: #79c0ff; }
.cta-btn-ghost {
    background: transparent;
    color: #c9d1d9;
    border-color: #30363d;
}
.cta-btn-ghost:hover { border-color: #58a6ff; color: #f0f6fc; }
.cta-ico { font-size: 1rem; }

@media (max-width: 640px) {
    .endpoints-grid { grid-template-columns: 1fr; }
    .ep-tools ol { columns: 1; }
    .cta-actions { flex-direction: column; }
}

/* ===== TikTok Assistant widget ===== */
.tk-assistant-section { max-width: 900px; margin: 0 auto; padding: 20px; }
.tk-subtitle { text-align: center; }
.tk-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 16px 0; }
.tk-chip { background: var(--bg-card); border: 1px solid var(--border-color); color: var(--accent-cyan);
    border-radius: 20px; padding: 8px 16px; cursor: pointer; font-size: 0.85rem; transition: all 0.2s; }
.tk-chip:hover { border-color: var(--accent-cyan); transform: translateY(-1px); }
.tk-chat-body { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-lg);
    height: 320px; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.tk-msg { max-width: 85%; padding: 10px 14px; border-radius: 12px; font-size: 0.9rem; line-height: 1.6; white-space: pre-wrap; }
.tk-msg-user { align-self: flex-end; background: var(--accent-cyan); color: #06281a; border-bottom-right-radius: 4px; }
.tk-msg-ai { align-self: flex-start; background: rgba(255,255,255,0.06); color: var(--text-primary, #e8f5e9);
    border: 1px solid var(--border-color); border-bottom-left-radius: 4px; }
.tk-msg-ai strong { color: var(--accent-cyan); }
.tk-typing span { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent-cyan);
    margin: 0 2px; animation: tkBlink 1.2s infinite; }
.tk-typing span:nth-child(2) { animation-delay: 0.2s; } .tk-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes tkBlink { 0%, 60%, 100% { opacity: 0.3; } 30% { opacity: 1; } }
.tk-chat-form { display: flex; gap: 8px; margin-top: 12px; }
.tk-chat-input { flex: 1; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 10px;
    padding: 12px 16px; color: inherit; font-size: 0.9rem; outline: none; }
.tk-chat-input:focus { border-color: var(--accent-cyan); }
.tk-chat-send { background: var(--accent-cyan); color: #06281a; border: none; border-radius: 10px;
    padding: 0 24px; font-weight: 600; cursor: pointer; }
.tk-chat-send:hover { filter: brightness(1.1); }
