/* 简装标准：外观干净简约，样式集中此文件，方便以后单独换装修不动功能逻辑 */
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  color: #222;
  background: #f5f6fa;
}

.screen { min-height: 100vh; }

#gate {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
#gate .card {
  background: #fff;
  border-radius: 12px;
  padding: 32px 24px;
  max-width: 360px;
  width: 100%;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  text-align: center;
}
#gate h1 { font-size: 22px; margin: 0 0 8px; }
.hint { color: #888; font-size: 14px; margin: 4px 0 16px; }

input[type="text"] {
  width: 100%;
  padding: 12px 14px;
  font-size: 16px;
  border: 1px solid #ddd;
  border-radius: 8px;
  margin-bottom: 12px;
}

.btn-primary {
  display: inline-block;
  width: 100%;
  min-height: 48px;
  padding: 0 20px;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  background: #5b6ee8;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}
.btn-primary:active { background: #4a5cd0; }
.btn-primary:disabled { background: #bbb; cursor: not-allowed; }

.error-text { color: #d0342c; font-size: 14px; min-height: 20px; margin: 8px 0 0; }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  background: #fff;
  border-bottom: 1px solid #eee;
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 10;
}
.quota { font-size: 14px; font-weight: 400; color: #666; }

.panel {
  max-width: 720px;
  margin: 0 auto;
  padding: 20px;
}
.panel h2 { font-size: 18px; margin: 0 0 12px; }

textarea {
  width: 100%;
  min-height: 200px;
  padding: 12px;
  font-size: 16px;
  border: 1px solid #ddd;
  border-radius: 8px;
  margin-bottom: 12px;
  font-family: inherit;
  resize: vertical;
}

.preview-list {
  background: #fff;
  border-radius: 8px;
  padding: 12px 12px 12px 32px;
  margin: 8px 0;
  max-height: 240px;
  overflow-y: auto;
}
.preview-list li { padding: 2px 0; }

#quotaWarn { color: #b8860b; font-size: 14px; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.gen-card {
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.gen-card.error { outline: 2px solid #d0342c; }
.gen-card img {
  width: 100%;
  display: block;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: #eee;
}
.gen-card .body { padding: 8px 10px; }
.gen-card .title { font-size: 14px; font-weight: 600; margin: 0 0 4px; }
.gen-card .status { font-size: 13px; color: #888; }
.gen-card .status.error { color: #d0342c; }
.gen-card .actions { display: flex; gap: 8px; margin-top: 6px; }
.gen-card .actions a, .gen-card .actions button {
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid #ddd;
  background: #f8f8f8;
  text-decoration: none;
  color: #333;
  min-height: 32px;
  cursor: pointer;
}

@media (min-width: 640px) {
  .panel { padding: 24px 32px; }
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.btn-link {
  background: none;
  border: none;
  color: #5b6ee8;
  font-size: 14px;
  cursor: pointer;
  padding: 8px 0;
  min-height: 32px;
}

.history-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff;
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 8px;
  cursor: pointer;
  min-height: 48px;
}
.history-item .theme { font-weight: 600; font-size: 15px; }
.history-item .meta { font-size: 13px; color: #888; margin-top: 2px; }
.history-item .badge {
  font-size: 13px;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
  margin-left: 12px;
}
.badge.done { background: #e5f6e8; color: #2a8a45; }
.badge.running { background: #fff3d6; color: #b8860b; }
.badge.partial { background: #fde5e3; color: #d0342c; }
