/* ========================================
   offline-style.css - 线下文风选择页样式
   ======================================== */

/* ---- 页面容器 ---- */
.offline-style-page {
  position: absolute;
  inset: 0;
  z-index: 7100;
  background: #f5f5f7;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateX(100%);
  transition: transform .32s cubic-bezier(.4,0,.2,1), opacity .28s ease;
  pointer-events: none;
  overflow: hidden;
}
.offline-style-page.is-active {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

/* ---- 顶部栏 ---- */
.offline-style-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  padding-top: max(14px, env(safe-area-inset-top));
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: .5px solid rgba(0,0,0,.06);
  flex-shrink: 0;
}
.offline-style-back-btn {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  background: none; border: none; cursor: pointer; color: #333;
}
.offline-style-back-btn svg { width: 20px; height: 20px; }
.offline-style-title {
  font-size: 16px; font-weight: 600; color: #222;
}

/* ---- 内容滚动区 ---- */
.offline-style-content {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px;
  padding-bottom: max(24px, env(safe-area-inset-bottom));
}

/* ---- 模块区块 ---- */
.offline-style-section {
  margin-bottom: 24px;
}
.offline-style-section-title {
  font-size: 15px; font-weight: 600; color: #222; margin-bottom: 4px;
}
.offline-style-section-desc {
  font-size: 12px; color: #999; line-height: 1.5; margin-bottom: 14px;
}

/* ---- 当前启用卡片 ---- */
.offline-style-active-card {
  display: flex; align-items: flex-start; gap: 12px;
  background: #fff;
  border-radius: 18px;
  padding: 16px;
  border: .5px solid rgba(0,0,0,.04);
  box-shadow: 0 2px 8px rgba(0,0,0,.03);
  position: relative;
}
.offline-style-active-card__icon {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  background: #f0f6ff; border-radius: 12px;
  flex-shrink: 0; color: #4a90d9;
}
.offline-style-active-card__body { flex: 1; min-width: 0; }
.offline-style-active-card__name {
  font-size: 16px; font-weight: 600; color: #222; margin-bottom: 2px;
}
.offline-style-active-card__meta {
  font-size: 11px; color: #999; margin-bottom: 4px;
}
.offline-style-active-card__desc {
  font-size: 12px; color: #666; line-height: 1.5;
}
.offline-style-active-card__badge {
  position: absolute; top: 14px; right: 16px;
  font-size: 10px; color: #4a90d9; background: #eef4fd;
  padding: 3px 8px; border-radius: 8px; font-weight: 500;
}

/* ---- 警告提示 ---- */
.offline-style-warning {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: #fff8f0;
  border: 1px solid #ffe0b2;
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 14px;
}
.offline-style-warning svg {
  flex-shrink: 0;
  color: #e6930a;
  margin-top: 1px;
}
.offline-style-warning span {
  font-size: 11px;
  color: #9a6700;
  line-height: 1.5;
}

/* ---- 内置文风卡片 ---- */
.offline-style-builtin-list {
  display: flex; flex-direction: column; gap: 10px;
}
.offline-style-builtin-card {
  background: #fff;
  border-radius: 16px;
  padding: 14px 16px;
  border: 1.5px solid transparent;
  box-shadow: 0 1px 4px rgba(0,0,0,.03);
  transition: border-color .2s;
}
.offline-style-builtin-card.is-active {
  border-color: #4a90d9;
  box-shadow: 0 2px 10px rgba(74,144,217,.12);
}
.offline-style-builtin-card__info { margin-bottom: 10px; }
.offline-style-builtin-card__name {
  font-size: 14px; font-weight: 600; color: #222; margin-bottom: 4px;
}
.offline-style-builtin-card__using {
  font-size: 10px; color: #4a90d9; background: #eef4fd;
  padding: 2px 6px; border-radius: 6px; font-weight: 500;
  margin-left: 6px;
}
.offline-style-builtin-card__desc {
  font-size: 12px; color: #666; line-height: 1.5; margin-bottom: 6px;
}
.offline-style-builtin-card__tags {
  display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px;
}
.offline-style-builtin-card__tags span {
  font-size: 10px; color: #888; background: #f5f5f7;
  padding: 2px 8px; border-radius: 8px;
}
.offline-style-builtin-card__preview {
  font-size: 12px; color: #555; line-height: 1.6;
  background: #fafafa; border-radius: 10px;
  padding: 10px 12px;
  border-left: 3px solid #e8e8ec;
  font-style: italic;
  white-space: pre-wrap;
}
.offline-style-builtin-card__actions {
  display: flex; gap: 8px; flex-wrap: wrap;
}

/* ---- 自定义文风卡片 ---- */
.offline-style-custom-list {
  display: flex; flex-direction: column; gap: 10px;
  margin-top: 12px;
}
.offline-style-custom-card {
  background: #fff;
  border-radius: 16px;
  padding: 14px 16px;
  border: 1.5px solid transparent;
  box-shadow: 0 1px 4px rgba(0,0,0,.03);
  transition: border-color .2s;
}
.offline-style-custom-card.is-active {
  border-color: #4a90d9;
  box-shadow: 0 2px 10px rgba(74,144,217,.12);
}
.offline-style-custom-card__info { margin-bottom: 10px; }
.offline-style-custom-card__name {
  font-size: 14px; font-weight: 600; color: #222; margin-bottom: 4px;
}
.offline-style-custom-card__using {
  font-size: 10px; color: #4a90d9; background: #eef4fd;
  padding: 2px 6px; border-radius: 6px; font-weight: 500;
  margin-left: 6px;
}
.offline-style-custom-card__desc {
  font-size: 12px; color: #666; line-height: 1.5; margin-bottom: 6px;
}
.offline-style-custom-card__tags {
  display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px;
}
.offline-style-custom-card__tags span {
  font-size: 10px; color: #888; background: #f5f5f7;
  padding: 2px 8px; border-radius: 8px;
}
.offline-style-custom-card__preview {
  font-size: 12px; color: #555; line-height: 1.6;
  background: #fafafa; border-radius: 10px;
  padding: 10px 12px;
  border-left: 3px solid #e8e8ec;
  font-style: italic;
  white-space: pre-wrap;
}
.offline-style-custom-card__actions {
  display: flex; gap: 8px; flex-wrap: wrap;
}
.offline-style-custom-empty {
  font-size: 13px; color: #bbb; text-align: center;
  padding: 24px 16px; line-height: 1.6;
}

/* ---- 新建按钮 ---- */
.offline-style-custom-add-btn {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; padding: 12px;
  background: #f0f6ff; color: #4a90d9;
  border: 1px dashed #c4d9f2; border-radius: 12px;
  font-size: 14px; font-weight: 500;
  cursor: pointer; transition: background .15s;
}
.offline-style-custom-add-btn:active { background: #e4effc; }

/* ---- 小按钮 ---- */
.offline-style-btn-sm {
  font-size: 11px; font-weight: 500;
  padding: 5px 10px; border-radius: 8px;
  border: none; cursor: pointer;
  background: #f5f5f7; color: #555;
  transition: opacity .15s;
}
.offline-style-btn-sm:active { opacity: .7; }
.offline-style-btn-sm--danger {
  color: #e55; background: #fef0f0;
}


/* ---- 管理模块 ---- */
.offline-style-manage-card {
  display: flex; flex-direction: column; gap: 10px;
}
.offline-style-manage-btn {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; padding: 12px;
  border-radius: 12px; font-size: 13px; font-weight: 500;
  border: 1px solid #e2e2e6; background: #fff; color: #555;
  cursor: pointer; transition: opacity .15s;
}
.offline-style-manage-btn:active { opacity: .7; }
.offline-style-manage-btn--danger {
  color: #e55; border-color: #fdd; background: #fff;
}

/* ---- 底部说明 ---- */
.offline-style-footer-note {
  font-size: 12px; color: #bbb; text-align: center;
  padding: 16px 20px; line-height: 1.5;
}

/* ---- 提示词详情弹窗 ---- */
.offline-style-prompt-modal {
  position: fixed;
  inset: 0;
  z-index: 7200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity .25s ease;
}
.offline-style-prompt-modal.is-active {
  opacity: 1;
  pointer-events: auto;
}
.offline-style-prompt-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.35);
}
.offline-style-prompt-modal__panel {
  position: relative;
  width: 100%;
  max-width: 480px;
  max-height: 70vh;
  background: #fff;
  border-radius: 20px 20px 0 0;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform .3s cubic-bezier(.4,0,.2,1);
}
.offline-style-prompt-modal.is-active .offline-style-prompt-modal__panel {
  transform: translateY(0);
}
.offline-style-prompt-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  border-bottom: .5px solid rgba(0,0,0,.06);
  flex-shrink: 0;
}
.offline-style-prompt-modal__title {
  font-size: 15px;
  font-weight: 600;
  color: #222;
}
.offline-style-prompt-modal__close {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  background: #f5f5f7; border: none; border-radius: 50%;
  cursor: pointer; color: #666;
}
.offline-style-prompt-modal__close:active { opacity: .6; }
.offline-style-prompt-modal__body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px 20px;
}
.offline-style-prompt-modal__content {
  font-size: 13px;
  color: #333;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: inherit;
  margin: 0;
}
.offline-style-prompt-modal__footer {
  padding: 12px 20px;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  border-top: .5px solid rgba(0,0,0,.06);
  flex-shrink: 0;
}
.offline-style-prompt-modal__copy-btn {
  width: 100%;
  padding: 12px;
  font-size: 14px;
  font-weight: 500;
  color: #4a90d9;
  background: #f0f6ff;
  border: 1px solid #d6e6f9;
  border-radius: 10px;
  cursor: pointer;
  transition: opacity .15s;
}
.offline-style-prompt-modal__copy-btn:active { opacity: .7; }

/* ---- 编辑弹窗 ---- */
.offline-style-editor-mask {
  position: fixed;
  inset: 0;
  z-index: 7300;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0,0,0,.35);
  pointer-events: none;
  opacity: 0;
  transition: opacity .25s ease;
}
.offline-style-editor-mask.is-active {
  opacity: 1;
  pointer-events: auto;
}
.offline-style-editor-sheet {
  position: relative;
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  background: #fff;
  border-radius: 20px 20px 0 0;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform .3s cubic-bezier(.4,0,.2,1);
}
.offline-style-editor-mask.is-active .offline-style-editor-sheet {
  transform: translateY(0);
}
.offline-style-editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  border-bottom: .5px solid rgba(0,0,0,.06);
  flex-shrink: 0;
}
.offline-style-editor-title {
  font-size: 15px; font-weight: 600; color: #222;
}
.offline-style-editor-close {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  background: #f5f5f7; border: none; border-radius: 50%;
  cursor: pointer; color: #666;
}
.offline-style-editor-close:active { opacity: .6; }
.offline-style-editor-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px 20px;
}
.offline-style-editor-label {
  display: block;
  font-size: 13px; font-weight: 500; color: #333;
  margin-bottom: 6px; margin-top: 14px;
}
.offline-style-editor-label:first-child { margin-top: 0; }
.offline-style-editor-required {
  font-size: 11px; color: #e55; font-weight: 400; margin-left: 4px;
}
.offline-style-editor-input {
  width: 100%; padding: 10px 14px;
  font-size: 14px; color: #222;
  background: #f8f9fa; border: 1px solid #e2e2e6;
  border-radius: 10px; outline: none;
  transition: border-color .2s;
  box-sizing: border-box;
}
.offline-style-editor-input:focus {
  border-color: #4a90d9; background: #fff;
}
.offline-style-editor-textarea {
  width: 100%; padding: 10px 14px;
  font-size: 13px; color: #333; line-height: 1.6;
  background: #f8f9fa; border: 1px solid #e2e2e6;
  border-radius: 10px; outline: none;
  resize: vertical;
  transition: border-color .2s;
  box-sizing: border-box;
}
.offline-style-editor-textarea:focus {
  border-color: #4a90d9; background: #fff;
}
.offline-style-editor-textarea--sm { min-height: 70px; }
.offline-style-editor-textarea--lg { min-height: 180px; }
.offline-style-editor-template-btn {
  display: inline-block;
  margin-top: 8px;
  font-size: 12px; color: #4a90d9;
  background: none; border: none;
  cursor: pointer; text-decoration: underline;
  text-underline-offset: 2px;
}
.offline-style-editor-template-btn:active { opacity: .6; }
.offline-style-editor-actions {
  display: flex; gap: 10px;
  padding: 14px 20px;
  padding-bottom: max(14px, env(safe-area-inset-bottom));
  border-top: .5px solid rgba(0,0,0,.06);
  flex-shrink: 0;
}
.offline-style-editor-btn {
  flex: 1;
  padding: 12px;
  font-size: 14px; font-weight: 500;
  border-radius: 10px; border: none;
  cursor: pointer; transition: opacity .15s;
  text-align: center;
}
.offline-style-editor-btn:active { opacity: .7; }
.offline-style-editor-btn--cancel {
  background: #f5f5f7; color: #666;
}
.offline-style-editor-btn--save {
  background: #f0f6ff; color: #4a90d9; border: 1px solid #d6e6f9;
}
.offline-style-editor-btn--apply {
  background: #4a90d9; color: #fff;
}

/* ---- 删除确认弹窗 ---- */
.offline-style-confirm-mask {
  position: fixed;
  inset: 0;
  z-index: 7400;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.4);
  pointer-events: none;
  opacity: 0;
  transition: opacity .2s ease;
}
.offline-style-confirm-mask.is-active {
  opacity: 1;
  pointer-events: auto;
}
.offline-style-confirm-box {
  background: #fff;
  border-radius: 16px;
  padding: 24px 20px 16px;
  width: 280px;
  text-align: center;
}
.offline-style-confirm-text {
  font-size: 14px; color: #333; line-height: 1.6;
  margin-bottom: 20px;
}
.offline-style-confirm-actions {
  display: flex; gap: 10px;
}
.offline-style-confirm-btn {
  flex: 1;
  padding: 11px;
  font-size: 14px; font-weight: 500;
  border-radius: 10px; border: none;
  cursor: pointer;
}
.offline-style-confirm-btn:active { opacity: .7; }
.offline-style-confirm-btn--cancel {
  background: #f5f5f7; color: #666;
}
.offline-style-confirm-btn--delete {
  background: #ff4d4f; color: #fff;
}

/* ---- Toast 通用 ---- */
.offline-toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: rgba(0,0,0,.75);
  color: #fff;
  font-size: 13px;
  padding: 8px 18px;
  border-radius: 20px;
  z-index: 9999;
  opacity: 0;
  transition: opacity .25s, transform .25s;
  pointer-events: none;
}
.offline-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
