/* ==========================================================================
   Brinesheen Tools — 站点主题
   依赖 Bootstrap 3（栅格 / 按钮 / 表单基础），其余布局全部自定义。
   ========================================================================== */

:root {
    --ink: #111827;
    --ink-2: #374151;
    --muted: #6b7280;
    --muted-2: #9ca3af;
    --line: #e5e7eb;
    --line-soft: #f1f3f5;
    --bg: #ffffff;
    --bg-soft: #fafafa;
    --accent: #111827;
    --accent-soft: #f3f4f6;
    --sidebar-w: 280px;
    --header-h: 64px;
    --radius: 14px;
    --radius-sm: 10px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
        "PingFang SC", "Microsoft YaHei", Roboto, Helvetica, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--ink);
    text-decoration: none;
}

a:hover,
a:focus {
    color: var(--ink);
    text-decoration: none;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--ink);
    letter-spacing: -0.01em;
}

img {
    max-width: 100%;
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-thumb {
    background: #d7dbe0;
    border-radius: 999px;
    border: 2px solid #fff;
}

::-webkit-scrollbar-thumb:hover {
    background: #c2c8d0;
}

/* --------------------------------------------------------------------------
   顶栏
   -------------------------------------------------------------------------- */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 60;
    display: flex;
    align-items: center;
    height: var(--header-h);
    background: #fff;
    border-bottom: 1px solid var(--line);
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    width: var(--sidebar-w);
    height: 100%;
    padding: 0 24px;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--ink);
    flex: 0 0 auto;
}

.brand:hover {
    color: var(--ink);
}

.brand-mark {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: var(--accent);
    color: #fff;
    font-size: 15px;
    flex: 0 0 auto;
}

.topbar-tagline {
    flex: 1 1 auto;
    text-align: center;
    font-size: 14px;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-right: 24px;
    flex: 0 0 auto;
}

.btn-outline {
    display: -webkit-inline-box;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 38px;
    padding: 0 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--ink);
    font-size: 14px;
    font-weight: 600;
    -webkit-transition: background .18s ease, border-color .18s ease;
    transition: background .18s ease, border-color .18s ease;
}

.btn-outline:hover {
    background: var(--bg-soft);
    border-color: #d3d8de;
    color: var(--ink);
}

.nav-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin-left: 10px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    color: var(--ink);
    font-size: 16px;
    cursor: pointer;
}

/* --------------------------------------------------------------------------
   侧边栏
   -------------------------------------------------------------------------- */
.main-sidebar {
    position: fixed;
    top: var(--header-h);
    left: 0;
    bottom: 0;
    z-index: 50;
    width: var(--sidebar-w);
    padding: 30px 20px 40px;
    background: #fff;
    border-right: 1px solid var(--line);
    overflow-y: auto;
}

.sidebar-section + .sidebar-section {
    margin-top: 34px;
}

.sidebar-heading {
    padding: 0 10px;
    margin: 0 0 12px;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--ink);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 10px;
    border-radius: 9px;
    color: var(--ink-2);
    font-size: 15px;
    font-weight: 500;
    -webkit-transition: background .16s ease, color .16s ease;
    transition: background .16s ease, color .16s ease;
}

.sidebar-link i {
    width: 20px;
    font-size: 15px;
    text-align: center;
    color: var(--muted-2);
}

.sidebar-link:hover {
    background: var(--accent-soft);
    color: var(--ink);
}

.sidebar-link.is-active {
    background: var(--accent-soft);
    color: var(--ink);
    font-weight: 600;
}

.sidebar-link.is-active i {
    color: var(--ink);
}

/* --------------------------------------------------------------------------
   内容容器
   -------------------------------------------------------------------------- */
.wrapper {
    min-height: 100vh;
}

.content-wrapper {
    margin-left: var(--sidebar-w);
    padding-top: var(--header-h);
    min-height: 100vh;
    background: var(--bg);
}

.content {
    max-width: 1240px;
    margin: 0 auto;
    padding: 34px 32px 72px;
}

.content-header {
    max-width: 1240px;
    margin: 0 auto;
    padding: 34px 32px 0;
}

.content-header h1 {
    margin: 0;
    font-size: 30px;
    font-weight: 800;
    letter-spacing: -0.025em;
}

.content-header p {
    margin: 8px 0 0;
    color: var(--muted);
}

/* --------------------------------------------------------------------------
   首页 Hero / 搜索 / 分类
   -------------------------------------------------------------------------- */
.hero {
    padding: 18px 0 10px;
    text-align: center;
}

.hero h1 {
    margin: 0 0 14px;
    font-size: 50px;
    line-height: 1.12;
    font-weight: 800;
    letter-spacing: -0.035em;
}

.hero-sub {
    max-width: 660px;
    margin: 0 auto 28px;
    font-size: 17px;
    line-height: 1.65;
    color: var(--muted);
}

.hero-search {
    position: relative;
    max-width: 620px;
    margin: 0 auto 24px;
}

.hero-search > i {
    position: absolute;
    left: 18px;
    top: 50%;
    -webkit-transform: translateY(-50%);
    -ms-transform: translateY(-50%);
    transform: translateY(-50%);
    color: var(--muted-2);
    font-size: 15px;
    pointer-events: none;
}

.hero-search input {
    width: 100%;
    height: 54px;
    padding: 0 18px 0 46px;
    font-family: inherit;
    font-size: 16px;
    color: var(--ink);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    outline: none;
    -webkit-transition: border-color .18s ease, box-shadow .18s ease;
    transition: border-color .18s ease, box-shadow .18s ease;
}

.hero-search input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(17, 24, 39, .06);
}

.hero-search input::placeholder {
    color: var(--muted-2);
}

.filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    max-width: 900px;
    margin: 0 auto 38px;
}

.chip {
    display: -webkit-inline-box;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 42px;
    padding: 0 18px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 500;
    color: var(--ink-2);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 999px;
    cursor: pointer;
    -webkit-transition: background .16s ease, border-color .16s ease, color .16s ease;
    transition: background .16s ease, border-color .16s ease, color .16s ease;
}

.chip i {
    font-size: 14px;
    color: var(--muted);
}

.chip:hover {
    background: var(--bg-soft);
    border-color: #d3d8de;
}

.chip.is-active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.chip.is-active i {
    color: #fff;
}

/* --------------------------------------------------------------------------
   工具卡片网格
   -------------------------------------------------------------------------- */
.tool-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.tool-card {
    display: block;
    padding: 22px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    -webkit-transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.tool-card:hover {
    border-color: #d1d5db;
    box-shadow: 0 10px 26px rgba(17, 24, 39, .07);
    -webkit-transform: translateY(-2px);
    -ms-transform: translateY(-2px);
    transform: translateY(-2px);
}

.tool-card.is-hidden {
    display: none;
}

.tool-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.tool-icon {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--accent-soft);
    color: var(--ink);
    font-size: 16px;
}

.tool-badge {
    padding: 3px 10px;
    font-size: 12px;
    font-weight: 600;
    color: var(--ink-2);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 999px;
}

.tool-card h3 {
    margin: 0 0 6px;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--ink);
}

.tool-card p {
    margin: 0;
    font-size: 14px;
    line-height: 1.55;
    color: var(--muted);
}

.empty-state {
    padding: 60px 0;
    text-align: center;
    color: var(--muted);
}

.empty-state i {
    display: block;
    margin-bottom: 12px;
    font-size: 28px;
    color: var(--muted-2);
}

/* --------------------------------------------------------------------------
   工具页：卡片 / 表单 / 按钮
   -------------------------------------------------------------------------- */
.box {
    position: relative;
    margin-bottom: 24px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 1px 2px rgba(17, 24, 39, .04);
}

.box > .box-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 20px 26px;
    border-bottom: 1px solid var(--line-soft);
}

.box-header.with-border {
    border-bottom: 1px solid var(--line);
}

.box-header .box-title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.015em;
    color: var(--ink);
}

h1.box-title {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.025em;
    line-height: 1.3;
}


.box-header .box-title a {
    color: var(--ink);
}

.box-body {
    padding: 24px 26px;
}

.box-footer {
    padding: 18px 26px;
    background: #fafbfc;
    border-top: 1px solid var(--line-soft);
    border-radius: 0 0 var(--radius) var(--radius);
}

.box-body > p:last-child,
.box-body > :last-child {
    margin-bottom: 0;
}

.box-body p {
    color: var(--ink-2);
    line-height: 1.7;
}

.box-body h1,
.box-body h2,
.box-body h3 {
    margin-top: 0;
    font-weight: 700;
}

.box-body h1 {
    font-size: 26px;
}

.box-body h2 {
    font-size: 21px;
}

.box-body h3 {
    font-size: 18px;
}

.box-body hr {
    border-top: 1px solid var(--line);
    margin: 24px 0;
}

/* 表单 */
.form-group {
    margin-bottom: 18px;
}

.control-label {
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 600;
    color: var(--ink-2);
}

.form-control {
    height: 42px;
    padding: 8px 13px;
    font-family: inherit;
    font-size: 15px;
    color: var(--ink);
    background: #fff;
    border: 1px solid #d9dee5;
    border-radius: var(--radius-sm);
    box-shadow: none;
    -webkit-transition: border-color .18s ease, box-shadow .18s ease;
    transition: border-color .18s ease, box-shadow .18s ease;
}

textarea.form-control {
    height: auto;
    min-height: 140px;
    padding: 12px 14px;
    line-height: 1.65;
    resize: vertical;
}

.form-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(17, 24, 39, .06);
    outline: none;
}

.form-control::placeholder {
    color: var(--muted-2);
}

select.form-control {
    height: 42px;
}

.input-group-addon {
    background: #f9fafb;
    border-color: #d9dee5;
    color: var(--muted);
    border-radius: var(--radius-sm);
}

/* 按钮 */
.btn {
    padding: 9px 18px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    -webkit-transition: background .18s ease, border-color .18s ease, box-shadow .18s ease, transform .12s ease;
    transition: background .18s ease, border-color .18s ease, box-shadow .18s ease, transform .12s ease;
}

.btn:active,
.btn:focus {
    outline: none;
}

.btn:active {
    -webkit-transform: translateY(1px);
    -ms-transform: translateY(1px);
    transform: translateY(1px);
}

.btn-primary,
.btn-info,
.btn-success {
    color: #fff;
    background: var(--accent);
    border: 1px solid var(--accent);
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active,
.btn-info:hover,
.btn-info:focus,
.btn-info:active,
.btn-success:hover,
.btn-success:focus,
.btn-success:active {
    color: #fff;
    background: #000;
    border-color: #000;
    box-shadow: 0 6px 16px rgba(17, 24, 39, .16);
}

.btn-default {
    color: var(--ink-2);
    background: #fff;
    border: 1px solid var(--line);
}

.btn-default:hover,
.btn-default:focus,
.btn-default:active {
    color: var(--ink);
    background: var(--bg-soft);
    border-color: #d3d8de;
}

.btn-danger {
    color: #fff;
    background: #dc2626;
    border: 1px solid #dc2626;
}

.btn-danger:hover,
.btn-danger:focus {
    background: #b91c1c;
    border-color: #b91c1c;
    color: #fff;
}

.btn-warning {
    color: #fff;
    background: #d97706;
    border: 1px solid #d97706;
}

.btn-warning:hover,
.btn-warning:focus {
    background: #b45309;
    border-color: #b45309;
    color: #fff;
}

.btn-link {
    color: var(--ink);
    font-weight: 600;
}

.btn-group .btn {
    border-radius: 0;
}

.btn-group > .btn:first-child {
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.btn-group > .btn:last-child {
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* 表格 */
.table {
    margin-bottom: 0;
}

.table > thead > tr > th {
    padding: 12px 14px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--muted);
    border-bottom: 1px solid var(--line);
}

.table > tbody > tr > td,
.table > tbody > tr > th {
    padding: 12px 14px;
    border-top: 1px solid var(--line-soft);
    color: var(--ink-2);
    vertical-align: middle;
}

.table-striped > tbody > tr:nth-of-type(odd) {
    background: #fafbfc;
}

/* 标签 / 徽章 / 进度条 */
.label,
.badge {
    padding: 3px 10px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 999px;
}

.label-default,
.badge {
    background: var(--accent-soft);
    color: var(--ink-2);
}

.progress {
    height: 8px;
    border-radius: 999px;
    background: #eef1f4;
    box-shadow: none;
    overflow: hidden;
}

.progress-bar {
    background: var(--accent);
}

.progress-xs {
    height: 5px;
}

/* 提示块 */
.alert {
    padding: 14px 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    font-size: 14px;
}

.alert-info {
    background: #f8fafc;
    color: var(--ink-2);
}

.alert-success {
    background: #f0fdf4;
    border-color: #dcfce7;
    color: #166534;
}

.alert-warning {
    background: #fffbeb;
    border-color: #fef3c7;
    color: #92400e;
}

.alert-danger {
    background: #fef2f2;
    border-color: #fee2e2;
    color: #991b1b;
}

/* FAQ / 摘要块 */
.faq-item {
    padding: 18px 20px;
    margin-bottom: 12px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
}

.faq-question {
    margin: 0 0 8px;
    font-size: 16px;
    font-weight: 700;
    color: var(--ink);
}

.faq-answer {
    font-size: 14.5px;
    color: var(--muted);
}

.faq-answer > :last-child {
    margin-bottom: 0;
}

.summary-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 0;
    border-bottom: 1px dashed var(--line);
}

.summary-item:last-child {
    border-bottom: 0;
}

.summary-item-label {
    color: var(--muted);
}

.summary-item-value {
    font-weight: 700;
    color: var(--ink);
}

.keyword-highlight {
    padding: 1px 4px;
    background: #fef3c7;
    border-radius: 4px;
}

.input-container,
.tx-input-field {
    border-radius: var(--radius-sm);
}

/* --------------------------------------------------------------------------
   独立内容页（关于 / 隐私 / 条款）
   -------------------------------------------------------------------------- */
.page-head {
    max-width: 820px;
    margin: 0 auto 8px;
}

.page-head h1 {
    margin: 0 0 8px;
    font-size: 38px;
    line-height: 1.15;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.page-head .page-meta {
    margin: 0;
    font-size: 14px;
    color: var(--muted);
}

.prose {
    max-width: 820px;
    margin: 0 auto;
    padding: 32px 40px 40px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 1px 2px rgba(17, 24, 39, .04);
}

.prose h2 {
    margin: 36px 0 12px;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.prose h3 {
    margin: 24px 0 8px;
    font-size: 16px;
    font-weight: 700;
}

.prose > h2:first-child {
    margin-top: 0;
}

.prose p,
.prose li {
    font-size: 15.5px;
    line-height: 1.75;
    color: var(--ink-2);
}

.prose p {
    margin: 0 0 14px;
}

.prose ul,
.prose ol {
    margin: 0 0 16px;
    padding-left: 22px;
}

.prose li {
    margin-bottom: 8px;
}

.prose a {
    color: var(--ink);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.prose strong {
    color: var(--ink);
    font-weight: 700;
}

.prose .callout {
    margin: 0 0 20px;
    padding: 16px 18px;
    background: #f9fafb;
    border: 1px solid var(--line);
    border-radius: 12px;
    font-size: 15px;
    line-height: 1.7;
    color: var(--ink-2);
}

.prose .callout strong {
    color: var(--ink);
}

.prose .updated {
    margin: 28px 0 0;
    padding-top: 18px;
    border-top: 1px solid var(--line);
    font-size: 13.5px;
    color: var(--muted);
}

.about-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin: 8px 0 24px;
}

.about-card {
    padding: 18px;
    background: #fafbfc;
    border: 1px solid var(--line);
    border-radius: 12px;
}

.about-card h3 {
    margin: 0 0 6px;
    font-size: 15px;
}

.about-card p {
    margin: 0;
    font-size: 14px;
    color: var(--muted);
}

/* --------------------------------------------------------------------------
   页脚
   -------------------------------------------------------------------------- */
.main-footer {
    margin-left: var(--sidebar-w);
    padding: 26px 32px;
    font-size: 13px;
    color: var(--muted-2);
    text-align: center;
    background: #fff;
    border-top: 1px solid var(--line);
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 22px;
    margin-bottom: 10px;
}

.footer-links a {
    color: var(--ink-2);
    font-weight: 600;
}

.footer-links a:hover {
    color: var(--ink);
}

.main-footer a {
    color: var(--ink-2);
    font-weight: 600;
}

/* --------------------------------------------------------------------------
   响应式
   -------------------------------------------------------------------------- */
@media (max-width: 1180px) {
    .tool-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 1024px) {
    .nav-toggle {
        display: -webkit-inline-box;
        display: inline-flex;
    }

    .brand {
        width: auto;
        padding: 0 16px 0 12px;
    }

    .topbar-tagline {
        display: none;
    }

    .topbar-actions {
        margin-left: auto;
        padding-right: 16px;
    }

    .main-sidebar {
        -webkit-transform: translateX(-100%);
        -ms-transform: translateX(-100%);
        transform: translateX(-100%);
        -webkit-transition: transform .25s ease;
        transition: transform .25s ease;
        box-shadow: 0 12px 40px rgba(17, 24, 39, .12);
    }

    body.nav-open .main-sidebar {
        -webkit-transform: none;
        -ms-transform: none;
        transform: none;
    }

    body.nav-open {
        overflow: hidden;
    }

    .content-wrapper,
    .main-footer {
        margin-left: 0;
    }

    .content,
    .content-header {
        padding-left: 20px;
        padding-right: 20px;
    }

    .hero h1 {
        font-size: 36px;
    }
}

@media (max-width: 720px) {
    .tool-grid {
        grid-template-columns: 1fr;
    }

    .about-grid {
        grid-template-columns: 1fr;
    }

    .prose {
        padding: 22px 18px;
    }

    .page-head h1 {
        font-size: 30px;
    }

    .content {
        padding: 24px 16px 56px;
    }

    .content-header {
        padding: 24px 16px 0;
    }

    .hero {
        padding-top: 6px;
    }

    .hero h1 {
        font-size: 30px;
    }

    .hero-sub {
        font-size: 15.5px;
    }

    .box-body,
    .box-header,
    .box-footer {
        padding-left: 18px;
        padding-right: 18px;
    }

    .btn-outline span {
        display: none;
    }
}
