:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --success: #10b981;
  --danger: #ef4444;
  --danger-hover: #dc2626;
  --danger-light: #fef2f2;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --radius: 14px;
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-family);
  background-color: #f8fafc;
  color: var(--gray-800);
  line-height: 1.5;
  min-height: 100vh;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

.app-container {
  max-width: 880px;
  margin: 0 auto;
  padding: 16px 20px 48px;
}

/* 通用 SVG 矢量图标规范 */
.svg-icon {
  width: 1.2em;
  height: 1.2em;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

/* 顶部导航 */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0 20px;
  border-bottom: 1px solid var(--gray-200);
  margin-bottom: 24px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon-box {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
}

.brand-svg {
  width: 22px;
  height: 22px;
  stroke-width: 2.2;
}

.brand-titles h1 {
  font-size: 20px;
  font-weight: 700;
  color: var(--gray-900);
  line-height: 1.2;
}

.brand-domain {
  font-size: 12px;
  color: var(--primary);
  font-weight: 600;
  letter-spacing: 0.5px;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 500;
  background: #f1f5f9;
  color: var(--gray-600);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--gray-400);
}

.status-pill.online {
  background: #dcfce7;
  color: #166534;
}

.status-pill.online .status-dot {
  background-color: var(--success);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}

.status-pill.offline {
  background: #fee2e2;
  color: #991b1b;
}

.status-pill.offline .status-dot {
  background-color: var(--danger);
}

.device-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 9999px;
  font-size: 12px;
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 500;
}

.device-icon-box {
  display: inline-flex;
  align-items: center;
}

.btn-icon {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  padding: 6px 12px;
  min-height: 36px;
  font-size: 15px;
  color: var(--gray-700);
  cursor: pointer;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-icon:hover {
  background: var(--gray-100);
  border-color: var(--gray-300);
  color: var(--gray-900);
}

.btn-icon:active {
  transform: scale(0.96);
}

/* 主操作卡片 */
.action-card {
  background: #ffffff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--gray-200);
  overflow: hidden;
  margin-bottom: 24px;
}

/* 即时文本中转头部 */
.action-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
}

.action-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-800);
}

.action-card-title svg {
  width: 17px;
  height: 17px;
  color: var(--primary);
}

.action-card-hint {
  font-size: 12px;
  color: var(--gray-400);
}

.transit-input-body {
  padding: 18px 20px;
}

.tabs-header {
  display: flex;
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
}

.tab-btn {
  flex: 1;
  padding: 14px 16px;
  border: none;
  background: transparent;
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-500);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.15s;
  border-bottom: 2px solid transparent;
  min-height: 48px;
}

.tab-btn:active {
  background: rgba(0, 0, 0, 0.04);
}

.tab-btn.active {
  color: var(--primary);
  background: #ffffff;
  border-bottom-color: var(--primary);
}

.tab-icon {
  width: 17px;
  height: 17px;
}

.tab-pane {
  display: none;
  padding: 18px 20px;
}

.tab-pane.active {
  display: block;
}

.textarea-wrapper textarea {
  width: 100%;
  height: 130px;
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 14px;
  color: var(--gray-900);
  resize: vertical;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  line-height: 1.5;
}

.textarea-wrapper textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.tab-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
}

.shortcut-tip {
  font-size: 12px;
  color: var(--gray-400);
}

.footer-actions {
  display: flex;
  gap: 10px;
}

/* 按钮通用 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
  min-height: 40px;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-secondary {
  background: var(--gray-100);
  color: var(--gray-700);
  border-color: var(--gray-300);
}

.btn-secondary:hover {
  background: var(--gray-200);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 13px;
  min-height: 36px;
}

.btn-block {
  width: 100%;
}

.btn-arrow-svg {
  width: 16px;
  height: 16px;
  transition: transform 0.15s;
}

.btn:hover .btn-arrow-svg {
  transform: translateX(3px);
}

/* 拖拽上传区 */
.drop-zone {
  border: 2px dashed var(--gray-300);
  border-radius: 12px;
  padding: 36px 20px;
  text-align: center;
  cursor: pointer;
  background: var(--gray-50);
  transition: all 0.2s ease;
}

.drop-zone:hover, .drop-zone.dragover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.drop-zone:active {
  transform: scale(0.99);
}

.hidden-file-input {
  display: none;
}

.drop-icon-box {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #ffffff;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  margin-bottom: 12px;
  border: 1px solid var(--gray-200);
}

.upload-cloud-svg {
  width: 32px;
  height: 32px;
}

.drop-content h3 {
  font-size: 16px;
  color: var(--gray-800);
  margin-bottom: 6px;
}

.drop-content p {
  font-size: 13px;
  color: var(--gray-500);
}

.selected-file-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8fafc;
  border: 1px solid var(--gray-200);
  padding: 12px 16px;
  border-radius: 10px;
  margin-top: 14px;
  gap: 12px;
}

.selected-file-info {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
  flex: 1;
}

.file-lead-icon {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.file-lead-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--gray-900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-lead-size {
  font-size: 12px;
  color: var(--gray-500);
  flex-shrink: 0;
}

.file-action-buttons {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* 上传全局浮动进度条 */
.upload-progress-box {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 380px;
  max-width: calc(100vw - 32px);
  padding: 16px 20px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--gray-200);
  z-index: 1000;
  transition: all 0.25s ease;
}

.upload-progress-box.hidden {
  display: none !important;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 8px;
  font-weight: 500;
}

.progress-bar-track {
  width: 100%;
  height: 8px;
  background: var(--gray-200);
  border-radius: 9999px;
  overflow: hidden;
}

.progress-bar-fill {
  width: 0%;
  height: 100%;
  background: var(--primary);
  transition: width 0.15s ease-out;
}

/* 列表控制栏 */
.list-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.filter-pills {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.filter-btn {
  border: 1px solid var(--gray-300);
  background: #fff;
  border-radius: 9999px;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-600);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.filter-btn:hover {
  background: var(--gray-50);
}

.filter-btn:active {
  transform: scale(0.96);
}

.filter-btn.active {
  background: var(--gray-900);
  color: #fff;
  border-color: var(--gray-900);
}

.pill-icon {
  width: 14px;
  height: 14px;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-box .search-icon {
  position: absolute;
  left: 12px;
  width: 15px;
  height: 15px;
  color: var(--gray-400);
  pointer-events: none;
}

.search-box input {
  padding: 8px 14px 8px 34px;
  border-radius: 10px;
  border: 1px solid var(--gray-300);
  font-size: 13px;
  outline: none;
  width: 220px;
  transition: all 0.2s;
}

.search-box input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* 卡片列表 */
.items-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.item-card {
  background: #ffffff;
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  padding: 16px 20px;
  transition: all 0.15s;
}

.item-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--gray-300);
}

.item-card.is-favorite {
  border-left: 3px solid #f59e0b;
}

.item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 12px;
  color: var(--gray-500);
}

.item-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-star {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-400);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 28px;
  min-height: 28px;
  line-height: 1;
}

.btn-star svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-star:hover {
  background: #fef3c7;
  color: #f59e0b;
}

.btn-star:hover svg {
  transform: scale(1.18);
}

.btn-star.active {
  color: #f59e0b;
  background: #fffbeb;
}

.btn-star.active svg {
  fill: #f59e0b;
  stroke: #d97706;
}

.btn-star.active:hover {
  background: #fef3c7;
}

.item-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.type-tag {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 11px;
}

.tag-text {
  background: #e0f2fe;
  color: #0369a1;
}

.tag-file {
  background: #fef3c7;
  color: #b45309;
}

.item-content-text {
  font-size: 14px;
  line-height: 1.6;
  color: var(--gray-900);
  white-space: pre-wrap;
  word-break: break-all;
  overflow-wrap: anywhere;
  background: var(--gray-50);
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid var(--gray-200);
  font-family: var(--font-mono);
  max-height: 280px;
  overflow-y: auto;
}

.item-content-file {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--gray-50);
  padding: 14px 18px;
  border-radius: 10px;
  border: 1px solid var(--gray-200);
}

.file-icon-box {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.file-lead-svg {
  width: 24px;
  height: 24px;
}

.text-blue { stroke: #2563eb; }
.text-amber { stroke: #d97706; }
.text-purple { stroke: #9333ea; }
.text-emerald { stroke: #059669; }
.text-indigo { stroke: #4f46e5; }
.text-gray { stroke: #6b7280; }

.file-details {
  flex: 1;
  overflow: hidden;
}

.file-name {
  font-weight: 600;
  font-size: 15px;
  color: var(--gray-900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.file-meta-row {
  font-size: 12px;
  color: var(--gray-500);
}

/* 按钮操作栏 */
.item-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  gap: 10px;
}

.action-group-main {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.action-group-danger {
  display: flex;
  align-items: center;
}

.action-btn {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-700);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s;
  min-height: 36px;
}

.action-btn .svg-icon {
  width: 15px;
  height: 15px;
}

.action-btn:hover {
  background: var(--gray-100);
  border-color: var(--gray-300);
  color: var(--gray-900);
}

.action-btn:active {
  transform: scale(0.96);
}

.action-btn.btn-delete {
  color: var(--gray-500);
}

.action-btn.btn-delete:hover {
  background: var(--danger-light);
  color: var(--danger);
  border-color: #fca5a5;
}

.icon-success {
  stroke: var(--success) !important;
}

/* 空状态与加载中 */
.empty-state, .loading-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--gray-500);
}

.empty-icon-box {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: var(--gray-100);
  color: var(--gray-400);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.empty-svg {
  width: 34px;
  height: 34px;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 12px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 弹窗通用 */
.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}

.modal.hidden {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(5px);
}

.modal-card {
  position: relative;
  background: #fff;
  border-radius: 18px;
  width: 100%;
  max-width: 400px;
  padding: 24px;
  box-shadow: var(--shadow-lg);
  text-align: center;
  z-index: 1;
}

.modal-icon-box {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.modal-header-svg {
  width: 28px;
  height: 28px;
}

.modal-header h2 {
  font-size: 18px;
  color: var(--gray-900);
  margin-bottom: 6px;
}

.modal-header p {
  font-size: 13px;
  color: var(--gray-500);
  margin-bottom: 18px;
}

.modal-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--gray-300);
  border-radius: 10px;
  font-size: 15px;
  outline: none;
  margin-bottom: 12px;
}

.modal-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.auth-error {
  color: var(--danger);
  font-size: 13px;
  margin-bottom: 12px;
}

.qr-code-body {
  margin: 16px 0;
  display: flex;
  justify-content: center;
}

.qr-code-body img {
  width: 220px;
  height: 220px;
  border-radius: 10px;
  border: 1px solid var(--gray-200);
}

.modal-footer {
  display: flex;
  gap: 10px;
  justify-content: center;
}

/* 全屏拖拽遮罩 */
.drag-overlay {
  position: fixed;
  inset: 0;
  background: rgba(37, 99, 235, 0.85);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  text-align: center;
  pointer-events: none;
}

.drag-overlay.hidden {
  display: none;
}

.drag-large-icon-box {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  animation: bounce 1s infinite alternate;
}

.drag-large-svg {
  width: 48px;
  height: 48px;
}

@keyframes bounce {
  from { transform: translateY(0); }
  to { transform: translateY(-12px); }
}

/* Toast 提示 */
.toast-container {
  position: fixed;
  bottom: calc(24px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 10000;
  pointer-events: none;
  max-width: 90%;
}

.toast {
  background: var(--gray-900);
  color: #fff;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  animation: fadeIn 0.2s ease;
  white-space: pre-wrap;
  text-align: center;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.hidden {
  display: none !important;
}

/* ===================================================
   移动端专有深度适配优化 (Max Width: 640px)
   =================================================== */
@media (max-width: 640px) {
  .app-container {
    padding: 12px 14px calc(36px + env(safe-area-inset-bottom));
  }

  .navbar {
    padding: 8px 0 16px;
    margin-bottom: 16px;
    gap: 12px;
    flex-direction: row;
    flex-wrap: wrap;
  }

  .nav-brand {
    gap: 8px;
  }

  .brand-icon-box {
    width: 34px;
    height: 34px;
  }

  .brand-svg {
    width: 18px;
    height: 18px;
  }

  .brand-titles h1 {
    font-size: 18px;
  }

  .nav-actions {
    margin-left: auto;
    gap: 6px;
  }

  .status-pill {
    padding: 4px 8px;
    font-size: 11px;
  }

  .device-pill,
  #btn-site-qr {
    display: none;
  }

  .btn-icon {
    padding: 5px 10px;
    min-height: 32px;
    font-size: 14px;
  }

  input,
  textarea,
  .modal-input,
  .textarea-wrapper textarea,
  .search-box input {
    font-size: 16px !important;
  }

  .action-card {
    border-radius: 12px;
    margin-bottom: 20px;
  }

  .tab-pane {
    padding: 14px 14px;
  }

  .textarea-wrapper textarea {
    height: 110px;
  }

  .tab-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .shortcut-tip {
    display: none;
  }

  .footer-actions {
    display: flex;
    gap: 8px;
  }

  .footer-actions .btn {
    flex: 1;
    min-height: 44px;
    font-size: 15px;
  }

  .drop-zone {
    padding: 24px 14px;
  }

  .drop-icon-box {
    width: 52px;
    height: 52px;
    margin-bottom: 10px;
  }

  .upload-cloud-svg {
    width: 26px;
    height: 26px;
  }

  .drop-content h3 {
    font-size: 15px;
  }

  .selected-file-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .file-action-buttons {
    display: flex;
    gap: 8px;
  }

  .file-action-buttons .btn {
    flex: 1;
    min-height: 42px;
  }

  .list-control {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .filter-pills {
    width: 100%;
    justify-content: flex-start;
  }

  .filter-btn {
    flex: 1;
    text-align: center;
    padding: 8px 10px;
    min-height: 40px;
    font-size: 13px;
    justify-content: center;
  }

  .search-box {
    width: 100%;
  }

  .search-box input {
    width: 100%;
    min-height: 42px;
  }

  .item-card {
    padding: 14px 14px;
    border-radius: 12px;
  }

  .item-content-text {
    font-size: 14px;
    padding: 12px 12px;
    max-height: 220px;
  }

  .item-content-file {
    padding: 12px 14px;
    gap: 12px;
  }

  .file-icon-box {
    width: 38px;
    height: 38px;
  }

  .file-lead-svg {
    width: 20px;
    height: 20px;
  }

  .file-name {
    font-size: 14px;
  }

  .item-actions {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
  }

  .action-btn {
    min-height: 42px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
  }

  .modal-card {
    padding: 20px;
    border-radius: 16px;
  }

  .modal-card .btn {
    min-height: 44px;
    font-size: 15px;
  }

  /* 网盘视窗移动端适配 */
  .drive-window {
    border-radius: 12px;
    margin-bottom: 16px;
  }

  .drive-window-toolbar {
    padding: 10px 12px;
    gap: 8px;
  }

  .drive-tool-group {
    gap: 6px;
  }

  .drive-tool-group .btn-sm {
    min-height: 34px;
    padding: 6px 10px;
    font-size: 12px;
  }

  .drive-search-box {
    width: 100%;
    order: 10;
    margin-top: 4px;
  }

  .drive-search-box input {
    width: 100%;
  }

  .drive-window-addressbar {
    padding: 8px 12px;
  }

  .drive-list-header {
    display: none !important;
  }

  .drive-row {
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 10px 12px;
    gap: 8px;
  }

  .drive-row .col-time,
  .drive-row .col-size {
    display: none;
  }

  .drive-row-submeta {
    display: block;
    font-size: 11px;
    color: var(--gray-400);
    margin-top: 2px;
  }

  .drive-row-left {
    align-items: flex-start;
  }

  .drive-row-left .custom-checkbox {
    margin-top: 2px;
  }

  .drive-container.grid-mode {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    padding: 12px;
  }

  .drive-window-footer {
    padding: 8px 12px;
    font-size: 11px;
  }
}

/* ==========================================================================
   网盘存储、多选批量操作、右键菜单、触控抽屉与全功能样式 (严格 0 Emoji)
   ========================================================================== */

/* 顶部模式切换导航 */
.main-mode-nav {
  display: flex;
  background: var(--gray-100);
  border-radius: 12px;
  padding: 4px;
  gap: 6px;
  margin-bottom: 20px;
}

.main-mode-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 9px;
  border: none;
  background: transparent;
  color: var(--gray-600);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.main-mode-btn.active {
  background: #fff;
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.mode-icon-box {
  display: flex;
  align-items: center;
  justify-content: center;
}

.view-panel {
  display: block;
}

.view-panel.hidden {
  display: none;
}

/* 列表控制右侧操作 */
.control-right-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 批量操作条 */
.batch-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border: 1px solid var(--primary);
  padding: 10px 16px;
  border-radius: 12px;
  margin-bottom: 16px;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.12);
  animation: slideDown 0.2s ease;
  flex-wrap: wrap;
  gap: 10px;
}

.batch-bar.hidden {
  display: none;
}

.batch-info {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
}

.batch-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* 卡片勾选框 */
.item-card-select-wrap {
  display: flex;
  align-items: center;
  margin-right: 8px;
}

.custom-checkbox {
  width: 20px;
  height: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
}

.btn-xs {
  padding: 4px 10px;
  font-size: 12px;
  min-height: 28px;
  border-radius: 6px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* ==========================================================================
   网盘存储一体化工作台视窗 (Drive Workspace Window)
   ========================================================================== */
.drive-window {
  background: #ffffff;
  border: 1px solid var(--gray-200);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin-bottom: 24px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.drive-window.drag-over {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* 1. 顶部操作工具栏 */
.drive-window-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--gray-100);
  background: #ffffff;
  flex-wrap: wrap;
}

.drive-tool-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* 统一工具栏按钮尺寸与图标大小 (严格 36px 高度对齐) */
.drive-tool-group .btn {
  height: 36px;
  min-height: 36px;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 500;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 8px;
}

.drive-tool-group .btn-icon-svg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* 彻底覆盖任何全局 32px 样式，约束工具栏所有 svg 为 16px */
.drive-window-toolbar .svg-icon,
.drive-window-toolbar .upload-cloud-svg {
  width: 16px !important;
  height: 16px !important;
  max-width: 16px;
  max-height: 16px;
}

.drive-tool-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.drive-search-box {
  width: 190px;
  height: 36px;
  position: relative;
  display: flex;
  align-items: center;
}

.drive-search-box .search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: var(--gray-400);
  pointer-events: none;
}

.drive-search-box input {
  width: 100%;
  height: 36px;
  box-sizing: border-box;
  padding: 0 12px 0 32px;
  font-size: 13px;
  border-radius: 8px;
  border: 1px solid var(--gray-300);
  outline: none;
  background: #fff;
  transition: all 0.15s;
}

.drive-search-box input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.view-switch-group {
  display: inline-flex;
  align-items: center;
  background: var(--gray-100);
  border-radius: 8px;
  padding: 3px;
  gap: 3px;
  height: 36px;
  box-sizing: border-box;
}

.view-switch-group .btn-icon {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  background: transparent;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-600);
  transition: all 0.15s;
  padding: 0;
}

.view-switch-group .btn-icon.active {
  background: #fff;
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

#btn-drive-refresh {
  width: 36px;
  height: 36px;
  min-height: 36px;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  cursor: pointer;
  color: var(--gray-600);
  transition: all 0.15s;
  padding: 0;
}

#btn-drive-refresh:hover {
  background: var(--gray-200);
  color: var(--primary);
}

#btn-drive-refresh .svg-icon {
  width: 16px;
  height: 16px;
}

/* 2. 整合式路径与统计地址栏 */
.drive-window-addressbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 20px;
  background: #f8fafc;
  border-bottom: 1px solid var(--gray-200);
}

.drive-address-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.btn-drive-back {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border: 1px solid var(--gray-300);
  border-radius: 7px;
  cursor: pointer;
  color: var(--gray-700);
  transition: all 0.15s;
  flex-shrink: 0;
}

.btn-drive-back:hover:not(:disabled) {
  background: var(--gray-100);
  border-color: var(--gray-400);
}

.btn-drive-back:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.drive-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 2px;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  font-size: 13.5px;
  font-weight: 500;
  flex: 1;
  min-width: 0;
}

.drive-breadcrumbs::-webkit-scrollbar {
  display: none;
}

.crumb-item {
  color: var(--gray-600);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
}

.crumb-item:hover, .crumb-item.drag-over {
  background: var(--primary-light);
  color: var(--primary);
}

.crumb-item.active {
  color: var(--gray-900);
  font-weight: 600;
  cursor: default;
}

.crumb-sep {
  color: var(--gray-400);
  user-select: none;
  margin: 0 2px;
}

.drive-address-right {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  padding-left: 8px;
}

/* 扁平通透的现代元数据展示，告别生硬贴边的药丸框 */
.drive-address-meta {
  font-size: 12.5px;
  color: var(--gray-500);
  font-weight: 500;
  white-space: nowrap;
  user-select: none;
  letter-spacing: 0.01em;
}

/* 3. 内嵌式批量操作条 */
.drive-batch-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 18px;
  background: #eff6ff;
  border-bottom: 1px solid #bfdbfe;
  color: var(--primary);
  animation: slideDown 0.18s ease;
  flex-wrap: wrap;
}

.drive-batch-strip.hidden {
  display: none;
}

.batch-strip-info {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
}

.batch-strip-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

/* 4. 列表模式标准列头 */
.drive-list-header {
  display: grid;
  grid-template-columns: minmax(200px, 1fr) 160px 110px 80px;
  align-items: center;
  padding: 8px 18px;
  background: #f8fafc;
  border-bottom: 1px solid var(--gray-200);
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-500);
  user-select: none;
}

.drive-list-header.hidden {
  display: none;
}

.drive-list-header .col-name {
  padding-left: 30px;
}

.drive-list-header .col-actions {
  text-align: right;
  padding-right: 4px;
}

/* 5. 网盘文件主视窗 */
.drive-container {
  min-height: 380px;
  background: #ffffff;
}

/* 详细列表模式 (List Mode) */
.drive-container.list-mode {
  display: flex;
  flex-direction: column;
}

.drive-row {
  display: grid;
  grid-template-columns: minmax(200px, 1fr) 160px 110px 80px;
  align-items: center;
  padding: 9px 18px;
  border-bottom: 1px solid var(--gray-100);
  transition: background 0.12s ease;
  user-select: none;
  cursor: pointer;
}

.drive-row:last-child {
  border-bottom: none;
}

.drive-row:hover {
  background: #f8fafc;
}

.drive-row.selected {
  background: #eff6ff !important;
}

.drive-row.drag-over {
  background: #eff6ff !important;
  outline: 2px dashed var(--primary);
}

.drive-row-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  overflow: hidden;
}

.drive-row .custom-checkbox {
  opacity: 0.25;
  transition: opacity 0.15s;
  flex-shrink: 0;
}

.drive-row:hover .custom-checkbox,
.drive-row.selected .custom-checkbox,
.batch-active .drive-row .custom-checkbox {
  opacity: 1;
}

.drive-row-title-wrap {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.drive-row-title {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--gray-800);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.drive-row .col-time {
  font-size: 12.5px;
  color: var(--gray-500);
  white-space: nowrap;
}

.drive-row .col-size {
  font-size: 12.5px;
  color: var(--gray-500);
  white-space: nowrap;
}

.drive-row .col-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.drive-row .col-actions .btn-icon {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  opacity: 0.6;
}

.drive-row:hover .col-actions .btn-icon {
  opacity: 1;
}

.drive-row-submeta {
  display: none;
}

/* 视图切换按钮样式 */
.view-switch-group {
  display: flex;
  background: var(--gray-100);
  border-radius: 8px;
  padding: 2px;
  gap: 2px;
}

.view-switch-group .btn-icon {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-600);
  transition: all 0.15s;
}

.view-switch-group .btn-icon.active {
  background: #fff;
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

/* 大图标网格模式 (Grid Mode) */
.drive-container.grid-mode {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 14px;
  padding: 16px 18px;
}

.drive-grid-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 10px 12px;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  text-align: center;
  transition: all 0.15s ease;
  cursor: pointer;
  position: relative;
  user-select: none;
}

.drive-grid-item:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.drive-grid-item.selected {
  background: var(--primary-light);
  border-color: var(--primary);
}

.drive-grid-item.drag-over {
  border-color: var(--primary) !important;
  background: var(--primary-light) !important;
  outline: 2px dashed var(--primary);
}

.grid-select-box {
  position: absolute;
  top: 8px;
  left: 8px;
}

.grid-icon-box {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}

.grid-icon-box .svg-icon {
  width: 44px;
  height: 44px;
}

.grid-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-800);
  width: 100%;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-all;
  line-height: 1.35;
  min-height: 35px;
}

.grid-meta {
  font-size: 11px;
  color: var(--gray-500);
  margin-top: 4px;
}

/* 6. 视窗底部状态与容量栏 */
.drive-window-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 18px;
  background: #f8fafc;
  border-top: 1px solid var(--gray-200);
  font-size: 12px;
  color: var(--gray-500);
}

.footer-stats-left {
  font-weight: 500;
}

.footer-tip {
  color: var(--gray-400);
}

/* 剪切半透明态 */
.item-cut {
  opacity: 0.45 !important;
  filter: grayscale(30%);
}

/* 剪贴板悬浮胶囊条 */
.paste-capsule {
  position: fixed;
  bottom: calc(24px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  background: var(--gray-900);
  color: #fff;
  padding: 8px 18px;
  border-radius: 40px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
  z-index: 1000;
  animation: popUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.paste-capsule.hidden {
  display: none;
}

.paste-capsule-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
}

.capsule-icon-box {
  display: flex;
  align-items: center;
}

.paste-capsule-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 桌面端右键上下文菜单 */
.context-menu {
  position: fixed;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  padding: 6px 0;
  min-width: 160px;
  z-index: 1200;
  animation: fadeIn 0.12s ease;
}

.context-menu.hidden {
  display: none;
}

.ctx-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  font-size: 13px;
  color: var(--gray-700);
  cursor: pointer;
  transition: background 0.15s;
}

.ctx-item:hover {
  background: var(--gray-100);
  color: var(--primary);
}

.ctx-item.danger:hover {
  background: var(--danger-light);
  color: var(--danger);
}

.ctx-divider {
  height: 1px;
  background: var(--gray-200);
  margin: 4px 0;
}

/* 手机端底部操作抽屉 (Action Sheet) */
.action-sheet-card {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  border-radius: 20px 20px 0 0;
  padding: 18px 20px calc(18px + env(safe-area-inset-bottom));
  z-index: 1100;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
  animation: slideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  max-height: 80vh;
  overflow-y: auto;
}

.action-sheet-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--gray-200);
  margin-bottom: 10px;
}

.sheet-lead-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--gray-900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.action-sheet-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 14px;
}

.sheet-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 8px 12px;
  border-radius: 10px;
  border: none;
  background: transparent;
  font-size: 15px;
  color: var(--gray-800);
  cursor: pointer;
  width: 100%;
  text-align: left;
}

.sheet-btn:active {
  background: var(--gray-100);
}

.sheet-btn.danger {
  color: var(--danger);
}

/* 在线预览弹窗 */
.preview-modal-card {
  max-width: 820px;
  width: 92vw;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  padding: 18px 20px;
}

.preview-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.preview-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.preview-body {
  flex: 1;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 0;
  min-height: 250px;
}

.preview-img {
  max-width: 100%;
  max-height: 65vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

.preview-media {
  max-width: 100%;
  max-height: 60vh;
  width: 100%;
  border-radius: 8px;
}

.preview-text {
  width: 100%;
  max-height: 60vh;
  overflow: auto;
  background: var(--gray-50);
  padding: 16px;
  border-radius: 8px;
  border: 1px solid var(--gray-200);
  font-family: var(--font-mono);
  font-size: 13px;
  white-space: pre-wrap;
  word-break: break-all;
  line-height: 1.6;
}

.preview-pdf {
  width: 100%;
  height: 65vh;
  border: none;
  border-radius: 8px;
}

/* 文件夹树选择弹窗 */
.folder-tree-container {
  max-height: 280px;
  overflow-y: auto;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 8px;
  margin-bottom: 16px;
  background: var(--gray-50);
}

.tree-node {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  color: var(--gray-800);
  transition: all 0.15s;
}

.tree-node:hover {
  background: var(--gray-200);
}

.tree-node.selected {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}

.modal-footer-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}

.modal-sm {
  max-width: 400px;
}

@keyframes popUp {
  from { transform: translate(-50%, 20px); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

@keyframes slideDown {
  from { transform: translateY(-10px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
