/* Minimal responsive styles */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  color: #222;
  background: #fafafa;
}

a {
  color: #0a7;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px;
}

.site-header {
  background: #fff;
  border-bottom: 1px solid #eee;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-weight: 600;
  color: #0a7;
  font-size: 24px;
}

.nav a {
  margin-left: 12px;
  color: #333;
}

.site-footer {
  margin-top: 40px;
  padding: 20px 0;
  text-align: center;
  color: #666;
}

.site-footer .runtime {
  font-size: 8px;
  color: #888;
  margin-top: 6px;
}

.grid {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 16px;
}

@media (max-width: 768px) {
  .grid {
    grid-template-columns: 1fr;
  }

  .sidebar {
    order: 2;
  }

  .content {
    order: 1;
  }
}

.sidebar h3,
.content h3 {
  margin-top: 0;
}

.tree {
  list-style: none;
  padding: 0;
}

.tree li {
  padding: 6px 0;
}

/* 新增：可折叠树样式 */
.tree li.node>ul {
  display: none;
  margin-left: 14px;
}

.tree li.node.collapsed>ul {
  display: none;
}

.tree li.node:not(.collapsed)>ul {
  display: block;
}

.tree .toggle {
  display: inline-block;
  width: 1em;
  margin-right: 6px;
  color: #666;
  cursor: pointer;
}

.tree .toggle.placeholder {
  visibility: hidden;
}

.tree .count {
  color: #999;
  margin-left: 6px;
}

/* 标签云样式 */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-cloud .tag {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 16px;
  padding: 6px 10px;
  color: #0a7;
}

.tag-cloud .tag .name {
  color: #0a7;
  text-decoration: none;
}

.tag-cloud .tag .name:hover {
  text-decoration: underline;
}

.tag-cloud .tag .cnt {
  color: #888;
  margin-left: 6px;
}

.file-list {
  list-style: none;
  padding: 0;
}

.file-list li {
  padding: 8px 12px;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 6px;
  margin-bottom: 8px;
}

.file-list li .file {
  display: block;
}

.muted {
  color: #888;
}

.tip {
  color: #c00;
}

.form label {
  display: block;
  margin-bottom: 12px;
}

.form input {
  width: 100%;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
}

.form input[type="checkbox"],
.form input[type="radio"] {
  width: auto;
  padding: 0;
  /* native controls handle padding */
  border: none;
  /* avoid box-model expansion */
}

.form button,
.btn {
  padding: 8px 12px;
  border: none;
  border-radius: 4px;
  background: #0a7;
  color: #fff;
  cursor: pointer;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.card {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 6px;
  padding: 16px;
  text-align: center;
}

.card .num {
  font-size: 24px;
  font-weight: 700;
}

.card .label {
  color: #555;
}

.single .summary {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 16px;
  word-wrap: break-word;
  overflow-wrap: break-word;
  word-break: break-all;
}

.downloads .links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 768px) {
  .downloads .links {
    grid-template-columns: 1fr;
  }
}

.downloads .link-item {
  background: #f7f9fb;
  border: 1px solid #e6edf5;
  border-radius: 8px;
  padding: 12px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
}

.downloads .link-item .provider-badge {
  background: #f1f5f9;
  color: #0f172a;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 1.05rem;
  font-weight: 600;
  white-space: nowrap;
}

.downloads .link-item .meta-row {
  grid-column: 1 / span 2;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.downloads .link-item .actions .btn,
.downloads .link-item .btn-go {
  background: #22c55e;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 8px 12px;
}

.downloads .link-item .meta.chip {
  background: #edf2f7;
  border: 1px solid #d8dee4;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.downloads .link-item .btn-outline {
  background: #fff;
  border: 1px solid #d8dee4;
  color: #34495e;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 12px;
}

.downloads .link-item .meta.desc {
  grid-column: 1 / span 2;
  color: #4b5563;
  font-size: 13px;
  line-height: 1.6;
  background: #fff;
  border: 1px dashed #e5e7eb;
  padding: 8px;
  border-radius: 6px;
}

@media (max-width: 640px) {
  .downloads .link-item .meta-row {
    justify-content: space-between;
  }
}

.link-item {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 12px;
  display: grid;
  grid-template-columns: 140px 1fr auto;
  grid-template-rows: auto auto;
  gap: 8px 12px;
  align-items: center;
}

/* Provider badge clarity */
.link-item .provider-badge {
  font-size: 1.05rem;
  font-weight: 600;
  background: #f1f5f9;
  color: #0f172a;
  display: inline-block;
  padding: 6px 10px;
  border-radius: 6px;
  margin-bottom: 8px;
}

/* Single-line meta row adjustments */
.link-item .meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.link-item .btn-go {
  order: -1;
  margin-left: 0;
}

.link-item .url {
  grid-column: 2 / 3;
}

.link-item .url .link {
  font-weight: 600;
}

.link-item .meta {
  grid-column: 1 / 3;
  color: #555;
  font-size: 14px;
}

.link-item .meta.chip {
  background: #f7f7f7;
  border: 1px solid #eee;
  border-radius: 16px;
  padding: 6px 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: 8px;
}

.link-item .meta .code {
  font-weight: 700;
  letter-spacing: 0.5px;
}

.link-item .actions {
  grid-column: 3 / 4;
}

.btn-outline {
  background: #fff;
  color: #0a7;
  border: 1px solid #0a7;
}

/* 播放源按钮样式 */
.source-list .src-btn {
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
}

.source-list .src-btn .ping {
  margin-left: 6px;
  color: #7a869a;
  font-weight: normal;
}

.source-list .src-btn.active {
  background: #0a7;
  color: #fff;
  border-color: #0a7;
}

.source-list .src-btn.active .ping {
  color: #eaffea;
}

@media (max-width: 640px) {
  .link-item {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }

  .link-item .actions {
    grid-column: 1 / -1;
    justify-self: end;
  }
}

.wechat-mask-local {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  color: #111;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  z-index: 20;
  padding-top: 8px;
  pointer-events: auto;
}

.wechat-mask-local .wechat-tipbar {
  background: #ffeb3b;
  color: #111;
  padding: 12px 16px;
  border-radius: 6px;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.wechat-arrow {
  position: fixed;
  top: 8px;
  right: 10px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  color: #000;
}

.wechat-arrow .arrow-svg {
  display: block;
}

.wechat-arrow .arrow-text {
  background: rgba(255, 255, 255, 0.9);
  color: #111;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.4;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

@media (max-width: 640px) {
  .wechat-arrow {
    right: 6px;
    top: 6px;
  }

  .wechat-arrow .arrow-svg {
    width: 90px;
    height: 60px;
  }
}

.wechat-tip {
  background: rgba(0, 0, 0, 0.7);
  padding: 18px 24px;
  border-radius: 8px;
}

/* Provider badge icon layout and sizing */
.link-item .provider-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.link-item .provider-badge .icon-img {
  height: 1.4em;
  width: auto;
  object-fit: contain;
  vertical-align: middle;
  border-radius: 3px;
}

.link-item .provider-badge .icon-text {
  display: inline-block;
  font-weight: 700;
  font-size: 1.2em;
}

.copy-toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  background: rgba(17, 24, 39, 0.95);
  color: #fff;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 14px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 9999;
}

.copy-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(-4px);
}

/* Summary link styles */
.single .summary ul,
.single .summary ol {
  margin: 0 0 10px 0;
  padding-left: 1.25em;
  /* ensure bullets stay inside container */
  list-style-position: inside;
  /* avoid markers rendering outside rounded box */
}

.single .summary li {
  margin: 4px 0;
  word-wrap: break-word;
  overflow-wrap: break-word;
  /* long words/URLs won't overflow */
}

.single .summary ul ul,
.single .summary ul ol,
.single .summary ol ul,
.single .summary ol ol {
  margin: 6px 0;
  padding-left: 1.25em;
  /* nested lists keep consistent indent */
}

.single .summary p,
.single .summary h1,
.single .summary h2,
.single .summary h3,
.single .summary h4,
.single .summary h5,
.single .summary h6 {
  margin: 6px 0;
}

.single .summary img,
.single .summary video,
.single .summary iframe {
  max-width: 100%;
  height: auto;
}

.single .summary pre,
.single .summary code {
  white-space: pre-wrap;
  word-wrap: break-word;
}

.single .summary a {
  color: #06f;
  text-decoration: underline;
}

.single .summary a:hover {
  color: #f00;
}

/* --- Admin layout & tables --- */
.admin-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  align-items: start;
}

@media (max-width: 900px) {
  .admin-grid {
    grid-template-columns: 1fr;
  }
}

.admin-stack {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: start;
}

.panel {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 6px;
  padding: 12px;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 8px;
  border-bottom: 1px solid #f0f0f0;
  text-align: left;
}

.table thead th {
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
  font-weight: 600;
}

.table tbody tr:hover {
  background: #f9f9f9;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.toolbar .spacer {
  flex: 1;
}

.badge {
  display: inline-block;
  font-size: 12px;
  color: #555;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  padding: 2px 8px;
}

/* Permission groups */
.perm-group {
  margin: 8px 0;
  padding: 8px;
  border: 1px dashed #eee;
  border-radius: 6px;
}

.perm-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.perm-group-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

@media (max-width: 640px) {
  .perm-group-body {
    grid-template-columns: 1fr;
  }
}

.perm-count {
  color: #666;
}

.toggle-btn {
  background: #f3f4f6;
  color: #111;
  border: 1px solid #e5e7eb;
}

/* Admin actions toolbar layout */
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.actions .btn {
  margin: 0;
}

/* 分类选择器样式（WordPress风格） */
.cat-selector {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 6px;
  padding: 10px;
}

.cat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.cat-header .cat-search {
  flex: 0 0 200px;
  padding: 6px 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
}

.cat-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.cat-tabs .tab-btn {
  background: #f3f4f6;
  color: #111;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 6px 10px;
  cursor: pointer;
}

.cat-tabs .tab-btn.active {
  background: #0a7;
  color: #fff;
  border-color: #0a7;
}

.cat-tabs .tab-btn.active .ping {
  color: #eaffea;
}

.cat-unclassified {
  margin-bottom: 6px;
}

.cat-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
}

.cat-tree,
.cat-popular {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 240px;
  overflow: auto;
  border: 1px solid #f0f0f0;
  border-radius: 4px;
}

.cat-tree li.node {
  padding: 2px 0;
}

.cat-tree .children {
  margin-left: 0;
  padding-left: 0;
}

.cat-tree li.node.collapsed>ul.children {
  display: none;
}

.node-toggle {
  width: 18px;
  height: 18px;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.node-toggle:focus {
  outline: 2px solid #7db3ff;
  outline-offset: 2px;
  border-radius: 2px;
}

.node-toggle::before {
  content: "▾";
  font-size: 12px;
  line-height: 1;
  color: #555;
}

li.node.collapsed .node-toggle::before {
  content: "▸";
}

.cat-name {
  flex: 1;
}

.cat-count {
  color: #888;
  font-size: 12px;
  margin-left: auto;
}

.cat-tree {
  list-style: none;
  padding: 0;
}

.cat-tree li {
  padding: 6px 0;
}

/* Provider badge clarity */
.cat-item .provider-badge {
  font-size: 1.05rem;
  font-weight: 600;
  background: #f1f5f9;
  color: #0f172a;
  display: inline-block;
  padding: 6px 10px;
  border-radius: 6px;
  margin-bottom: 8px;
}

/* Single-line meta row adjustments */
.cat-item .meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.cat-item .btn-go {
  order: -1;
  margin-left: 0;
}

.cat-item .url {
  grid-column: 2 / 3;
}

.cat-item .url .link {
  font-weight: 600;
}

.cat-item .meta {
  grid-column: 1 / 3;
  color: #555;
  font-size: 14px;
}

.cat-item .meta.chip {
  background: #f7f7f7;
  border: 1px solid #eee;
  border-radius: 16px;
  padding: 6px 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: 8px;
}

.cat-item .meta .code {
  font-weight: 700;
  letter-spacing: 0.5px;
}

.cat-item .actions {
  grid-column: 3 / 4;
}

.btn-outline {
  background: #fff;
  color: #0a7;
  border: 1px solid #0a7;
}

@media (max-width: 640px) {
  .cat-item {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }

  .cat-item .actions {
    grid-column: 1 / -1;
    justify-self: end;
  }
}

.wechat-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  z-index: 9999;
  padding-top: 8px;
}

.wechat-tipbar {
  background: #ffeb3b;
  color: #111;
  padding: 12px 16px;
  border-radius: 6px;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.wechat-arrow {
  position: fixed;
  top: 8px;
  right: 10px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  color: #000;
}

.wechat-arrow .arrow-svg {
  display: block;
}

.wechat-arrow .arrow-text {
  background: rgba(255, 255, 255, 0.9);
  color: #111;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.4;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

@media (max-width: 640px) {
  .wechat-arrow {
    right: 6px;
    top: 6px;
  }

  .wechat-arrow .arrow-svg {
    width: 90px;
    height: 60px;
  }
}

.wechat-tip {
  background: rgba(0, 0, 0, 0.7);
  padding: 18px 24px;
  border-radius: 8px;
}

/* Provider badge icon layout and sizing */
.link-item .provider-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.link-item .provider-badge .icon-img {
  height: 1.4em;
  width: auto;
  object-fit: contain;
  vertical-align: middle;
  border-radius: 3px;
}

.link-item .provider-badge .icon-text {
  display: inline-block;
  font-weight: 700;
  font-size: 1.2em;
}

.copy-toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  background: rgba(17, 24, 39, 0.95);
  color: #fff;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 14px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 9999;
}

.copy-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(-4px);
}

/* Summary link styles */
.single .summary ul,
.single .summary ol {
  margin: 0 0 10px 0;
  padding-left: 1.25em;
  /* ensure bullets stay inside container */
  list-style-position: inside;
  /* avoid markers rendering outside rounded box */
}

.single .summary li {
  margin: 4px 0;
  word-wrap: break-word;
  overflow-wrap: break-word;
  /* long words/URLs won't overflow */
}

.single .summary ul ul,
.single .summary ul ol,
.single .summary ol ul,
.single .summary ol ol {
  margin: 6px 0;
  padding-left: 1.25em;
  /* nested lists keep consistent indent */
}

.single .summary p,
.single .summary h1,
.single .summary h2,
.single .summary h3,
.single .summary h4,
.single .summary h5,
.single .summary h6 {
  margin: 6px 0;
}

.single .summary img,
.single .summary video,
.single .summary iframe {
  max-width: 100%;
  height: auto;
}

.single .summary pre,
.single .summary code {
  white-space: pre-wrap;
  word-wrap: break-word;
}

.single .summary a {
  color: #06f;
  text-decoration: underline;
}

.single .summary a:hover {
  color: #f00;
}

/* Admin actions toolbar layout */
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.actions .btn {
  margin: 0;
}

.cat-row.selected {
  background: #e6f7ff;
  border-radius: 4px;
}

.cat-tree mark,
.cat-popular mark {
  background: #fffb8f;
  color: inherit;
  padding: 0 1px;
}

.cat-tabs .tab-btn:focus {
  outline: 2px solid #0a7;
  outline-offset: 2px;
}

.cat-search:focus {
  outline: 2px solid #0a7;
  outline-offset: 1px;
}

/* Audio meta: two-column grid with wrapping for mobile */
.audio .audio-panel .audio-meta {
  display: grid !important;
  grid-template-columns: auto 1fr;
  gap: 8px 12px;
  align-items: center;
}

#audioFileName,
#audioDuration {
  overflow-wrap: anywhere;
  word-break: break-all;
}

.cat-item .meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.cat-item .btn-go {
  order: -1;
  margin-left: 0;
}

.cat-item .url {
  grid-column: 2 / 3;
}

.cat-item .url .link {
  font-weight: 600;
}

.cat-item .meta {
  grid-column: 1 / 3;
  color: #555;
  font-size: 14px;
}

.cat-item .meta.chip {
  background: #f7f7f7;
  border: 1px solid #eee;
  border-radius: 16px;
  padding: 6px 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: 8px;
}

.cat-item .meta .code {
  font-weight: 700;
  letter-spacing: 0.5px;
}

.cat-item .actions {
  grid-column: 3 / 4;
}

.btn-outline {
  background: #fff;
  color: #0a7;
  border: 1px solid #0a7;
}

@media (max-width: 640px) {
  .cat-item {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }

  .cat-item .actions {
    grid-column: 1 / -1;
    justify-self: end;
  }
}

.wechat-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  z-index: 9999;
  padding-top: 8px;
}

.wechat-tipbar {
  background: #ffeb3b;
  color: #111;
  padding: 12px 16px;
  border-radius: 6px;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.wechat-arrow {
  position: fixed;
  top: 8px;
  right: 10px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  color: #000;
}

.wechat-arrow .arrow-svg {
  display: block;
}

.wechat-arrow .arrow-text {
  background: rgba(255, 255, 255, 0.9);
  color: #111;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.4;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

@media (max-width: 640px) {
  .wechat-arrow {
    right: 6px;
    top: 6px;
  }

  .wechat-arrow .arrow-svg {
    width: 90px;
    height: 60px;
  }
}

.wechat-tip {
  background: rgba(0, 0, 0, 0.7);
  padding: 18px 24px;
  border-radius: 8px;
}

/* Provider badge icon layout and sizing */
.link-item .provider-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.link-item .provider-badge .icon-img {
  height: 1.4em;
  width: auto;
  object-fit: contain;
  vertical-align: middle;
  border-radius: 3px;
}

.link-item .provider-badge .icon-text {
  display: inline-block;
  font-weight: 700;
  font-size: 1.2em;
}

.copy-toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  background: rgba(17, 24, 39, 0.95);
  color: #fff;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 14px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 9999;
}

.copy-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(-4px);
}

/* Summary link styles */
.single .summary ul,
.single .summary ol {
  margin: 0 0 10px 0;
  padding-left: 1.25em;
  /* ensure bullets stay inside container */
  list-style-position: inside;
  /* avoid markers rendering outside rounded box */
}

.single .summary li {
  margin: 4px 0;
  word-wrap: break-word;
  overflow-wrap: break-word;
  /* long words/URLs won't overflow */
}

.single .summary ul ul,
.single .summary ul ol,
.single .summary ol ul,
.single .summary ol ol {
  margin: 6px 0;
  padding-left: 1.25em;
  /* nested lists keep consistent indent */
}

.single .summary p,
.single .summary h1,
.single .summary h2,
.single .summary h3,
.single .summary h4,
.single .summary h5,
.single .summary h6 {
  margin: 6px 0;
}

.single .summary img,
.single .summary video,
.single .summary iframe {
  max-width: 100%;
  height: auto;
}

.single .summary pre,
.single .summary code {
  white-space: pre-wrap;
  word-wrap: break-word;
}

.single .summary a {
  color: #06f;
  text-decoration: underline;
}

.single .summary a:hover {
  color: #f00;
}

/* Admin actions toolbar layout */
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.actions .btn {
  margin: 0;
}

.cat-row.selected {
  background: #e6f7ff;
  border-radius: 4px;
}

.cat-tree mark,
.cat-popular mark {
  background: #fffb8f;
  color: inherit;
  padding: 0 1px;
}

.cat-tabs .tab-btn:focus {
  outline: 2px solid #0a7;
  outline-offset: 2px;
}

.cat-search:focus {
  outline: 2px solid #0a7;
  outline-offset: 1px;
}

.item-id.is-clicked {
  color: #f00000;
  font-weight: 700;
}

/* Hide audio download button where supported */
.audio #itemAudio::-webkit-media-controls-download-button {
  display: none;
}

.audio #itemAudio::-internal-media-controls-download-button {
  display: none;
}

/* Minor styling for rate selector */
.audio .rate-control select {
  padding: 6px 8px;
  border-radius: 4px;
}

.audio .source-list .src-btn {
  border-radius: 6px;
}

.audio .source-list .src-btn.active {
  background: #0a7;
  color: #fff;
  border-color: #0a7;
}

.audio .source-list .src-btn.active .ping,
.audio .source-list .src-btn.active .cache,
.audio .source-list .src-btn.active span.muted {
  color: #eaffea;
}

/* Improve focus visibility on mobile keyboards */
.audio .source-list .src-btn:focus-visible {
  outline: 2px solid #111;
  outline-offset: 2px;
}

@media (max-width: 640px) {
  .cat-item {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }

  .cat-item .actions {
    grid-column: 1 / -1;
    justify-self: end;
  }
}

.wechat-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  z-index: 9999;
  padding-top: 8px;
}

.wechat-tipbar {
  background: #ffeb3b;
  color: #111;
  padding: 12px 16px;
  border-radius: 6px;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.wechat-arrow {
  position: fixed;
  top: 8px;
  right: 10px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  color: #000;
}

.wechat-arrow .arrow-svg {
  display: block;
}

.wechat-arrow .arrow-text {
  background: rgba(255, 255, 255, 0.9);
  color: #111;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.4;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

@media (max-width: 640px) {
  .wechat-arrow {
    right: 6px;
    top: 6px;
  }

  .wechat-arrow .arrow-svg {
    width: 90px;
    height: 60px;
  }
}

.wechat-tip {
  background: rgba(0, 0, 0, 0.7);
  padding: 18px 24px;
  border-radius: 8px;
}

/* Provider badge icon layout and sizing */
.link-item .provider-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.link-item .provider-badge .icon-img {
  height: 1.4em;
  width: auto;
  object-fit: contain;
  vertical-align: middle;
  border-radius: 3px;
}

.link-item .provider-badge .icon-text {
  display: inline-block;
  font-weight: 700;
  font-size: 1.2em;
}

.copy-toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  background: rgba(17, 24, 39, 0.95);
  color: #fff;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 14px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 9999;
}

.copy-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(-4px);
}

/* Summary link styles */
.single .summary ul,
.single .summary ol {
  margin: 0 0 10px 0;
  padding-left: 1.25em;
  /* ensure bullets stay inside container */
  list-style-position: inside;
  /* avoid markers rendering outside rounded box */
}

.single .summary li {
  margin: 4px 0;
  word-wrap: break-word;
  overflow-wrap: break-word;
  /* long words/URLs won't overflow */
}

.single .summary ul ul,
.single .summary ul ol,
.single .summary ol ul,
.single .summary ol ol {
  margin: 6px 0;
  padding-left: 1.25em;
  /* nested lists keep consistent indent */
}

.single .summary p,
.single .summary h1,
.single .summary h2,
.single .summary h3,
.single .summary h4,
.single .summary h5,
.single .summary h6 {
  margin: 6px 0;
}

.single .summary img,
.single .summary video,
.single .summary iframe {
  max-width: 100%;
  height: auto;
}

.single .summary pre,
.single .summary code {
  white-space: pre-wrap;
  word-wrap: break-word;
}

.single .summary a {
  color: #06f;
  text-decoration: underline;
}

.single .summary a:hover {
  color: #f00;
}

/* Admin actions toolbar layout */
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.actions .btn {
  margin: 0;
}

.cat-row.selected {
  background: #e6f7ff;
  border-radius: 4px;
}

.cat-tree mark,
.cat-popular mark {
  background: #fffb8f;
  color: inherit;
  padding: 0 1px;
}

.cat-tabs .tab-btn:focus {
  outline: 2px solid #0a7;
  outline-offset: 2px;
}

.cat-search:focus {
  outline: 2px solid #0a7;
  outline-offset: 1px;
}

/* Footer Navigation */
/* Footer Navigation */
.footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 20px;
  list-style: none;
  padding: 12px 20px;
  margin: 0 auto 16px auto;
  max-width: 1000px;
  background-color: #f0fdf4;
  /* Light green background */
  border: 1px solid #dcfce7;
  border-radius: 8px;
  /* Dedicated rounded area */
}

.footer-nav li a {
  color: #059669;
  /* Theme dark green link color */
  text-decoration: none;
  font-size: 15px;
  /* Bigger than copyright */
  font-weight: 500;
  border-bottom: 1px solid #059669;
  /* Always underlined */
  padding-bottom: 1px;
  /* Prepare for hover */
  transition: all 0.2s ease;
}

.footer-nav li a:hover {
  color: #047857;
  /* Darker on hover */
  border-bottom-width: 2px;
  background-color: rgba(5, 150, 105, 0.1);
  /* Highlight effect */
  border-radius: 2px;
}

@media (max-width: 600px) {
  .footer-nav {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 98%;
    /* Center properly on mobile */
  }
}

/* Like button active state */
#btnLike.liked {
  color: #e91e63 !important;
  border-color: #e91e63 !important;
  background-color: #fce4ec !important;
  cursor: default;
}

#btnLike.liked span {
  color: #e91e63 !important;
}

#btnLike.liked:hover {
  background-color: #fce4ec !important;
}

/* Report Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
}

.modal-overlay.open {
  display: flex;
}

.modal-box {
  background: #fff;
  width: 90%;
  max-width: 500px;
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
  from {
    transform: translateY(20px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.modal-title {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #999;
}

.modal-body textarea {
  width: 100%;
  min-height: 100px;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  resize: vertical;
  font-family: inherit;
  margin-bottom: 12px;
}

.modal-body select {
  width: 100%;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  margin-bottom: 12px;
  background: #fff;
}

.modal-footer {
  text-align: right;
  margin-top: 16px;
}

/* Toast modifiers */
.copy-toast.success {
  background: #10b981 !important;
}

.copy-toast.error {
  background: #ef4444 !important;
}

.copy-toast.show {
  opacity: 1;
  pointer-events: auto;
}

/* =========================================
   Rich Text Typography (for .single .summary)
   ========================================= */

.single .summary {
  font-size: 16px;
  line-height: 1.75;
  color: #333;
}

.single .summary p {
  margin: 0 0 1.5em 0;
}

/* Headings */
.single .summary h1,
.single .summary h2,
.single .summary h3,
.single .summary h4,
.single .summary h5,
.single .summary h6 {
  margin-top: 1.5em;
  margin-bottom: 0.75em;
  font-weight: 600;
  line-height: 1.3;
  color: #111;
}

.single .summary h1 {
  font-size: 28px;
  border-bottom: 2px solid #eee;
  padding-bottom: 0.3em;
}

.single .summary h2 {
  font-size: 24px;
  border-bottom: 1px solid #eee;
  padding-bottom: 0.3em;
}

.single .summary h3 {
  font-size: 20px;
}

.single .summary h4 {
  font-size: 18px;
}

/* Lists */
.single .summary ul,
.single .summary ol {
  margin: 0 0 1.5em 0;
  padding-left: 2em;
  list-style-position: outside;
}

.single .summary li {
  margin: 0.5em 0;
}

.single .summary li>ul,
.single .summary li>ol {
  margin: 0.5em 0;
}

/* Blockquotes */
.single .summary blockquote {
  margin: 1.5em 0;
  padding: 1em 1.5em;
  background: #f9fafb;
  border-left: 4px solid #0a7;
  color: #555;
  font-style: italic;
}

.single .summary blockquote p:last-child {
  margin-bottom: 0;
}

/* Code Blocks */
.single .summary pre {
  margin: 1.5em 0;
  padding: 1em;
  background: #f3f4f6;
  border-radius: 6px;
  overflow-x: auto;
  font-family: Consolas, Monaco, 'Courier New', monospace;
  font-size: 14px;
  line-height: 1.5;
  color: #333;
}

.single .summary code {
  padding: 0.2em 0.4em;
  background: #f3f4f6;
  border-radius: 4px;
  font-family: Consolas, Monaco, 'Courier New', monospace;
  font-size: 90%;
  color: #d63384;
}

.single .summary pre code {
  padding: 0;
  background: transparent;
  color: inherit;
  border-radius: 0;
}

/* Images */
.single .summary img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1.5em auto;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* Tables */
.single .summary table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
  font-size: 15px;
}

.single .summary table th,
.single .summary table td {
  padding: 0.75em 1em;
  border: 1px solid #e5e7eb;
}

.single .summary table thead th {
  background: #f9fafb;
  font-weight: 600;
  text-align: left;
}

.single .summary table tbody tr:nth-child(even) {
  background: #f9f9f9;
}

.single .summary table tbody tr:hover {
  background: #f3f4f6;
}

/* Links */
.single .summary a {
  color: #0a7;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}

.single .summary a:hover {
  border-bottom-color: #0a7;
}

/* Horizontal Rule */
.single .summary hr {
  height: 1px;
  background: #e5e7eb;
  border: none;
  margin: 2em 0;
}

/* =========================================
   Related Articles Beautification
   ========================================= */

.related-posts {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px dashed #eee;
}

.related-posts h3 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 16px;
  padding-left: 10px;
  border-left: 4px solid #0a7;
  line-height: 1.2;
}

.related-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 768px) {
  .related-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.related-item {
  background: #fff;
  border: 1px solid #f0f0f0;
  border-radius: 8px;
  padding: 12px 16px;
  transition: all 0.2s ease;
  display: flex;
  align-items: flex-start;
  /* Align to top for multi-line */
  min-width: 0;
}

.related-item:hover {
  border-color: #0a7;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.1);
  transform: translateY(-2px);
}

.related-item a {
  display: block;
  color: #333;
  text-decoration: none;
  font-size: 15px;
  line-height: 1.5;
  /* Improve readability */
  white-space: normal;
  /* Allow wrapping */
  flex: 1;
  min-width: 0;
}

.related-item:hover a {
  color: #0a7;
}

.related-item::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  background: #ccc;
  border-radius: 50%;
  margin-right: 10px;
  flex-shrink: 0;
  transition: background 0.2s;
  margin-top: 9px;
  /* Align with first line of text */
}

.related-item:hover::before {
  background: #0a7;
}