/* ============================================================
   40J 工具网 · 复古简约紧凑主题（retro.css）
   纸感底色 / 墨色文字 / 细线分隔 / 紧凑间距 / 无圆角
   ============================================================ */

:root {
  --paper: #f3eee2;
  --paper-deep: #e9e2d2;
  --surface: #fbf8f0;
  --ink: #26221c;
  --ink-soft: #5f5749;
  --ink-mute: #8b8272;
  --rule: #d3c8b1;
  --rule-strong: #b9ad93;
  --accent: #9c3b2a;
  --accent-dark: #7d2c1e;
  --green: #3d5b4b;
  --gold: #a8843f;
  --radius: 0;
}

html {
  font-size: 15px;
}

body {
  background-color: var(--paper);
  background-image:
    repeating-linear-gradient(0deg, rgba(38, 34, 28, 0.022) 0 1px, transparent 1px 3px);
  color: var(--ink);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 0.93rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6,
.section-title,
.card-header,
.modal-title {
  font-family: Georgia, "Songti SC", "STSong", "SimSun", serif;
  color: var(--ink);
  letter-spacing: 0.02em;
  font-weight: 700;
}

h1 {
  font-size: 1.6rem;
}

h2 {
  font-size: 1.35rem;
}

h3 {
  font-size: 1.15rem;
}

h4 {
  font-size: 1.02rem;
}

h5 {
  font-size: 0.95rem;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color .15s ease;
}

a:hover {
  color: var(--accent-dark);
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 3px;
}

hr {
  border-color: var(--rule);
  opacity: 1;
}

::selection {
  background: var(--accent);
  color: var(--paper);
}

/* ---------- 顶部导航 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1030;
  background: var(--paper);
  border-bottom: 1px solid var(--rule-strong);
  box-shadow: 0 1px 0 rgba(38, 34, 28, .08);
}

.site-header::after {
  content: "";
  display: block;
  height: 3px;
  background: linear-gradient(90deg, var(--accent) 0 96px, transparent 96px);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  height: 48px;
  position: relative;
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  color: var(--ink) !important;
  text-decoration: none !important;
  flex: 0 0 auto;
}

.site-brand .seal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  background: var(--accent);
  color: var(--paper);
  font-family: Georgia, "Times New Roman", serif;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .04em;
  border-radius: 2px;
}

.site-brand .brand-text {
  font-family: Georgia, "Songti SC", "SimSun", serif;
  font-size: 1rem;
  letter-spacing: .18em;
}

.menu-items {
  display: flex;
  align-items: center;
  gap: .15rem;
  margin: 0 0 0 auto;
}

.menu-items a {
  display: block;
  padding: .3rem .62rem;
  color: var(--ink-soft) !important;
  font-size: .84rem;
  letter-spacing: .08em;
  border-bottom: 2px solid transparent;
  text-decoration: none !important;
}

.menu-items a:hover,
.menu-items a.active {
  color: var(--ink) !important;
  border-bottom-color: var(--accent);
  background: transparent;
}

.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 30px;
  height: 30px;
  margin-left: auto;
  cursor: pointer;
  padding: 0;
  border: 1px solid var(--rule-strong);
  background: var(--surface);
}

.menu-toggle span {
  display: block;
  width: 16px;
  height: 1.5px;
  margin: 0 auto;
  background: var(--ink);
}

@media (max-width: 768px) {
  .menu-toggle {
    display: flex;
  }

  .menu-items {
    display: none;
    position: absolute;
    top: 48px;
    right: 0;
    left: 0;
    flex-direction: column;
    align-items: stretch;
    background: var(--surface);
    border: 1px solid var(--rule-strong);
    border-top: none;
    padding: .25rem 0;
    z-index: 1040;
  }

  .menu-items.active {
    display: flex;
  }

  .menu-items a {
    padding: .55rem 1rem;
    border-bottom: 1px solid var(--rule);
  }

  .menu-items a:last-child {
    border-bottom: none;
  }
}

/* ---------- 容器与页面主标题 ---------- */
@media (min-width: 1200px) {
  .container {
    max-width: 1100px;
  }
}

main {
  padding-top: .9rem;
  padding-bottom: .5rem;
}

main .py-4 {
  padding-top: 0.9rem !important;
  padding-bottom: 0.9rem !important;
}

/* a.min.css 给 .container 留了 6rem 顶部内边距（旧波浪头图时代的遗留） */
html body .container {
  padding-top: 0;
}

/* a.min.css 把卡片锁在 800px 并加了 15px 圆角与阴影 */
html body .card {
  max-width: 100%;
}

/* 首页每个分类区块的旧外边距 */
html body .nav-section {
  max-width: 1100px;
  margin: 0 auto .55rem;
  padding: 0 12px;
}

.card-header {
  background: var(--paper-deep);
  border-bottom: 1px solid var(--rule);
  padding: .5rem .85rem;
  font-size: 1rem;
}

.card-header h3,
.card-header h4 {
  margin: 0;
  font-size: 1.05rem;
  letter-spacing: .04em;
}

.card-header h3 i,
.card-header h4 i {
  color: var(--accent);
  margin-right: .25rem;
}

/* ---------- 卡片 ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: none;
}

.card-body {
  padding: .85rem 1rem;
}

.card-footer {
  background: var(--paper-deep);
  border-top: 1px solid var(--rule);
  padding: .5rem .85rem;
}

.card:hover {
  box-shadow: none;
}

/* 分类页卡片网格里的悬浮效果统一收敛 */
.nav-item,
.tool-card,
.category-card {
  box-shadow: none !important;
}

/* ---------- 按钮 ---------- */
.btn {
  border-radius: var(--radius);
  font-size: .85rem;
  padding: .32rem .78rem;
  line-height: 1.5;
  border-width: 1px;
  height: auto;
  margin: 0;
  box-shadow: none !important;
  letter-spacing: .02em;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}

.btn-sm {
  font-size: .8rem;
  padding: .2rem .55rem;
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fdf9ef;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active,
.btn-primary:not(:disabled):not(.disabled):active {
  background: var(--accent-dark) !important;
  border-color: var(--accent-dark) !important;
  color: #fdf9ef !important;
}

.btn-secondary {
  background: var(--ink-soft);
  border-color: var(--ink-soft);
  color: #fdf9ef;
}

.btn-secondary:hover {
  background: var(--ink) !important;
  border-color: var(--ink) !important;
  color: #fdf9ef !important;
}

.btn-success {
  background: var(--green);
  border-color: var(--green);
}

.btn-success:hover {
  background: #2e4639 !important;
  border-color: #2e4639 !important;
}

.btn-warning {
  background: var(--gold);
  border-color: var(--gold);
  color: #2b2413;
}

.btn-danger {
  background: var(--accent);
  border-color: var(--accent);
}

/* disabled 状态需与常态同色（Bootstrap 的 .btn-*:disabled 权重更高，不覆盖会漏出默认亮蓝） */
.btn-primary:disabled,
.btn-primary.disabled {
  background: var(--accent);
  border-color: var(--accent);
  color: #fdf9ef;
}

.btn-secondary:disabled,
.btn-secondary.disabled {
  background: var(--ink-soft);
  border-color: var(--ink-soft);
  color: #fdf9ef;
}

.btn-success:disabled,
.btn-success.disabled {
  background: var(--green);
  border-color: var(--green);
  color: #fdf9ef;
}

.btn-danger:disabled,
.btn-danger.disabled {
  background: var(--accent);
  border-color: var(--accent);
  color: #fdf9ef;
}

.btn-warning:disabled,
.btn-warning.disabled {
  background: var(--gold);
  border-color: var(--gold);
  color: #2b2413;
}

.btn-outline-secondary,
.btn-outline-primary,
.btn-outline-dark {
  background: transparent;
  border-color: var(--rule-strong);
  color: var(--ink-soft);
}

.btn-outline-secondary:hover,
.btn-outline-primary:hover,
.btn-outline-dark:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper) !important;
}

.btn-light {
  background: var(--surface);
  border-color: var(--rule);
  color: var(--ink);
}

.btn-link {
  color: var(--accent);
}

/* ---------- 表单 ---------- */
.form-control,
.form-select,
.custom-select {
  border-radius: var(--radius);
  border: 1px solid var(--rule-strong);
  background-color: #fffdf6;
  color: var(--ink);
  font-size: .88rem;
  padding: .34rem .6rem;
  height: auto;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--accent);
  background-color: #fffdf6;
  box-shadow: 0 0 0 2px rgba(156, 59, 42, .12);
  color: var(--ink);
}

.form-control::placeholder {
  color: var(--ink-mute);
}

.form-label,
label {
  font-size: .82rem;
  color: var(--ink-soft);
  margin-bottom: .25rem;
  letter-spacing: .02em;
}

.form-text {
  font-size: .76rem;
  color: var(--ink-mute);
}

.input-group-text {
  border-radius: var(--radius);
  border: 1px solid var(--rule-strong);
  background: var(--paper-deep);
  color: var(--ink-soft);
  font-size: .82rem;
}

.form-check-input {
  border-radius: 0;
  border-color: var(--rule-strong);
}

.form-check-input:checked {
  background-color: var(--accent);
  border-color: var(--accent);
}

textarea.form-control {
  line-height: 1.6;
}

/* ---------- 表格 ---------- */
.table {
  color: var(--ink);
  font-size: .85rem;
  margin-bottom: .75rem;
  border-color: var(--rule);
}

.table> :not(caption)>*>* {
  padding: .38rem .55rem;
  border-color: var(--rule);
  vertical-align: middle;
}

.table thead th,
.table>thead>tr>th {
  background: var(--paper-deep);
  color: var(--ink);
  font-weight: 600;
  font-size: .82rem;
  letter-spacing: .03em;
  border-bottom: 1px solid var(--rule-strong);
  white-space: nowrap;
}

.table-hover>tbody>tr:hover>* {
  background-color: rgba(156, 59, 42, .06);
}

.table-striped>tbody>tr:nth-of-type(odd)>* {
  background-color: rgba(38, 34, 28, .025);
}

.table-bordered {
  border-color: var(--rule);
}

.table-bordered> :not(caption)>*>* {
  border-color: var(--rule);
}

/* ---------- 提示框 ---------- */
.alert {
  border-radius: var(--radius);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--accent);
  background: var(--surface);
  color: var(--ink-soft);
  font-size: .84rem;
  padding: .55rem .8rem;
}

.alert-info {
  border-left-color: var(--green);
}

.alert-success {
  border-left-color: var(--green);
}

.alert-warning {
  border-left-color: var(--gold);
}

.alert-danger {
  border-left-color: var(--accent);
}

.alert-light {
  background: var(--surface);
}

/* ---------- 徽章 ---------- */
.badge {
  border-radius: var(--radius);
  font-weight: 500;
  font-size: .72rem;
  letter-spacing: .04em;
  padding: .25em .45em;
}

.badge.bg-primary {
  background: var(--accent) !important;
}

.badge.bg-secondary {
  background: var(--ink-soft) !important;
}

.badge.bg-success {
  background: var(--green) !important;
}

.badge.bg-warning {
  background: var(--gold) !important;
  color: #2b2413 !important;
}

/* ---------- 导航 / 标签 ---------- */
.nav-tabs {
  border-bottom: 1px solid var(--rule-strong);
}

.nav-tabs .nav-link {
  border-radius: 0;
  border: 1px solid transparent;
  color: var(--ink-soft);
  font-size: .85rem;
  padding: .4rem .8rem;
}

.nav-tabs .nav-link:hover {
  border-color: transparent;
  color: var(--ink);
}

.nav-tabs .nav-link.active {
  background: var(--surface);
  border-color: var(--rule-strong) var(--rule-strong) var(--surface);
  color: var(--ink);
  font-weight: 600;
}

.nav-pills .nav-link {
  border-radius: 0;
  color: var(--ink-soft);
  font-size: .85rem;
  padding: .3rem .7rem;
  border: 1px solid var(--rule);
  background: var(--surface);
}

.nav-pills .nav-link.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--paper);
}

.dropdown-menu {
  border-radius: var(--radius);
  border: 1px solid var(--rule-strong);
  background: var(--surface);
  box-shadow: 0 6px 18px rgba(38, 34, 28, .12);
  padding: .25rem 0;
  font-size: .85rem;
}

.dropdown-item {
  padding: .42rem .9rem;
  color: var(--ink-soft);
}

.dropdown-item:hover,
.dropdown-item:focus {
  background: var(--paper-deep);
  color: var(--ink);
  transform: none;
}

/* ---------- 首页首屏简介 ---------- */
.home-hero {
  padding: 1.6rem 0 1.2rem;
  text-align: center;
}

.home-hero-title {
  margin: 0 0 .35rem;
  font-size: 1.75rem;
  letter-spacing: .08em;
}

.home-hero-sub {
  margin: 0 0 .7rem;
  color: var(--accent);
  font-size: .95rem;
  letter-spacing: .12em;
}

.home-hero-desc {
  max-width: 640px;
  margin: 0 auto .9rem;
  color: var(--ink-soft);
  font-size: .88rem;
  line-height: 1.8;
}

.home-hero-meta {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.2rem;
  color: var(--ink-mute);
  font-size: .82rem;
}

.home-hero-meta i {
  color: var(--gold);
  margin-right: .3rem;
}

/* ---------- 首页搜索区 ---------- */
.search-section {
  background: transparent;
  border-bottom: 1px solid var(--rule);
  padding-bottom: .9rem;
}

.search-section .input-group .btn {
  border-radius: 0;
}

/* ---------- 首页工具格子 ---------- */
.section-title {
  font-size: 1.1rem;
  margin: 1rem 0 .6rem;
  padding-left: .55rem;
  border-left: 3px solid var(--accent);
  line-height: 1.3;
}

.nav-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: .4rem;
}

.nav-item {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 0;
  transition: border-color .15s ease, background-color .15s ease;
}

.nav-item a {
  display: block;
  padding: .46rem .6rem;
  color: var(--ink-soft) !important;
  font-size: .84rem;
  text-align: left;
  text-decoration: none !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-item:hover {
  background: var(--paper-deep);
  border-color: var(--rule-strong);
  transform: none;
}

.nav-item:hover a {
  color: var(--ink) !important;
}

/* ---------- 面包屑 / 分页 ---------- */
.breadcrumb {
  background: transparent;
  font-size: .8rem;
  padding: .2rem 0;
  margin-bottom: .6rem;
}

.breadcrumb-item+.breadcrumb-item::before {
  color: var(--ink-mute);
}

.breadcrumb-item.active {
  color: var(--ink-mute);
}

.pagination .page-link {
  border-radius: 0;
  border: 1px solid var(--rule);
  color: var(--ink-soft);
  background: var(--surface);
  padding: .28rem .6rem;
  font-size: .82rem;
}

.pagination .page-item.active .page-link {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--paper);
}

/* ---------- 模态框 ---------- */
.modal-content {
  border-radius: var(--radius);
  border: 1px solid var(--rule-strong);
  background: var(--surface);
  box-shadow: 0 10px 40px rgba(38, 34, 28, .25);
}

.modal-header,
.modal-footer {
  border-color: var(--rule);
  padding: .6rem .9rem;
}

.modal-body {
  padding: .9rem;
}

/* ---------- 页脚 ---------- */
.footer {
  background: var(--paper-deep);
  border-top: 1px solid var(--rule-strong);
  margin-top: 1.5rem !important;
}

.footer .py-4 {
  padding-top: 1.1rem !important;
  padding-bottom: 1.1rem !important;
}

.footer h4 {
  font-family: Georgia, "Songti SC", "SimSun", serif;
  color: var(--ink) !important;
  font-size: 1rem !important;
  letter-spacing: .16em;
}

.footer p,
.footer .text-muted {
  color: var(--ink-mute) !important;
  font-size: .8rem;
}

.footer .page-url-share input {
  background: var(--surface);
  border: 1px solid var(--rule) !important;
  border-radius: 0;
  color: var(--ink-soft);
  font-size: .78rem;
}

.footer hr {
  border-color: var(--rule);
}

/* ---------- 代码块 / 等宽 ---------- */
pre,
code,
kbd,
samp {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: .84em;
}

pre {
  background: #efe9db;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: .6rem .75rem;
  color: var(--ink);
}

code {
  color: var(--accent-dark);
  background: rgba(156, 59, 42, .07);
  padding: .1em .3em;
  border-radius: 1px;
}

pre code {
  background: transparent;
  color: inherit;
  padding: 0;
}

/* ---------- 其它统一项 ---------- */
.text-primary {
  color: var(--accent) !important;
}

.text-secondary {
  color: var(--ink-soft) !important;
}

.text-success {
  color: var(--green) !important;
}

.text-muted {
  color: var(--ink-mute) !important;
}

.bg-light {
  background: var(--paper-deep) !important;
}

.border {
  border-color: var(--rule) !important;
}

img {
  max-width: 100%;
}

input[type="range"] {
  accent-color: var(--accent);
}

.progress {
  border-radius: 0;
  background: var(--paper-deep);
  height: .7rem;
}

.progress-bar {
  background: var(--accent);
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--paper-deep);
}

::-webkit-scrollbar-thumb {
  background: var(--rule-strong);
  border: 2px solid var(--paper-deep);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--ink-mute);
}

/* ============================================================
   兼容层：压掉 a.min.css / 页面内联样式里的旧观感
   ============================================================ */

/* 旧样式表给按钮和卡片加了渐变，统一去掉 */
html body .btn,
html body .card,
html body .modal-content,
html body .alert,
html body .badge {
  background-image: none !important;
}

html body .shadow,
html body .shadow-sm,
html body .shadow-lg,
html body .hover-shadow:hover,
html body .card:hover {
  box-shadow: none !important;
  transform: none !important;
}

/* 补齐页面里会出现的彩色按钮（btn-{$color}） */
html body .btn-info {
  background: var(--green);
  border-color: var(--green);
  color: var(--paper);
}

html body .btn-info:hover {
  background: #2e4639 !important;
  border-color: #2e4639 !important;
  color: var(--paper) !important;
}

html body .btn-dark {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

html body .btn-dark:hover {
  background: #000 !important;
  border-color: #000 !important;
  color: var(--paper) !important;
}

html body .text-info {
  color: var(--green) !important;
}

html body .text-warning {
  color: var(--gold) !important;
}

html body .text-danger {
  color: var(--accent) !important;
}

/* 紧凑化：压掉工具页里常见的 py-5 / 大图标 */
html body .py-5 {
  padding-top: 1.1rem !important;
  padding-bottom: 1.1rem !important;
}

html body .mb-5 {
  margin-bottom: 1.2rem !important;
}

html body .mt-5 {
  margin-top: 1.2rem !important;
}

html body .fa-3x {
  font-size: 2.2em;
}

/* 页面内联样式常把 h1/h3 居中放大，统一收敛 */
html body .container>h1.text-center,
html body .container>h3.text-center {
  font-size: 1.4rem;
  margin-bottom: 1rem !important;
}

/* 工具页常见的浅灰底信息块 */
html body .bg-light,
html body .bg-white {
  background: var(--surface) !important;
}

html body .rounded,
html body .rounded-3,
html body .rounded-4 {
  border-radius: var(--radius) !important;
}

/* ============================================================
   深度统一层
   工具页的内联 <style> 在 retro.css 之后加载，用 html body 前缀
   提升权重，把各页面残留的旧配色 / 圆角 / 阴影压回主题
   ============================================================ */

/* 卡片 */
html body .card {
  background: var(--surface);
  border: 1px solid var(--rule) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

html body .card-header {
  background: var(--paper-deep) !important;
  border-bottom: 1px solid var(--rule) !important;
  border-radius: 0 !important;
  padding: .5rem .85rem !important;
  color: var(--ink) !important;
}

html body .card-body {
  padding: .85rem 1rem;
}

html body .card-footer {
  background: var(--paper-deep) !important;
  border-top: 1px solid var(--rule) !important;
  padding: .5rem .85rem !important;
}

/* 旧页面用 bg-primary / bg-info 当标题底色 */
html body .bg-primary {
  background: var(--accent) !important;
  color: var(--paper) !important;
}

html body .bg-secondary {
  background: var(--ink-soft) !important;
  color: var(--paper) !important;
}

html body .bg-info {
  background: var(--green) !important;
  color: var(--paper) !important;
}

html body .bg-success {
  background: var(--green) !important;
  color: var(--paper) !important;
}

html body .bg-warning {
  background: var(--gold) !important;
  color: #2b2413 !important;
}

html body .bg-danger {
  background: var(--accent) !important;
  color: var(--paper) !important;
}

html body .bg-dark {
  background: var(--ink) !important;
  color: var(--paper) !important;
}

html body .bg-light {
  background: var(--paper-deep) !important;
}

/* 列表组（分类首页工具列表） */
html body .list-group-item {
  background: transparent !important;
  border-color: var(--rule) !important;
  padding: .58rem .85rem !important;
  color: var(--ink);
}

html body .list-group-item.hover-effect:hover,
html body .list-group-item:hover {
  background: var(--paper-deep) !important;
  transform: none !important;
}

/* 圆形图标改方形，统一成印章风 */
html body .rounded-circle,
html body .rounded-pill {
  border-radius: 2px !important;
}

html body .icon-wrapper {
  background: var(--accent) !important;
  color: var(--paper) !important;
  border-radius: 2px !important;
}

/* 旧徽章名（BS4 写法）统一走主题色 */
html body .badge {
  background: var(--ink-soft);
  color: var(--paper);
  border-radius: 0 !important;
}

html body .badge-primary {
  background: var(--accent) !important;
}

html body .badge-info,
html body .badge-success {
  background: var(--green) !important;
}

html body .badge-warning {
  background: var(--gold) !important;
  color: #2b2413 !important;
}

html body .badge-danger {
  background: var(--accent) !important;
}

html body .badge-dark {
  background: var(--ink) !important;
}

/* 所有悬停位移 / 浮动阴影统一取消 */
html body .hover-effect:hover,
html body .hover-shadow:hover,
html body .card:hover,
html body .btn:hover,
html body .dropdown-item:hover {
  transform: none !important;
}

html body .hover-shadow:hover {
  box-shadow: none !important;
}

/* 圆角一律归零（含页面内联写的 4/6/8/12px） */
html body .btn,
html body .btn-toolbar .btn,
html body .form-control,
html body .form-select,
html body .input-group-text,
html body .modal-content,
html body .alert,
html body .dropdown-menu,
html body .nav-link,
html body .pagination .page-link,
html body .list-group,
html body .list-group-item {
  border-radius: 0 !important;
}

/* 页面内联的大标题统一收敛 */
html body .page-title {
  color: var(--ink) !important;
  font-family: Georgia, "Songti SC", "STSong", "SimSun", serif;
  font-size: 1.35rem !important;
  font-weight: 600 !important;
  letter-spacing: .04em;
  margin-bottom: 1rem !important;
}

/* 首页分类标题里的内联链接色 */
html body .section-title a {
  color: var(--ink) !important;
}

html body .section-title a:hover {
  text-decoration: underline;
  text-decoration-style: dotted;
}

/* 工具页固定宽度容器统一 */
html body .container-fluid {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.1rem .9rem;
}

/* 首页搜索区 */
html body .search-section .input-group {
  position: relative;
}

html body .search-section .input-group>.btn {
  border: 1px solid var(--rule-strong);
}

html body .search-section .dropdown-menu {
  width: auto;
  min-width: 8rem;
  margin-top: 2px !important;
}

/* 文本工具页常见的粘贴区/结果区 */
html body .form-control[readonly],
html body .form-control:disabled {
  background: var(--paper-deep) !important;
  color: var(--ink-soft);
}

/* 代码块内联背景色统一 */
html body pre,
html body .output,
html body .result-box {
  background: #efe9db !important;
  border: 1px solid var(--rule) !important;
  border-radius: 0 !important;
}

/* 页脚本页地址：输入框固定宽度，避免把复制按钮推到行尾 */
.footer .page-url-share .form-control {
  flex: 0 0 200px;
  width: 200px;
}

/* 分类列表行（游戏等） */
html body .game-row {
  column-gap: .65rem;
}

html body .game-row>i {
  flex: 0 0 auto;
  font-size: .8rem;
  color: var(--accent);
}

html body .game-row h5 {
  font-size: .92rem;
  font-weight: 500;
  letter-spacing: .02em;
}

/* 导航分类页（/dev、/tools、/design、/ai） */
html body .lead {
  color: var(--ink-soft) !important;
  font-size: 1rem;
}

html body .display-4 {
  color: var(--ink) !important;
  font-size: 1.8rem;
  letter-spacing: .06em;
}

html body .divider {
  display: flex;
  align-items: center;
  margin: 1rem auto 0;
  max-width: 220px;
}

html body .divider span {
  flex: 1;
  height: 1px;
  background: var(--rule-strong) !important;
}

html body .tool-card .card-body {
  padding: 1rem !important;
}

html body .tool-card .icon-wrapper {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

html body .tool-card .icon-wrapper i {
  font-size: 1.05rem;
}

html body .tool-card .card-title {
  color: var(--ink) !important;
  font-size: 1rem;
}

/* ---------- 行内复制按钮（随机密码/花体字等结果列表） ----------
   原样式在已停用的 a.css 中，按钮退回浏览器默认外观；统一为复古描边小按钮 */
html body .copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: .5rem;
  padding: .12rem .45rem;
  background: var(--surface);
  border: 1px solid var(--rule-strong);
  border-radius: 0;
  color: var(--ink-soft);
  font-size: .85rem;
  line-height: 1.5;
  cursor: pointer;
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}

html body .copy-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--paper-deep);
}

.footer .page-url-share .copy-btn {
  flex: 0 0 auto;
  position: static;
  transform: none;
  background: var(--surface);
  border: 1px solid var(--rule-strong);
  color: var(--ink-soft);
  padding: .2rem .5rem;
  border-radius: 0;
}

.footer .page-url-share .copy-btn:hover {
  background: var(--paper-deep);
  color: var(--ink);
  border-color: var(--rule-strong);
}

@media (max-width: 576px) {
  .footer .page-url-share .d-flex {
    flex-wrap: wrap;
  }

  .footer .page-url-share .form-control {
    flex: 1 1 auto;
    width: auto;
  }
}

/* ---------- 模式切换分段条（自 card-header 移入 body 顶部） ---------- */
.mode-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin-bottom: .9rem;
  width: 100%;
}

.mode-tabs>.btn {
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  border-color: var(--rule-strong);
}

.mode-tabs>.btn.btn-outline-secondary {
  background: var(--surface);
  color: var(--ink-soft);
}

.mode-tabs>.btn.btn-outline-secondary:hover {
  background: var(--paper-deep);
  color: var(--ink);
}

.mode-tabs>.btn.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--paper);
}

/* 桌面端不强制撑满，保持紧凑 */
@media (min-width: 576px) {
  .mode-tabs {
    width: auto;
  }
}

/* ---------- 主体宽度统一 ----------
   老页面用 .row.justify-content-center > .col-md-6/8/10 做单列居中壳，
   造成各页内容宽度不一；统一为容器全宽（多列布局不受影响） */
@media (min-width: 768px) {
  html body main .container>.row.justify-content-center>[class*="col-"]:only-child {
    /* BS4 分栏用 flex-basis 实现（flex:0 0 50%），basis 优先于 width，必须一并重置 */
    flex: 0 0 100%;
    width: 100%;
    max-width: 100%;
  }
}

/* ---------- 手风琴 / 折叠面板 ---------- */
html body .accordion {
  border: 1px solid var(--rule);
  background: var(--surface);
}

html body .accordion-item {
  border-bottom: 1px solid var(--rule);
}

html body .accordion-item:last-child {
  border-bottom: none;
}

html body .accordion-header {
  margin: 0 !important;
}

html body .accordion-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  width: 100%;
  margin: 0;
  padding: .5rem .8rem;
  background: var(--surface);
  border: 0;
  border-radius: 0;
  box-shadow: none;
  color: var(--ink);
  font-family: Georgia, "Songti SC", "STSong", "SimSun", serif;
  font-size: .9rem;
  letter-spacing: .04em;
  line-height: 1.5;
  text-align: left;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}

html body .accordion-button::after {
  content: "＋";
  flex: 0 0 auto;
  font-family: Arial, "Helvetica Neue", sans-serif;
  font-size: .95rem;
  color: var(--ink-mute);
}

html body .accordion-button:not(.collapsed) {
  background: var(--paper-deep);
  color: var(--accent);
}

html body .accordion-button:not(.collapsed)::after {
  content: "－";
  color: var(--accent);
}

html body .accordion-button:hover {
  background: var(--paper-deep);
  color: var(--accent-dark);
}

html body .accordion-button:focus,
html body .accordion-button:active {
  outline: none;
  box-shadow: none;
}

html body .accordion-body {
  padding: .7rem .9rem;
  border-top: 1px dashed var(--rule);
  background: var(--surface);
  font-size: .88rem;
  color: var(--ink-soft);
}

html body .accordion-body>ol,
html body .accordion-body>ul {
  margin-bottom: 0;
}

/* ---------- 关闭按钮 ---------- */
html body .btn-close {
  width: 1.55rem;
  height: 1.55rem;
  padding: 0;
  border: 1px solid var(--rule-strong);
  background-color: var(--surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%2326221c'%3E%3Cpath d='M.293.293a1 1 0 0 1 1.414 0L8 6.586 14.293.293a1 1 0 1 1 1.414 1.414L9.414 8l6.293 6.293a1 1 0 0 1-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 0 1-1.414-1.414L6.586 8 .293 1.707a1 1 0 0 1 0-1.414z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: .8rem;
  border-radius: 0;
  opacity: .75;
  cursor: pointer;
}

html body .btn-close:hover {
  opacity: 1;
  background-color: var(--paper-deep);
}

/* ---------- 分类首页工具卡片 ---------- */
.tool-card {
  transition: transform .2s ease, box-shadow .2s ease;
}

.tool-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 .4rem .9rem rgba(38, 34, 28, .14);
}

.tool-card .card-title {
  margin-bottom: .35rem;
}

.tool-card .card-text {
  min-height: 2.6em;
}

.tool-card .tool-icon {
  display: inline-block;
  font-size: 2.6rem;
  line-height: 1;
  margin-bottom: .75rem;
}