﻿:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-2: #f9fafb;
  --text: #202a33;
  --muted: #667085;
  --line: #d7dee8;
  --accent: #216e62;
  --accent-hover: #18584e;
  --accent-soft: #e7f3ef;
  --warn: #9a5b19;
  --danger: #9b3434;
  --danger-soft: #fff0f0;
  --shadow: 0 12px 28px rgba(32, 42, 51, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  width: min(1320px, calc(100% - 32px));
  min-height: 72px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 22px;
  letter-spacing: 0;
}

h2 {
  font-size: 16px;
  letter-spacing: 0;
}

.header-status {
  display: flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.app-main {
  width: min(1320px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0 40px;
  display: grid;
  grid-template-columns: minmax(360px, 450px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.input-panel,
.output-panel,
.draft-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.input-panel,
.output-panel {
  padding: 18px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.output-head {
  align-items: flex-start;
}

.output-head p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 13px;
}

.wide {
  grid-column: 1 / -1;
}

label,
.section-title {
  display: grid;
  gap: 6px;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

input[type="text"],
input[type="url"],
input[type="datetime-local"],
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  padding: 10px 11px;
  outline: none;
}

textarea {
  min-height: 220px;
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(33, 110, 98, 0.14);
  background: #ffffff;
}

.image-field {
  display: grid;
  gap: 8px;
}

.image-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 94px;
  padding: 12px;
  border: 1px dashed #aeb8c5;
  border-radius: 8px;
  background: var(--surface-2);
  flex-wrap: wrap;
}

#imagePreview {
  display: none;
  width: 82px;
  height: 82px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.hint {
  color: var(--muted);
  font-size: 12px;
}

.platform-box {
  margin-top: 16px;
}

.platform-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.platform-toggle,
.switch-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  font-size: 13px;
  font-weight: 800;
}

.platform-toggle input,
.switch-row input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.option-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
}

.button-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}

.primary-button,
.secondary-button,
.ghost-button,
.danger-button {
  min-height: 42px;
  border-radius: 8px;
  border: 1px solid var(--line);
  padding: 9px 12px;
  font-weight: 800;
}

.primary-button {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.primary-button:hover {
  background: var(--accent-hover);
}

.secondary-button,
.ghost-button {
  background: #ffffff;
  color: var(--text);
}

.ghost-button {
  min-height: 36px;
  padding: 7px 10px;
}

.danger-button {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: #f0c5c5;
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.draft-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.empty-state {
  min-height: 240px;
  place-items: center;
  border: 1px dashed #aeb8c5;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--muted);
  text-align: center;
  padding: 20px;
}

.draft-card {
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 360px;
}

.draft-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.draft-head span {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.draft-note {
  margin-top: 3px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

.draft-body {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
}

.draft-body textarea {
  min-height: 190px;
  height: 100%;
  background: #ffffff;
}

.meta-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.over-limit {
  color: var(--warn);
  font-weight: 800;
}

.draft-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: min(360px, calc(100% - 36px));
  padding: 12px 14px;
  border-radius: 8px;
  background: #263238;
  color: #ffffff;
  box-shadow: var(--shadow);
  transform: translateY(22px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
  font-size: 13px;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1020px) {
  .app-main {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .header-inner {
    align-items: flex-start;
    flex-direction: column;
    padding: 14px 0;
  }

  .field-grid,
  .platform-grid,
  .option-row,
  .button-row,
  .draft-grid,
  .draft-actions {
    grid-template-columns: 1fr;
  }

  textarea {
    min-height: 170px;
  }
}

