:root {
  font-family: Inter, "Microsoft YaHei", sans-serif;
  color: #19211d;
  background: #f3f6f4;
}

* { box-sizing: border-box; }
body { margin: 0; }
button, input, textarea, select { font: inherit; }
a { color: inherit; }

input, textarea, select {
  width: 100%;
  border: 1px solid #cbd5d0;
  border-radius: 5px;
  padding: 10px 12px;
  background: #fff;
  color: #1c2822;
  outline: none;
}

input:focus, textarea:focus, select:focus {
  border-color: #1b7650;
  box-shadow: 0 0 0 3px rgba(27, 118, 80, .12);
}

textarea { min-height: 280px; resize: vertical; }
.summary-input { min-height: 100px; }

button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 0;
  border-radius: 5px;
  padding: 9px 15px;
  background: #19724c;
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

button:hover, .button:hover { background: #115d3d; }

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

aside {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 24px 18px 18px;
  background: #13231c;
  color: #dce8e1;
  border-right: 1px solid #24382f;
}

.logo {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 8px;
  color: #fff;
  font-weight: 750;
  text-decoration: none;
}

.logo > span {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  background: #1b8659;
  font-size: 12px;
  font-weight: 800;
}

.logo div { display: grid; gap: 2px; }
.logo small { color: #829b8e; font-size: 10px; font-weight: 600; }

.site-context {
  display: grid;
  gap: 7px;
  margin: 28px 0 24px;
  padding: 14px;
  border: 1px solid #31463c;
  border-radius: 7px;
  background: #1a2d25;
}

.context-label, .nav-label {
  color: #829b8e;
  font-size: 10px;
  font-weight: 750;
  text-transform: uppercase;
}

.site-context strong { color: #fff; font-size: 14px; }
.site-context select {
  min-width: 0;
  height: 38px;
  padding: 7px 30px 7px 9px;
  border-color: #40584c;
  background: #22382e;
  color: #fff;
}
.site-key { color: #8ea398; font-size: 11px; }
.nav-label { margin: 0 10px 8px; }

nav { display: grid; gap: 5px; }
nav a {
  display: block;
  padding: 11px 12px;
  border-radius: 5px;
  color: #afc1b7;
  text-decoration: none;
  font-size: 14px;
  font-weight: 650;
}
nav a:hover { background: #20362c; color: #fff; }
nav .nav-active { background: #294238; color: #fff; box-shadow: inset 3px 0 #39a876; }

.account {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding: 16px 9px 10px;
  border-top: 1px solid #2a3c34;
}
.account > div { min-width: 0; display: grid; gap: 2px; }
.account strong { overflow: hidden; color: #fff; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.account div span, .muted { color: #82978b; font-size: 11px; }
.avatar {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #d6e8de;
  color: #154a33;
  font-size: 13px;
  font-weight: 800;
}
.logout { margin: 0; }
.logout button { width: 100%; min-height: 34px; padding: 7px 9px; background: transparent; color: #8ea398; font-size: 12px; }
.logout button:hover { background: #20362c; color: #fff; }

.workspace { min-width: 0; padding: 0 clamp(24px, 4vw, 56px) 60px; }
.workspace-inner { width: min(1180px, 100%); margin: 0 auto; }
.page-header, .workspace header {
  min-height: 134px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
  border-bottom: 1px solid #dce3df;
}
.page-header h1, .workspace header h1 { margin: 5px 0 6px; font-size: 25px; }
.page-header p, .workspace header p { margin: 0; color: #68756e; font-size: 13px; }
.eyebrow { color: #1a7650; font-size: 11px; font-weight: 800; }
.save-state { color: #75827b; font-size: 12px; }
.back { display: inline-block; margin-bottom: 10px; color: #52665b; font-size: 12px; text-decoration: none; }

.content-toolbar {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 4px;
}
.content-toolbar div { display: flex; align-items: baseline; gap: 6px; }
.content-toolbar strong { font-size: 18px; }
.content-toolbar span, .content-toolbar p { margin: 0; color: #7b8781; font-size: 12px; }

.table-wrap { overflow: auto; border: 1px solid #d9e1dd; border-radius: 7px; background: #fff; }
table { width: 100%; min-width: 760px; border-collapse: collapse; }
th, td { padding: 13px 15px; border-bottom: 1px solid #edf1ef; text-align: left; font-size: 13px; }
th { background: #f8faf9; color: #69766f; font-size: 11px; font-weight: 750; }
tr:last-child td { border-bottom: 0; }
.title-link { color: #1d2a24; font-weight: 700; text-decoration: none; }
.title-link:hover { color: #157049; }
.status { display: inline-block; padding: 3px 8px; border-radius: 4px; background: #edf1ef; color: #53605a; font-size: 11px; }
.status.published { background: #dcf5e7; color: #137044; }
.actions { display: flex; align-items: center; gap: 6px; }
.actions form { margin: 0; }
.small { min-height: 29px; padding: 5px 9px; background: #edf2ef; color: #254436; font-size: 11px; }
.danger { background: #f7e9e7; color: #a52a22; }
.danger:hover { background: #f0d6d2; }
.empty { padding: 52px 20px; color: #849089; text-align: center; }

.editor-page { max-width: 940px; padding: 28px; border: 1px solid #d9e1dd; border-radius: 7px; background: #fff; }
.editor-page.narrow { max-width: 720px; }
.form-section { padding: 0 0 22px; margin: 0 0 24px; border-bottom: 1px solid #e8ecea; }
.form-section h2 { margin: 0 0 18px; font-size: 15px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.form-grid label { display: grid; gap: 7px; margin-bottom: 16px; font-size: 12px; font-weight: 700; }
.form-grid .wide { grid-column: 1 / -1; }
.form-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 8px; }
.secondary { background: #e8eeeb; color: #30483c; }
.secondary:hover { background: #dce5e0; }
.error { min-height: 20px; color: #b42318; font-size: 12px; }
.success { padding: 10px 12px; border-radius: 5px; background: #eaf6ef; color: #17663f; font-size: 12px; }

fieldset { margin: 0 0 18px; padding: 16px; border: 1px solid #dce3df; border-radius: 6px; }
legend { padding: 0 7px; font-size: 12px; font-weight: 700; }
.check-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.check-grid label { display: flex; align-items: center; gap: 9px; margin: 0; padding: 10px; border: 1px solid #e3e9e6; border-radius: 5px; }
.check-grid input { width: 17px; height: 17px; }
.notice { max-width: 620px; margin-top: 40px; padding: 28px; border: 1px solid #dce3df; border-radius: 7px; background: #fff; }

.login-shell { min-height: 100vh; display: grid; place-items: center; background: #e9efec; }
.login-panel { width: min(390px, calc(100% - 32px)); padding: 36px; border: 1px solid #dce3df; border-radius: 8px; background: #fff; box-shadow: 0 18px 48px rgba(31, 59, 44, .1); }
.brand-mark { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 5px; background: #16724a; color: #fff; font-weight: 800; }
.login-panel h1 { margin: 20px 0 28px; font-size: 24px; }
.login-panel label { display: grid; gap: 7px; margin-bottom: 16px; font-size: 12px; font-weight: 700; }
.login-panel button { width: 100%; }
.setup-panel { width: min(460px, calc(100% - 32px)); }
.setup-panel h1 { margin-bottom: 10px; }
.setup-step { display: block; margin-top: 18px; color: #17734b; font-size: 10px; font-weight: 800; }
.setup-copy { margin: 0 0 24px; color: #627168; font-size: 13px; line-height: 1.7; }

@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; }
  aside { position: static; height: auto; padding: 14px 16px; }
  .logo { padding: 0; }
  .site-context { margin: 16px 0 12px; }
  .nav-label { display: none; }
  nav { grid-template-columns: 1fr 1fr; }
  .account { display: none; }
  .logout { position: absolute; top: 17px; right: 14px; }
  .logout button { width: auto; }
  .workspace { padding: 0 16px 40px; }
  .page-header, .workspace header { min-height: 112px; align-items: flex-start; padding: 24px 0; }
  .save-state { display: none; }
  .form-grid, .check-grid { grid-template-columns: 1fr; }
  .form-grid .wide { grid-column: auto; }
  .editor-page { padding: 18px; }
}
