﻿:root {
  --ink: #15231d;
  --muted: #5f6f68;
  --line: #e4d8c9;
  --green: #2f6f57;
  --green-dark: #233238;
  --soft: #faf4ea;
  --paper: #fff;
  --danger: #b42318;
  --shadow: 0 18px 44px rgba(26, 55, 43, 0.12);
  font-family: "Noto Sans SC", "Noto Sans JP", "Hiragino Sans", "Microsoft YaHei", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 80% 0%, rgba(42, 127, 98, 0.1), transparent 26rem),
    linear-gradient(180deg, #ffffff 0%, #eef7f2 48%, #ffffff 100%);
}

a {
  color: inherit;
}

.shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.topbar {
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.topbar-inner {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand img {
  width: 58px;
  height: 58px;
  border-radius: 14px;
  object-fit: contain;
  background: #fff;
  box-shadow: 0 8px 22px rgba(27, 88, 65, 0.12);
}

.brand strong {
  display: block;
  font-size: 20px;
  line-height: 1.2;
}

.brand span span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  margin-top: 3px;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.button,
button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #334940;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.button.primary,
button.primary {
  background: var(--green-dark);
  color: #fff;
  border-color: var(--green-dark);
}

.button.danger,
button.danger {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}

main {
  padding: 30px 0 40px;
}

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
  align-items: stretch;
}

.admin-dashboard {
  align-items: stretch;
}

.card {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.93);
  box-shadow: var(--shadow);
  border-radius: 22px;
  padding: clamp(22px, 3vw, 34px);
}

.publish-card,
.article-manager-card {
  min-height: 100%;
}

.article-manager-card {
  display: flex;
  flex-direction: column;
}

h1,
h2 {
  margin: 0 0 14px;
  line-height: 1.2;
}

h1 {
  font-size: clamp(30px, 5vw, 48px);
}

p {
  color: var(--muted);
  line-height: 1.75;
}

.notice {
  margin-bottom: 18px;
  border: 1px solid #b7e4c7;
  background: #effaf2;
  color: #14532d;
  border-radius: 16px;
  padding: 14px 16px;
  line-height: 1.7;
}

.notice.error {
  border-color: #fecaca;
  background: #fff1f2;
  color: #991b1b;
}

.field {
  margin: 0 0 16px;
}

label {
  display: block;
  margin-bottom: 7px;
  font-weight: 800;
}

input,
textarea {
  width: 100%;
  min-height: 44px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

textarea {
  min-height: 300px;
  line-height: 1.8;
  resize: vertical;
}

@media (min-width: 821px) {
  .admin-dashboard .card {
    padding: 28px 34px;
  }

  .admin-dashboard h1 {
    margin-bottom: 12px;
    font-size: clamp(32px, 3.8vw, 44px);
  }

  .publish-card .field {
    margin-bottom: 12px;
  }

  .publish-card label {
    margin-bottom: 5px;
  }

  .publish-card input,
  .publish-card textarea {
    min-height: 40px;
    padding: 9px 12px;
  }

  .publish-card textarea {
    height: 198px;
    min-height: 198px;
    line-height: 1.7;
  }

  .publish-card .hint {
    margin-top: 4px;
    line-height: 1.45;
  }
}

.hint {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.article-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.article-manager-card .article-list {
  flex: 1 1 auto;
  align-content: start;
}

.article-manager-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.article-manager-head p {
  margin: 0;
}

.article-manager-head span {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: #edf7f1;
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
}

.article-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  grid-column: 1 / -1;
  padding: 0;
  text-decoration: none;
  min-height: 48px;
}

.article-row time {
  color: var(--green);
  font-weight: 800;
}

.article-row strong {
  display: -webkit-box;
  min-height: 44px;
  overflow: hidden;
  font-size: 15px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.article-admin-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 8px 12px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8fbf9;
  min-height: 86px;
}

.article-admin-row:hover {
  outline: 2px solid rgba(47, 111, 87, 0.12);
}

.delete-article-form {
  grid-column: 1;
  grid-row: 2;
  margin: 0;
  display: block;
}

.delete-article-form button {
  width: auto;
  min-height: 28px;
  height: auto;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12px;
}

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

.article-pager .button {
  min-height: 34px;
  padding: 0 12px;
  font-size: 13px;
}

.article-pager .disabled {
  color: #98a79f;
  background: #f5f7f6;
  cursor: default;
}

.page-count {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.empty-state {
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  color: var(--muted);
  background: #fbfdfb;
}

.confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(21, 35, 29, 0.36);
}

.confirm-overlay[hidden] {
  display: none;
}

.confirm-dialog {
  width: min(420px, 100%);
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(20, 35, 29, 0.24);
  padding: 24px;
}

.confirm-dialog p {
  margin: 0 0 18px;
}

.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.login-card {
  max-width: 520px;
  margin: 0 auto;
}

@media (max-width: 820px) {
  .topbar-inner {
    align-items: flex-start;
    flex-direction: column;
    padding: 14px 0 12px;
  }

  .nav {
    justify-content: flex-start;
  }

  .brand img {
    width: 58px;
    height: 58px;
  }

  .grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  body {
    overflow-x: hidden;
  }

  .shell {
    width: calc(100vw - 22px);
  }

  .card {
    border-radius: 18px;
    padding: 20px;
  }

  .article-row {
    grid-template-columns: 1fr;
  }

  .article-admin-row {
    grid-template-columns: 1fr;
  }

  .delete-article-form button {
    width: auto;
    min-height: 34px;
  }

  .article-pager {
    flex-wrap: wrap;
  }
}
