/* 手机版二创 V6.7 — 分步操作栏 */
.page-derive .derive-section { padding: 12px 16px 24px; background: #f5f6fa; min-height: 100vh; }
#pageDerive.active .derive-section {
  padding-bottom: calc(var(--bottom-nav-total) + 20px);
}
.derive-header { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.derive-header h2 { font-size: 17px; flex: 1; color: #222; margin: 0; }
.derive-card { background: #fff; border-radius: 12px; padding: 14px; margin-bottom: 12px; box-shadow: 0 1px 6px rgba(0,0,0,.05); }
.derive-card h3 { font-size: 14px; color: #555; margin: 0 0 8px; font-weight: 600; }
.derive-block-title { margin-top: 12px; margin-bottom: 8px; }
.derive-card textarea, .derive-card input[type=text] {
  width: 100%; border: 1px solid #e8e8e8; border-radius: 8px; padding: 10px; font-size: 14px;
  box-sizing: border-box; font-family: inherit; line-height: 1.65; background: #fafafa;
}
.derive-card textarea:focus, .derive-card input:focus { border-color: #2196F3; background: #fff; outline: none; }
.derive-card textarea { min-height: 120px; resize: vertical; }
.derive-meta { font-size: 12px; color: #888; margin-bottom: 10px; line-height: 1.7; padding: 10px 12px; background: #fff; border-radius: 8px; }
.derive-meta strong { color: #2196F3; }
.derive-word-count { font-size: 12px; color: #999; text-align: right; margin-top: 4px; }
.derive-options { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.derive-opt { padding: 10px 18px; border: 1px solid #ddd; border-radius: 22px; font-size: 14px; cursor: pointer; background: #fff; user-select: none; min-height: 42px; display: inline-flex; align-items: center; }
.derive-opt.active { border-color: #2196F3; color: #2196F3; background: #e3f2fd; font-weight: 600; }

/* 四键操作栏（与快速版/思考版同款胶囊按钮，纯文字一行） */
.derive-toolbar-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 5px;
  margin-top: 0;
}
.derive-toolbar-bottom {
  margin-top: 0;
  margin-bottom: 8px;
  padding: 0 2px;
}
.derive-opt-action {
  flex: 1;
  min-width: 0;
  padding: 8px 2px;
  font-size: 11px;
  font-weight: 600;
  justify-content: center;
  text-align: center;
  min-height: 36px;
  line-height: 1.15;
  white-space: nowrap;
  letter-spacing: -0.2px;
}
.derive-opt-action:disabled { opacity: .55; cursor: not-allowed; }
.derive-opt-primary { border-color: #2196F3; color: #1976D2; background: #e3f2fd; }
.derive-opt-warn { border-color: #ff4757; color: #e53935; background: #ffebee; }
.derive-opt-muted { border-color: #cfd8dc; color: #607D8B; background: #fafafa; }

.btn-sm { padding: 6px 12px !important; font-size: 12px !important; min-width: auto !important; flex: none !important; }

/* 旧版大按钮（草稿箱等仍可能引用 btn-sm） */
.derive-empty { text-align: center; color: #999; padding: 48px 20px; line-height: 1.8; }
.derive-draft-item, .derive-work-item {
  background: #fff; border-radius: 12px; padding: 14px; margin-bottom: 10px;
  box-shadow: 0 1px 5px rgba(0,0,0,.05);
}
.derive-draft-item h4, .derive-work-item h4 { font-size: 15px; margin: 0 0 6px; color: #222; }
.derive-draft-meta, .derive-work-item .derive-draft-meta { font-size: 12px; color: #999; margin: 2px 0; }
.derive-draft-preview { font-size: 13px; color: #666; margin-top: 6px; line-height: 1.5; }
.derive-draft-actions { margin-top: 10px; display: flex; gap: 8px; }
.derive-work-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.derive-badge { font-size: 11px; padding: 2px 8px; border-radius: 10px; white-space: nowrap; }
.derive-badge.ok { background: #e8f5e9; color: #2e7d32; }
.derive-badge.wait { background: #fff3e0; color: #e65100; }
.derive-badge.off { background: #f5f5f5; color: #999; }
.derive-stats-bar { background: #fff; padding: 12px 14px; border-radius: 10px; margin-bottom: 12px; font-size: 13px; color: #666; line-height: 1.7; }
.derive-stats-bar strong { color: #2196F3; }
.derive-loading {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 99999;
  align-items: center; justify-content: center; flex-direction: column;
}
.derive-loading.show { display: flex; }
.derive-loading-box { background: #fff; border-radius: 12px; padding: 24px 28px; text-align: center; max-width: 280px; }
.derive-loading-spinner { width: 36px; height: 36px; border: 3px solid #e0e0e0; border-top-color: #2196F3; border-radius: 50%; animation: deriveSpin .8s linear infinite; margin: 0 auto 12px; }
@keyframes deriveSpin { to { transform: rotate(360deg); } }
.derive-loading-text { font-size: 14px; color: #555; }
.detail-derive-section { margin: 16px 0; padding: 0 4px; }
.detail-derive-title { font-size: 15px; font-weight: 600; color: #333; margin-bottom: 10px; }
.detail-derive-title span { font-size: 12px; color: #999; font-weight: normal; margin-left: 6px; }
.detail-derive-scroll { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; -webkit-overflow-scrolling: touch; }
.detail-derive-card {
  flex: 0 0 160px; background: #fff; border-radius: 10px; padding: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,.06); cursor: pointer;
}
.detail-derive-card .dtitle { font-size: 14px; font-weight: 500; color: #222; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.detail-derive-card .dmeta { font-size: 11px; color: #999; margin-top: 6px; }
.detail-derive-parent { margin-bottom: 10px; }
.detail-derive-parent-btn {
  display: inline-block; padding: 8px 14px; background: #e3f2fd; color: #1976D2;
  border: none; border-radius: 18px; font-size: 13px; font-weight: 500; cursor: pointer;
}
.m-toast {
  position: fixed; top: 60px; left: 50%; transform: translateX(-50%); z-index: 999999;
  padding: 10px 18px; border-radius: 20px; font-size: 14px; color: #fff; max-width: 90%;
  box-shadow: 0 4px 16px rgba(0,0,0,.2); animation: mToastIn .25s ease;
}
.m-toast.success { background: rgba(46,125,50,.92); }
.m-toast.error { background: rgba(198,40,40,.92); }
.m-toast.warn { background: rgba(245,124,0,.92); }
.m-toast.info { background: rgba(33,33,33,.88); }
@keyframes mToastIn { from { opacity: 0; transform: translateX(-50%) translateY(-8px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }

/* 原作选择器（手机创作中心） */
.page-derive .parent-picker-filters { gap: 6px; }
.page-derive .pp-select, .page-derive .pp-input { font-size: 13px; padding: 8px; }
.page-derive .pp-input { max-width: none; flex: 1 1 45%; min-width: 0; }
.page-derive .parent-picker-list { max-height: 50vh; }
.page-derive .pp-item { padding: 12px; }
.page-derive .pp-item-title { font-size: 15px; }
.page-derive .parent-picker-pager { margin-top: 12px; }
.page-derive .parent-picker-selected { font-size: 13px; }
