* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { -webkit-tap-highlight-color: transparent; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: linear-gradient(180deg, #E8F0FF 0%, #EEF2FB 45%, #F4F6FB 100%);
  min-height: 100vh;
  color: #2C3E50;
  padding-bottom: 86px;
  max-width: 480px;
  margin: 0 auto;
  -webkit-font-smoothing: antialiased;
}

/* 顶部栏 */
.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 18px 6px;
}
.logo-area { display: flex; align-items: center; gap: 10px; }
.logo-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, #4ECCA3, #3DB892);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 10px rgba(78, 204, 163, 0.35);
}
.top h1 { font-size: 19px; font-weight: 700; color: #2C3E50; letter-spacing: 0.5px; }
.top-actions { display: flex; gap: 8px; }
.icon-btn {
  width: 30px; height: 30px;
  border: none;
  background: rgba(255,255,255,0.7);
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  color: #6B7C8C;
}

.subtitle {
  text-align: center;
  font-size: 12.5px;
  color: #7C8A9C;
  padding: 6px 20px 16px;
  letter-spacing: 0.3px;
}

.wrap { padding: 0 14px; }

/* 卡片通用 */
.input-card, .guide-card, .result-card, .me-card, .tool-list {
  background: rgba(255,255,255,0.96);
  border-radius: 18px;
  padding: 18px 16px;
  box-shadow: 0 4px 18px rgba(70, 100, 140, 0.06);
  margin-bottom: 14px;
}

/* 输入卡片 */
#linkInput {
  width: 100%;
  min-height: 90px;
  border: 1.5px solid #E2EAF2;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14.5px;
  resize: none;
  outline: none;
  font-family: inherit;
  background: #F8FBFD;
  color: #2C3E50;
  line-height: 1.5;
}
#linkInput::placeholder { color: #A8B6C8; }
#linkInput:focus { border-color: #4ECCA3; background: #fff; }

.action-row {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  align-items: stretch;
}
.btn-ghost {
  flex: 0.9;
  height: 42px;
  border: none;
  background: #EEF2F7;
  border-radius: 21px;
  font-size: 13.5px;
  color: #5A6B7C;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.btn-ghost:active { background: #E2E8F0; }
.btn-primary {
  flex: 2.2;
  height: 42px;
  border: none;
  background: linear-gradient(135deg, #4ECCA3, #3DB892);
  border-radius: 21px;
  font-size: 14.5px;
  color: white;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(78, 204, 163, 0.3);
  letter-spacing: 1px;
}
.btn-primary:active { transform: translateY(1px); box-shadow: 0 2px 6px rgba(78,204,163,0.3); }

.status {
  font-size: 12.5px;
  text-align: center;
  margin-top: 10px;
  min-height: 18px;
  color: #7C8A9C;
}
.status.err { color: #E57373; }
.status.ok { color: #3DB892; }

/* 结果卡片 */
.rtitle {
  font-size: 13.5px;
  color: #2C3E50;
  margin-bottom: 10px;
  word-break: break-all;
  line-height: 1.4;
  max-height: 2.8em;
  overflow: hidden;
}
.result-card video {
  width: 100%;
  border-radius: 10px;
  background: #000;
  margin-bottom: 12px;
  max-height: 320px;
}
.dl-btn {
  display: block;
  text-align: center;
  height: 44px;
  line-height: 44px;
  background: linear-gradient(135deg, #4ECCA3, #3DB892);
  color: white !important;
  text-decoration: none;
  border-radius: 22px;
  font-weight: 600;
  font-size: 14.5px;
  box-shadow: 0 4px 12px rgba(78, 204, 163, 0.3);
  letter-spacing: 1px;
}
.cand { margin-top: 12px; font-size: 12.5px; color: #7C8A9C; }
.cand summary { cursor: pointer; padding: 6px 0; }
.cand ul { list-style: none; margin-top: 6px; padding-left: 0; }
.cand li { margin-bottom: 5px; }
.cand a { color: #4ECCA3; text-decoration: none; word-break: break-all; font-size: 12px; }

.hidden { display: none !important; }

/* 使用指南 */
.guide-card h2 {
  font-size: 15.5px;
  color: #2C3E50;
  margin-bottom: 14px;
  font-weight: 600;
}
.guide-card ol { list-style: none; }
.guide-card li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}
.guide-card li:last-child { margin-bottom: 0; }
.guide-card .num {
  width: 24px; height: 24px;
  background: linear-gradient(135deg, #4ECCA3, #3DB892);
  color: white;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600;
  flex-shrink: 0;
  margin-top: 1px;
}
.guide-card li b {
  font-size: 14.5px;
  color: #2C3E50;
  display: block;
  margin-bottom: 3px;
}
.guide-card li p { font-size: 12.5px; color: #7C8A9C; line-height: 1.5; }

/* 功能区 */
.features {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
.feat {
  background: rgba(255,255,255,0.96);
  border-radius: 14px;
  padding: 14px 6px;
  text-align: center;
  box-shadow: 0 2px 10px rgba(70,100,140,0.05);
}
.feat-icon {
  display: block;
  font-size: 20px;
  margin-bottom: 6px;
  color: #3DB892;
}
.feat span:last-child { font-size: 11.5px; color: #5A6B7C; }

.footer-tip {
  text-align: center;
  font-size: 11.5px;
  color: #9AA8BC;
  padding: 10px 20px 6px;
  line-height: 1.5;
}

/* 底部 tab */
.tabbar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  max-width: 480px;
  margin: 0 auto;
  background: rgba(255,255,255,0.98);
  display: flex;
  border-top: 1px solid #E8EEF6;
  padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
  backdrop-filter: blur(8px);
  z-index: 10;
}
.tabbar .tab {
  flex: 1;
  text-align: center;
  text-decoration: none;
  color: #A0B0C0;
  font-size: 11px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 4px 0;
  border: none;
  background: transparent;
  font-family: inherit;
  cursor: pointer;
}
.tabbar .tab:active { transform: scale(0.96); }
.tabbar .tab.active { color: #3DB892; }
.tabbar .tab-icon { font-size: 22px; line-height: 1; }

/* 工具列表页 */
.tool-list { padding: 8px; }
.tool-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 10px;
  text-decoration: none;
  color: inherit;
  border-radius: 12px;
}
.tool-item:not(:last-child) { border-bottom: 1px solid #F0F4F8; }
.tool-item:active { background: #F5F8FC; }
.tool-item.disabled { opacity: 0.55; }
.tool-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.tool-info { flex: 1; min-width: 0; }
.tool-info h3 { font-size: 14.5px; color: #2C3E50; font-weight: 600; margin-bottom: 2px; }
.tool-info p { font-size: 12px; color: #7C8A9C; }
.tool-arrow { color: #C0CAD8; font-size: 22px; }

/* 我的页 */
.me-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid #F0F4F8;
  margin-bottom: 14px;
}
.me-avatar {
  width: 52px; height: 52px;
  background: linear-gradient(135deg, #4ECCA3, #3DB892);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
}
.me-head h3 { font-size: 16px; color: #2C3E50; font-weight: 600; margin-bottom: 4px; }
.me-ver { font-size: 12px; color: #7C8A9C; }
.me-list { list-style: none; }
.me-list li {
  display: flex;
  justify-content: space-between;
  padding: 9px 0;
  font-size: 13.5px;
  border-bottom: 1px solid #F4F7FB;
}
.me-list li:last-child { border-bottom: none; }
.me-list span { color: #7C8A9C; }
.me-list b { color: #2C3E50; font-weight: 500; }
.me-h3 { font-size: 14.5px; color: #2C3E50; font-weight: 600; margin-bottom: 10px; }
.me-text { font-size: 12.5px; color: #5A6B7C; line-height: 1.7; }

/* 大屏适配 */
@media (min-width: 481px) {
  body {
    border-left: 1px solid #E8EEF6;
    border-right: 1px solid #E8EEF6;
    box-shadow: 0 0 30px rgba(0,0,0,0.04);
  }
}

/* ===== 新版本：单页 · 分段标签 · 处理面板 ===== */
.logo-img {
  width: 36px; height: 36px;
  border-radius: 10px;
  box-shadow: 0 4px 10px rgba(78, 138, 210, 0.3);
  display: block;
}
.top-actions { display: flex; gap: 8px; }

/* 分段标签栏（可横滑） */
.segbar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 14px 14px;
  scrollbar-width: none;
}
.segbar::-webkit-scrollbar { display: none; }
.seg {
  flex: 0 0 auto;
  border: 1.5px solid #E2EAF2;
  background: #fff;
  border-radius: 20px;
  padding: 9px 15px;
  font-size: 13.5px;
  color: #5A6B7C;
  cursor: pointer;
  display: flex; align-items: center; gap: 5px;
  white-space: nowrap;
  transition: all .15s ease;
}
.seg .seg-ico { font-size: 15px; }
.seg.active {
  background: linear-gradient(135deg, #5B8DEF, #3DB892);
  border-color: transparent;
  color: #fff;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(78, 138, 210, 0.28);
}

/* 面板 */
.panel { display: none; }
.panel.active { display: block; animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.card {
  background: rgba(255,255,255,0.96);
  border-radius: 18px;
  padding: 18px 16px;
  box-shadow: 0 4px 18px rgba(70, 100, 140, 0.06);
  margin-bottom: 12px;
}

/* 文件选择框 */
.filebox {
  display: flex; align-items: center; gap: 10px;
  border: 1.5px dashed #C7D4E4;
  border-radius: 12px;
  padding: 16px 14px;
  cursor: pointer;
  color: #5A6B7C;
  font-size: 13.5px;
  margin-bottom: 14px;
  background: #F8FBFD;
  transition: border-color .15s;
}
.filebox:active { border-color: #5B8DEF; }
.filebox input[type=file] { display: none; }
.filebox.has-file { border-style: solid; border-color: #3DB892; color: #2C3E50; background: #F2FBF7; }

/* 表单字段 */
.field { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.field > label { width: 64px; flex-shrink: 0; font-size: 13px; color: #5A6B7C; }
.field select, .field input {
  flex: 1;
  height: 42px;
  border: 1.5px solid #E2EAF2;
  border-radius: 12px;
  padding: 0 12px;
  font-size: 14px;
  background: #F8FBFD;
  color: #2C3E50;
  outline: none;
  font-family: inherit;
}
.field select:focus, .field input:focus { border-color: #5B8DEF; background: #fff; }

/* 自定义裁剪网格 */
.custom-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 12px; }
.custom-grid > div { display: flex; align-items: center; gap: 8px; }
.custom-grid label { width: 18px; font-size: 13px; color: #5A6B7C; }
.custom-grid input {
  flex: 1; min-width: 0;
  height: 40px; border: 1.5px solid #E2EAF2; border-radius: 10px;
  padding: 0 10px; font-size: 14px; background: #F8FBFD; outline: none; font-family: inherit;
}
.custom-grid input:focus { border-color: #5B8DEF; background: #fff; }

/* 按钮通用（扩展） */
.btn-primary.block { width: 100%; margin-top: 4px; flex: none; }
.btn-primary:disabled { opacity: .5; box-shadow: none; cursor: not-allowed; }

/* 进度条 */
.prog { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.prog .bar { flex: 1; height: 8px; background: #EAF0F7; border-radius: 6px; overflow: hidden; }
.prog .bar i { display: block; height: 100%; width: 0; background: linear-gradient(135deg, #5B8DEF, #3DB892); border-radius: 6px; transition: width .2s; }
.prog span { font-size: 12px; color: #7C8A9C; min-width: 42px; text-align: right; }

/* 下载按钮（处理面板用 hidden 控制显隐） */
.dl-btn.hidden { display: none; }
a.dl-btn.block, .dl-btn { margin-top: 12px; }

/* 预览（裁剪） */
.preview {
  position: relative;
  margin: 12px 0 4px;
  border-radius: 12px;
  overflow: hidden;
  background: #111;
  line-height: 0;
}
.preview.hidden { display: none; }
#cropCanvas { width: 100%; height: auto; display: block; }
.crop-rect {
  position: absolute;
  border: 2px dashed #FFD23F;
  box-shadow: 0 0 0 9999px rgba(0,0,0,0.45);
  box-sizing: border-box;
}
.preview-tag {
  position: absolute; left: 8px; bottom: 8px;
  background: rgba(0,0,0,0.6); color: #fff;
  font-size: 11px; padding: 2px 8px; border-radius: 8px; line-height: 1.5;
}

/* 提示行 */
.hint { text-align: center; font-size: 11.5px; color: #9AA8BC; padding: 4px 18px 8px; line-height: 1.5; }

/* 高级设置（链接面板） */
.adv { margin-top: 12px; border-top: 1px dashed #E3E8F0; padding-top: 10px; }
.adv summary { cursor: pointer; color: #5b6b86; font-size: 13px; }
.adv input {
  width: 100%; margin-top: 8px; padding: 10px;
  border: 1px solid #dbe2ec; border-radius: 10px; font-size: 14px;
  box-sizing: border-box; background: #F8FBFD; outline: none; font-family: inherit;
}
.adv input:focus { border-color: #5B8DEF; }
.adv-btns { display: flex; gap: 8px; margin-top: 8px; }
.adv-btns .btn-ghost { flex: 1; height: 38px; font-size: 13px; }
.adv-status { color: #3DB892; font-size: 12px; margin: 6px 0 0; }
.adv-tip { color: #9aa6ba; font-size: 12px; margin: 6px 0 0; line-height: 1.5; }

/* ===================== 三页布局 ===================== */
.page { display: none; }
.page.active { display: block; animation: pageIn .22s ease; }
@keyframes pageIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* 顶部小标签 */
.top-tag {
  font-size: 11px;
  color: #3DB892;
  background: #EAFaf4;
  border: 1px solid #CDEFE2;
  padding: 4px 10px;
  border-radius: 12px;
  font-weight: 600;
}

/* Hero 区 */
.hero {
  text-align: center;
  padding: 8px 14px 16px;
}
.hero-emoji {
  width: 66px; height: 66px;
  margin: 0 auto 10px;
  border-radius: 20px;
  background: linear-gradient(135deg, #5B8DEF, #3DB892);
  display: flex; align-items: center; justify-content: center;
  font-size: 34px;
  box-shadow: 0 8px 20px rgba(78, 138, 210, 0.32);
}
.hero-title { font-size: 22px; font-weight: 800; color: #2C3E50; letter-spacing: 0.5px; }
.hero-sub { font-size: 12.5px; color: #7C8A9C; margin-top: 8px; line-height: 1.6; }

/* 广告位预留样式（页面中已全部移除广告位，样式保留供后续自主接入）
   接入方式：在 index.html 中加
     <div class="ad-slot"><span class="ad-badge">AD</span><span class="ad-text">…</span></div> */
.ad-slot {
  display: flex; align-items: center; gap: 8px;
  margin: 0 0 14px;
  padding: 16px 14px;
  border: 1.5px dashed #C7D4E4;
  border-radius: 16px;
  background: repeating-linear-gradient(45deg, #FBFCFE, #FBFCFE 10px, #F4F8FC 10px, #F4F8FC 20px);
  color: #9AA8BC;
}
.ad-badge {
  font-size: 10px; font-weight: 700; letter-spacing: 1px;
  color: #fff; background: #B7C4D4;
  padding: 2px 7px; border-radius: 6px; flex-shrink: 0;
}
.ad-text { font-size: 12.5px; }

/* 区块标题 */
.sec-title { font-size: 16px; color: #2C3E50; font-weight: 700; margin-bottom: 14px; }
.sec-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.sec-head .sec-title { margin-bottom: 0; }
.link-btn {
  border: none; background: none; cursor: pointer;
  color: #5B8DEF; font-size: 13px; font-family: inherit; padding: 4px 6px;
}
.link-btn:active { opacity: .6; }

/* 工具卡小标题 */
.tool-h { font-size: 15.5px; color: #2C3E50; font-weight: 700; margin-bottom: 14px; }

/* 优点网格 */
.adv-card { margin-bottom: 14px; }
.adv-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.adv-item {
  display: flex; align-items: center; gap: 10px;
  background: #F7FAFD;
  border: 1px solid #EDF2F8;
  border-radius: 14px;
  padding: 12px 12px;
}
.adv-ico {
  width: 38px; height: 38px; flex-shrink: 0;
  border-radius: 11px;
  background: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  box-shadow: 0 2px 8px rgba(70,100,140,0.08);
}
.adv-txt { display: flex; flex-direction: column; min-width: 0; }
.adv-txt b { font-size: 13.5px; color: #2C3E50; margin-bottom: 2px; }
.adv-txt span { font-size: 11.5px; color: #7C8A9C; line-height: 1.4; }

/* 解析记录 */
.rec-list { display: flex; flex-direction: column; gap: 10px; }
.rec-list .empty { text-align: center; color: #9AA8BC; font-size: 13px; padding: 14px 0; }
.rec {
  border: 1px solid #EDF2F8;
  border-radius: 12px;
  padding: 10px 12px;
  background: #F9FBFD;
}
.rec-main {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
}
.rec-title {
  font-size: 13.5px; color: #2C3E50; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rec-meta { font-size: 11.5px; color: #9AA8BC; margin-top: 4px; }
.rec-meta .badge {
  display: inline-block; color: #3DB892; background: #EAFaf4;
  border-radius: 6px; padding: 1px 6px; margin-right: 6px; font-weight: 600;
}
.rec-actions { display: flex; gap: 6px; flex-shrink: 0; }
.rec-actions button {
  border: none; cursor: pointer; font-family: inherit;
  font-size: 12px; padding: 6px 10px; border-radius: 9px; white-space: nowrap;
}
.rec-copy { background: #EEF2F7; color: #5A6B7C; }
.rec-dl { background: linear-gradient(135deg, #5B8DEF, #3DB892); color: #fff; }
.rec-actions button:active { opacity: .7; }

/* 教程 */
.guide { list-style: none; }
.guide li { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.guide li:last-child { margin-bottom: 0; }
.guide .num {
  width: 24px; height: 24px;
  background: linear-gradient(135deg, #5B8DEF, #3DB892);
  color: white; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; flex-shrink: 0; margin-top: 1px;
}
.guide li b { font-size: 14px; color: #2C3E50; display: block; margin-bottom: 3px; }
.guide li p { font-size: 12.5px; color: #7C8A9C; line-height: 1.5; }

/* 联系客服 */
.contact { list-style: none; }
.contact li {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 0; border-bottom: 1px solid #F0F4F8;
}
.contact li:last-child { border-bottom: none; }
.c-label { font-size: 13.5px; color: #2C3E50; flex-shrink: 0; width: 86px; }
.c-val {
  flex: 1; min-width: 0;
  font-size: 13px; color: #5A6B7C;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.copy-btn {
  flex-shrink: 0; border: none; cursor: pointer; font-family: inherit;
  font-size: 12px; padding: 6px 12px; border-radius: 9px;
  background: linear-gradient(135deg, #5B8DEF, #3DB892); color: #fff;
}
.copy-btn:active { opacity: .7; }
.copy-btn.done { background: #3DB892; }
.contact-tip { font-size: 12px; color: #9AA8BC; margin-top: 10px; line-height: 1.5; }