/* 我知铜价网 · Apple 风格浅色主题 */
:root {
    --bg: #f5f5f7;
    --card: #ffffff;
    --ink: #1d1d1f;
    --ink-2: #6e6e73;
    --ink-3: #86868b;
    --line: rgba(0, 0, 0, .08);
    --accent: #0071e3;
    --up: #d70015;
    --down: #00897b;
    --copper: #b0653a;
    --radius: 18px;
    --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 8px 24px rgba(0, 0, 0, .06);
    --font: -apple-system, BlinkMacSystemFont, "SF Pro SC", "SF Pro Text", "PingFang SC", "Helvetica Neue", "Microsoft YaHei", Arial, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--ink);
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; transition: color .2s ease, opacity .2s ease; }
a:hover { color: var(--accent); }
img { max-width: 100%; display: block; }
ul, ol { list-style: none; }
table { border-collapse: collapse; width: 100%; }
.container { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

/* ---------- 导航 ---------- */
.nav {
    position: sticky; top: 0; z-index: 100;
    background: rgba(245, 245, 247, .8);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; height: 56px; gap: 28px; }
.brand { display: flex; align-items: center; gap: 8px; font-size: 21px; font-weight: 700; letter-spacing: .5px; white-space: nowrap; }
.brand .dot { width: 12px; height: 12px; border-radius: 50%; background: linear-gradient(135deg, #d98c53, var(--copper)); box-shadow: 0 0 0 3px rgba(176, 101, 58, .15); }
.nav-links { display: flex; gap: 4px; flex: 1; }
.nav-links a { padding: 6px 14px; border-radius: 999px; font-size: 14.5px; color: var(--ink-2); }
.nav-links a:hover { color: var(--ink); background: rgba(0, 0, 0, .05); }
.nav-links a.active { color: var(--ink); font-weight: 600; background: rgba(0, 0, 0, .06); }
.nav-search { display: flex; align-items: center; }
.nav-search input {
    width: 200px; height: 34px; border: none; outline: none;
    background: rgba(0, 0, 0, .05); border-radius: 999px;
    padding: 0 16px; font-size: 13.5px; font-family: var(--font); color: var(--ink);
    transition: background .2s ease, width .25s ease;
}
.nav-search input:focus { background: #fff; box-shadow: 0 0 0 3px rgba(0, 113, 227, .25); width: 240px; }
.nav-burger { display: none; margin-left: auto; width: 40px; height: 40px; border: none; background: transparent; cursor: pointer; }
.nav-burger span { display: block; width: 20px; height: 2px; background: var(--ink); margin: 4px auto; border-radius: 2px; transition: transform .25s ease; }
.nav-mobile { display: none; }

/* ---------- Hero ---------- */
.hero { padding: 56px 0 8px; text-align: center; }
.hero h1 { font-size: 44px; font-weight: 700; letter-spacing: -.5px; }
.hero h1 em { font-style: normal; background: linear-gradient(100deg, #7a4a2b, var(--copper), #d98c53); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { margin-top: 10px; color: var(--ink-2); font-size: 17px; }
.hero .update-time { margin-top: 16px; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-3); background: var(--card); border: 1px solid var(--line); padding: 6px 14px; border-radius: 999px; }
.hero .live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--down); animation: pulse 1.6s ease infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }

/* ---------- 卡片 ---------- */
.card {
    background: var(--card); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 24px; margin-bottom: 20px;
}
.card-title { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 16px; }
.card-title h2, .card-title h3 { font-size: 20px; font-weight: 700; letter-spacing: -.2px; }
.card-title .more { font-size: 13.5px; color: var(--ink-3); }
.card-title .more:hover { color: var(--accent); }

/* ---------- 行情速览卡 ---------- */
.quote-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 28px auto 8px; }
.quote-card {
    background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
    padding: 20px; transition: transform .25s ease, box-shadow .25s ease;
}
.quote-card:hover { transform: translateY(-3px); box-shadow: 0 4px 12px rgba(0, 0, 0, .08), 0 16px 40px rgba(0, 0, 0, .1); }
.quote-card .q-name { font-size: 14px; color: var(--ink-2); }
.quote-card .q-price { font-size: 30px; font-weight: 700; letter-spacing: -1px; margin-top: 4px; font-variant-numeric: tabular-nums; }
.quote-card .q-unit { font-size: 12px; color: var(--ink-3); margin-left: 4px; font-weight: 400; }
.quote-card .q-chg { margin-top: 6px; font-size: 13.5px; font-weight: 600; }

/* ---------- 行情表 ---------- */
.qtable th { text-align: left; font-size: 12.5px; font-weight: 600; color: var(--ink-3); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.qtable td { padding: 14px 12px; border-bottom: 1px solid var(--line); font-size: 14.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.qtable tr:last-child td { border-bottom: none; }
.qtable tr:hover td { background: rgba(0, 0, 0, .018); }
.qtable .t-name { font-weight: 600; }
.qtable .t-name small { display: block; font-weight: 400; color: var(--ink-3); font-size: 12px; }
.num { font-variant-numeric: tabular-nums; }
.up { color: var(--up); }
.down { color: var(--down); }
.flat { color: var(--ink-2); }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 600; }
.badge.up { background: rgba(215, 0, 21, .08); }
.badge.down { background: rgba(0, 137, 123, .1); }

/* ---------- 废铜回收表 ---------- */
.ftable td { padding: 12px; border-bottom: 1px solid var(--line); font-size: 14.5px; }
.ftable tr:last-child td { border-bottom: none; }
.ftable .ft-name { font-weight: 500; }
.ftable .ft-price { text-align: right; font-weight: 700; color: var(--copper); font-variant-numeric: tabular-nums; }
.ftable .ft-date { text-align: right; color: var(--ink-3); font-size: 12.5px; width: 90px; }
.ftable th { font-size: 12.5px; color: var(--ink-3); text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.ftable th.ft-price-h, .ftable th.ft-date-h { text-align: right; }

/* ---------- 布局：左+侧栏 ---------- */
.layout { display: grid; grid-template-columns: 1fr 320px; gap: 20px; align-items: start; }
.layout > * { min-width: 0; }
.side .card { padding: 20px; }
.side .card-title h3 { font-size: 17px; }

/* ---------- 文章列表 ---------- */
.post-item { display: flex; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.post-item:last-child { border-bottom: none; padding-bottom: 0; }
.post-item .p-main { flex: 1; min-width: 0; }
.post-item .p-title { font-size: 17px; font-weight: 600; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-item:hover .p-title { color: var(--accent); }
.post-item .p-intro { margin-top: 5px; font-size: 13.5px; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-item .p-meta { margin-top: 8px; font-size: 12.5px; color: var(--ink-3); display: flex; gap: 14px; }
.post-item .p-thumb { width: 128px; height: 84px; border-radius: 12px; overflow: hidden; flex-shrink: 0; background: var(--bg); }
.post-item .p-thumb img { width: 100%; height: 100%; object-fit: cover; }
.link-list li { padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14.5px; display: flex; align-items: baseline; gap: 8px; }
.link-list li:last-child { border-bottom: none; }
.link-list .rank { width: 20px; height: 20px; line-height: 20px; text-align: center; border-radius: 6px; font-size: 12px; font-weight: 700; background: var(--bg); color: var(--ink-3); flex-shrink: 0; }
.link-list li:nth-child(1) .rank { background: var(--copper); color: #fff; }
.link-list li:nth-child(2) .rank { background: #cd8a60; color: #fff; }
.link-list li:nth-child(3) .rank { background: #e0b495; color: #fff; }
.link-list .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tagcloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tagcloud a { font-size: 12.5px; color: var(--ink-2); background: var(--bg); padding: 5px 12px; border-radius: 999px; }
.tagcloud a:hover { color: var(--accent); background: rgba(0, 113, 227, .08); }

/* ---------- 面包屑 ---------- */
.crumb { font-size: 13px; color: var(--ink-3); margin-bottom: 14px; }
.crumb a:hover { color: var(--accent); }

/* ---------- 文章详情 ---------- */
.article h1 { font-size: 32px; font-weight: 700; letter-spacing: -.4px; line-height: 1.3; }
.article .a-meta { margin: 12px 0 24px; font-size: 13px; color: var(--ink-3); display: flex; gap: 16px; }
.article .a-content { font-size: 16.5px; line-height: 1.9; color: #333; }
.article .a-content p { margin-bottom: 1em; }
.article .a-content img { border-radius: 12px; margin: 8px 0; }
.a-content .exchange-rate-table { width: 100%; table-layout: fixed; border-collapse: collapse; margin: 18px 0 6px; }
.a-content .exchange-rate-table caption { caption-side: top; text-align: left; font-size: 14px; font-weight: 600; color: var(--ink-2); padding-bottom: 10px; }
.a-content .exchange-rate-table th, .a-content .exchange-rate-table td { padding: 11px 12px; border-bottom: 1px solid var(--line); font-size: 14.5px; text-align: left; overflow-wrap: anywhere; }
.a-content .exchange-rate-table th { font-size: 12.5px; font-weight: 500; color: var(--ink-3); }
.a-content .exchange-rate-table td:nth-child(2), .a-content .exchange-rate-table td:last-child { text-align: right; }
.a-content .exchange-rate-table td:nth-child(2) { font-weight: 700; color: var(--copper); font-variant-numeric: tabular-nums; }
.article .a-note { margin-top: 24px; padding: 14px 18px; background: rgba(176, 101, 58, .06); border: 1px solid rgba(176, 101, 58, .15); border-radius: 12px; font-size: 13px; color: var(--ink-2); }
.article .a-prevnext { display: flex; justify-content: space-between; gap: 12px; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 14px; }
.article .a-prevnext span { flex: 1; min-width: 0; }
.article .a-prevnext a { display: block; color: var(--ink-2); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.article .a-prevnext a:hover { color: var(--accent); }

/* ---------- 行情详情页 ---------- */
.price-hero { display: flex; align-items: flex-end; gap: 40px; flex-wrap: wrap; }
.price-hero .ph-label { font-size: 13px; color: var(--ink-3); margin-bottom: 8px; }
.price-hero .ph-line { display: flex; align-items: baseline; gap: 8px; }
.price-hero .ph-price { font-size: 52px; font-weight: 700; letter-spacing: -2px; line-height: 1; font-variant-numeric: tabular-nums; }
.price-hero .ph-unit { font-size: 14px; color: var(--ink-3); }
.price-hero .ph-time { margin-top: 10px; font-size: 12.5px; color: var(--ink-3); }
#chart-container { height: 360px; margin-top: 10px; }
/* 插件历史价格表（symbol_table_content 输出） */
.list-container .list-group { border: none; }
.list-container .list-item, .list-container .list-header { display: flex; align-items: center; padding: 11px 6px; border-bottom: 1px solid var(--line); font-size: 14px; font-variant-numeric: tabular-nums; }
.list-container .list-header { font-size: 12.5px; color: var(--ink-3); font-weight: 600; }
.list-container .list-item:last-child { border-bottom: none; }
.list-container .list-item > div, .list-container .list-header > div { flex: 1; }
.list-container .name { flex: 1.4 !important; }
.text-danger, .list-item .zd.text-danger, .list-item .kpj.text-danger { color: var(--up); }
.text-success, .list-item .zd.text-success, .list-item .kpj.text-success { color: var(--down); }

/* ---------- 分页 ---------- */
.pages { display: flex; justify-content: center; gap: 6px; margin: 24px 0; font-size: 14px; }
.pages a, .pages span, .pages b { display: inline-block; min-width: 34px; text-align: center; padding: 6px 10px; border-radius: 10px; background: var(--card); box-shadow: var(--shadow); color: var(--ink-2); }
.pages .current, .pages b { background: var(--accent); color: #fff; }
.pages a:hover { color: var(--accent); }

/* ---------- 分类宫格 ---------- */
.cate-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

/* ---------- 页脚 ---------- */
.footer { margin-top: 48px; border-top: 1px solid var(--line); background: var(--bg); padding: 36px 0 28px; font-size: 13px; color: var(--ink-3); }
.footer .f-nav { display: flex; flex-wrap: wrap; gap: 18px; justify-content: center; margin-bottom: 14px; }
.footer .f-nav a { color: var(--ink-2); }
.footer .f-links { text-align: center; margin-bottom: 10px; }
.footer .f-links a { margin: 0 8px; color: var(--ink-3); }
.footer .f-disc { text-align: center; max-width: 720px; margin: 0 auto 10px; line-height: 1.8; }
.footer .f-copy { text-align: center; }
.footer a:hover { color: var(--accent); }
.footer .kw-box { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.footer .kw-box .kw-label { font-size: 12.5px; color: var(--ink-3); }
.footer .kw-box a { font-size: 12.5px; color: var(--ink-2); background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; transition: color .2s ease, border-color .2s ease; }
.footer .kw-box a:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- 返回顶部 ---------- */
#go-top { position: fixed; right: 22px; bottom: 32px; width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); box-shadow: var(--shadow); color: var(--ink-2); font-size: 18px; cursor: pointer; opacity: 0; pointer-events: none; transition: opacity .25s ease; z-index: 99; }
#go-top.show { opacity: 1; pointer-events: auto; }

/* ---------- 搜索页 ---------- */
.search-tip { font-size: 14px; color: var(--ink-2); margin-bottom: 4px; }
.search-tip b { color: var(--accent); }

/* ---------- 404 ---------- */
.err404 { text-align: center; padding: 90px 0; }
.err404 .code { font-size: 84px; font-weight: 700; letter-spacing: -3px; background: linear-gradient(120deg, var(--ink), var(--copper)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.err404 p { color: var(--ink-2); margin: 10px 0 26px; }
.btn-primary { display: inline-block; background: var(--accent); color: #fff !important; padding: 11px 28px; border-radius: 999px; font-size: 15px; font-weight: 600; }
.btn-primary:hover { background: #0077ed; }

/* ---------- 广告位：后台「广告管理」唯一标识 top / mid / bottom，代码非空才输出 ---------- */
.ad { position: relative; margin: 24px auto; text-align: center; }
.ad img { display: block; margin: 0 auto; max-width: 100%; height: auto; border-radius: 14px; }
.ad .ad-tag { position: absolute; top: 8px; right: 10px; font-size: 10px; line-height: 1.6; color: var(--ink-3); background: rgba(245, 245, 247, .85); border: 1px solid var(--line); border-radius: 999px; padding: 0 7px; pointer-events: none; }
.ad-bottom { margin: 36px auto 0; }

/* ---------- 响应式 ---------- */
@media (max-width: 1024px) {
    .layout { grid-template-columns: 1fr; }
    .cate-grid { grid-template-columns: 1fr 1fr; }
    .quote-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
    .nav-links, .nav-search { display: none; }
    .nav-burger { display: block; }
    .nav-mobile.open { display: block; padding: 6px 20px 16px; }
    .nav-mobile a { display: block; padding: 11px 4px; font-size: 16px; border-bottom: 1px solid var(--line); color: var(--ink-2); }
    .hero { padding-top: 36px; }
    .hero h1 { font-size: 30px; }
    .quote-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .quote-card { padding: 15px; }
    .quote-card .q-price { font-size: 22px; }
    .cate-grid { grid-template-columns: 1fr; }
    .qtable { font-size: 12px; min-width: 560px; }
    .card { padding: 18px; }
    .table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .article h1 { font-size: 24px; }
    .price-hero .ph-price { font-size: 38px; }
    #chart-container { height: 260px; }
    .post-item .p-thumb { width: 100px; height: 70px; }
    .ad { margin: 14px auto; }
    .ad-bottom { margin-top: 24px; }
}
