:root {
  --bg: #f7f4f1;
  --panel: rgba(255, 255, 255, 0.88);
  --border: #eadfd7;
  --text: #31251f;
  --muted: #7f6a5d;
  --primary: #d85b73;
  --primary-dark: #b64463;
  --danger: #c74343;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top left, #fff5f3, #f7f4f1 42%);
  color: var(--text);
}

.layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 28px 22px;
  background: #2f2422;
  color: #fff7f2;
}

.brand {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 28px;
}

.brand-badge {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: linear-gradient(135deg, #ff8b7c, #ff6288);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.brand-title {
  font-size: 18px;
  font-weight: 700;
}

.brand-subtitle {
  margin-top: 4px;
  color: rgba(255, 247, 242, 0.62);
  font-size: 13px;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.nav a {
  padding: 10px 12px;
  border-radius: 12px;
  color: rgba(255, 247, 242, 0.82);
  text-decoration: none;
}

.nav a:hover {
  background: rgba(255, 255, 255, 0.08);
}

.content {
  padding: 26px 28px 60px;
}

.page-header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 20px;
}

.page-header h1 {
  margin: 0 0 8px;
  font-size: 34px;
}

.page-header p {
  margin: 0;
  color: var(--muted);
}

.header-actions {
  display: flex;
  gap: 12px;
}

.panel {
  margin-bottom: 20px;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--panel);
  box-shadow: 0 12px 30px rgba(108, 71, 52, 0.06);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: baseline;
  margin-bottom: 18px;
}

.panel-header h2 {
  margin: 0;
  font-size: 22px;
}

.panel-header span,
.hint,
.table-note {
  color: var(--muted);
  font-size: 14px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
}

.summary-card {
  padding: 18px;
  border-radius: 18px;
  background: linear-gradient(145deg, #fffaf8, #fff0eb);
  border: 1px solid var(--border);
}

.summary-card-value {
  margin-top: 8px;
  font-size: 28px;
  font-weight: 700;
}

.config-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

.card-form,
.crud-layout {
  display: grid;
  gap: 14px;
}

.card-form {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: #fffaf7;
}

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

label {
  display: grid;
  gap: 6px;
  font-size: 14px;
  color: var(--muted);
}

.full-width {
  grid-column: 1 / -1;
}

input,
textarea,
select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  font: inherit;
  color: var(--text);
  background: #fff;
}

textarea {
  resize: vertical;
}

.primary-button,
.ghost-button,
.table-action {
  border: none;
  border-radius: 999px;
  padding: 11px 18px;
  font: inherit;
  cursor: pointer;
}

.primary-button {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), #f06e7b);
}

.primary-button:hover {
  background: linear-gradient(135deg, var(--primary-dark), #df6374);
}

.danger {
  background: linear-gradient(135deg, var(--danger), #d96d6d);
}

.ghost-button {
  color: var(--primary-dark);
  background: #fff4f2;
  border: 1px solid var(--border);
}

.crud-layout {
  grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.9fr);
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 16px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

th,
td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid #f0e7e1;
  vertical-align: top;
  font-size: 14px;
}

th {
  position: sticky;
  top: 0;
  background: #fff8f5;
}

.table-actions {
  display: flex;
  gap: 8px;
}

.table-action {
  padding: 8px 12px;
  font-size: 13px;
}

.table-action.edit {
  color: #8a4a62;
  background: #fff2f2;
}

.table-action.delete {
  color: #9c3030;
  background: #ffe8e8;
}

.section-form {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: #fffaf7;
}

.section-form h3 {
  margin: 0 0 6px;
}

.form-actions {
  display: flex;
  gap: 12px;
}

.code-preview {
  padding: 14px;
  border-radius: 16px;
  background: #fff8f5;
  border: 1px solid var(--border);
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 13px;
}

@media (max-width: 1080px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .crud-layout {
    grid-template-columns: 1fr;
  }

  .field-grid {
    grid-template-columns: 1fr;
  }
}

.hidden {
  display: none !important;
}

.login-gate {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(circle at top left, #fff5f3, #f7f4f1 42%);
}

.login-form {
  width: 100%;
  max-width: 380px;
  padding: 36px 32px;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(108, 71, 52, 0.12);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.login-logo {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: linear-gradient(135deg, #ff8b7c, #ff6288);
  color: #fff;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}

.login-form h2 {
  margin: 0;
  font-size: 26px;
}

.login-form label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}

.login-form .primary-button {
  margin-top: 8px;
}

.form-error {
  min-height: 18px;
  color: var(--danger);
  font-size: 13px;
}

.login-hint {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

.sidebar-footer {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: rgba(255, 247, 242, 0.7);
}

.sidebar-footer .brand-title {
  color: #fff7f2;
  font-size: 16px;
}

.sidebar-footer .ghost-button {
  margin-top: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.16);
}

.self-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  font-size: 12px;
  border-radius: 999px;
  background: rgba(216, 91, 115, 0.12);
  color: var(--primary-dark);
}

.filter-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.filter-chip {
  border: 1px solid var(--border);
  background: #fffaf7;
  color: var(--muted);
  padding: 8px 18px;
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
}

.filter-chip.active {
  background: #fff;
  color: var(--primary-dark);
  border-color: #f4c9c2;
  font-weight: 600;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.media-card {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #fff;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.media-preview {
  width: 100%;
  height: 180px;
  background: #f6ece6;
  display: flex;
  align-items: center;
  justify-content: center;
}

.media-preview img,
.media-preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-info {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
}

.media-name {
  font-weight: 600;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-meta {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
}

.media-actions {
  margin-top: 6px;
  display: flex;
  gap: 8px;
  align-items: center;
}

.media-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 14px;
  font-size: 12px;
  text-decoration: none;
}

.media-actions .table-action {
  padding: 6px 12px;
  font-size: 12px;
}

.media-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--border);
  border-radius: 16px;
  background: #fffaf7;
}

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

.period-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, #ffe3ee, #fff);
  margin-bottom: 16px;
  font-size: 14px;
}

.period-stats > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.badge {
  display: inline-block;
  padding: 2px 10px;
  font-size: 12px;
  border-radius: 999px;
  background: var(--bg);
  color: var(--muted);
}

.badge.done {
  background: linear-gradient(135deg, #fcc419, #ff9f43);
  color: #fff;
  font-weight: 600;
}

.timeline-note {
  margin-bottom: 12px;
}

.timeline-content {
  margin-top: 4px;
  max-width: 480px;
}

.timeline-thumbs {
  margin-top: 8px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.timeline-thumb {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
}

/* ===== 审核模式 ===== */
.review-mode-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  padding: 20px 24px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  align-items: center;
}

.review-mode-card.is-on {
  border-color: #ff7f6b;
  background: linear-gradient(135deg, #fff5f1, #fff);
  box-shadow: 0 4px 16px rgba(255, 127, 107, 0.12);
}

.review-mode-status {
  grid-column: 1;
}

.review-mode-label {
  font-size: 12px;
  color: #94a3b8;
  margin-bottom: 6px;
}

.review-mode-state {
  font-size: 18px;
  font-weight: 600;
}

.review-mode-state.on { color: #e85a72; }
.review-mode-state.off { color: #16a34a; }

.review-mode-desc {
  grid-column: 1 / -1;
  font-size: 13px;
  color: #475569;
  line-height: 1.6;
}

.review-mode-desc p { margin: 4px 0; }
.review-mode-desc strong { color: #e85a72; }

.review-mode-actions {
  grid-column: 2;
  grid-row: 1;
}
