/* ============================================================
   ed2kers 样式表
   原则：只保留模板实际使用的样式，现代写法，无 IE hack
   结构：变量 → 基础 → 布局 → 头部导航 → 首页 → 列表 → 详情 → 页脚 → 内页 → 响应式
   ============================================================ */

/* ---------- 变量 ---------- */
:root {
    --green: #6EA903;
    --green-light: #85BD38;
    --green-dark: #40830B;
    --green-deep: #4F7D00;
    --green-wash: #f6fbeb;
    --orange: #FF6600;
    --red: #C30;
    --link: #0B66A8;
    --text: #555;
    --text-strong: #333;
    --text-mute: #888;
    --text-faint: #999;
    --line: #e2e2e2;
    --line-soft: #f0f0f0;
    --bg: #E6EAE4;
    --radius: 6px;
    --container: 1200px;
    --aside: 270px;
    --gap: 30px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
ul, ol, li { list-style: none; }
img { border: 0; vertical-align: middle; }
a { text-decoration: none; }
table { border-collapse: collapse; }
h1, h2, h3, h4, h5, h6 { font-weight: 700; }
figure { margin: 0; }

/* ---------- 基础 ---------- */
body {
    font: 400 15px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI",
        "Microsoft YaHei", "PingFang SC", Tahoma, Arial, sans-serif;
    color: var(--text);
    background-color: var(--bg);
}
h1 { font-size: 24px; line-height: 32px; }
h2 { font-size: 20px; line-height: 28px; }
h3 { font-size: 18px; line-height: 26px; }
h4 { font-size: 15px; line-height: 22px; }

a:link, a:visited { color: var(--link); transition: color .2s linear; }
a:hover, a:active { color: #f60; text-decoration: underline; }

input, select, button, textarea { font: inherit; color: #000; }
button { cursor: pointer; border: none; }

/* 键盘可见焦点（鼠标点击不显示） */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid var(--green);
    outline-offset: 2px;
}

/* 屏幕阅读器专用（视觉隐藏但可被读屏/搜索引擎读取） */
.sr-only {
    position: absolute; width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link {
    position: absolute; left: -9999px; top: 0; z-index: 999;
    background: var(--green); color: #fff; padding: 8px 16px; border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus { left: 0; top: 0; color: #fff; text-decoration: none; }

/* ---------- 布局 ---------- */
.wrapper { width: var(--container); clear: both; margin: 0 auto; }
.mT5 { margin-top: 5px; }
.mB10 { margin-bottom: 10px; }

/* 左右两栏：侧栏 270 + 间距 30 + 主栏 900 = 1200 */
.cols { display: flex; gap: var(--gap); align-items: flex-start; }
.cols .l_left { flex: 0 0 var(--aside); position: sticky; top: 10px; }
.cols .l_right { flex: 1; min-width: 0; }

/* ---------- 面包屑 ---------- */
.crumb { margin-top: 5px; font-size: 14px; color: var(--text-mute); }
.crumb ol { display: flex; flex-wrap: wrap; align-items: center; gap: 0 6px; padding-left: 20px; }
.crumb li { max-width: 460px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crumb li + li::before { content: ">"; margin-right: 6px; color: #bbb; }
.crumb a { color: var(--link); }
.crumb a:hover { color: var(--green); text-decoration: none; }
.crumb li[aria-current] { color: var(--text-mute); }

/* ---------- 头部 ---------- */
.site-head { background: transparent; }
.head-inner {
    display: flex; align-items: center; justify-content: space-between;
    gap: 20px; min-height: 84px;
}
.brand { padding-left: 10px; }
.brand a { display: block; }
.brand img { display: block; width: 249px; height: 50px; }

.head-search { display: flex; align-items: center; gap: 60px; }
.head-qun { color: #c00; font-size: 14px; white-space: nowrap; }
.search-form { display: flex; }
.search-form input[type="search"] {
    width: 230px; height: 34px; padding: 5px 8px;
    font-size: 15px; border: 1px solid var(--green); border-radius: 0;
    background: #fff; -webkit-appearance: none; appearance: none;
}
.search-form input[type="search"]:focus { outline-offset: -2px; }
.search-form button {
    width: 110px; height: 34px; flex: 0 0 auto;
    background: var(--green); color: #fff; font-size: 15px;
    border: 1px solid var(--green); border-radius: 0;
}
.search-form button:hover { background: var(--green-dark); }

/* ---------- 导航 ---------- */
.site-nav { background: var(--green); margin-bottom: 8px; }
#nav { display: flex; }
#nav li { flex: 1; }
#nav a {
    display: block; height: 40px; line-height: 40px;
    text-align: center; color: #fff; font-size: 15px;
}
#nav a:hover, #nav a.nav_on { background: var(--green-dark); color: #fff; text-decoration: none; }

/* ---------- 通用内容块 ---------- */
.itemt {
    font-size: 15px; font-weight: 400; color: var(--green); line-height: 36px;
    background: linear-gradient(to bottom, #fff, #eee);
    border-bottom: 1px solid #ddd;
    border-radius: 5px 5px 0 0;
    padding: 0 10px;
    overflow: hidden;
}
.itemt a { color: var(--green); }
.itemt a:hover { color: var(--green-dark); text-decoration: none; }
.stitle { color: var(--green); font-size: 15px; }
.itemt-more { float: right; font-size: 14px; }
.itemt-label { font-size: 14px; }
.itemt-count { float: right; font-size: 14px; font-weight: 400; color: var(--text-mute); }
.itemt-title { line-height: 40px; min-height: 40px; padding-top: 2px; padding-bottom: 2px; }
.sep { color: #aaa; margin: 0 4px; }
.ucontent { background: #fff; }

/* ---------- 首页两栏（等高） ---------- */
.home-cols { display: flex; gap: 20px; align-items: stretch; }
.hotdown { flex: 0 0 850px; min-width: 0; display: flex; flex-direction: column; }
.hothelp { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.hotdown .ucontent { flex: 1; display: flex; flex-direction: column; }
.hothelp .ucontent { flex: 1; display: flex; flex-direction: column; }

/* 首页：最新图区（4 列，space-between 均匀分布） */
.hotdown .list-main {
    flex: 1; display: flex; flex-wrap: wrap; justify-content: space-between;
    align-content: flex-start; padding: 5px 20px 10px;
}
.showimg {
    flex: 0 0 calc(25% - 12.5px);
    height: 182px; text-align: center; overflow: hidden; padding-top: 8px;
}
.showimg a { display: inline-block; }
.showimg img {
    width: 110px; height: 136px; object-fit: cover;
    transition: box-shadow .2s ease;
}
.showimg img:hover { box-shadow: 0 0 10px var(--green); }
.iterm-name {
    display: block; width: 100%; margin: 6px auto 0;
    white-space: nowrap; text-overflow: ellipsis; overflow: hidden; font-size: 14px;
}
.iterm-name a { color: var(--orange); }

/* 首页：随机列表 */
.hothelp .list-main { flex: 1; display: flex; flex-direction: column; padding: 8px 20px; }
.hothelp ul { flex: 1; display: flex; flex-direction: column; justify-content: flex-start; }
.hothelp li {
    display: flex; align-items: center; gap: 6px; width: 100%;
    line-height: 28px; overflow: hidden;
}
.hothelp .date { order: 2; flex: 0 0 auto; color: var(--text-faint); font-size: 14px; }
.hothelp .r_a {
    order: 1; flex: 1; min-width: 0; color: var(--text-strong);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.hothelp .r_a:hover { color: var(--green); text-decoration: none; }

/* ---------- 左侧分类面板 ---------- */
.otitle {
    height: 36px; background: var(--green); font-size: 15px; font-weight: 700;
    color: #fff; line-height: 36px; padding-left: 20px; border-radius: 5px 5px 0 0;
}
.ocontent { border: 2px solid var(--green); background: #fff; }
.oliterm { padding: 8px 0; }
.oliterm li { position: relative; padding-left: 30px; line-height: 34px; width: 100%; color: var(--text); }
.oliterm li::before {
    content: ''; position: absolute; left: 15px; top: 50%; transform: translateY(-50%);
    width: 6px; height: 6px; border-radius: 50%; background: var(--green);
}
.oliterm a { display: block; color: var(--text); }
.oliterm a:hover { color: var(--green); text-decoration: none; }

/* ---------- 列表页 ---------- */
.list-wrap { padding: 24px; }
.addlist {
    display: flex; gap: 12px;
    padding-bottom: 16px; margin-bottom: 16px;
    border-bottom: 1px dashed #bbb;
}
.addlist:last-of-type { border-bottom: none; padding-bottom: 0; }
.addlist .litimg { flex: 0 0 96px; }
.litimg a { display: block; }
.litimg img {
    width: 96px; height: 120px; object-fit: cover; display: block;
    transition: box-shadow .2s ease;
}
.litimg img:hover { box-shadow: 0 0 10px var(--green); }
.techdes { flex: 1; min-width: 0; }
.dtitle { font-size: 16px; font-weight: 400; line-height: 1.5; margin-bottom: 6px; }
.dtitle .tag { color: var(--red); font-size: 16px; }
.dtitle .dtitle-link { font-size: 16px; color: var(--link); }
.dtitle .dtitle-link:hover { color: var(--orange); }
.meta { font-size: 14px; color: #777; }
.meta-row { display: block; line-height: 1.75; word-break: break-word; }
.meta b { color: var(--text-strong); font-weight: 400; }
.empty-tip { padding: 48px 20px; text-align: center; color: var(--text-faint); }

/* 搜索关键词高亮（原 <font style="color:red"> 的替代） */
mark.hl { background: #fff2a8; color: inherit; padding: 0 1px; border-radius: 2px; }

/* ---------- 分页条 ---------- */
.pagelist { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; padding: 14px 0; }
.pagelist a, .pagelist .pg-cur, .pagelist .pg-ellip {
    display: inline-block; min-width: 30px; height: 30px; line-height: 28px;
    padding: 0 6px; text-align: center; font-size: 14px;
}
.pagelist a {
    border: 1px solid var(--line); border-radius: var(--radius);
    color: var(--text); background: #fff;
    transition: all .15s ease;
}
.pagelist a:hover {
    border-color: var(--green); color: var(--green); background: var(--green-wash); text-decoration: none;
}
.pagelist .pg-cur {
    border: 1px solid var(--green); border-radius: var(--radius);
    background: var(--green); color: #fff; font-weight: 600;
}
.pagelist .pg-ellip { border: none; background: none; min-width: 18px; color: var(--text-faint); }
.pagelist .pg-first, .pagelist .pg-prev, .pagelist .pg-next, .pagelist .pg-last { color: var(--text-mute); }

/* ---------- 详情页 ---------- */
.arcbody { padding: 10px 20px; }
#baseinfo { display: flex; gap: 10px; align-items: flex-start; }
#baseinfo .litimg { flex: 0 0 150px; margin: 0; }
#baseinfo .litimg img { width: 150px; height: 188px; object-fit: cover; }
.basetext {
    flex: 1; min-width: 0;
    display: grid; grid-template-columns: auto 1fr; gap: 0 6px;
    line-height: 26px; overflow-wrap: break-word; word-break: normal;
}
.basetext dt { color: var(--text-strong); white-space: nowrap; }
.basetext dd { color: var(--text); min-width: 0; }
.basetext a { color: var(--link); }

.sbar {
    background-color: var(--green-light); padding-left: 12px;
    height: 32px; line-height: 32px; margin-top: 12px;
    font-weight: 700; color: #fff; font-size: 15px;
}
.arcbody .destext { color: #666; line-height: 26px; font-size: 14px; }
.destext table { width: 100%; word-break: break-all; font-size: 14px; }
.destext td, .destext th { padding: 6px; border-bottom: 1px solid var(--line-soft); }
.destext th { background: #f7f7f7; color: var(--text-strong); text-align: center; font-weight: 400; }
.destext .num { text-align: right; width: 90px; white-space: nowrap; color: var(--text-mute); }
.destext .itemtitle { color: var(--link); }
.destext .itemtitle:hover { color: var(--orange); }
.destext input[type="checkbox"] { margin-right: 6px; vertical-align: middle; }
.destext label { margin-right: 10px; }

/* 简介区（老站抓取的 HTML）：约束字体与图片宽度，避免溢出/花哨 */
.arcbody .destext img { max-width: 100%; height: auto; }
.arcbody .destext table, .arcbody .destext iframe { max-width: 100%; }
.arcbody .destext font { color: inherit !important; font-size: inherit !important; }
.arcbody .destext p,
.arcbody .destext div,
.arcbody .destext span,
.arcbody .destext li { line-height: 1.8; }

#btncopy, #btndown {
    background: var(--green-light); color: #fff;
    height: 26px; padding: 0 12px; font-size: 13px; border-radius: 3px;
    margin-left: 6px;
}
#btncopy:hover, #btndown:hover { background: var(--green); }
#btncopy:disabled, #btndown:disabled { background: #9dc86a; cursor: default; }

/* ---------- 页脚 ---------- */
.site-foot { margin-top: 10px; }
.foot-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px; }
.foot-text { flex: 1 1 auto; margin-left: 50px; font-size: 14px; color: #777; }
.foot-text a { color: var(--link); margin-right: 5px; }
.to-top { flex: 0 0 auto; font-size: 14px; }
.foot-copy { flex: 1 1 100%; padding-top: 5px; font-size: 14px; color: var(--text-mute); }
.foot-copy a { color: var(--link); }

.flink-show { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px; }
.flink-show a { display: inline-block; height: 26px; line-height: 26px; color: var(--link); }

/* ---------- 内页（留言 / 捐助 / 版权声明 / 404） ---------- */
.page-single .destext { font-size: 15px; }
.page-single .destext p { margin: 0 0 14px; }
.page-single .destext h3 {
    font-size: 16px; color: var(--green-deep); margin: 24px 0 12px;
    padding-left: 10px; border-left: 3px solid var(--green); line-height: 1.3;
}
.page-single .destext strong { color: var(--text-strong); }
.page-single .destext a { color: var(--link); }
.page-single .destext a:hover { color: var(--green); }
.page-single .destext ul { margin: 0 0 14px; padding-left: 4px; }
.page-single .destext ul li { position: relative; padding-left: 16px; line-height: 1.9; }
.page-single .destext ul li::before {
    content: ""; position: absolute; left: 2px; top: 13px;
    width: 5px; height: 5px; border-radius: 50%; background: var(--green);
}
.page-single .destext table { width: 100%; margin: 12px 0 18px; }
.page-single .destext th { background: #F4F7EF; text-align: left; color: var(--green-deep); font-weight: 700; }
.page-single .destext td, .page-single .destext th { padding: 9px 12px; border-bottom: 1px solid #EDEDED; }
.page-single .destext tr:hover td { background: #FAFCF7; }

/* ============================================================
   响应式
   ============================================================ */

/* 中屏：容器流式，两栏收窄，首页竖排 */
@media (max-width: 1239px) {
    .wrapper { width: 100%; padding-left: 12px; padding-right: 12px; }
    :root { --aside: 220px; --gap: 16px; }
    .home-cols { flex-direction: column; gap: 8px; }
    .hotdown, .hothelp { flex: 0 0 auto; width: 100%; }
    .hotdown .list-main { padding-bottom: 12px; }
    .showimg { flex: 0 0 calc(25% - 9px); }
}

/* 平板：图区 3 列，详情栏收窄 */
@media (max-width: 1023px) {
    .showimg { flex: 0 0 calc(33.333% - 8px); height: auto; min-height: 172px; }
    .head-search { gap: 20px; }
    .head-qun { display: none; }
    #baseinfo .litimg { flex: 0 0 120px; }
    #baseinfo .litimg img { width: 120px; height: 150px; }
}

/* 手机：全部单栏，侧栏变横排标签，导航横滑 */
@media (max-width: 767px) {
    :root { --gap: 12px; }
    .wrapper { padding-left: 12px; padding-right: 12px; }

    .head-inner {
        flex-direction: column; align-items: stretch;
        min-height: 0; gap: 10px; padding-block: 10px;
    }
    .brand { padding-left: 0; }
    .brand img { width: 200px; height: 40px; }
    .head-search { width: 100%; }
    .search-form { width: 100%; }
    .search-form input[type="search"] { flex: 1; width: auto; min-width: 0; }
    .search-form button { width: 88px; }

    .site-nav { margin-bottom: 6px; }
    #nav { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
    #nav::-webkit-scrollbar { display: none; }
    #nav li { flex: 0 0 auto; }
    #nav a { padding: 0 14px; white-space: nowrap; }

    .crumb ol { padding-left: 10px; }
    .crumb li { max-width: 240px; }

    .cols { flex-direction: column; }
    .cols .l_left { position: static; flex: none; width: 100%; }
    .oliterm { display: flex; flex-wrap: wrap; gap: 0 4px; padding: 8px 6px; }
    .oliterm li { width: auto; padding-left: 14px; line-height: 30px; }
    .oliterm li::before { left: 3px; width: 5px; height: 5px; }
    .oliterm a { display: inline-block; padding-right: 4px; }

    .showimg { flex: 0 0 calc(50% - 5px); height: auto; min-height: 176px; }
    .showimg img { width: 100%; height: auto; aspect-ratio: 110 / 136; }
    .hotdown .list-main { padding: 4px 10px 8px; }
    .hothelp .list-main { padding: 6px 10px; }
    .itemt-more, .itemt-count { font-size: 13px; }
    .list-wrap { padding: 14px; }
    .addlist { gap: 10px; }
    .addlist .litimg { flex: 0 0 76px; }
    .litimg img { width: 76px; height: 95px; }
    .dtitle, .dtitle .tag, .dtitle .dtitle-link { font-size: 15px; }

    #baseinfo { flex-direction: column; }
    #baseinfo .litimg { flex: none; width: auto; }
    #baseinfo .litimg img { width: 140px; height: 175px; }
    .basetext { grid-template-columns: auto 1fr; font-size: 14px; }

    .destext .num { width: 70px; font-size: 12px; }
    .arcbody { padding: 10px 12px; }

    .foot-text { margin-left: 0; font-size: 13px; }
    .foot-copy { font-size: 13px; }

    .itemt-title { font-size: 15px; line-height: 1.5; padding-top: 6px; padding-bottom: 6px; }
}
