/* ============================================================
   index.css — DNS解析安全专题首页 专属样式
   复用全局 style.css 变量（--primary/--bg-card/--border 等）
   与威胁情报参考页视觉系统一致：hero 画布 + 数字计数 + 可展开子课题卡
   ============================================================ */

/* ===== HERO ===== */
.dns-hero {
    position: relative;
    min-height: 680px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: linear-gradient(180deg, #f0f5ff 0%, #ffffff 100%);
    padding-top: 72px;
}
#dnsCanvas {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 1;
}
.dns-hero-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    background: radial-gradient(ellipse at 30% 50%, transparent 0%, rgba(240,245,255,0.2) 50%, rgba(255,255,255,0.55) 100%);
    pointer-events: none;
}
.dns-hero-content {
    position: relative;
    z-index: 3;
    max-width: 920px;
    text-align: center;
    padding: 56px 24px;
}
.dns-breadcrumb {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 20px;
    font-size: 13px;
    color: var(--text-light);
    animation: fadeInDown 0.6s ease-out;
}
.dns-breadcrumb a { color: var(--primary); text-decoration: none; font-weight: 500; }
.dns-breadcrumb a:hover { text-decoration: underline; }
.dns-breadcrumb svg { width: 14px; height: 14px; color: var(--text-light); }
.dns-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(26, 110, 255, 0.08);
    color: var(--primary);
    font-size: 13px;
    font-weight: 600;
    padding: 8px 20px;
    border-radius: 100px;
    margin-bottom: 24px;
    border: 1px solid rgba(26, 110, 255, 0.15);
    animation: fadeInDown 0.8s ease-out;
}
.dns-hero-badge svg { width: 16px; height: 16px; }
@keyframes fadeInDown { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
.dns-hero h1 {
    font-size: clamp(30px, 5vw, 50px);
    font-weight: 900;
    line-height: 1.15;
    color: var(--text);
    margin-bottom: 20px;
    letter-spacing: -1px;
    animation: fadeInUp 0.8s ease-out 0.15s both;
}
.dns-hero h1 .highlight {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.dns-hero-content > p {
    font-size: clamp(15px, 2vw, 18px);
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto 28px;
    line-height: 1.85;
    animation: fadeInUp 0.8s ease-out 0.3s both;
}
.dns-hero-stats {
    display: flex;
    justify-content: center;
    gap: 44px;
    margin-top: 32px;
    flex-wrap: wrap;
    animation: fadeInUp 0.8s ease-out 0.5s both;
}
.dns-hero-stats .stat-item { text-align: center; min-width: 120px; }
.dns-hero-stats .stat-number {
    font-size: 38px;
    font-weight: 900;
    color: var(--primary);
    line-height: 1;
    font-variant-numeric: tabular-nums;
}
.dns-hero-stats .stat-label {
    font-size: 13px;
    color: var(--text-light);
    margin-top: 8px;
    font-weight: 500;
}
.dns-hero-note {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 16px;
    font-style: italic;
    animation: fadeInUp 0.8s ease-out 0.6s both;
}

/* ===== OVERVIEW ===== */
.overview-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.overview-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; transition: var(--transition); }
.overview-card:hover { border-color: rgba(26, 110, 255, 0.2); box-shadow: var(--shadow-hover); transform: translateY(-4px); }
.ov-icon { width: 48px; height: 48px; background: var(--primary-light); border-radius: 12px; display: flex; align-items: center; justify-content: center; margin-bottom: 16px; }
.ov-icon svg { width: 24px; height: 24px; color: var(--primary); }
.overview-card h4 { font-size: 16px; font-weight: 800; margin-bottom: 10px; color: var(--text); }
.overview-card p { font-size: 13px; color: var(--text-secondary); line-height: 1.8; }

/* ===== SUBTOPICS ===== */
.subtopic-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.subtopic-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    transition: var(--transition);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}
.subtopic-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 4px; height: 100%;
    background: var(--primary-gradient);
    transform: scaleY(0);
    transform-origin: top;
    transition: var(--transition);
}
.subtopic-card:hover::before { transform: scaleY(1); }
.subtopic-card:hover { border-color: rgba(26, 110, 255, 0.2); box-shadow: var(--shadow-hover); transform: translateY(-3px); }
.subtopic-card.expanded { grid-column: 1 / -1; border-color: rgba(26, 110, 255, 0.3); box-shadow: var(--shadow-hover); }
.st-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.st-num { font-size: 28px; font-weight: 900; color: var(--primary); opacity: 0.3; line-height: 1; }
.st-status { font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 100px; }
.st-status.active { background: #e6f7ed; color: #2ea043; }
.st-status.planned { background: #f0f0f5; color: var(--text-light); }
.subtopic-card h3 { font-size: 18px; font-weight: 700; margin-bottom: 10px; color: var(--text); }
.subtopic-card > p { font-size: 14px; color: var(--text-secondary); line-height: 1.7; margin-bottom: 16px; }
.st-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.st-keywords { display: flex; flex-wrap: wrap; gap: 6px; }
.st-keywords span { font-size: 11px; color: var(--primary); background: var(--primary-light); padding: 3px 10px; border-radius: 100px; font-weight: 500; }
.st-view-btn {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 13px; font-weight: 700; color: #fff;
    background: var(--primary-gradient); border: none;
    padding: 9px 18px; border-radius: 100px; text-decoration: none;
    box-shadow: 0 4px 14px rgba(26, 110, 255, 0.28);
    transition: var(--transition); flex-shrink: 0; white-space: nowrap;
}
.st-view-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(26, 110, 255, 0.36); }
.st-view-btn svg { width: 14px; height: 14px; }
.st-arrow {
    width: 32px; height: 32px;
    background: var(--primary-light);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    transition: var(--transition); flex-shrink: 0;
}
.st-arrow svg { width: 14px; height: 14px; color: var(--primary); transition: var(--transition); }
.subtopic-card:hover .st-arrow { background: var(--primary); }
.subtopic-card:hover .st-arrow svg { color: white; }
.subtopic-card.expanded .st-arrow svg { transform: rotate(90deg); }
.st-detail { display: none; margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--border); animation: fadeIn 0.3s ease; }
.subtopic-card.expanded .st-detail { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.st-detail-inner h5 { font-size: 15px; font-weight: 700; margin-bottom: 12px; color: var(--primary); }
.st-detail-inner ul { list-style: none; padding: 0; margin: 0 0 16px; }
.st-detail-inner li { font-size: 14px; color: var(--text-secondary); line-height: 1.8; padding-left: 18px; position: relative; margin-bottom: 8px; }
.st-detail-inner li::before { content: ''; position: absolute; left: 0; top: 10px; width: 6px; height: 6px; background: var(--primary); border-radius: 50%; opacity: 0.5; }
.st-detail-inner li strong { color: var(--text); font-weight: 600; }
.st-detail-btn {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: 14px; font-weight: 700; color: var(--primary);
    background: var(--primary-light); border: 1.5px solid rgba(26, 110, 255, 0.2);
    padding: 10px 20px; border-radius: 100px; text-decoration: none;
    transition: var(--transition);
}
.st-detail-btn:hover { background: var(--primary); color: #fff; border-color: transparent; }
.st-detail-btn svg { width: 15px; height: 15px; }
.st-ref { font-size: 12px; color: var(--text-light); background: var(--bg-warm); padding: 10px 14px; border-radius: var(--radius-sm); border-left: 3px solid var(--primary); margin-top: 4px; line-height: 1.7; }

/* ===== KEY TECH ===== */
.tech-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.tech-item { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; transition: var(--transition); }
.tech-item:hover { border-color: rgba(26, 110, 255, 0.2); box-shadow: var(--shadow-hover); }
.tech-item .t-icon { width: 44px; height: 44px; background: var(--primary-light); border-radius: 12px; display: flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.tech-item .t-icon svg { width: 22px; height: 22px; color: var(--primary); }
.tech-item h5 { font-size: 15px; font-weight: 700; margin-bottom: 8px; color: var(--text); }
.tech-item p { font-size: 13px; color: var(--text-secondary); line-height: 1.7; }

/* ===== FLOW ===== */
.flow-steps { display: flex; flex-direction: column; gap: 0; max-width: 760px; margin: 0 auto; }
.flow-step { display: flex; gap: 20px; position: relative; padding-bottom: 32px; }
.flow-step:last-child { padding-bottom: 0; }
.flow-step::before { content: ''; position: absolute; left: 19px; top: 40px; bottom: 0; width: 2px; background: linear-gradient(180deg, var(--primary), var(--primary-light)); }
.flow-step:last-child::before { display: none; }
.flow-dot { width: 40px; height: 40px; background: var(--primary-gradient); color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 15px; flex-shrink: 0; box-shadow: 0 4px 14px rgba(26, 110, 255, 0.3); }
.flow-body { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 24px; flex: 1; transition: var(--transition); }
.flow-body:hover { border-color: rgba(26, 110, 255, 0.2); box-shadow: var(--shadow); }
.flow-body h5 { font-size: 15px; font-weight: 700; margin-bottom: 6px; color: var(--text); }
.flow-body p { font-size: 13px; color: var(--text-secondary); line-height: 1.7; }

/* ===== DATA ===== */
.data-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.data-item { text-align: center; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px 16px; }
.data-item .d-num { font-size: 30px; font-weight: 900; color: var(--primary); line-height: 1; font-variant-numeric: tabular-nums; }
.data-item .d-label { font-size: 13px; color: var(--text-light); margin-top: 10px; font-weight: 500; }
.data-note { font-size: 12px; color: var(--text-light); line-height: 1.8; margin-top: 20px; padding: 14px 18px; background: var(--bg-warm); border-left: 3px solid var(--primary); border-radius: var(--radius-sm); }

/* ===== THREAT TIMELINE ===== */
.threat-timeline { position: relative; max-width: 860px; margin: 0 auto; padding-left: 8px; }
.threat-timeline::before { content: ''; position: absolute; left: 88px; top: 8px; bottom: 8px; width: 2px; background: linear-gradient(180deg, var(--primary), var(--primary-light)); opacity: 0.35; }
.tl-item { display: flex; gap: 24px; position: relative; padding-bottom: 28px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-year { width: 64px; flex-shrink: 0; text-align: right; font-size: 18px; font-weight: 900; color: var(--primary); font-variant-numeric: tabular-nums; padding-top: 20px; }
.tl-item::after { content: ''; position: absolute; left: 82px; top: 26px; width: 12px; height: 12px; background: #fff; border: 3px solid var(--primary); border-radius: 50%; z-index: 1; }
.tl-body { flex: 1; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 24px; margin-left: 28px; transition: var(--transition); }
.tl-item:hover .tl-body { border-color: rgba(26, 110, 255, 0.25); box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.tl-body h5 { font-size: 15px; font-weight: 800; margin-bottom: 8px; color: var(--text); display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.tl-body p { font-size: 13px; color: var(--text-secondary); line-height: 1.85; }
.tl-body p em { color: var(--primary); font-style: normal; font-weight: 600; }
.tl-tag { font-size: 10px; font-weight: 700; padding: 3px 10px; border-radius: 100px; }
.tag-poison { background: #fdecec; color: #d93025; }
.tag-hijack { background: #fff4e5; color: #e68600; }
.tag-ddos { background: #eef0ff; color: #4f46e5; }

/* ===== LAWS ===== */
.law-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.law-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; transition: var(--transition); position: relative; overflow: hidden; }
.law-card::after { content: ''; position: absolute; bottom: 0; left: 0; width: 100%; height: 3px; background: var(--primary-gradient); transform: scaleX(0); transform-origin: left; transition: var(--transition); }
.law-card:hover::after { transform: scaleX(1); }
.law-card:hover { border-color: rgba(26, 110, 255, 0.2); box-shadow: var(--shadow-hover); transform: translateY(-3px); }
.law-cat { display: inline-block; font-size: 10px; font-weight: 800; letter-spacing: 1px; color: var(--primary); background: var(--primary-light); padding: 3px 10px; border-radius: 100px; margin-bottom: 12px; }
.law-card h5 { font-size: 14px; font-weight: 800; margin-bottom: 8px; color: var(--text); line-height: 1.5; }
.law-card p { font-size: 12px; color: var(--text-secondary); line-height: 1.8; }

/* ===== GLOSSARY ===== */
.glossary-list { max-width: 860px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.gl-item { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; transition: var(--transition); }
.gl-item:hover { border-color: rgba(26, 110, 255, 0.2); }
.gl-item.open { border-color: rgba(26, 110, 255, 0.3); box-shadow: var(--shadow); }
.gl-head { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; background: none; border: none; cursor: pointer; font-size: 14px; font-weight: 700; color: var(--text); text-align: left; font-family: inherit; }
.gl-head svg { width: 16px; height: 16px; color: var(--primary); flex-shrink: 0; transition: transform 0.3s ease; }
.gl-item.open .gl-head svg { transform: rotate(180deg); }
.gl-body { max-height: 0; overflow: hidden; transition: max-height 0.35s ease; }
.gl-body p { padding: 0 20px 16px; font-size: 13px; color: var(--text-secondary); line-height: 1.85; border-top: 1px dashed var(--border); margin: 0 20px; padding: 14px 0 16px; }
.gl-item.open .gl-body { max-height: 260px; }

/* ===== REFERENCES ===== */
.ref-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; align-items: start; }
.ref-group { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.ref-group h5 { font-size: 14px; font-weight: 800; color: var(--primary); margin-bottom: 14px; padding-bottom: 10px; border-bottom: 2px solid var(--primary-light); }
.ref-list { list-style: none; padding: 0; margin: 0; }
.ref-list li { display: flex; gap: 8px; font-size: 12px; color: var(--text-secondary); line-height: 1.7; margin-bottom: 12px; }
.ref-list li:last-child { margin-bottom: 0; }
.ref-no { color: var(--primary); font-weight: 800; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.ref-list strong { color: var(--text); }
.ref-list a { display: block; color: var(--primary); text-decoration: none; font-size: 11px; word-break: break-all; margin-top: 2px; }
.ref-list a:hover { text-decoration: underline; }
.ref-note { font-size: 12px; color: var(--text-light); line-height: 1.8; margin-top: 24px; padding: 14px 18px; background: var(--bg-warm); border-left: 3px solid var(--primary); border-radius: var(--radius-sm); }

/* ===== BACK NAV ===== */
.back-bar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.back-link { display: inline-flex; align-items: center; gap: 8px; color: var(--primary); text-decoration: none; font-size: 14px; font-weight: 600; padding: 10px 20px; border: 1.5px solid var(--border); border-radius: 100px; transition: var(--transition); background: #fff; }
.back-link:hover { border-color: var(--primary); background: var(--primary-light); }
.sibling-nav { display: flex; gap: 10px; flex-wrap: wrap; }
.sibling-nav a { font-size: 13px; font-weight: 600; color: var(--text-secondary); text-decoration: none; padding: 10px 18px; border-radius: 100px; border: 1.5px solid var(--border); background: #fff; transition: var(--transition); }
.sibling-nav a:hover, .sibling-nav a.current { color: var(--primary); border-color: var(--primary); background: var(--primary-light); }

/* ===== 响应式 ===== */
@media (max-width:1024px){
    .overview-grid { grid-template-columns: repeat(2, 1fr); }
    .tech-list { grid-template-columns: repeat(2, 1fr); }
    .data-strip { grid-template-columns: repeat(2, 1fr); }
    .subtopic-grid { grid-template-columns: 1fr; }
    .subtopic-card.expanded { grid-column: auto; }
    .law-grid { grid-template-columns: repeat(2, 1fr); }
    .ref-cols { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width:768px){
    .dns-hero { min-height: 460px; padding-top: 96px; }
    .dns-hero h1 { font-size: clamp(26px, 7vw, 34px); }
    .dns-hero-stats { gap: 20px; margin-top: 24px; }
    .dns-hero-stats .stat-number { font-size: 28px; }
    .nav-links { display: none; position: absolute; top: 72px; left: 0; right: 0; background: white; flex-direction: column; padding: 16px 24px; box-shadow: 0 8px 24px rgba(0,0,0,0.08); gap: 4px; border-bottom: 1px solid var(--border); z-index: 1000; }
    .nav-links.active { display: flex; }
    .mobile-toggle { display: flex; }
    .subtopic-card { padding: 22px 18px; }
    .subj-grid, .overview-grid, .tech-list, .data-strip { grid-template-columns: 1fr; }
    .law-grid { grid-template-columns: 1fr; }
    .st-meta { flex-direction: column; align-items: stretch; }
    .st-view-btn { justify-content: center; }
    .st-arrow { display: none; }
    .flow-step { gap: 14px; }
    .flow-dot { width: 34px; height: 34px; font-size: 13px; }
    .flow-step::before { left: 16px; }
    .threat-timeline::before { left: 8px; }
    .tl-item { flex-direction: column; gap: 8px; padding-left: 32px; }
    .tl-item::after { left: 2px; top: 6px; }
    .tl-year { text-align: left; width: auto; padding-top: 0; font-size: 16px; }
    .tl-body { margin-left: 0; padding: 16px 18px; }
    .gl-head { padding: 14px 16px; font-size: 13px; }
    .footer-grid { grid-template-columns: 1fr; gap: 24px; }
    .footer { padding: 48px 0 24px; }
    .footer-bottom { flex-direction: column; align-items: flex-start; }
    .section { padding: 48px 0; }
    .back-bar { flex-direction: column; align-items: flex-start; }
}
