* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #f5f5f5;
  color: #333;
  min-height: 100vh;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 32px 16px;
}

h1 { font-size: 1.8rem; margin-bottom: 24px; color: #111; }

/* ── 上传区 ── */
.upload-section {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.drop-zone {
  border: 2px dashed #ccc;
  border-radius: 8px;
  padding: 40px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.drop-zone:hover, .drop-zone.dragover { border-color: #4f46e5; background: #f0f0ff; }
.drop-zone p { color: #666; }

.link { color: #4f46e5; cursor: pointer; text-decoration: underline; }

.upload-form { margin-top: 16px; display: flex; flex-direction: column; gap: 12px; }

.selected-file {
  display: flex; align-items: center; gap: 8px;
  background: #f0f0ff; padding: 8px 12px; border-radius: 6px; font-size: 0.9rem;
}
.selected-file span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.btn-text { background: none; border: none; cursor: pointer; color: #888; font-size: 1rem; padding: 0 4px; }

input[type="text"] {
  border: 1px solid #ddd; border-radius: 6px;
  padding: 10px 12px; font-size: 0.95rem; outline: none; transition: border-color 0.2s;
}
input[type="text"]:focus { border-color: #4f46e5; }

.btn-primary {
  background: #4f46e5; color: #fff; border: none;
  border-radius: 6px; padding: 10px 20px; font-size: 0.95rem;
  cursor: pointer; transition: background 0.2s; align-self: flex-start;
}
.btn-primary:hover { background: #4338ca; }
.btn-primary:disabled { background: #a5b4fc; cursor: not-allowed; }

.upload-progress { margin-top: 16px; }
.progress-bar { background: #e5e7eb; border-radius: 4px; height: 6px; overflow: hidden; margin-bottom: 6px; }
.progress-fill { background: #4f46e5; height: 100%; width: 0%; transition: width 0.3s; }
#progressText { font-size: 0.85rem; color: #666; }

/* ── 标签筛选 ── */
.filter-section { margin-bottom: 16px; }
.tag-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  background: #fff; border: 1px solid #ddd; border-radius: 20px;
  padding: 4px 14px; font-size: 0.85rem; cursor: pointer; transition: all 0.15s;
}
.tag:hover { border-color: #4f46e5; color: #4f46e5; }
.tag.active { background: #4f46e5; color: #fff; border-color: #4f46e5; }

/* ── 文件列表 ── */
.file-list { display: flex; flex-direction: column; gap: 10px; }
.empty-tip { color: #999; text-align: center; padding: 40px 0; }

/* 卡片：文件信息左，按钮右 */
.file-card {
  background: #fff;
  border-radius: 10px;
  padding: 16px 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.07);
  display: flex;
  align-items: center;
  gap: 16px;
}

.file-info { flex: 1; min-width: 0; }

.file-name-row {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
  margin-bottom: 4px;
}

.file-name {
  font-weight: 500;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.file-meta { font-size: 0.8rem; color: #999; display: flex; gap: 12px; flex-wrap: wrap; }

.file-tag { background: #ede9fe; color: #5b21b6; border-radius: 4px; padding: 2px 8px; font-size: 0.75rem; white-space: nowrap; }

/* 按钮组：桌面横排 */
.file-actions { display: flex; gap: 8px; flex-shrink: 0; }

.btn-copy {
  background: #f3f4f6; border: 1px solid #e5e7eb;
  border-radius: 6px; padding: 8px 14px; font-size: 0.85rem;
  cursor: pointer; white-space: nowrap; transition: all 0.15s;
}
.btn-copy:hover { background: #e0e7ff; border-color: #4f46e5; color: #4f46e5; }

.btn-delete {
  background: #fff0f0; border: 1px solid #fca5a5;
  border-radius: 6px; padding: 8px 14px; font-size: 0.85rem;
  cursor: pointer; white-space: nowrap; transition: all 0.15s; color: #dc2626;
}
.btn-delete:hover { background: #fee2e2; border-color: #dc2626; }
.btn-delete:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Toast ── */
.toast {
  position: fixed; bottom: 32px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #111; color: #fff; padding: 10px 20px;
  border-radius: 8px; font-size: 0.9rem;
  opacity: 0; transition: opacity 0.2s, transform 0.2s; pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── 移动端 ── */
@media (max-width: 600px) {
  .container { padding: 12px 10px; }
  h1 { font-size: 1.3rem; margin-bottom: 12px; }
  .upload-section { padding: 14px; }
  .drop-zone { padding: 20px 12px; }
  .btn-primary { width: 100%; align-self: stretch; text-align: center; }

  /* 卡片保持横排，压缩内边距 */
  .file-card { padding: 10px 12px; gap: 8px; }

  /* 按钮改为紧凑图标样式 */
  .file-actions { gap: 6px; }
  .file-actions .btn-copy,
  .file-actions .btn-delete {
    padding: 6px 10px;
    font-size: 0.8rem;
  }
}
