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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: #F8FAFC;
  color: #0F172A;
  line-height: 1.5;
  font-size: 14px;
}

.app-container {
  max-width: 600px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #F8FAFC;
  position: relative;
  box-shadow: 0 0 20px rgba(0,0,0,0.05);
}

/* 顶部导航栏 */
.app-header {
  height: 56px;
  background: #2563EB;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  box-shadow: 0 2px 8px rgba(37,99,235,0.25);
  position: sticky;
  top: 0;
  z-index: 100;
}

.app-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.app-badge {
  font-size: 11px;
  background: rgba(255, 255, 255, 0.2);
  padding: 3px 8px;
  border-radius: 12px;
  color: #E0E7FF;
}

/* Tab 切换栏 */
.tab-container {
  padding: 12px 16px 6px;
}

.tab-bar {
  display: flex;
  background: #EEF2F6;
  border-radius: 10px;
  padding: 4px;
}

.tab-btn {
  flex: 1;
  border: none;
  background: transparent;
  padding: 8px 0;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.tab-btn.active {
  background: #2563EB;
  color: #FFFFFF;
  box-shadow: 0 2px 6px rgba(37,99,235,0.2);
}

/* 主内容区 */
.content-area {
  flex: 1;
  padding: 10px 16px 24px;
}

.tab-page {
  display: none;
}

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

/* 卡片样式 */
.card {
  background: #FFFFFF;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  border: 1px solid #E2E8F0;
}

.card-title {
  font-size: 15px;
  font-weight: 700;
  color: #0F172A;
  margin-bottom: 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-desc {
  font-size: 12px;
  color: #94A3B8;
  margin-bottom: 12px;
}

/* 上传大框 */
.upload-box {
  border: 2px dashed #CBD5E1;
  border-radius: 10px;
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  background: #F8FAFC;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}

.upload-box:hover, .upload-box.dragover {
  border-color: #2563EB;
  background: #EFF6FF;
}

.upload-icon {
  font-size: 32px;
  margin-bottom: 6px;
}

.upload-text {
  font-size: 14px;
  font-weight: 600;
  color: #2563EB;
}

.upload-hint {
  font-size: 12px;
  color: #94A3B8;
  margin-top: 4px;
}

.file-preview-img {
  max-width: 100%;
  max-height: 180px;
  border-radius: 8px;
  display: none;
  object-fit: contain;
  margin: 0 auto;
}

.file-info-badge {
  font-size: 12px;
  color: #475569;
  background: #F1F5F9;
  padding: 6px 12px;
  border-radius: 6px;
  margin-top: 8px;
  display: none;
  text-align: center;
}

/* 封面选择区域 */
.cover-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cover-thumb {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  object-fit: contain;
  background: #000000;
  border: 1px solid #E2E8F0;
}

.cover-info {
  flex: 1;
}

.cover-status {
  font-size: 13px;
  color: #475569;
  font-weight: 500;
}

.cover-btns {
  display: flex;
  gap: 8px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.btn-outline {
  background: #FFFFFF;
  border: 1px solid #2563EB;
  color: #2563EB;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-outline:hover {
  background: #EFF6FF;
}

.btn-outline-danger {
  border-color: #EF4444;
  color: #EF4444;
}

.btn-outline-danger:hover {
  background: #FEF2F2;
}

/* 6色选择圆点 */
.color-selector {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  gap: 6px;
}

.color-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  padding: 4px;
  border-radius: 8px;
}

.color-dot {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid #E2E8F0;
  box-sizing: border-box;
  transition: transform 0.2s;
}

.color-item.selected .color-dot {
  border: 3px solid #2563EB;
  box-shadow: 0 0 0 2px #FFFFFF inset;
  transform: scale(1.1);
}

.color-label {
  font-size: 11px;
  color: #64748B;
  margin-top: 4px;
}

.color-item.selected .color-label {
  color: #2563EB;
  font-weight: 700;
}

/* 大按钮 */
.btn-primary-large {
  width: 100%;
  height: 48px;
  background: #2563EB;
  color: #FFFFFF;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(37,99,235,0.3);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 16px;
}

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

/* 结果卡片 */
.result-card {
  display: none;
  margin-top: 16px;
}

.preview-grid {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.preview-box {
  flex: 1;
  text-align: center;
}

.preview-box-title {
  font-size: 12px;
  color: #64748B;
  margin-bottom: 6px;
  font-weight: 600;
}

.preview-img {
  width: 100%;
  height: 140px;
  object-fit: contain;
  background: #000;
  border-radius: 8px;
  border: 1px solid #E2E8F0;
}

.action-row {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.action-row button {
  flex: 1;
}

/* 历史列表 */
.history-item {
  background: #FFFFFF;
  border-radius: 10px;
  border: 1px solid #E2E8F0;
  padding: 12px;
  margin-bottom: 10px;
  display: flex;
  gap: 12px;
  align-items: center;
}

.history-thumb {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  object-fit: cover;
  background: #F1F5F9;
  flex-shrink: 0;
}

.history-info {
  flex: 1;
  overflow: hidden;
}

.history-tag {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
}

.history-tag.disguised {
  background: #DBEAFE;
  color: #2563EB;
}

.history-tag.restored {
  background: #D1FAE5;
  color: #059669;
}

.history-title {
  font-size: 13px;
  font-weight: 700;
  color: #0F172A;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.history-meta {
  font-size: 11px;
  color: #94A3B8;
  margin-top: 2px;
}

.history-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.history-actions button {
  padding: 4px 8px;
  font-size: 11px;
}

/* 大图 Modal */
.modal-mask {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.85);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

.modal-content {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
}
