:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --bg: #f5f7fb;
    --card: #ffffff;
    --text: #1f2937;
    --muted: #6b7280;
    --border: #e5e7eb;
    --radius: 12px;
    --shadow: 0 2px 10px rgba(15, 23, 42, .06);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    line-height: 1.6;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); text-decoration: none; }
a:focus, a:active { text-decoration: none; }
.btn, .btn:hover, .dropdown-menu a, .sn-tool, .sn-cat, .tool-card { text-decoration: none !important; }
h1, h2, h3 { line-height: 1.3; }
.muted { color: var(--muted); }
.center { text-align: center; }
.mt-2 { margin-top: .75rem; } .mt-4 { margin-top: 1.5rem; } .mt-5 { margin-top: 2.5rem; } .mb-3 { margin-bottom: 1rem; }
.small { font-size: 12px; }
.text-success { color: #16a34a; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.container.narrow { max-width: 760px; }

/* ===== Header ===== */
.site-header {
    background: #fff;
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 100;
    box-shadow: var(--shadow);
}
.header-inner { display: flex; align-items: center; gap: 20px; height: 60px; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 18px; color: var(--text); white-space: nowrap; }
.brand-logo { font-size: 24px; }
.main-nav { display: flex; align-items: center; gap: 4px; flex: 1; }
.main-nav > a, .nav-dropdown > a {
    padding: 8px 12px; border-radius: 8px; color: var(--text); font-size: 14px;
}
.main-nav > a:hover, .nav-dropdown > a:hover { background: #eef2ff; color: var(--primary); }
.nav-dropdown { position: relative; }
.nav-dropdown:hover .dropdown-menu { display: block; }
.dropdown-menu {
    display: none; position: absolute; top: 100%; left: 0; background: #fff;
    border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.12);
    min-width: 170px; padding: 6px; z-index: 120;
}
.dropdown-menu.cols2 { min-width: 340px; columns: 2; column-gap: 6px; }
.dropdown-menu a { display: block; padding: 8px 10px; border-radius: 8px; color: var(--text); font-size: 14px; }
.dropdown-menu a:hover { background: #eef2ff; color: var(--primary); }
.dropdown-menu a span { margin-right: 4px; }
.header-right { display: flex; align-items: center; gap: 12px; }
.nav-search input {
    border: 1px solid var(--border); border-radius: 20px; padding: 7px 14px; width: 180px;
    outline: none; font-size: 13px; background: #f8fafc;
}
.nav-search input:focus { border-color: var(--primary); background: #fff; }
.lang-switch { display: flex; align-items: center; gap: 4px; font-size: 13px; }
.lang-switch a { color: var(--muted); padding: 2px 4px; }
.lang-switch a.active { color: var(--primary); font-weight: 700; }
.btn-login { background: var(--primary); color: #fff !important; padding: 7px 16px; border-radius: 20px; font-size: 13px; }
.btn-login:hover { background: var(--primary-dark); }
.nav-toggle { display: none; border: none; background: none; font-size: 22px; cursor: pointer; }

/* ===== Hero ===== */
.hero {
    background: linear-gradient(135deg, #eef2ff 0%, #e0f2fe 60%, #fdf4ff 100%);
    padding: 52px 0 40px;
}
.hero h1 { margin: 0 0 10px; font-size: 30px; }
.hero-sub { color: var(--muted); font-size: 15px; margin: 0 0 24px; }
.hero-stats { display: flex; justify-content: center; gap: 48px; }
.hero-stats .stat strong { font-size: 28px; color: var(--primary); display: block; }
.hero-stats .stat span { color: var(--muted); font-size: 13px; }

/* ===== Tool sections ===== */
.tool-sections { padding: 28px 16px 10px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; }
.section-head h2 { font-size: 20px; margin: 0; }
.cat-icon { margin-right: 6px; }
.more { font-size: 13px; }
.section-desc { margin: 4px 0 14px; font-size: 13px; }
.tool-section { margin-bottom: 36px; }
.tool-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px;
}
.tool-card {
    background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 14px 16px; color: var(--text); display: flex; flex-direction: column; gap: 4px;
    transition: all .18s ease; box-shadow: var(--shadow);
}
.tool-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(37, 99, 235, .12); border-color: #bfdbfe; color: var(--text); }
.tool-card-name { font-weight: 600; font-size: 15px; }
.tool-card-sub { font-size: 12.5px; }
.tool-card-meta { font-size: 12px; color: #9ca3af; margin-top: auto; }
.badge { font-size: 10px; padding: 1px 6px; border-radius: 6px; margin-left: 6px; vertical-align: middle; }
.badge.hot { background: #fee2e2; color: #dc2626; }
.badge.new { background: #dbeafe; color: #2563eb; }

/* ===== Contact band ===== */
.contact-band { background: #fff; border-top: 1px solid var(--border); margin-top: 30px; padding: 32px 0; }
.contact-grid { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 24px; }
.contact-grid h3, .contact-grid h4 { margin: 0 0 6px; }

/* ===== Page ===== */
.site-main { min-height: 60vh; padding-bottom: 40px; }
.crumbs { padding: 16px 0 4px; font-size: 13px; color: var(--muted); }
.page-head { padding: 8px 0 18px; }
.page-head h1 { margin: 0 0 6px; font-size: 24px; }
.center { text-align: center; }

/* ===== Rank ===== */
.rank-tabs { display: flex; gap: 8px; margin-top: 10px; }
.rank-tabs a { padding: 6px 16px; border-radius: 20px; border: 1px solid var(--border); background: #fff; color: var(--text); font-size: 13px; }
.rank-tabs a.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.rank-list { display: flex; flex-direction: column; gap: 8px; }
.rank-item {
    display: flex; align-items: center; gap: 14px; background: #fff; border: 1px solid var(--border);
    border-radius: 10px; padding: 12px 16px; color: var(--text);
}
.rank-item:hover { border-color: #bfdbfe; color: var(--text); }
.rank-no { width: 26px; height: 26px; border-radius: 8px; background: #f3f4f6; color: var(--muted); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; flex-shrink: 0; }
.rank-no.top { background: #fee2e2; color: #dc2626; }
.rank-name { flex: 1; font-weight: 500; }
.rank-name em { font-style: normal; font-size: 12.5px; margin-left: 6px; }
.rank-cat { font-size: 12px; flex-shrink: 0; }
.rank-count { color: var(--primary); font-size: 13px; flex-shrink: 0; width: 90px; text-align: right; }

/* ===== Tool page ===== */
.tool-page { display: grid; grid-template-columns: 1fr 300px; gap: 20px; align-items: start; }
.tool-title { font-size: 24px; margin: 0 0 4px; }
.tool-subtitle { margin: 0 0 16px; }
.tool-panel.card { padding: 20px; }
.tool-side { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 76px; }
.side-card { padding: 16px; }
.side-card h3 { margin: 0 0 10px; font-size: 15px; }
.side-info { list-style: none; margin: 0; padding: 0; font-size: 13.5px; }
.side-info li { display: flex; justify-content: space-between; padding: 5px 0; border-bottom: 1px dashed var(--border); }
.side-info li:last-child { border-bottom: none; }
.side-links { display: flex; flex-direction: column; gap: 8px; }
.side-links a { font-size: 13.5px; color: var(--text); }
.side-links a em { font-style: normal; color: var(--muted); font-size: 12px; margin-left: 4px; }
.tool-doc h2, .tool-doc h3 { font-size: 17px; margin: 18px 0 8px; }
.tool-doc p, .tool-doc li { font-size: 14px; color: #374151; }

/* ===== Forms & cards ===== */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.doc-card { padding: 24px; }
.tool-form label, .tool-form .form-grid label { display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; color: #374151; margin-bottom: 10px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px 16px; }
input[type=text], input[type=number], input[type=email], input[type=password], select, textarea {
    border: 1px solid var(--border); border-radius: 8px; padding: 9px 12px; font-size: 14px;
    background: #fff; outline: none; width: 100%; font-family: inherit;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
textarea { resize: vertical; }
.btn {
    display: inline-block; border: 1px solid var(--border); background: #fff; color: var(--text);
    border-radius: 8px; padding: 9px 20px; font-size: 14px; cursor: pointer; transition: all .15s; text-align: center;
}
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-dark); color: #fff; }
.btn.danger { color: #dc2626; }
.btn.sm { padding: 6px 12px; font-size: 12.5px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.tool-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.tool-preview { margin-top: 18px; text-align: center; overflow-x: auto; }
.tool-result { margin-top: 16px; }
.tool-grid-images { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.tool-grid-images .img-item { background: #f8fafc; border: 1px solid var(--border); border-radius: 10px; padding: 10px; text-align: center; font-size: 12px; }
.tool-grid-images img { max-width: 100%; height: 120px; object-fit: contain; border-radius: 6px; background: repeating-conic-gradient(#f1f5f9 0 25%, #fff 0 50%) 0 0/16px 16px; }
.file-label { position: relative; display: block; border: 2px dashed #c7d2fe; border-radius: 10px; padding: 22px; text-align: center; color: var(--primary); background: #f8faff; cursor: pointer; margin-bottom: 12px; }
.file-label input { display: none; }
.log-box { background: #0f172a; color: #a5f3fc; border-radius: 10px; padding: 14px; min-height: 160px; font-size: 12.5px; white-space: pre-wrap; word-break: break-all; }
.code-box { background: #0f172a; color: #e2e8f0; border-radius: 10px; padding: 14px; font-size: 12.5px; min-height: 200px; white-space: pre-wrap; word-break: break-all; }
.rmb-result { font-size: 20px; font-weight: 700; color: #dc2626; padding: 16px; background: #fef2f2; border-radius: 10px; text-align: center; }

/* result tables */
.kv-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.kv-table td, .kv-table th { border-bottom: 1px solid var(--border); padding: 10px 8px; text-align: left; }
.kv-table th { color: var(--muted); font-weight: 500; width: 140px; }
.trace-list { list-style: none; padding-left: 0; }
.trace-list li { position: relative; padding: 8px 0 8px 22px; border-left: 2px solid #dbeafe; margin-left: 8px; font-size: 13.5px; }
.trace-list li::before { content: ''; position: absolute; left: -5px; top: 14px; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); }
.trace-list li:first-child { border-left-color: var(--primary); }
.trace-time { color: var(--muted); font-size: 12px; margin-right: 8px; }

/* chat emulator */
.chat-editor { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.chat-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.chat-row select { width: auto; }
.chat-editor-bar { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
/* phone preview */
.phone {
    width: 375px; max-width: 100%; background: #ededed; border-radius: 28px; overflow: hidden;
    font-family: -apple-system, "PingFang SC", sans-serif; box-shadow: 0 8px 30px rgba(0,0,0,.18); margin: 0 auto;
}
.phone-status { background: #ededed; padding: 8px 18px 4px; display: flex; justify-content: space-between; font-size: 12px; color: #000; font-weight: 600; }
.phone-nav { background: #ededed; padding: 6px 14px; display: flex; align-items: center; justify-content: center; position: relative; }
.phone-nav .nav-title { font-size: 16px; font-weight: 600; color: #000; }
.phone-nav .nav-back { position: absolute; left: 14px; color: #000; font-size: 14px; }
.phone-body { background: #f7f7f7; min-height: 420px; padding: 10px 0 60px; overflow: hidden; }
.chat-msg { display: flex; gap: 8px; padding: 6px 14px; margin-bottom: 2px; align-items: flex-start; }
.chat-msg .avatar { width: 36px; height: 36px; border-radius: 5px; background: linear-gradient(135deg,#74ebd5,#ACB6E5); flex-shrink: 0; color:#fff; display:flex; align-items:center; justify-content:center; font-size:15px; }
.chat-msg.me { flex-direction: row-reverse; }
.chat-bubble { max-width: 64%; background: #fff; border-radius: 5px; padding: 8px 11px; font-size: 14.5px; color: #000; line-height: 1.45; word-break: break-word; }
.chat-msg.me .chat-bubble { background: #95ec69; }
.chat-time { text-align: center; color: #9a9a9a; font-size: 11.5px; margin: 10px 0 4px; }

/* pay ui */
.pay-page { background: #fff; padding: 30px 24px 40px; text-align: center; }
.pay-page.alipay { background: linear-gradient(180deg,#1677ff 0%,#1677ff 120px,#f5f6f8 120px); }
.pay-icon-lg { width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 12px; display: flex; align-items: center; justify-content: center; font-size: 32px; color: #fff; background: #09bb07; }
.pay-amount { font-size: 40px; font-weight: 700; margin: 6px 0 16px; }
.pay-kv { text-align: left; font-size: 13.5px; color: #666; margin-top: 18px; border-top: 1px solid #eee; padding-top: 14px; }
.pay-kv div { display: flex; justify-content: space-between; padding: 4px 0; }

/* certificate */
#certCanvas { max-width: 100%; border-radius: 8px; box-shadow: var(--shadow); }

/* copybook & math print */
.print-area { background: #fff; padding: 16px; border: 1px solid var(--border); border-radius: 10px; overflow-x: auto; }
.cb-grid-row { display: flex; }
.cb-cell { width: 64px; height: 64px; position: relative; border-right: 1px solid #d1d5db; border-bottom: 1px solid #d1d5db; display: flex; align-items: center; justify-content: center; font-size: 40px; font-family: "Kaiti SC", KaiTi, STKaiti, serif; }
.cb-cell span.trace { color: #d1d5db; }
.cb-cell::before, .cb-cell::after { content: ''; position: absolute; background: #f3f4f6; }
.cb-cell.tian::before { left: 50%; top: 0; bottom: 0; width: 1px; }
.cb-cell.tian::after { top: 50%; left: 0; right: 0; height: 1px; }
.cb-cell.mi::before { left: 50%; top: 0; bottom: 0; width: 1px; top:0; height:0; }
.cb-cell.mi { }
.cb-cell.mi { }
.cb-cell.mi { }
.cb-mi-d1, .cb-mi-d2 { position: absolute; left: 0; top: 0; right: 0; bottom: 0; }
.cb-mi-d1::before { content: ''; position: absolute; left: 0; top: 50%; right: 0; height: 1px; background: #f3f4f6; }
.cb-mi-d1::after { content: ''; position: absolute; top: 0; bottom: 0; left: 50%; width: 1px; background: #f3f4f6; }
.cb-mi-d2::before { content: ''; position: absolute; left: 0; top: 0; right: 0; bottom: 0; border-left: 1px solid #f3f4f6; transform: rotate(45deg); transform-origin: center; }
.cb-mi-d2::after { content: ''; position: absolute; left: 0; top: 0; right: 0; bottom: 0; border-right: 1px solid #f3f4f6; transform: rotate(-45deg); transform-origin: center; }
.math-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px 20px; font-size: 16px; font-family: "Times New Roman", serif; }
.math-grid .q { border-bottom: 1px dotted #9ca3af; min-height: 24px; }
.math-grid .ans { color: #dc2626; font-size: 13px; }

/* dns */
.dns-filter { margin-bottom: 12px; }
.dns-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.dns-item { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; cursor: pointer; transition: all .15s; }
.dns-item:hover { border-color: var(--primary); box-shadow: 0 4px 14px rgba(37,99,235,.12); }
.dns-item .dns-ip { font-size: 17px; font-weight: 700; font-family: Menlo, monospace; color: var(--primary); }
.dns-item .dns-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* json cols */
.json-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 720px) { .json-cols { grid-template-columns: 1fr; } }

/* generic & link */
.generic-notice { text-align: center; padding: 40px 16px; }
.generic-icon { font-size: 48px; margin-bottom: 8px; }
.link-card { padding: 40px 16px; }
.link-icon { font-size: 56px; margin: 0 0 8px; }

/* cut stage */
.cut-stage { position: relative; display: inline-block; max-width: 100%; user-select: none; }
.cut-stage img { max-width: 100%; display: block; }
.cut-box { position: absolute; border: 2px dashed #2563eb; background: rgba(37,99,235,.15); cursor: move; }

/* VIP */
.vip-status { padding: 16px 20px; display: flex; gap: 30px; flex-wrap: wrap; margin-bottom: 22px; }
.vip-plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.vip-plan { padding: 24px 20px; text-align: center; }
.vip-plan.featured { border-color: var(--primary); box-shadow: 0 10px 30px rgba(37,99,235,.15); }
.plan-price { font-size: 34px; font-weight: 800; color: var(--primary); margin: 10px 0; }
.plan-features { list-style: none; padding: 0; margin: 0 0 18px; font-size: 13.5px; text-align: left; }
.plan-features li { padding: 4px 0; }
.btn-vip { width: 100%; }
.pay-opt { border-radius: 10px !important; font-weight: 600; }
.pay-opt.alipay { background: #1677ff; border-color: #1677ff; color: #fff; }
.pay-opt.alipay:hover { background: #0958d9; }
.pay-opt.wxpay { background: #07c160; border-color: #07c160; color: #fff; }
.pay-opt.wxpay:hover { background: #06ad56; }
.pay-opt.qqpay { background: #12b7f5; border-color: #12b7f5; color: #fff; }
.pay-opt.qqpay:hover { background: #0ea3db; }

/* articles */
.article-list { display: flex; flex-direction: column; gap: 14px; }
.article-item { padding: 18px 22px; color: var(--text); display: block; }
.article-item:hover { color: var(--text); border-color: #bfdbfe; }
.article-item h2 { font-size: 17px; margin: 0 0 6px; }
.article-view { padding: 28px 32px; }
.article-view h1 { font-size: 24px; }
.article-content h3 { font-size: 17px; }

/* table */
.table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 10px; overflow: hidden; font-size: 13.5px; }
.table th, .table td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; }
.table th { background: #f8fafc; color: var(--muted); font-weight: 500; }

/* footer */
.site-footer { background: #111827; color: #9ca3af; padding: 40px 0 20px; margin-top: 50px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1.4fr 1fr 1fr; gap: 28px; }
.footer-col h4 { color: #fff; font-size: 14.5px; margin: 0 0 12px; }
.footer-col p { font-size: 13px; margin: 6px 0; }
.footer-links { display: flex; flex-direction: column; gap: 7px; }
.footer-links a { color: #9ca3af; font-size: 13px; }
.footer-links a:hover { color: #fff; }
.qr-col { display: flex; gap: 18px; justify-content: center; }
.qr-item { text-align: center; font-size: 12px; }
.qr-box { width: 90px; height: 90px; background: #fff; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 40px; margin-bottom: 6px; }
.qr-box.big { width: 150px; height: 150px; font-size: 64px; }
.footer-bottom { border-top: 1px solid #1f2937; margin-top: 28px; padding-top: 16px; text-align: center; font-size: 12.5px; }
.donate-qr { display: flex; gap: 24px; justify-content: center; margin: 14px 0 6px; }
.donate-qr-labels { display: flex; gap: 24px; justify-content: center; font-size: 13px; color: var(--muted); }
.donate-qr-labels span { width: 150px; text-align: center; }

/* modal fix (bootstrap5 present) */
.modal-content { border-radius: 14px; }

/* responsive */
@media (max-width: 960px) {
    .tool-page { grid-template-columns: 1fr; }
    .tool-side { position: static; }
    .contact-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 820px) {
    .main-nav { display: none; position: absolute; top: 60px; left: 0; right: 0; background: #fff; flex-direction: column; align-items: stretch; padding: 10px 16px 16px; border-bottom: 1px solid var(--border); box-shadow: var(--shadow); }
    .main-nav.open { display: flex; }
    .nav-dropdown:hover .dropdown-menu { display: none; }
    .nav-search input { width: 120px; }
    .nav-toggle { display: block; }
    .rank-cat { display: none; }
}

/* ===== iconfont ===== */
svg.icon { width: 1em; height: 1em; vertical-align: -0.15em; fill: currentColor; overflow: hidden; }

/* ===== 左侧可折叠导航 ===== */
.page-with-sidebar { max-width: 1200px; margin: 0 auto; padding: 0 16px; display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 22px; align-items: start; }
.page-content { min-width: 0; }
.side-nav { position: sticky; top: 76px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; max-height: calc(100vh - 96px); display: flex; flex-direction: column; }
.side-nav-head { padding: 12px 14px; font-weight: 700; border-bottom: 1px solid var(--border); background: linear-gradient(135deg, #eef2ff, #e0f2fe); flex-shrink: 0; }
.side-nav-close { display: none; float: right; border: none; background: none; cursor: pointer; font-size: 16px; }
.side-nav-list { overflow-y: auto; padding: 6px; }
.sn-group { border-radius: 8px; margin-bottom: 2px; }
.sn-cat { display: flex; align-items: center; gap: 6px; padding: 9px 10px; color: var(--text); border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer; }
.sn-cat:hover { background: #f1f5f9; }
.sn-group.active > .sn-cat { color: var(--primary); background: #eff6ff; }
.sn-toggle { width: 14px; font-size: 11px; color: #94a3b8; transition: transform .18s; transform-origin: center; flex-shrink: 0; }
.sn-group.open > .sn-cat .sn-toggle { transform: rotate(90deg); }
.sn-icon { font-size: 15px; }
.sn-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sn-count { font-size: 11px; color: #94a3b8; background: #f3f4f6; border-radius: 8px; padding: 0 7px; }
.sn-tools { display: none; padding: 2px 0 4px 30px; }
.sn-group.open .sn-tools { display: block; }
.sn-tool { display: flex; align-items: center; gap: 7px; padding: 6px 8px; color: #4b5563; font-size: 13px; border-radius: 7px; }
.sn-tool:hover { background: #f1f5f9; color: var(--primary); }
.sn-tool.current { background: #eff6ff; color: var(--primary); font-weight: 600; }
.sn-tool-icon { font-size: 15px; color: #6366f1; flex-shrink: 0; }
.side-nav-fab { display: none; }

/* 卡片图标 */
.tool-card-top { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.tool-card-icon { width: 42px; height: 42px; border-radius: 11px; background: linear-gradient(135deg, #eef2ff, #e0f2fe); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.tool-card-icon svg.icon { font-size: 26px; color: #4f6ef7; }
.rank-icon { font-size: 24px; color: #4f6ef7; flex-shrink: 0; }

/* ===== responsive sidebar ===== */
@media (max-width: 900px) {
    .page-with-sidebar { grid-template-columns: 1fr; }
    .side-nav {
        position: fixed; left: -280px; top: 0; bottom: 0; width: 260px; z-index: 200;
        max-height: 100vh; border-radius: 0; transition: left .22s ease;
    }
    .side-nav.open { left: 0; box-shadow: 20px 0 60px rgba(0,0,0,.25); }
    .side-nav-close { display: inline-block; }
    .side-nav-fab {
        display: block; position: fixed; bottom: 22px; left: 16px; z-index: 150;
        background: var(--primary); color: #fff; border: none; border-radius: 22px;
        padding: 10px 18px; font-size: 14px; box-shadow: 0 8px 24px rgba(37,99,235,.35); cursor: pointer;
    }
    .rank-cat { display: none; }
}

/* ===== 广告位 ===== */
.ad-slot { margin: 10px 0; }
.ad-slot .ad-item { display: block; }
.ad-slot .ad-item img { max-width: 100%; border-radius: 10px; }
.ad-demo { background: linear-gradient(135deg, #fef3c7, #fde68a); color: #92400e; text-align: center; padding: 14px 16px; border-radius: 12px; font-size: 14px; font-weight: 600; }
.side-nav .ad-slot { padding: 0 8px; }
.tool-panel .ad-tool_top, .ad-tool_top { margin-bottom: 14px; }
.ad-tool_bottom { margin-top: 18px; }

/* 积分消耗角标 */
.point-badge {
    display: inline-flex; align-items: center; gap: 4px; margin-bottom: 12px;
    background: #fffbeb; color: #b45309; border: 1px solid #fde68a;
    padding: 5px 12px; border-radius: 20px; font-size: 12.5px;
}
.point-badge b { color: #dc2626; }

/* ===== Admin 后台 ===== */
.admin-body { background: #f1f5f9; }
.admin-wrap { display: flex; min-height: 100vh; }
.admin-side { width: 220px; background: #0f172a; color: #cbd5e1; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.admin-brand { padding: 18px 16px; color: #fff; font-weight: 800; font-size: 17px; border-bottom: 1px solid #1e293b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-menu { flex: 1; padding: 10px 8px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.admin-menu a { color: #cbd5e1; padding: 11px 14px; border-radius: 9px; font-size: 14px; }
.admin-menu a:hover { background: #1e293b; color: #fff; }
.admin-menu a.active { background: var(--primary); color: #fff; font-weight: 600; }
.admin-side-foot { padding: 12px 8px; border-top: 1px solid #1e293b; display: flex; flex-direction: column; gap: 4px; }
.admin-side-foot a { color: #94a3b8; padding: 7px 14px; border-radius: 8px; font-size: 13px; }
.admin-side-foot a:hover { background: #1e293b; color: #fff; }
.admin-main { flex: 1; min-width: 0; }
.admin-topbar { display: flex; justify-content: space-between; align-items: center; background: #fff; padding: 14px 24px; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 50; }
.admin-topbar h1 { margin: 0; font-size: 19px; }
.admin-content { padding: 22px 24px; }
.admin-content .table { background: #fff; }
.admin-panel { padding: 20px; margin-bottom: 20px; }
.admin-panel h3 { margin: 0 0 14px; }
.admin-panel.narrow { max-width: 560px; }
.admin-panel.narrow-wide { max-width: 900px; }
.admin-stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.stat-card { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 14px 18px; display: flex; flex-direction: column; gap: 2px; }
.stat-card span { color: var(--muted); font-size: 12.5px; }
.stat-card b { font-size: 24px; }
.stat-card em { font-style: normal; color: #94a3b8; font-size: 12px; }
.admin-two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 18px; align-items: start; }
.admin-filter { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.admin-filter input[type=text] { width: 240px; }
.admin-filter select { width: auto; }
.mono { font-family: Menlo, Consolas, monospace; font-size: 12.5px; word-break: break-all; }

/* 后台表格：表头与内容严格对齐、横向滚动 */
.table-wrap { overflow-x: auto; background: #fff; border-radius: 12px; border: 1px solid var(--border); box-shadow: var(--shadow); margin-bottom: 16px; }
table.admin-table { width: 100%; border-collapse: collapse; background: #fff; font-size: 13.5px; min-width: 720px; }
table.admin-table th {
    text-align: left; padding: 11px 14px; background: #f1f5f9; color: #475569;
    font-weight: 600; white-space: nowrap; border-bottom: 2px solid var(--border);
}
table.admin-table td {
    padding: 10px 14px; border-bottom: 1px solid #f1f5f9; vertical-align: middle;
}
table.admin-table tbody tr:hover td { background: #f8fafc; }
table.admin-table tbody tr:last-child td { border-bottom: none; }
table.admin-table .btn.sm { padding: 4px 10px; font-size: 12px; }

/* 后台分页 */
.admin-content ul.pagination, .admin-content nav ul.pagination { justify-content: center; margin: 18px 0 6px; gap: 6px; }
.pagination .page-link { border-radius: 8px !important; border: 1px solid var(--border) !important; color: var(--text) !important; padding: 6px 13px !important; font-size: 13.5px; }
.pagination .active .page-link { background: var(--primary) !important; border-color: var(--primary) !important; color: #fff !important; }
.pagination li:first-child .page-link, .pagination li:last-child .page-link { border-radius: 8px !important; }
.check-label { display: flex !important; flex-direction: row !important; align-items: center; gap: 6px; }
.check-row { display: flex; gap: 24px; margin-top: 14px; }
.reply-form { display: flex; gap: 6px; }
.reply-form input { width: 200px; }
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #1e293b, #0f172a); }
.login-card { width: 360px; padding: 34px 32px; }
.login-card label { display: block; font-size: 13.5px; color: #374151; margin-bottom: 14px; }
.login-card input { width: 100%; margin-top: 6px; }
.epay-head { display: flex; align-items: center; justify-content: space-between; }

@media (max-width: 860px) {
    .admin-wrap { flex-direction: column; }
    .admin-side { width: 100%; height: auto; position: static; flex-direction: row; flex-wrap: wrap; align-items: center; }
    .admin-brand { border-bottom: none; flex-shrink: 0; }
    .admin-menu { flex-direction: row; flex-wrap: wrap; }
    .admin-side-foot { border-top: none; flex-direction: row; margin-left: auto; }
}

@media print {
    .site-header, .site-footer, .crumbs, .tool-actions, .tool-side { display: none !important; }
    body { background: #fff; }
    .tool-page { grid-template-columns: 1fr; }
}
