/* ============================================================
   在线工具箱 - 全站公用样式
   ============================================================ */

:root {
  --primary: #0f766e;
  --primary-dark: #115e59;
  --primary-light: #ccfbf1;
  --bg: #f6f7f9;
  --card-bg: #ffffff;
  --text: #1f2937;
  --text-2: #6b7280;
  --text-3: #9ca3af;
  --border: #e5e7eb;
  --header-bg: #0f172a;
  --header-text: #e2e8f0;
  --danger: #dc2626;
  --success: #16a34a;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 4px 12px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 6px 24px rgba(15, 23, 42, 0.12);
  --cate-dev: #0ea5e9;
  --cate-encode: #10b981;
  --cate-text: #f59e0b;
  --cate-image: #f43f5e;
  --cate-calc: #0f766e;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: none;
}

img {
  max-width: 100%;
}

/* ========== 公用头部 ========== */
/* 固定层设在 #app-header 容器上：父级是 body（整页高度），
   滚动空间充足，滚动时头部始终钉在视口顶部 */
#app-header {
  position: sticky;
  top: 0;
  z-index: 1000;
}

.site-header {
  background: var(--header-bg);
  color: var(--header-text);
  box-shadow: 0 1px 3px rgba(2, 6, 23, 0.3), 0 4px 14px rgba(2, 6, 23, 0.2);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 28px;
  height: 60px;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.site-logo svg,
.site-logo img {
  display: block;
}

.site-logo:hover {
  color: #fff;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}

.header-nav::-webkit-scrollbar {
  display: none;
}

.header-nav a {
  color: #cbd5e1;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 14px;
  white-space: nowrap;
  transition: color 0.15s, background 0.15s;
}

.header-nav a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.header-nav a.active {
  color: #fff;
  background: var(--primary);
}

.header-nav .nav-home {
  font-weight: 600;
}

/* ========== 公用底部 ========== */
.site-footer {
  margin-top: auto;
  background: #0f172a;
  color: #94a3b8;
  font-size: 13px;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.footer-links a {
  color: #94a3b8;
  margin-left: 16px;
}

.footer-links a:hover {
  color: #fff;
}

/* ========== 首页 ========== */
.hero {
  background: linear-gradient(180deg, #e6f4f1 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--border);
  text-align: center;
  padding: 52px 20px 44px;
}

.hero h1 {
  font-size: 34px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: 1px;
}

.hero h1 em {
  font-style: normal;
  color: var(--primary);
}

.hero p {
  color: var(--text-2);
  margin-top: 10px;
  font-size: 15px;
}

.hero .hero-meta {
  margin-top: 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 16px;
  font-size: 13px;
  color: var(--text-2);
}

.hero .hero-meta b {
  color: var(--primary);
}

.main-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 20px 48px;
}

/* 首页搜索框 */
.search-bar {
  max-width: 600px;
  margin: 0 auto 22px;
  position: relative;
}

.search-bar input {
  width: 100%;
  height: 46px;
  padding: 0 20px 0 44px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  font-size: 15px;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  font-family: inherit;
}

.search-bar input::placeholder {
  color: var(--text-3);
}

.search-bar input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.search-bar .search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-3);
  pointer-events: none;
}

/* 分类筛选条（单行横向滚动 + 吸顶：跟随顶部导航，固定在导航下方） */
.cate-filter {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  padding: 8px 0 12px;
  margin: -8px 0 20px;
  position: sticky;
  top: var(--header-h, 60px);
  z-index: 900;
  background: var(--bg);
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}

.cate-filter::-webkit-scrollbar {
  height: 5px;
}

.cate-filter::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 999px;
}

.cate-filter::-webkit-scrollbar-track {
  background: transparent;
}

.cate-btn {
  flex: 0 0 auto;
  white-space: nowrap;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-2);
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}

.cate-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.cate-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 600;
}

.cate-btn .cate-count {
  opacity: 0.75;
  font-size: 12px;
  margin-left: 4px;
}

.cate-btn.active .cate-count {
  opacity: 0.85;
}

/* 工具网格 */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 16px;
}

.tool-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 18px;
  display: flex;
  gap: 14px;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  cursor: pointer;
}

.tool-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(15, 118, 110, 0.35);
}

.tool-icon {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

.tool-icon svg {
  width: 24px;
  height: 24px;
}

.tool-card-body {
  min-width: 0;
}

.tool-card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.tool-card-desc {
  font-size: 13px;
  color: var(--text-2);
  margin-top: 4px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tool-card-tag {
  display: inline-block;
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-3);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 8px;
}

/* 空态 */
.empty-tip {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 0;
  color: var(--text-3);
}

.empty-tip svg {
  margin: 0 auto 12px;
  display: block;
  opacity: 0.5;
}

/* ========== 工具页通用 ========== */
.page-wrap {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 20px 56px;
  flex: 1;
}

.breadcrumb {
  font-size: 13px;
  color: var(--text-3);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.breadcrumb a {
  color: var(--text-2);
}

.breadcrumb a:hover {
  color: var(--primary);
}

.breadcrumb .sep {
  color: var(--text-3);
}

.page-title {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 6px;
}

.page-desc {
  color: var(--text-2);
  font-size: 14px;
  margin-bottom: 22px;
}

.tool-box {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}

.form-row {
  margin-bottom: 16px;
}

.form-row:last-child {
  margin-bottom: 0;
}

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}

.form-label .optional {
  font-weight: 400;
  color: var(--text-3);
}

textarea.input-area,
input.input-area,
select.input-area {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: Consolas, "Courier New", "Microsoft YaHei", monospace;
  color: var(--text);
  background: #fff;
  resize: vertical;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input.input-area,
select.input-area {
  font-family: inherit;
  max-width: 420px;
}

textarea.input-area:focus,
input.input-area:focus,
select.input-area:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

textarea.input-area.code-area {
  min-height: 220px;
  line-height: 1.5;
}

.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.btn {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  border-radius: 8px;
  padding: 9px 18px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}

.btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 600;
}

.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  color: #fff;
}

.btn-secondary {
  background: var(--primary-light);
  border-color: transparent;
  color: var(--primary-dark);
}

.btn-secondary:hover {
  background: #99f6e4;
  color: var(--primary-dark);
}

.btn-danger {
  border-color: #fecaca;
  color: var(--danger);
}

.btn-danger:hover {
  background: #fef2f2;
  color: var(--danger);
  border-color: var(--danger);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.result-area {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #0f172a;
  color: #e2e8f0;
  padding: 14px;
  font-size: 13px;
  line-height: 1.55;
  font-family: Consolas, "Courier New", monospace;
  overflow: auto;
  min-height: 60px;
  max-height: 480px;
  white-space: pre-wrap;
  word-break: break-all;
}

.result-area.result-light {
  background: #f8fafc;
  border-color: var(--border);
  color: var(--text);
}

.result-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}

.result-row .result-value {
  font-family: Consolas, "Courier New", monospace;
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
}

.result-ok {
  color: var(--success);
  font-weight: 600;
}

.result-err {
  color: var(--danger);
  font-weight: 600;
}

.msg-tip {
  font-size: 13px;
  margin-top: 10px;
}

.msg-tip.ok {
  color: var(--success);
}

.msg-tip.err {
  color: var(--danger);
}

.hint {
  font-size: 12.5px;
  color: var(--text-3);
  margin-top: 10px;
  line-height: 1.7;
}

.hint code {
  background: #f1f5f9;
  border-radius: 4px;
  padding: 1px 6px;
  font-family: Consolas, monospace;
  font-size: 12px;
  color: var(--primary-dark);
}

.copy-btn {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 6px;
  padding: 4px 12px;
  font-size: 12.5px;
  cursor: pointer;
  color: var(--text-2);
  font-family: inherit;
  transition: all 0.15s;
}

.copy-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* 双栏工具（文本对比等） */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.two-col .col-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 6px;
}

.two-col textarea {
  min-height: 260px;
}

.diff-add {
  background: #dcfce7;
  color: #166534;
}

.diff-del {
  background: #fee2e2;
  color: #991b1b;
}

.diff-eq {
  color: var(--text-2);
}

.diff-line {
  display: block;
  white-space: pre-wrap;
  word-break: break-all;
}

/* 表格（单位换算等） */
.unit-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin-top: 8px;
}

.unit-table th,
.unit-table td {
  border: 1px solid var(--border);
  padding: 8px 12px;
  text-align: left;
}

.unit-table th {
  background: #f8fafc;
  font-weight: 600;
  white-space: nowrap;
}

.unit-table td input {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  padding: 4px 6px;
  border-radius: 6px;
  font-size: 14px;
  font-family: Consolas, monospace;
  color: var(--text);
  outline: none;
}

.unit-table td input:focus {
  border-color: var(--primary);
  background: #fff;
}

.unit-table td input:disabled {
  color: var(--text-2);
}

.unit-select {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  outline: none;
  max-width: 420px;
  width: 100%;
}

.unit-select:focus {
  border-color: var(--primary);
}

/* 颜色工具 */
.color-preview {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 8px;
}

.color-swatch {
  width: 72px;
  height: 72px;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  flex: 0 0 auto;
}

.color-formats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.color-format-item {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.color-format-item .fmt-name {
  font-size: 13px;
  color: var(--text-2);
  font-weight: 600;
}

.color-format-item .fmt-value {
  font-family: Consolas, monospace;
  font-size: 13.5px;
  word-break: break-all;
}

input[type="color"].color-input {
  width: 56px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  padding: 3px;
  cursor: pointer;
}

/* 密码生成强度条 */
.strength-bar {
  height: 8px;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
  margin-top: 8px;
}

.strength-bar i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  transition: width 0.3s, background 0.3s;
}

.strength-label {
  font-size: 13px;
  margin-top: 6px;
  color: var(--text-2);
}

/* 文件上传区 */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: 10px;
  padding: 36px 20px;
  text-align: center;
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.15s;
  font-size: 14px;
}

.drop-zone:hover,
.drop-zone.dragover {
  border-color: var(--primary);
  color: var(--primary);
  background: #f0fdfa;
}

.drop-zone .dz-icon {
  margin: 0 auto 10px;
  color: var(--text-3);
}

/* 密码工具 */
.password-display {
  display: flex;
  align-items: center;
  gap: 10px;
}

.password-display input {
  flex: 1;
}

.checkbox-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 14px;
  color: var(--text);
}

.checkbox-row label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.checkbox-row input[type="checkbox"] {
  accent-color: var(--primary);
  width: 15px;
  height: 15px;
}

/* 响应式 */
@media (max-width: 720px) {
  .hero {
    padding: 36px 16px 30px;
  }

  .hero h1 {
    font-size: 26px;
  }

  .header-inner {
    gap: 14px;
    padding: 0 14px;
  }

  .two-col {
    grid-template-columns: 1fr;
  }

  .tool-grid {
    grid-template-columns: 1fr;
  }

  .tool-box {
    padding: 16px;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }

  .footer-links a {
    margin: 0 8px;
  }
}

/* 减少动效偏好 */
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}

/* 二维码预览 */
.qr-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  padding: 20px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.qr-preview svg {
  max-width: 100%;
  height: auto;
  image-rendering: pixelated;
}

/* 滑块行 */
.range-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.range-row label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

.range-row input[type="range"] {
  flex: 1;
  min-width: 0;
  accent-color: var(--primary);
}

.range-row .range-val {
  min-width: 46px;
  text-align: right;
  font-size: 13px;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}

.btn:disabled,
input[type="range"]:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ========== 导航设置入口 / 汉堡菜单 ========== */
.header-inner {
  position: relative;
}

.nav-settings {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: 6px;
  border-left: 1px solid rgba(255, 255, 255, 0.14);
  background: none;
  border-top: none;
  border-right: none;
  border-bottom: none;
  color: #cbd5e1;
  font-family: inherit;
  font-size: 14px;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s, background 0.15s;
}

.nav-settings:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.nav-settings .nav-settings-ico {
  display: inline-flex;
  align-items: center;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 40px;
  height: 40px;
  padding: 8px;
  margin-left: auto;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  height: 2px;
  width: 100%;
  background: #e2e8f0;
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}

.header-inner.open .nav-toggle span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.header-inner.open .nav-toggle span:nth-child(2) {
  opacity: 0;
}

.header-inner.open .nav-toggle span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

@media (max-width: 900px) {
  .header-inner {
    gap: 12px;
  }

  .site-logo {
    font-size: 15.5px;
  }

  .nav-toggle {
    display: flex;
  }

  .header-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    background: var(--header-bg);
    padding: 10px 14px 16px;
    box-shadow: 0 12px 24px rgba(2, 6, 23, 0.35);
    overflow-y: auto;
    max-height: calc(100vh - var(--header-h, 60px));
  }

  .header-inner.open .header-nav {
    display: flex;
  }

  .header-nav a {
    padding: 10px 12px;
    font-size: 15px;
    border-radius: 8px;
  }

  .nav-settings {
    margin-left: 0;
    border-left: none;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    margin-top: 4px;
    padding-top: 10px;
    border-radius: 0;
    text-align: left;
  }
}

/* ========== 设置弹窗 ========== */
.settings-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.settings-modal {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 24px 64px rgba(2, 6, 23, 0.35);
  width: 100%;
  max-width: 620px;
  max-height: 84vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.settings-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--border);
  flex: 0 0 auto;
}

.settings-modal-title {
  font-size: 17px;
  font-weight: 800;
}

.settings-modal-close {
  width: 32px;
  height: 32px;
  border: none;
  background: #f1f5f9;
  color: var(--text-2);
  border-radius: 8px;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.settings-modal-close:hover {
  background: #fee2e2;
  color: var(--danger);
}

.settings-modal-body {
  padding: 18px 20px 8px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1 1 auto;
  min-height: 0;
}

.settings-modal-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px 16px;
  border-top: 1px solid var(--border);
  flex: 0 0 auto;
}

.settings-modal .settings-section {
  margin-bottom: 22px;
}

/* ========== 首页收藏按钮 ========== */
.tool-card {
  position: relative;
  padding-right: 58px;
}

.fav-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-3);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 11.5px;
  line-height: 1.7;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
  white-space: nowrap;
}

.fav-btn:hover {
  border-color: #f59e0b;
  color: #f59e0b;
}

.fav-btn.is-fav {
  background: #fffbeb;
  border-color: #fcd34d;
  color: #b45309;
  font-weight: 600;
}

/* 收藏分类按钮（首页分类条） */
.cate-btn-fav {
  border-color: #fcd34d;
  color: #b45309;
  background: #fffbeb;
}

.cate-btn-fav:hover {
  border-color: #f59e0b;
  color: #b45309;
}

.cate-btn-fav.active {
  background: #f59e0b;
  border-color: #f59e0b;
  color: #fff;
}

/* ========== 设置页 ========== */
.settings-section {
  margin-bottom: 28px;
}

.settings-section-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.settings-section-desc {
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 12px;
}

.setting-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}

.setting-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  background: #fff;
  font-size: 14px;
}

.setting-item .si-name {
  font-weight: 600;
  color: var(--text);
}

.setting-item .si-count {
  font-size: 12px;
  color: var(--text-3);
}

.setting-item input[type="checkbox"] {
  accent-color: var(--primary);
  width: 17px;
  height: 17px;
  cursor: pointer;
}

.setting-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}

.setting-toggle .st-text {
  font-size: 14px;
}

.setting-toggle .st-title {
  font-weight: 600;
}

.setting-toggle .st-desc {
  font-size: 12.5px;
  color: var(--text-2);
  margin-top: 2px;
}

.setting-toggle input[type="checkbox"] {
  accent-color: var(--primary);
  width: 17px;
  height: 17px;
  cursor: pointer;
  flex: 0 0 auto;
}

.setting-saved-tip {
  display: none;
  font-size: 13px;
  color: var(--success);
  margin-top: 10px;
}

.setting-saved-tip.show {
  display: block;
}

/* ========== 批量文件列表（图片压缩等） ========== */
.file-list {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fafc;
  overflow: hidden;
}

.file-list-empty {
  padding: 26px;
  text-align: center;
  color: var(--text-3);
  font-size: 13px;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: #fff;
}

.file-item:last-child {
  border-bottom: none;
}

.fi-thumb {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #f1f5f9;
  flex: 0 0 auto;
}

.fi-info {
  flex: 1;
  min-width: 0;
}

.fi-name {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fi-meta {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 2px;
}

.fi-status {
  font-size: 12.5px;
  color: var(--text-3);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.fi-status.ok {
  color: var(--success);
}

.fi-dl {
  padding: 5px 14px;
  font-size: 13px;
  flex: 0 0 auto;
}

/* ========== 播放器（视频/音乐） ========== */
.player-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 16px;
  align-items: start;
}

.player-stage {
  background: #0f172a;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}

.player-stage video {
  display: block;
  width: 100%;
  max-height: 480px;
  background: #000;
}

.player-stage audio {
  display: none;
}

.player-stage canvas#spectrum {
  display: block;
  width: 100%;
  height: 160px;
}

.track-name {
  position: absolute;
  left: 12px;
  bottom: 10px;
  color: #e2e8f0;
  font-size: 13px;
  background: rgba(2, 6, 23, 0.55);
  border-radius: 6px;
  padding: 3px 10px;
  max-width: 80%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-controls {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pc-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pc-btn {
  padding: 6px 14px;
  font-size: 14px;
}

.player-list {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 420px;
}

.pl-title {
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 700;
  border-bottom: 1px solid var(--border);
  background: #f8fafc;
  flex: 0 0 auto;
}

.pl-items {
  overflow-y: auto;
  flex: 1;
}

.pl-empty {
  padding: 26px;
  text-align: center;
  color: var(--text-3);
  font-size: 13px;
}

.pl-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.12s;
}

.pl-item:hover {
  background: #f8fafc;
}

.pl-item.active {
  background: var(--primary-light);
}

.pl-item.active .pl-name {
  color: var(--primary-dark);
  font-weight: 600;
}

.pl-name {
  flex: 1;
  min-width: 0;
  font-size: 13.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pl-del {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border: none;
  background: transparent;
  color: var(--text-3);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  border-radius: 6px;
}

.pl-del:hover {
  background: #fee2e2;
  color: #dc2626;
}

@media (max-width: 860px) {
  .player-layout {
    grid-template-columns: 1fr;
  }

  .player-list {
    max-height: 260px;
  }
}

/* ========== 倒计时 ========== */
.cd-inputs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 10px;
  max-width: 720px;
}

.cd-input {
  display: flex;
  align-items: center;
  gap: 6px;
}

.cd-input .input-area {
  max-width: none;
  flex: 1;
}

.cd-input span {
  font-size: 14px;
  color: var(--text-2);
  flex: 0 0 auto;
}

.cd-display {
  text-align: center;
  background: #0f172a;
  border-radius: 12px;
  padding: 30px 20px;
  transition: background 0.3s;
}

.cd-display.flash {
  animation: cd-flash 0.8s ease-in-out 6;
}

@keyframes cd-flash {
  0%, 100% { background: #0f172a; }
  50% { background: #dc2626; }
}

.cd-time {
  font-size: 52px;
  font-weight: 800;
  color: #f8fafc;
  font-variant-numeric: tabular-nums;
  letter-spacing: 1px;
  line-height: 1.2;
  word-break: break-all;
}

.cd-state {
  margin-top: 10px;
  font-size: 14px;
  color: var(--text-2);
}

@media (max-width: 720px) {
  .cd-time {
    font-size: 34px;
  }
}
