:root {
  --bg: #f6f1e8;
  --panel: #fffdf8;
  --text: #1c1b19;
  --muted: #6e665c;
  --line: #d7ccb9;
  --accent: #b85c38;
  --accent-dark: #7e3d23;
  --danger: #9e2a2b;
  --shadow: 0 12px 36px rgba(60, 44, 25, 0.08);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: linear-gradient(180deg, #f3ede2 0%, #faf7f1 100%);
  color: var(--text);
  font-family: "Hiragino Sans", "Yu Gothic", sans-serif;
  line-height: 1.7;
}
a { color: inherit; }
.container { width: min(1080px, calc(100% - 32px)); margin: 0 auto; }
.site-header, .site-footer { background: rgba(255, 253, 248, 0.9); border-bottom: 1px solid var(--line); }
.site-footer { border-top: 1px solid var(--line); border-bottom: 0; margin-top: 48px; }
.page-content { padding: 32px 0 48px; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.brand { font-weight: 800; text-decoration: none; font-size: 1.1rem; letter-spacing: 0.04em; }
.nav { display: flex; gap: 16px; }
.nav a { text-decoration: none; color: var(--muted); }
.hero, .panel, .metric-card, .auth-card, .card { background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: 20px; }
.hero { padding: 32px; margin-bottom: 28px; }
.panel { padding: 24px; margin-bottom: 24px; }
.metric-card { padding: 24px; }
.dashboard-grid, .card-grid { display: grid; gap: 20px; }
.dashboard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 24px; }
.card-grid { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.card-image, .hero-image { width: 100%; height: auto; display: block; border-radius: 16px 16px 0 0; object-fit: cover; }
.card-body { padding: 20px; }
.tag-list { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.tag { display: inline-flex; padding: 6px 12px; border-radius: 999px; background: #f1e0d4; color: var(--accent-dark); text-decoration: none; font-size: 0.92rem; }
.eyebrow { color: var(--accent); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }
.button { border: 0; border-radius: 999px; background: var(--accent); color: white; padding: 10px 18px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.button.secondary { background: #e9ddcf; color: var(--text); }
.button.danger { background: var(--danger); }
.stack { display: grid; gap: 16px; }
label { display: grid; gap: 8px; font-weight: 600; }
.label-text { display: inline-flex; align-items: center; gap: 4px; }
.required-mark { color: #d93025; font-weight: 700; font-size: 0.9em; line-height: 1; }
input, textarea { width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; font: inherit; background: white; }
select { width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; font: inherit; background: white; }
.inline-upload, .row-gap { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.dropzone {
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 2px dashed #d0b89f;
  border-radius: 16px;
  background: #fff8f0;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.dropzone.is-dragover {
  border-color: var(--accent);
  background: #f7e6d8;
}
.dropzone-note {
  margin: 0;
  color: var(--muted);
}
.upload-preview {
  width: min(280px, 100%);
  border-radius: 12px;
  border: 1px solid var(--line);
}
.admin-list {
  display: grid;
  gap: 0;
}
.admin-list-row {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) 120px minmax(180px, 0.9fr) 190px minmax(280px, 1.2fr);
  gap: 16px;
  align-items: stretch;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.admin-list-head {
  padding-top: 0;
  padding-bottom: 14px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}
.admin-list-cell {
  min-width: 0;
  display: flex;
  align-items: flex-start;
}
.admin-list-title a {
  display: inline-block;
  word-break: break-word;
}
.admin-list-tags {
  margin-top: 0;
}
.admin-list-updated-at {
  word-break: break-word;
}
.admin-list-actions {
  justify-content: flex-end;
}
.table-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.status { display: inline-flex; padding: 4px 10px; border-radius: 999px; background: #efe6d8; color: var(--accent-dark); font-size: 0.85rem; }
.error-message { color: var(--danger); font-weight: 700; }
.hidden { display: none; }
.auth-card { width: min(480px, 100%); margin: 60px auto; padding: 28px; }
.article-detail { background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: 20px; padding: 24px; }
.meta-row { display: flex; gap: 16px; flex-wrap: wrap; color: var(--muted); margin-bottom: 12px; }
.markdown-body pre { overflow-x: auto; background: #201d1a; color: #f4efe8; padding: 14px; border-radius: 14px; }
.markdown-body code { font-family: "SFMono-Regular", Consolas, monospace; }
.pagination { display: flex; gap: 8px; justify-content: center; margin-top: 24px; }
.pagination a { padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line); text-decoration: none; background: white; }
.pagination a.active { background: var(--accent); color: white; border-color: var(--accent); }
.confirm-dialog {
  border: 0;
  border-radius: 18px;
  padding: 0;
  width: min(420px, calc(100% - 32px));
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.24);
}
.confirm-dialog::backdrop {
  background: rgba(35, 28, 22, 0.45);
}
.confirm-dialog form {
  padding: 24px;
  background: var(--panel);
}

@media (max-width: 720px) {
  .row-between { flex-direction: column; align-items: flex-start; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .admin-list-head {
    display: none;
  }
  .admin-list-row {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 16px 0;
  }
  .admin-list-cell {
    width: 100%;
  }
  .admin-list-actions {
    justify-content: flex-start;
  }
}
