/* 合并与拆分 · 样式（与资源页紫色渐变主题一致，类名 ms- 前缀） */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  min-height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.ms-container {
  max-width: 760px;
  margin: 0 auto;
  padding: 20px;
}

/* ---------- 头部 ---------- */
.ms-header {
  margin-bottom: 20px;
}

.ms-back {
  color: white;
  text-decoration: none;
  font-size: 14px;
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  transition: background 0.3s;
  margin-right: 8px;
}

.ms-back:hover {
  background: rgba(255, 255, 255, 0.35);
}

.ms-back-dim {
  background: rgba(255, 255, 255, 0.12);
}

.ms-title {
  color: white;
  font-size: 26px;
  font-weight: 700;
  margin-top: 14px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.ms-subtitle {
  color: rgba(255, 255, 255, 0.85);
  font-size: 14px;
  margin-top: 6px;
}

/* ---------- 卡片 ---------- */
.ms-card {
  background: white;
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

.ms-card h2 {
  font-size: 18px;
  color: #1a1a2e;
  margin-bottom: 16px;
}

/* ---------- 流程说明 ---------- */
.ms-flow {
  padding: 18px 24px;
}

.ms-flow-step {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: #444;
  line-height: 1.6;
}

.ms-flow-num {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #667eea;
  color: white;
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ms-flow-arrow {
  text-align: center;
  color: #a5b4fc;
  font-size: 14px;
  padding: 2px 0 2px 34px;
}

/* ---------- 标签页 ---------- */
.ms-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.ms-tab {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.25);
  color: white;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.ms-tab.active {
  background: white;
  color: #4c51bf;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.ms-tab-panel {
  display: none;
}

.ms-tab-panel.active {
  display: block;
}

/* ---------- 上传区 ---------- */
.ms-drop {
  border: 2px dashed #c3d0f2;
  border-radius: 12px;
  background: #f7f9ff;
  padding: 28px 16px;
  text-align: center;
  color: #555;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 16px;
}

.ms-drop:hover,
.ms-drop-over {
  border-color: #667eea;
  background: #eef1ff;
}

.ms-drop-icon {
  font-size: 36px;
  margin-bottom: 8px;
}

.ms-drop-hint {
  font-size: 12px;
  color: #999;
  margin-top: 6px;
}

/* ---------- 文件列表 ---------- */
.ms-file-list {
  list-style: none;
  margin-bottom: 16px;
  max-height: 320px;
  overflow-y: auto;
  border: 1px solid #eef0f5;
  border-radius: 10px;
}

.ms-file-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid #f1f3f8;
  font-size: 14px;
}

.ms-file-item:last-child {
  border-bottom: none;
}

.ms-file-idx {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #eef1ff;
  color: #4c51bf;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ms-file-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #333;
}

.ms-file-size {
  flex-shrink: 0;
  color: #999;
  font-size: 12px;
}

.ms-file-ops {
  flex-shrink: 0;
  display: flex;
  gap: 4px;
}

.ms-file-ops button {
  width: 26px;
  height: 26px;
  border: 1px solid #e2e5ef;
  background: white;
  border-radius: 6px;
  color: #555;
  font-size: 12px;
  cursor: pointer;
}

.ms-file-ops button:hover:not(:disabled) {
  border-color: #667eea;
  color: #667eea;
}

.ms-file-ops button:disabled {
  opacity: 0.35;
  cursor: default;
}

/* ---------- 表单与按钮 ---------- */
.ms-row {
  margin-bottom: 14px;
}

.ms-label {
  display: block;
  font-size: 14px;
  color: #666;
  margin-bottom: 6px;
}

.ms-input {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  font-size: 15px;
  transition: border-color 0.2s;
}

.ms-input:focus {
  outline: none;
  border-color: #667eea;
}

.ms-input-file {
  width: 100%;
  padding: 10px;
  border: 2px dashed #d5d9e8;
  border-radius: 10px;
  font-size: 14px;
  color: #555;
  background: #fafbfe;
}

.ms-btn {
  padding: 12px 20px;
  border: 1px solid #d5d9e8;
  background: white;
  color: #444;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.ms-btn:hover:not(:disabled) {
  border-color: #667eea;
  color: #4c51bf;
}

.ms-btn-primary {
  width: 100%;
  background: #667eea;
  border-color: #667eea;
  color: white;
}

.ms-btn-primary:hover:not(:disabled) {
  background: #5a67d8;
  color: white;
}

.ms-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.ms-btn-small {
  padding: 8px 16px;
  font-size: 14px;
  flex-shrink: 0;
}

.ms-btn-ghost {
  width: 100%;
  margin-bottom: 12px;
  background: #fefce8;
  border-color: #fde68a;
  color: #854d0e;
  font-size: 14px;
}

.ms-btn-ghost:hover:not(:disabled) {
  border-color: #f59e0b;
  color: #854d0e;
}

/* ---------- 进度 ---------- */
.ms-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  color: #555;
  font-size: 14px;
}

.ms-spinner {
  width: 18px;
  height: 18px;
  border: 3px solid #e0e4f5;
  border-top-color: #667eea;
  border-radius: 50%;
  animation: ms-spin 0.8s linear infinite;
  flex-shrink: 0;
}

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

/* ---------- 结果 ---------- */
.ms-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.ms-meta-item {
  background: #f1f3fa;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 14px;
  color: #444;
}

.ms-meta-note {
  flex-basis: 100%;
  font-size: 13px;
  color: #b45309;
  background: #fefce8;
  border: 1px solid #fde68a;
  border-radius: 8px;
  padding: 8px 12px;
}

.ms-badge {
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 14px;
  font-weight: 700;
}

.ms-badge-ok {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.ms-badge-bad {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.ms-warn {
  background: #fffbeb;
  border: 1px solid #fcd34d;
  color: #92400e;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.7;
  margin-bottom: 14px;
}

/* ---------- 盖章页码 ---------- */
.ms-stamp-box {
  background: #fffbeb;
  border: 2px solid #fcd34d;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
}

.ms-stamp-label {
  font-size: 15px;
  font-weight: 700;
  color: #78350f;
  margin-bottom: 10px;
}

.ms-stamp-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ms-stamp-row code {
  flex: 1;
  background: white;
  border: 1px solid #fde68a;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 16px;
  font-weight: 700;
  color: #b45309;
  word-break: break-all;
  user-select: all;
  cursor: text;
}

.ms-stamp-hint {
  font-size: 13px;
  color: #92400e;
  margin-top: 8px;
}

/* ---------- 操作按钮组 ---------- */
.ms-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.ms-actions .ms-btn-primary {
  flex: 1;
  min-width: 180px;
  width: auto;
}

/* ---------- 表格 ---------- */
.ms-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.ms-table th,
.ms-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #f1f3f8;
  text-align: left;
}

.ms-table th {
  color: #888;
  font-weight: 600;
  background: #fafbfe;
}

.ms-table td:nth-child(2) {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ms-table td:nth-child(5) {
  font-weight: 700;
  color: #b45309;
}

.ms-tip {
  font-size: 12px;
  color: #999;
  line-height: 1.6;
  margin-bottom: 14px;
}

/* ---------- 拆分 ---------- */
.ms-split-info {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.ms-split-info-item {
  background: #eef1ff;
  color: #4c51bf;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 13px;
}

.ms-split-list {
  list-style: none;
}

.ms-split-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid #f1f3f8;
  font-size: 14px;
}

.ms-split-name {
  flex: 1;
  color: #333;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ms-split-range {
  flex-shrink: 0;
  color: #999;
  font-size: 12px;
}

/* ---------- Toast ---------- */
.ms-toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(17, 24, 39, 0.92);
  color: white;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 14px;
  max-width: 86vw;
  z-index: 999;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
  transition: opacity 0.4s;
  text-align: center;
}

.ms-toast-error {
  background: rgba(185, 28, 28, 0.95);
}

.ms-toast-out {
  opacity: 0;
}

/* ---------- 底部 ---------- */
.ms-footer {
  text-align: center;
  padding: 10px 0 20px;
  font-size: 12px;
}

.ms-footer a {
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
}

/* ---------- 响应式 ---------- */
@media (max-width: 480px) {
  .ms-container {
    padding: 12px;
  }

  .ms-card {
    padding: 16px;
    border-radius: 12px;
  }

  .ms-title {
    font-size: 22px;
  }

  .ms-actions .ms-btn-primary {
    min-width: 100%;
  }

  .ms-file-size {
    display: none;
  }
}
