/* 下载视频提取器 · PWA 网页版样式（绿色主题，与小程序一致） */
:root {
  --green: #0CA55E;
  --green-light: #EAF6EF;
  --red: #E64340;
  --text: #333;
  --text2: #666;
  --text3: #999;
}
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: #F6F6F6; color: var(--text); font-size: 15px;
  -webkit-user-select: none; user-select: none;
}
input, textarea { -webkit-user-select: auto; user-select: auto; }
button { font-family: inherit; border: none; background: none; cursor: pointer; }

#app { max-width: 560px; margin: 0 auto; min-height: 100%; display: flex; flex-direction: column; }
@supports (padding: env(safe-area-inset-top)) {
  body { padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); }
}

/* 顶栏 */
.topbar {
  background: var(--green); color: #fff; padding: 12px 16px;
  display: flex; align-items: center; gap: 8px; position: sticky; top: 0; z-index: 10;
  min-height: 48px;
}
.topbar-title { flex: 1; text-align: center; font-weight: 700; font-size: 17px; }
.topbar-spacer { width: 28px; }
.back-btn { width: 28px; font-size: 26px; line-height: 1; color: #fff; font-weight: 300; padding: 0 4px 4px; }

.views { padding: 12px; padding-bottom: 32px; }
.view { padding: 12px; padding-bottom: 40px; }
[hidden] { display: none !important; }

/* 公告 */
.notice {
  background: #FDF6DC; border-radius: 8px; padding: 10px 14px; margin-bottom: 12px;
  color: #C88A2D; font-size: 14px; font-weight: 600; display: flex; gap: 6px; align-items: center;
}

/* 输入行 */
.input-row { display: flex; gap: 8px; align-items: stretch; }
.link-input {
  flex: 1; min-height: 52px; background: #F2FAF5; border: 1px solid #BFDFCB; border-radius: 8px;
  padding: 12px; font-size: 14px; resize: none; color: var(--text);
}
.btn-green {
  background: var(--green); color: #fff; border-radius: 8px; font-weight: 600; font-size: 15px;
  display: flex; align-items: center; justify-content: center; padding: 10px 16px;
}
.btn-green:active { opacity: .85; }
.btn-green[disabled] { background: rgba(12,165,94,.45); }
.btn-outline {
  background: #fff; color: var(--green); border: 1px solid var(--green); border-radius: 8px;
  font-weight: 600; font-size: 15px; display: flex; align-items: center; justify-content: center; padding: 10px 16px;
}
.btn-red-outline {
  background: #fff; color: var(--red); border: 1px solid #F0C1C0; border-radius: 8px;
  font-size: 14px; padding: 10px 16px;
}
.extract-btn { width: 96px; }
.paste-btn { width: 64px; }
.action-row { display: flex; gap: 12px; margin: 12px 0; }
.half { flex: 1; }

.disclaimer { text-align: center; color: var(--text3); font-size: 13px; margin: 14px 0 18px; }

/* 功能宫格 */
.feature-grid { display: flex; gap: 10px; }
.feature-item {
  flex: 1; background: var(--green); color: #fff; border-radius: 12px; padding: 16px 0;
  display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 13px; font-weight: 600;
  box-shadow: 0 3px 8px rgba(12,165,94,.25);
}
.f-ic { font-size: 24px; }

.pwa-install { text-align: center; color: var(--green); font-size: 13px; margin-top: 16px; }

/* 卡片与通用 */
.card { background: #fff; border-radius: 12px; padding: 16px; margin-bottom: 12px; }
.link-box {
  background: #F2FAF5; border: 1px solid #BFDFCB; border-radius: 8px; padding: 12px;
  font-size: 14px; word-break: break-all; margin-top: 4px; -webkit-user-select: all; user-select: all;
}

/* Tabs */
.tabs { display: flex; border-bottom: 1px solid #F0F0F0; margin-bottom: 12px; }
.tab { flex: 1; padding: 12px 0; color: #666; font-size: 15px; position: relative; }
.tab.on { color: var(--green); font-weight: 700; }
.tab.on::after {
  content: ''; position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 36px; height: 3px; background: var(--green); border-radius: 3px;
}

/* 视频区 */
.video-wrap { position: relative; background: #000; border-radius: 8px; overflow: hidden; }
.video-wrap video { width: 100%; max-height: 62vh; display: block; object-fit: contain; }
.duration-label {
  position: absolute; right: 10px; bottom: 8px; color: #fff; font-size: 14px;
  text-shadow: 0 1px 3px rgba(0,0,0,.6);
}
.meta-row { display: flex; gap: 8px; justify-content: flex-end; margin-top: 10px; flex-wrap: wrap; }
.meta-pill { background: #F5F5F5; color: #666; font-size: 13px; padding: 6px 10px; border-radius: 6px; }
.source-pill { background: #fff; border: 1px solid var(--green); color: var(--green); font-weight: 700; }

/* 进度 */
.progress-card { background: var(--green-light); border-radius: 10px; padding: 14px; margin-top: 12px; }
.progress-head { display: flex; justify-content: space-between; margin-bottom: 8px; }
.pct { color: var(--green); }
.bar { background: #E2EFE7; border-radius: 4px; height: 8px; overflow: hidden; }
.bar-fill { height: 100%; width: 0; background: var(--green); border-radius: 4px; transition: width .15s; }
.progress-foot { display: flex; justify-content: space-between; color: var(--text3); font-size: 12px; margin-top: 8px; }

/* 图片 */
.img-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.img-grid img { width: calc(33.33% - 4px); aspect-ratio: 1; object-fit: cover; border-radius: 6px; background: #F0F0F0; -webkit-user-select: auto; user-select: auto; -webkit-touch-callout: default; }

/* 标题 tab */
.title-text { font-size: 15px; line-height: 1.7; word-break: break-all; }
.title-meta { color: var(--text3); font-size: 13px; margin-top: 10px; }

/* 提示 */
.missing-tip { background: #FFF7E6; color: #B88230; font-size: 12px; border-radius: 6px; padding: 10px 12px; margin-top: 8px; }
.tutorial-link { text-align: center; color: var(--green); font-size: 14px; padding: 12px 0 24px; cursor: pointer; }

/* 历史 */
.hist-head { display: flex; justify-content: space-between; align-items: center; padding: 8px 4px 14px; font-size: 15px; }
.hist-head .num { color: var(--green); }
.clear-btn { border: 1px solid var(--red); color: var(--red); border-radius: 6px; padding: 6px 16px; font-size: 13px; background: #fff; }
.time-line { color: var(--text3); font-size: 13px; padding: 8px 4px; }
.record-card { background: #fff; border-radius: 12px; padding: 10px; display: flex; gap: 10px; margin-bottom: 4px; cursor: pointer; }
.record-card img { width: 110px; height: 110px; border-radius: 8px; object-fit: cover; background: #F0F0F0; flex-shrink: 0; }
.r-right { flex: 1; display: flex; flex-direction: column; justify-content: space-between; }
.r-title { font-size: 14px; line-height: 1.5; color: #333; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.r-actions { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.r-actions button { border: 1px solid #DCDCDC; border-radius: 6px; color: #666; font-size: 12px; padding: 5px 10px; background: #fff; }
.r-actions .del { color: var(--red); border-color: #F0C1C0; }
.empty { text-align: center; color: var(--text3); padding: 80px 0; }
.e-ic { font-size: 40px; margin-bottom: 8px; }

/* 历史详情 */
.rows { margin-top: 8px; }
.row { display: flex; padding: 10px 0; border-bottom: 1px solid #F7F7F7; }
.row:last-child { border-bottom: none; }
.row.col { flex-direction: column; gap: 6px; }
.label { width: 110px; flex-shrink: 0; color: var(--text3); font-size: 13px; }
.value { flex: 1; font-size: 14px; word-break: break-all; }
.value.link { color: var(--green); }
.hd-cover { width: 100%; height: 210px; object-fit: cover; border-radius: 8px; background: #F0F0F0; }
.action-col { display: flex; flex-direction: column; gap: 12px; padding: 0 4px 32px; }
.action-col .btn-green, .action-col .btn-outline, .action-col .btn-red-outline { height: 46px; }

/* 静态页 */
.static-body { background: #fff; border-radius: 12px; padding: 20px; line-height: 1.8; font-size: 14px; color: #444; }
.static-body h3 { margin: 14px 0 8px; font-size: 16px; }
.static-body p { margin-bottom: 10px; }
.static-body ol, .static-body ul { padding-left: 22px; margin-bottom: 10px; }

/* iOS 添加主屏引导 */
.a2hs-tip {
  background: #FFF7E6; color: #B88230; font-size: 13px; padding: 10px 14px;
  display: flex; align-items: center; gap: 6px; border-bottom: 1px solid #F5E6C8;
}
.a2hs-tip b { color: #A06E20; }
.a2hs-close { margin-left: auto; color: #B88230; font-size: 14px; padding: 0 4px; }

/* Toast & Modal */
.toast {
  position: fixed; bottom: 12%; left: 50%; transform: translateX(-50%);
  background: rgba(0,0,0,.78); color: #fff; font-size: 14px; padding: 10px 18px;
  border-radius: 8px; z-index: 100; max-width: 82%; text-align: center; word-break: break-all;
}
.modal-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 90;
  display: flex; align-items: center; justify-content: center; padding: 32px;
}
.modal { background: #fff; border-radius: 14px; width: 100%; max-width: 340px; padding: 22px 20px 16px; }
.modal-title { font-weight: 700; font-size: 16px; text-align: center; margin-bottom: 10px; }
.modal-body { font-size: 14px; color: #555; line-height: 1.7; word-break: break-all; max-height: 40vh; overflow: auto; }
.modal-btns { display: flex; gap: 12px; margin-top: 18px; }
.modal-btns button { height: 42px; }

/* 顶栏「我的」 */
.topbar-mine { width: 28px; font-size: 20px; color: #fff; padding: 0 4px 2px; }

/* 我的 */
.profile-card {
  background: #fff; border-radius: 12px; padding: 20px;
  display: flex; align-items: center; gap: 16px; margin-bottom: 12px;
}
.profile-card .avatar { width: 64px; height: 64px; border-radius: 50%; flex-shrink: 0; }
.profile-info { flex: 1; min-width: 0; }
.uid-row { font-size: 15px; color: #333; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.uid-row b { color: var(--green); letter-spacing: .5px; }
.copy-btn {
  border: 1px solid var(--green); color: var(--green); background: #fff;
  border-radius: 6px; font-size: 12px; padding: 4px 12px;
}
.uid-sub { color: var(--text3); font-size: 13px; margin-top: 8px; }
.menu-card { background: #fff; border-radius: 12px; overflow: hidden; }
.menu-item {
  width: 100%; display: flex; align-items: center; gap: 14px;
  padding: 16px; font-size: 15px; color: #333; text-align: left;
  border-bottom: 1px solid #F5F5F5; background: #fff;
}
.menu-item:last-child { border-bottom: none; }
.menu-item:active { background: #F8F8F8; }
.m-ic { font-size: 20px; }
.menu-item .arrow { margin-left: auto; color: #C4C4C4; font-size: 20px; }
.version { text-align: center; color: var(--text3); font-size: 12px; padding: 20px 0 8px; line-height: 1.8; }
