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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f5f5f7;
  color: #333;
  line-height: 1.5;
  padding: 24px;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
}

.page-header {
  margin-bottom: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  object-fit: cover;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.page-header h1 {
  font-size: 22px;
  font-weight: 600;
  color: #111;
}

.page-header p {
  font-size: 13px;
  color: #888;
  margin-top: 2px;
}

.config-panel {
  background: #fff;
  border-radius: 12px;
  padding: 20px 24px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
  margin-bottom: 20px;
}

.form-row {
  display: flex;
  align-items: flex-end;
  gap: 20px;
  margin-bottom: 16px;
}

.form-row:last-child {
  margin-bottom: 0;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 12px;
  color: #666;
  font-weight: 500;
}

.form-group input[type="text"],
.form-group input[type="date"] {
  height: 36px;
  padding: 0 12px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
  min-width: 160px;
}

.form-group input[type="text"]:focus,
.form-group input[type="date"]:focus {
  border-color: #4caf50;
}

.avatar-group {
  flex: 1;
}

.avatar-upload {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 2px dashed #ddd;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  background: #fafafa;
  transition: border-color 0.2s;
}

.avatar-upload:hover {
  border-color: #4caf50;
}

.avatar-upload input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

.avatar-upload img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
  z-index: 1;
}

.avatar-upload.has-image img {
  display: block;
}

.avatar-upload.has-image .upload-tip {
  display: none;
}

.upload-tip {
  font-size: 10px;
  color: #aaa;
  text-align: center;
  padding: 0 8px;
  line-height: 1.2;
}

.actions {
  flex: 1;
  flex-direction: row;
  align-items: flex-end;
  gap: 10px;
}

.btn {
  height: 36px;
  padding: 0 18px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

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

.btn-primary:hover {
  background: #43a047;
}

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

.btn-secondary {
  background: #f0f0f0;
  color: #555;
}

.btn-secondary:hover {
  background: #e0e0e0;
}

.data-editor {
  background: #fff;
  border-radius: 12px;
  padding: 20px 24px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
  margin-bottom: 20px;
}

.empty-tip {
  text-align: center;
  color: #999;
  font-size: 14px;
  padding: 40px 0;
}

.day-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.day-label {
  width: 90px;
  flex-shrink: 0;
}

.day-label .date-name {
  font-size: 14px;
  font-weight: 500;
  color: #444;
}

.day-label .date-iso {
  font-size: 11px;
  color: #aaa;
  margin-top: 1px;
}

.hour-cells {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(24, 1fr);
  gap: 3px;
}

.hour-cell {
  position: relative;
}

.hour-cell input {
  width: 100%;
  height: 30px;
  border: 1px solid #e8e8e8;
  border-radius: 4px;
  text-align: center;
  font-size: 11px;
  color: #444;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.hour-cell input:focus {
  border-color: #4caf50;
  box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.15);
}

.hour-cell input::-webkit-outer-spin-button,
.hour-cell input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.hour-cell .hour-index {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 9px;
  color: #bbb;
  display: none;
}

.data-editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.data-editor-header h2 {
  font-size: 16px;
  font-weight: 600;
  color: #111;
}

.hour-legend {
  display: grid;
  grid-template-columns: 90px repeat(24, 1fr);
  gap: 3px;
  margin-left: 102px;
  margin-top: 8px;
}

.hour-legend span {
  text-align: center;
  font-size: 10px;
  color: #bbb;
}

.result-panel {
  background: #fff;
  border-radius: 12px;
  padding: 20px 24px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.result-header h2 {
  font-size: 16px;
  font-weight: 600;
  color: #111;
}

.result-image-wrapper {
  border-radius: 12px;
  overflow: hidden;
  background: #f5f5f7;
  text-align: center;
}

.result-image-wrapper img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

.loading-mask {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.loading-box {
  text-align: center;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #e8e8e8;
  border-top-color: #4caf50;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 12px;
}

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

.loading-box p {
  font-size: 14px;
  color: #666;
}

.error-tip {
  color: #e53935;
  font-size: 13px;
  margin-top: 6px;
}
