/* 免费工具站：左右应用壳布局 —— 左侧固定边栏 + 右侧主面板，占满整个浏览器宽度，不留中间窄栏。 */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; overflow: hidden; }
body { font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; color: #1f2937; background: #f3f5f9; line-height: 1.6; }
svg { display: block; }

/* ---------- 应用壳：左右占满全宽 ---------- */
.app { display: flex; width: 100%; height: 100vh; height: 100dvh; overflow: hidden; }
.main { flex: 1; min-width: 0; height: 100vh; height: 100dvh; overflow-y: auto; background: linear-gradient(180deg, #e8edf5 0%, #f3f5f9 260px, #f3f5f9 100%); }
.views { padding: 4px 28px 28px; }
.view { display: none; }
.view.active { display: block; animation: fadein .18s ease; }
@keyframes fadein { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---------- 左侧边栏：深藏青 ---------- */
.sidebar { flex: 0 0 284px; width: 284px; height: 100vh; height: 100dvh; background: #0e2a47; color: #c7d2e0; display: flex; flex-direction: column; overflow-y: auto; }
.side-brand { display: flex; gap: 12px; align-items: center; padding: 18px 18px 14px; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.logo-tile { width: 44px; height: 44px; border-radius: 12px; background: linear-gradient(135deg, #4f46e5, #7c3aed); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; box-shadow: 0 4px 14px rgba(79, 70, 229, .45); }
.logo-tile svg { width: 26px; height: 26px; }
.side-brand-name { font-size: 19px; font-weight: 800; color: #fff; line-height: 1.3; }
.side-brand-sub { font-size: 12px; color: #8fa8c0; }
.side-search { padding: 14px 16px 4px; }
.search-box { display: flex; align-items: center; gap: 8px; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .16); border-radius: 999px; padding: 8px 14px; }
.search-box:focus-within { border-color: #818cf8; background: rgba(255, 255, 255, .14); }
.search-box .search-ic { display: inline-flex; color: #93b4d4; flex-shrink: 0; }
.search-box .search-ic svg { width: 16px; height: 16px; }
.search-box input { flex: 1; min-width: 0; background: transparent; border: none; outline: none; color: #fff; font-size: 14px; padding: 0; }
.search-box input::placeholder { color: #7e9ab5; }
.side-nav { flex: 1; padding: 6px 12px 12px; }
.side-group-title { font-size: 12px; color: #7e9ab5; padding: 14px 10px 6px; letter-spacing: 2px; }
.side-cat { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: #c7d2e0; padding: 10px 10px 4px; }
.side-cat .dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.dot-video { background: #ef4444; } .dot-image { background: #3b82f6; } .dot-music { background: #a78bfa; }
.dot-ai { background: #f59e0b; } .dot-media { background: #10b981; } .dot-web { background: #94a3b8; }
.side-item { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: transparent; border: none; color: #c7d2e0; font-size: 14px; padding: 8px 10px; border-radius: 9px; cursor: pointer; font-family: inherit; }
.side-item:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.side-item.active { background: linear-gradient(135deg, #4f46e5, #7c3aed); color: #fff; box-shadow: 0 2px 10px rgba(79, 70, 229, .4); }
.side-item .ic { width: 30px; height: 30px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; background: rgba(255, 255, 255, .1); color: #dbeafe; }
.side-item .ic svg { width: 17px; height: 17px; }
.side-item.active .ic { background: rgba(255, 255, 255, .22); color: #fff; }
.side-item[data-cat="视频工具"] .ic { background: rgba(220, 38, 38, .25); color: #fca5a5; }
.side-item[data-cat="图片工具"] .ic { background: rgba(37, 99, 235, .25); color: #bfdbfe; }
.side-item[data-cat="音乐工具"] .ic { background: rgba(124, 58, 237, .28); color: #ddd6fe; }
.side-item[data-cat="AI 工具"] .ic { background: rgba(217, 119, 6, .25); color: #fde68a; }
.side-item[data-cat="自媒体工具"] .ic { background: rgba(5, 150, 105, .25); color: #a7f3d0; }
.side-item[data-cat="建站工具"] .ic { background: rgba(100, 116, 139, .3); color: #e2e8f0; }
.side-foot { padding: 12px 16px; font-size: 12px; color: #7e9ab5; border-top: 1px solid rgba(255, 255, 255, .08); line-height: 1.5; }
.side-overlay { display: none; }

/* ---------- 主面板顶栏 ---------- */
.mainbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 12px 28px; background: rgba(255, 255, 255, .94); border-bottom: 1px solid #e5e9f0; }
.hamburger { display: none; align-items: center; justify-content: center; width: 36px; height: 36px; border: 1px solid #d1d5db; background: #fff; border-radius: 9px; cursor: pointer; color: #374151; flex-shrink: 0; }
.hamburger svg { width: 20px; height: 20px; }
.mainbar-title { font-size: 18px; font-weight: 800; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge { margin-left: auto; font-size: 12px; background: #eef2ff; color: #4338ca; border: 1px solid #c7d2fe; border-radius: 999px; padding: 2px 10px; white-space: nowrap; }
.badge.ok { background: #dcfce7; color: #166534; border-color: #86efac; }

/* ---------- hero：靛蓝 → 紫渐变 + 装饰 SVG ---------- */
.hero { position: relative; overflow: hidden; padding: 30px 28px 22px; margin-top: 20px; border-radius: 18px; background: linear-gradient(135deg, #3730a3 0%, #4f46e5 45%, #7c3aed 100%); color: #fff; box-shadow: 0 8px 28px rgba(79, 70, 229, .28); }
.hero .deco { position: absolute; right: 6px; top: 0; bottom: 0; width: 340px; opacity: .16; pointer-events: none; }
.hero .deco svg { width: 100%; height: 100%; }
.hero h1 { position: relative; font-size: 38px; margin: 0 0 8px; color: #fff; }
.hero p { position: relative; max-width: 760px; color: #e0e7ff; }
.hl { color: #fde68a; }
.hero .hint { color: #c7d2fe; }
.stats { position: relative; display: flex; gap: 10px; flex-wrap: wrap; margin: 14px 0 4px; }
.stats span { background: #fff; border: 1px solid #e5e9f0; border-radius: 10px; padding: 8px 14px; font-size: 13px; color: #4b5563; box-shadow: 0 1px 4px rgba(15, 23, 42, .08); }
.stats span b { font-size: 18px; color: #4338ca; margin-right: 2px; }
.rule { position: relative; color: #92400e; background: #fef3c7; border: 1px solid #fcd34d; border-radius: 8px; padding: 8px 12px; }

/* ---------- 分区标题：图标 + 左侧色块 ---------- */
h2 { font-size: 24px; border-left: 5px solid #4f46e5; border-bottom: 2px solid #e0e7ff; padding: 2px 0 6px 12px; margin-top: 36px; }
h2 .h-ic { display: inline-flex; vertical-align: -3px; margin-right: 8px; color: #4f46e5; }
h2 .h-ic svg { width: 22px; height: 22px; }
h3 { margin-top: 0; }
.hint { color: #6b7280; font-size: 14px; }
.cost { color: #6b7280; font-size: 13px; background: #f3f4f6; border-radius: 8px; padding: 8px 12px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 14px; }
.chips button { border: 1px solid #d1d5db; background: #fff; border-radius: 999px; padding: 6px 14px; cursor: pointer; font-size: 14px; font-family: inherit; }
.chips button:hover { border-color: #4f46e5; color: #4338ca; }
.chips button.active { background: #4f46e5; color: #fff; border-color: #4f46e5; }
.back-link { margin-top: 20px; background: #fff; border: 1px solid #d1d5db; border-radius: 999px; padding: 6px 14px; cursor: pointer; font-size: 14px; font-family: inherit; color: #4338ca; }
.back-link:hover { border-color: #4f46e5; }

/* ---------- 按钮：靛蓝 → 紫渐变 ---------- */
.wall-btn { background: linear-gradient(135deg, #4f46e5, #7c3aed); color: #fff; border: none; border-radius: 8px; padding: 6px 14px; cursor: pointer; font-size: 14px; box-shadow: 0 2px 8px rgba(79, 70, 229, .35); }
.wall-btn:hover { background: linear-gradient(135deg, #4338ca, #6d28d9); box-shadow: 0 4px 12px rgba(79, 70, 229, .45); }

/* ---------- 热门榜：前三金 / 银 / 铜 ---------- */
.rank-list { list-style: none; padding: 0; margin: 0; background: #fff; border: 1px solid #e5e9f0; border-radius: 12px; overflow: hidden; box-shadow: 0 1px 3px rgba(15, 23, 42, .06), 0 4px 14px rgba(15, 23, 42, .05); }
.rank-list li { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid #f1f5f9; font-size: 14px; }
.rank-list li:last-child { border-bottom: none; }
.rank-list .rank { width: 22px; height: 22px; border-radius: 50%; background: #475569; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; flex-shrink: 0; }
.rank-list li:nth-child(1) .rank { background: linear-gradient(135deg, #f59e0b, #b45309); box-shadow: 0 0 0 2px #fef3c7; }
.rank-list li:nth-child(2) .rank { background: linear-gradient(135deg, #94a3b8, #475569); box-shadow: 0 0 0 2px #e2e8f0; }
.rank-list li:nth-child(3) .rank { background: linear-gradient(135deg, #d97706, #9a3412); box-shadow: 0 0 0 2px #ffedd5; }
.rank-list li:nth-child(1) { background: linear-gradient(90deg, #fffbeb, #fff); }
.rank-list li:nth-child(2) { background: linear-gradient(90deg, #f8fafc, #fff); }
.rank-list li:nth-child(3) { background: linear-gradient(90deg, #fff7ed, #fff); }
.rank-list li.note { color: #6b7280; font-size: 12px; justify-content: center; }
.rank-list button { margin-left: auto; background: linear-gradient(135deg, #4f46e5, #7c3aed); border: none; border-radius: 999px; padding: 4px 12px; cursor: pointer; font-size: 12px; color: #fff; flex-shrink: 0; }
.rank-list button:hover { background: linear-gradient(135deg, #4338ca, #6d28d9); }

.card .steps { white-space: pre-wrap; }
#tool-tabs { display: none; }
.panel { background: #fff; border: 1px solid #e5e9f0; border-radius: 12px; padding: 18px; margin-bottom: 16px; box-shadow: 0 1px 3px rgba(15, 23, 42, .06), 0 4px 14px rgba(15, 23, 42, .05); }
.form { display: flex; flex-direction: column; gap: 10px; margin: 12px 0; }
.form label { font-size: 14px; display: flex; flex-direction: column; gap: 4px; }
.form input, .form select { padding: 8px 10px; border: 1px solid #d1d5db; border-radius: 8px; font-size: 14px; }
.form input:focus, .form select:focus { outline: none; border-color: #4f46e5; box-shadow: 0 0 0 3px rgba(79, 70, 229, .15); }
.form .row { display: flex; gap: 10px; flex-wrap: wrap; }
.form .row label { flex: 1; min-width: 90px; }
.form button { align-self: flex-start; background: linear-gradient(135deg, #4f46e5, #7c3aed); color: #fff; border: none; border-radius: 8px; padding: 9px 20px; font-size: 15px; cursor: pointer; box-shadow: 0 2px 8px rgba(79, 70, 229, .35); }
.form button:hover { background: linear-gradient(135deg, #4338ca, #6d28d9); }
.result { font-size: 14px; }
.result .ok-box { background: #f0fdf4; border: 1px solid #86efac; border-radius: 8px; padding: 10px 12px; margin: 8px 0; }
.result .err-box { background: #fef2f2; border: 1px solid #fca5a5; border-radius: 8px; padding: 10px 12px; margin: 8px 0; white-space: pre-wrap; }
.result a { color: #4338ca; }
.result pre { background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 8px; padding: 8px; overflow: auto; max-height: 220px; font-size: 12px; }
.result img.thumb { max-width: 160px; border-radius: 8px; display: block; margin: 8px 0; }

/* ---------- 卡片网格：宽屏 4 列，随宽度递减；卡片带图标 ---------- */
.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 1500px) { .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1150px) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .cards { grid-template-columns: minmax(0, 1fr); } }
.card { background: #fff; border: 1px solid #e5e9f0; border-top: 3px solid #cbd5e1; border-radius: 12px; padding: 14px 16px; box-shadow: 0 1px 3px rgba(15, 23, 42, .06), 0 4px 14px rgba(15, 23, 42, .05); transition: transform .18s ease, box-shadow .18s ease; min-width: 0; }
.card:hover { transform: translateY(-3px); box-shadow: 0 4px 8px rgba(15, 23, 42, .08), 0 12px 28px rgba(15, 23, 42, .12); }
.card[data-cat="视频工具"] { border-top-color: #dc2626; }
.card[data-cat="图片工具"] { border-top-color: #2563eb; }
.card[data-cat="音乐工具"] { border-top-color: #7c3aed; }
.card[data-cat="AI 工具"] { border-top-color: #d97706; }
.card[data-cat="自媒体工具"] { border-top-color: #059669; }
.card[data-cat="建站工具"] { border-top-color: #475569; }
.card-head { display: flex; gap: 10px; align-items: center; }
.card-head h3 { margin: 0; }
.card-ic { width: 40px; height: 40px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; color: #fff; flex-shrink: 0; background: #64748b; }
.card-ic svg { width: 22px; height: 22px; }
.card-ic.cat-video { background: linear-gradient(135deg, #ef4444, #b91c1c); }
.card-ic.cat-image { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.card-ic.cat-music { background: linear-gradient(135deg, #8b5cf6, #6d28d9); }
.card-ic.cat-ai { background: linear-gradient(135deg, #f59e0b, #b45309); }
.card-ic.cat-media { background: linear-gradient(135deg, #10b981, #047857); }
.card-ic.cat-web { background: linear-gradient(135deg, #64748b, #334155); }
.card h3 { font-size: 17px; }
.card .sell { color: #4338ca; font-weight: 700; font-size: 14px; margin: 2px 0; }
.tag-cloud { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 10px 0 4px; }
.tag-cloud-label { font-size: 13px; color: #c7d2fe; }
.tag-cloud button { border: 1px solid rgba(255, 255, 255, .55); background: rgba(255, 255, 255, .16); color: #fff; border-radius: 999px; padding: 3px 12px; cursor: pointer; font-size: 13px; font-family: inherit; }
.tag-cloud button:hover { background: rgba(255, 255, 255, .32); border-color: #fff; }
.card .tag { display: inline-block; font-size: 12px; background: #dcfce7; color: #166534; border-radius: 999px; padding: 1px 8px; margin-right: 6px; }
.card .tag.warn { background: #fef3c7; color: #92400e; }
.card .tag.cat-video { background: #fee2e2; color: #991b1b; }
.card .tag.cat-image { background: #dbeafe; color: #1e40af; }
.card .tag.cat-music { background: #ede9fe; color: #5b21b6; }
.card .tag.cat-ai { background: #fef3c7; color: #92400e; }
.card .tag.cat-media { background: #dcfce7; color: #166534; }
.card .tag.cat-web { background: #e2e8f0; color: #334155; }
.card p { margin: 6px 0; font-size: 14px; overflow-wrap: break-word; }
.card a { color: #4338ca; }
.card .meta { color: #6b7280; font-size: 12px; }
.chat { background: #fff; border: 1px solid #e5e9f0; border-radius: 12px; padding: 14px; box-shadow: 0 1px 3px rgba(15, 23, 42, .06), 0 4px 14px rgba(15, 23, 42, .05); }
.chat-log { min-height: 120px; max-height: 320px; overflow: auto; display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.msg { padding: 8px 12px; border-radius: 10px; max-width: 90%; white-space: pre-wrap; font-size: 14px; overflow-wrap: break-word; }
.msg.user { background: #e0e7ff; align-self: flex-end; }
.msg.ai { background: #f3f4f6; align-self: flex-start; }
.chat-form { flex-direction: row; }
.chat-form input { flex: 1; }
footer { color: #6b7280; font-size: 13px; padding: 28px 28px 40px; }

/* ---------- 手机：边栏收成抽屉，单列 ---------- */
@media (max-width: 900px) {
  .sidebar { position: fixed; left: 0; top: 0; z-index: 60; transform: translateX(-105%); transition: transform .22s ease; box-shadow: 0 0 40px rgba(0, 0, 0, .35); }
  .sidebar.open { transform: translateX(0); }
  .side-overlay.show { display: block; position: fixed; inset: 0; background: rgba(15, 23, 42, .5); z-index: 55; }
  .hamburger { display: inline-flex; }
  .views { padding: 4px 14px 20px; }
  .mainbar { padding: 10px 14px; }
  .hero { padding: 22px 18px; margin-top: 12px; }
  .hero h1 { font-size: 28px; }
  .hero .deco { display: none; }
  footer { padding: 24px 14px 32px; }
}
