:root {
  --leaf-50: #f4fbf1;
  --leaf-100: #e4f6dc;
  --leaf-300: #a9d994;
  --leaf-600: #3b7f37;
  --leaf-700: #285f2b;
  --moss: #17391f;
  --ink: #142018;
  --muted: #68766a;
  --paper: #fffef8;
  --line: rgba(29, 73, 36, 0.13);
  --danger: #b94b4b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  background:
    linear-gradient(135deg, rgba(244, 251, 241, 0.95), rgba(228, 246, 220, 0.72)),
    url("../img/mainBack.jpg") center / 420px auto repeat;
}

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

button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 0 16px;
  background: var(--leaf-600);
  color: white;
  font-weight: 800;
  cursor: pointer;
}

button:hover {
  filter: brightness(1.04);
}

.hidden {
  display: none !important;
}

.admin-shell {
  min-height: 100vh;
}

.login-view {
  width: min(920px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  align-items: center;
  gap: 22px;
}

.login-visual,
.login-form,
.sidebar,
.admin-content article,
.notice-box,
.list-panel,
.editor-panel,
.settings-form {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 254, 248, 0.9);
  box-shadow: 0 20px 55px rgba(28, 73, 37, 0.12);
}

.login-visual {
  min-height: 420px;
  padding: 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.login-visual::after {
  content: "";
  width: 260px;
  height: 150px;
  position: absolute;
  right: -70px;
  bottom: -36px;
  border-radius: 260px 14px 260px 14px;
  background: linear-gradient(135deg, rgba(169, 217, 148, 0.45), rgba(243, 201, 105, 0.2));
  transform: rotate(-18deg);
}

.login-visual img {
  width: 116px;
}

.login-visual h1 {
  margin: 26px 0 10px;
  color: var(--moss);
  font-size: clamp(2.4rem, 6vw, 4.8rem);
  line-height: 0.95;
}

.login-visual p,
.notice-box p,
.form-message,
.list-item p {
  color: var(--muted);
  line-height: 1.7;
}

.account-hint {
  padding: 12px;
  border-radius: 8px;
  background: var(--leaf-50);
  border: 1px solid var(--line);
}

.login-form,
.editor-panel,
.settings-form {
  padding: 24px;
}

label {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
  color: var(--moss);
  font-weight: 800;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  padding: 12px 13px;
  outline: 0;
}

textarea {
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--leaf-600);
  box-shadow: 0 0 0 3px rgba(59, 127, 55, 0.12);
}

.dashboard-view {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
}

.sidebar {
  min-height: calc(100vh - 32px);
  margin: 16px;
  padding: 18px;
  position: sticky;
  top: 16px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--moss);
  text-decoration: none;
  font-weight: 900;
}

.admin-brand img {
  width: 42px;
}

.admin-tabs {
  display: grid;
  gap: 8px;
}

.admin-tabs button,
.ghost-button,
.danger-button {
  width: 100%;
  text-align: left;
}

.admin-tabs button {
  background: transparent;
  color: var(--moss);
}

.admin-tabs button.active {
  background: var(--leaf-100);
}

.ghost-button {
  margin-top: auto;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--moss);
}

.danger-button {
  background: var(--danger);
}

.admin-content {
  padding: 28px 28px 64px 0;
}

.topbar,
.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--leaf-600);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.topbar h1,
.panel-heading h2 {
  margin: 0;
  color: var(--moss);
}

.role-pill {
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--leaf-100);
  color: var(--leaf-700);
  font-weight: 800;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.stat-grid article {
  padding: 28px;
}

.stat-grid span {
  color: var(--leaf-600);
  font-size: 2.8rem;
  font-weight: 900;
}

.stat-grid p {
  margin: 8px 0 0;
  color: var(--muted);
}

.notice-box {
  padding: 24px;
}

.notice-box h2 {
  margin: 0;
  color: var(--moss);
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(420px, 1.2fr);
  gap: 16px;
  align-items: start;
}

.list-panel {
  min-height: 240px;
  padding: 12px;
}

.list-item {
  width: 100%;
  margin: 0 0 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 13px;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.list-item.active {
  border-color: var(--leaf-300);
  background: var(--leaf-50);
}

.list-item strong {
  display: block;
  color: var(--moss);
}

.list-item p {
  margin: 4px 0 0;
  font-size: 0.88rem;
}

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

.form-actions button {
  width: auto;
}

.check-row {
  display: flex;
  align-items: center;
  grid-template-columns: none;
  gap: 10px;
}

.check-row input {
  width: 18px;
  height: 18px;
}

@media (max-width: 920px) {
  .login-view,
  .dashboard-view,
  .workspace-grid,
  .stat-grid {
    grid-template-columns: 1fr;
  }

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

  .admin-content {
    padding: 0 16px 48px;
  }
}
