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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: #f5f5f5;
  color: #333;
  line-height: 1.6;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 10px 20px;
}

header {
  text-align: center;
  padding: 14px 0;
}

header h1 {
  font-size: 20px;
  color: #222;
}

header p {
  color: #666;
  margin-top: 4px;
  font-size: 13px;
}

/* 入口页卡片 */
.nav-cards {
  display: flex;
  gap: 24px;
  justify-content: center;
  margin-top: 40px;
  flex-wrap: wrap;
}

.nav-card {
  background: #fff;
  border-radius: 12px;
  padding: 40px 32px;
  width: 360px;
  text-align: center;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  text-decoration: none;
  color: inherit;
}

.nav-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.nav-card .icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.nav-card h2 {
  font-size: 20px;
  margin-bottom: 12px;
  color: #222;
}

.nav-card p {
  color: #666;
  font-size: 14px;
}

/* 功能页布局 */
.app-layout {
  display: flex;
  gap: 16px;
  margin-top: 10px;
  min-height: 500px;
}

.sidebar {
  width: 320px;
  flex-shrink: 0;
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.preview-area {
  flex: 1;
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: auto;
}

/* 上传区域 */
.upload-zone {
  border: 2px dashed #d0d5dd;
  border-radius: 12px;
  padding: 28px 24px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s ease;
  margin-bottom: 16px;
  background: #fafbfc;
}

.upload-zone:hover,
.upload-zone.dragover {
  border-color: #4a90d9;
  background: #f0f7ff;
  box-shadow: 0 0 0 4px rgba(74, 144, 217, 0.08);
}

.upload-zone input[type="file"] {
  display: none;
}

.upload-icon {
  margin-bottom: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.upload-icon svg {
  transition: transform 0.25s ease;
}

.upload-zone:hover .upload-icon svg {
  transform: translateY(-3px);
}

.upload-text {
  font-size: 14px;
  font-weight: 600;
  color: #333;
  margin-bottom: 4px;
}

.upload-hint {
  font-size: 12px;
  color: #999;
}

/* 提示卡片 */
.hint-card {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: #fffbe6;
  border: 1px solid #ffe58f;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 14px;
}

.hint-icon {
  flex-shrink: 0;
  margin-top: 1px;
}

.hint-text {
  font-size: 12px;
  color: #8c6e00;
  line-height: 1.5;
}

.hint-text strong {
  color: #6b4f00;
}

/* 自定义复选框 */
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 13px;
  cursor: pointer;
  user-select: none;
  color: #555;
  padding: 6px 0;
}

.checkbox-label input[type="checkbox"] {
  display: none;
}

.check-box {
  width: 18px;
  height: 18px;
  border: 2px solid #d0d5dd;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s ease;
  background: #fff;
}

.checkbox-label input[type="checkbox"]:checked + .check-box {
  background: #4a90d9;
  border-color: #4a90d9;
}

.checkbox-label input[type="checkbox"]:checked + .check-box svg {
  opacity: 1;
}

.check-box svg {
  opacity: 0;
  transition: opacity 0.15s ease;
}

.check-text {
  line-height: 1;
}

/* 按钮图标 */
.btn svg {
  display: inline-block;
  vertical-align: middle;
  margin-right: 5px;
  flex-shrink: 0;
}

.btn-xs svg {
  margin-right: 4px;
}

/* 表单控件 */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #555;
  margin-bottom: 6px;
}

.form-group input[type="number"] {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
}

.form-group input[type="number"]:focus {
  outline: none;
  border-color: #4a90d9;
}

/* 按钮 */
.btn {
  display: inline-block;
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  width: 100%;
  text-align: center;
}

.btn-primary {
  background: #4a90d9;
  color: #fff;
}

.btn-primary:hover {
  background: #3a7bc8;
}

.btn-success {
  background: #52c41a;
  color: #fff;
}

.btn-success:hover {
  background: #45a316;
}

.btn:disabled {
  background: #ccc;
  cursor: not-allowed;
}

/* 预览 Canvas */
#previewCanvas {
  border: 1px solid #eee;
  border-radius: 4px;
}

/* 错误提示 */
.error-msg {
  color: #f5222d;
  background: #fff1f0;
  border: 1px solid #ffa39e;
  border-radius: 8px;
  padding: 10px 14px;
  margin-top: 12px;
  font-size: 13px;
  line-height: 1.5;
}

/* 进度 */
.progress-info {
  margin-top: 12px;
  font-size: 13px;
  color: #666;
  padding: 8px 12px;
  background: #f6f8fa;
  border-radius: 6px;
  line-height: 1.5;
}

/* 矩形列表 */
.rect-list {
  margin-top: 10px;
  max-height: 160px;
  overflow-y: auto;
}

.rect-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 10px;
  background: #f6f8fa;
  border: 1px solid #e8eaed;
  border-radius: 6px;
  margin-bottom: 5px;
  font-size: 12px;
  transition: border-color 0.15s;
}

.rect-item:hover {
  border-color: #d0d5dd;
}

.rect-item .rect-info {
  color: #555;
  font-weight: 500;
}

.rect-item .rect-delete {
  color: #999;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.rect-item .rect-delete:hover {
  color: #f5222d;
  background: #fff1f0;
}

/* 响应式 */
@media (max-width: 900px) {
  .app-layout {
    flex-direction: column;
  }
  .sidebar {
    width: 100%;
  }
}
