/* =====================================================================
   在线工具箱 · 前台样式（2026-11-09）
   ---------------------------------------------------------------------
   设计基调与网址导航一致：白卡片 + 淡蓝底 + 蓝色主色，圆角 12px。
   栅格：PC 4 列 / 平板 3 列 / 手机 2 列；推荐区大卡 PC 4 列、手机 2 列。
   ===================================================================== */

:root {
    --tl-blue: #2563eb;
    --tl-blue-d: #1d4ed8;
    --tl-blue-l: #eef4ff;
    --tl-ink: #1f2937;
    --tl-sub: #5b667a;
    --tl-mute: #8b95a5;
    --tl-line: #e6ebf3;
    --tl-soft: #f6f8fc;
    --tl-card: #ffffff;
    --tl-bg: #f4f7fc;
    --tl-radius: 12px;
    --tl-shadow: 0 2px 10px rgba(31, 61, 120, .05);
    --tl-shadow-h: 0 10px 26px rgba(31, 61, 120, .10);
}

* { box-sizing: border-box; }

.tl-body {
    margin: 0;
    background: var(--tl-bg);
    color: var(--tl-ink);
    font: 14px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    -webkit-font-smoothing: antialiased;
}

.tl-body a { color: inherit; text-decoration: none; }
.tl-body img { vertical-align: middle; }

.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px; }

.tl-skip {
    position: absolute; left: -9999px; top: 0; z-index: 99;
    background: #fff; padding: 10px 16px; border-radius: 0 0 8px 0;
}
.tl-skip:focus { left: 0; }

/* ---------------- 顶栏 ---------------- */
.tl-topbar { background: #fff; border-bottom: 1px solid var(--tl-line); font-size: 13px; color: var(--tl-sub); }
.tl-topbar-in { display: flex; align-items: center; justify-content: space-between; height: 40px; gap: 12px; }
.tl-top-left, .tl-top-right { display: flex; align-items: center; gap: 8px; min-width: 0; }
.tl-top-left span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-top-date { color: var(--tl-mute); }
.tl-top-dot { color: #cfd8e6; }
.tl-top-link:hover { color: var(--tl-blue); }
.tl-top-user { color: var(--tl-blue); font-weight: 600; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 公告 */
.tl-notice { background: #fff8e8; border-bottom: 1px solid #f6e3b8; color: #8a5a10; font-size: 13px; }
.tl-notice .wrap { padding-top: 7px; padding-bottom: 7px; }
.tl-notice a { color: #8a5a10; text-decoration: underline; }

/* ---------------- 头部 ---------------- */
.tl-header { background: #fff; border-bottom: 1px solid var(--tl-line); }
.tl-header-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 14px; padding-bottom: 14px; }
.tl-brand { display: flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 700; letter-spacing: .3px; }
.tl-brand img { width: 40px; height: 40px; }
.tl-brand:hover { color: var(--tl-blue); }
.tl-nav-links { display: flex; align-items: center; gap: 18px; font-size: 14px; color: var(--tl-sub); }
.tl-nav-links a:hover { color: var(--tl-blue); }

/* ---------------- Hero / 搜索 ---------------- */
.tl-hero { padding: 38px 0 26px; text-align: center; }
.tl-h1 { margin: 0; font-size: 30px; font-weight: 800; letter-spacing: .5px; }
.tl-sub { margin: 10px 0 22px; color: var(--tl-sub); font-size: 14px; }

.tl-search {
    position: relative;
    display: flex; align-items: center;
    max-width: 620px; margin: 0 auto;
    background: #fff; border: 1px solid var(--tl-line);
    border-radius: 999px; box-shadow: var(--tl-shadow);
    transition: border-color .2s, box-shadow .2s;
}
.tl-search:focus-within { border-color: #bed3ff; box-shadow: 0 8px 24px rgba(37, 99, 235, .10); }
.tl-search input {
    flex: 1; min-width: 0; height: 50px; padding: 0 8px 0 46px;
    border: 0; outline: 0; background: transparent; font-size: 15px; color: var(--tl-ink);
    border-radius: 999px;
}
.tl-search input::-webkit-search-cancel-button { display: none; }
.tl-search-ico {
    position: absolute; left: 18px; width: 16px; height: 16px;
    border: 2px solid #9aa8bd; border-radius: 50%;
}
.tl-search-ico::after {
    content: ""; position: absolute; right: -5px; bottom: -4px;
    width: 7px; height: 2px; background: #9aa8bd; transform: rotate(45deg); border-radius: 2px;
}
.tl-search-clear {
    display: none; width: 34px; height: 34px; margin-right: 8px;
    border: 0; border-radius: 50%; background: var(--tl-soft);
    color: var(--tl-mute); font-size: 18px; line-height: 1; cursor: pointer;
}
.tl-search-clear:hover { background: #e8eef8; color: var(--tl-ink); }
.tl-search.has-val .tl-search-clear { display: block; }

/* 最近使用 */
.tl-recent { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 16px; font-size: 13px; color: var(--tl-mute); }
.tl-recent[hidden] { display: none; }
.tl-recent-list { display: flex; flex-wrap: wrap; gap: 8px; }
.tl-recent-list a {
    padding: 4px 12px; background: #fff; border: 1px solid var(--tl-line);
    border-radius: 999px; color: var(--tl-sub);
}
.tl-recent-list a:hover { border-color: #bed3ff; color: var(--tl-blue); }

/* ---------------- 区块 ---------------- */
.tl-sec { padding: 8px 0 18px; }
.tl-sec-hd { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 14px 0 14px; }
.tl-sec-hd h2 { margin: 0; font-size: 17px; font-weight: 700; }
.tl-sec-hd h2::before {
    content: ""; display: inline-block; width: 4px; height: 15px; margin-right: 9px;
    background: var(--tl-blue); border-radius: 3px; vertical-align: -2px;
}
.tl-sec-note { color: var(--tl-mute); font-size: 12px; }

/* ---------------- 推荐大卡 ---------------- */
.tl-featured { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.tl-fcard {
    position: relative; display: flex; align-items: center; gap: 14px;
    padding: 18px 18px 18px 16px; background: var(--tl-card);
    border: 1px solid var(--tl-line); border-radius: var(--tl-radius);
    box-shadow: var(--tl-shadow); transition: transform .2s, box-shadow .2s, border-color .2s;
}
.tl-fcard:hover { transform: translateY(-2px); box-shadow: var(--tl-shadow-h); border-color: #cfe0ff; }
.tl-fcard.is-primary { border-color: #bcd6ff; background: linear-gradient(180deg, #f7fbff, #fff 60%); }
.tl-fcard-bd { min-width: 0; flex: 1; }
.tl-fcard-bd strong { display: flex; align-items: center; gap: 6px; font-size: 15px; }
.tl-fcard-bd p { margin: 4px 0 0; color: var(--tl-sub); font-size: 12px; line-height: 1.5; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.tl-fcard-go { color: #c3cfe2; font-size: 16px; transition: color .2s, transform .2s; }
.tl-fcard:hover .tl-fcard-go { color: var(--tl-blue); transform: translateX(3px); }

/* ---------------- 工具网格 ---------------- */
.tl-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.tl-card {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 15px 16px; background: var(--tl-card);
    border: 1px solid var(--tl-line); border-radius: var(--tl-radius);
    transition: transform .18s, box-shadow .18s, border-color .18s;
}
.tl-card:hover { transform: translateY(-2px); box-shadow: var(--tl-shadow-h); border-color: #cfe0ff; }
.tl-card-bd { min-width: 0; }
.tl-card-bd strong { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; }
.tl-card-bd p {
    margin: 3px 0 0; color: var(--tl-mute); font-size: 12px; line-height: 1.5;
    overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}

/* 图标 */
.tl-ico {
    flex: 0 0 auto; display: grid; place-items: center;
    width: 42px; height: 42px; border-radius: 11px;
    color: #fff; font-size: 15px; font-weight: 700; font-style: normal;
    letter-spacing: -.3px; box-shadow: 0 4px 10px rgba(37, 99, 235, .16);
}
.tl-fcard .tl-ico { width: 46px; height: 46px; font-size: 16px; }

/* 角标 */
.tl-badge {
    display: inline-block; padding: 0 6px; border-radius: 4px;
    background: var(--tl-blue-l); color: var(--tl-blue-d);
    font-size: 11px; font-style: normal; font-weight: 600; line-height: 17px;
}
.tl-badge.is-hot { background: #fff1e6; color: #c2410c; }

/* 空态 */
.tl-empty, .tl-noresult {
    padding: 46px 20px; text-align: center; color: var(--tl-mute);
    background: #fff; border: 1px dashed var(--tl-line); border-radius: var(--tl-radius);
}
.tl-noresult { margin: 10px 0 30px; }

/* ---------------- 页脚 ---------------- */
.tl-footer { margin-top: 26px; padding: 26px 0 34px; background: #fff; border-top: 1px solid var(--tl-line); text-align: center; color: var(--tl-mute); font-size: 13px; }
.tl-footer-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 18px; margin: 0 0 10px; }
.tl-footer-links a:hover { color: var(--tl-blue); }
.tl-footer-copy { margin: 0; }
.tl-footer-beian { margin: 6px 0 0; }
.tl-footer-beian a { color: var(--tl-mute); }
.tl-footer-note { margin: 10px 0 0; font-size: 12px; color: #a6b0c0; }

/* ---------------- 弹层 ---------------- */
.tl-modal { position: fixed; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center; padding: 20px; }
.tl-modal[hidden] { display: none; }
.tl-modal-mask { position: absolute; inset: 0; background: rgba(17, 28, 48, .45); backdrop-filter: blur(2px); }
.tl-modal-box {
    position: relative; width: 100%; max-width: 640px; max-height: 86vh;
    display: flex; flex-direction: column;
    background: #fff; border-radius: 14px; box-shadow: 0 24px 60px rgba(15, 30, 60, .25);
    animation: tl-pop .18s ease-out;
}
@keyframes tl-pop { from { opacity: 0; transform: translateY(8px) scale(.99); } to { opacity: 1; transform: none; } }
.tl-modal-hd { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--tl-line); }
.tl-modal-hd h3 { margin: 0; font-size: 16px; font-weight: 700; }
.tl-modal-x { width: 32px; height: 32px; border: 0; border-radius: 8px; background: var(--tl-soft); color: var(--tl-sub); font-size: 20px; line-height: 1; cursor: pointer; }
.tl-modal-x:hover { background: #e8eef8; color: var(--tl-ink); }
.tl-modal-bd { padding: 18px 20px 22px; overflow: auto; }

/* 弹层内部元素 */
.tl-field { margin-bottom: 14px; }
.tl-field label { display: block; margin-bottom: 6px; color: var(--tl-sub); font-size: 13px; }
.tl-input, .tl-textarea, .tl-select {
    width: 100%; padding: 10px 12px; font-size: 14px; color: var(--tl-ink);
    background: #fff; border: 1px solid var(--tl-line); border-radius: 9px; outline: 0;
    font-family: inherit;
}
.tl-textarea { min-height: 130px; resize: vertical; font-family: ui-monospace, Consolas, Monaco, "Courier New", monospace; font-size: 13px; line-height: 1.6; }
.tl-input:focus, .tl-textarea:focus, .tl-select:focus { border-color: #b9d1ff; box-shadow: 0 0 0 3px rgba(37, 99, 235, .08); }
.tl-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.tl-row > .tl-input { flex: 1 1 220px; width: auto; }
.tl-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 10px 20px; border: 1px solid transparent; border-radius: 9px;
    background: var(--tl-blue); color: #fff; font-size: 14px; font-weight: 600;
    cursor: pointer; transition: background .18s;
}
.tl-btn:hover { background: var(--tl-blue-d); }
.tl-btn.is-ghost { background: #fff; border-color: var(--tl-line); color: var(--tl-sub); font-weight: 500; }
.tl-btn.is-ghost:hover { background: var(--tl-soft); color: var(--tl-ink); }
.tl-btn[disabled] { opacity: .6; cursor: not-allowed; }
.tl-tip { margin: 10px 0 0; color: var(--tl-mute); font-size: 12px; line-height: 1.7; }
.tl-err { margin: 10px 0 0; padding: 9px 12px; border-radius: 8px; background: #fff1f0; color: #b42318; font-size: 13px; }
.tl-err[hidden] { display: none; }

/* DNS 结果 */
.tl-dns-out { margin-top: 16px; }
.tl-dns-group { margin-bottom: 14px; }
.tl-dns-group h4 { margin: 0 0 7px; font-size: 13px; color: var(--tl-sub); font-weight: 600; }
.tl-dns-group h4 span { margin-left: 6px; color: var(--tl-mute); font-weight: 400; }
.tl-dns-list { border: 1px solid var(--tl-line); border-radius: 9px; overflow: hidden; }
.tl-dns-item { display: flex; gap: 10px; padding: 9px 12px; font-size: 13px; }
.tl-dns-item + .tl-dns-item { border-top: 1px solid var(--tl-line); }
.tl-dns-item code { flex: 1; min-width: 0; word-break: break-all; font-family: ui-monospace, Consolas, Monaco, monospace; color: var(--tl-ink); }
.tl-dns-item em { flex: 0 0 auto; color: var(--tl-mute); font-style: normal; font-size: 12px; }

/* 工具面板通用 */
.tl-panel-hint { margin: 0 0 14px; color: var(--tl-sub); font-size: 13px; line-height: 1.7; }
.tl-out {
    margin-top: 12px; padding: 12px; background: var(--tl-soft); border-radius: 9px;
    font-family: ui-monospace, Consolas, Monaco, monospace; font-size: 13px;
    word-break: break-all; min-height: 44px; white-space: pre-wrap;
}
.tl-out:empty { display: none; }
.tl-checks { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 13px; color: var(--tl-sub); }
.tl-checks label { display: flex; align-items: center; gap: 6px; margin: 0; cursor: pointer; }
.tl-range { display: flex; align-items: center; gap: 12px; }
.tl-range input[type="range"] { flex: 1; accent-color: var(--tl-blue); }
.tl-range b { min-width: 26px; text-align: right; font-size: 15px; color: var(--tl-blue); }

/* ---------------- 响应式 ---------------- */
@media (max-width: 1024px) {
    .tl-featured { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .tl-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
    .wrap { padding: 0 14px; }
    .tl-topbar-in { font-size: 12px; }
    .tl-top-left .tl-top-dot, .tl-top-left span:last-child { display: none; }
    .tl-header-in { padding-top: 11px; padding-bottom: 11px; }
    .tl-brand { font-size: 17px; }
    .tl-brand img { width: 34px; height: 34px; }
    .tl-nav-links { display: none; }
    .tl-hero { padding: 26px 0 18px; }
    .tl-h1 { font-size: 23px; }
    .tl-sub { margin: 8px 0 16px; font-size: 13px; }
    .tl-search input { height: 46px; font-size: 14px; }
    .tl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .tl-card { padding: 12px; gap: 10px; }
    .tl-card .tl-ico { width: 36px; height: 36px; border-radius: 9px; font-size: 13px; }
    .tl-card-bd strong { font-size: 13px; }
    /* 卡片标题本来就窄，移动端不再挤「自研」角标，避免标题折成两行 */
    .tl-card .tl-badge { display: none; }
    .tl-card-bd p { font-size: 11.5px; -webkit-line-clamp: 2; }
    .tl-fcard { padding: 13px 12px; gap: 9px; }
    .tl-fcard .tl-ico { width: 34px; height: 34px; border-radius: 9px; font-size: 13px; }
    .tl-fcard-bd strong { font-size: 13.5px; gap: 4px; }
    .tl-fcard-bd p { font-size: 11px; -webkit-line-clamp: 2; }
    .tl-fcard-go { display: none; }
    .tl-badge { font-size: 10px; padding: 0 4px; line-height: 15px; }
    .tl-footer { padding: 20px 0 26px; font-size: 12px; }
    .tl-footer-links { gap: 12px; }
    .tl-modal { padding: 12px; align-items: flex-end; }
    .tl-modal-box { max-height: 90vh; border-radius: 14px 14px 0 0; }
}
@media (max-width: 380px) {
    .tl-grid { grid-template-columns: minmax(0, 1fr); }
    .tl-featured { grid-template-columns: minmax(0, 1fr); }
}

/* 减少动效偏好 */
@media (prefers-reduced-motion: reduce) {
    * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
