:root {
  --ink: #17242d;
  --muted: #60717b;
  --line: #d8e0e4;
  --paper: #ffffff;
  --soft: #f4f7f8;
  --blue: #24485f;
  --green: #4f8b7d;
  --coral: #d85b49;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--soft);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", sans-serif;
}

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

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

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

.login-panel {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(320px, 440px);
  gap: 48px;
  align-items: center;
  min-height: 100vh;
  padding: 7vw;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--coral);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 16px;
  font-size: clamp(2.4rem, 6vw, 5rem);
  line-height: 1;
}

h2 {
  font-size: 1.2rem;
}

.login-panel p {
  max-width: 680px;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.65;
}

.form-card,
.editor-card,
.content-card {
  padding: 24px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
}

label {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

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

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(79, 139, 125, 0.16);
}

button,
.sidebar-actions a {
  min-height: 42px;
  padding: 10px 14px;
  color: #fff;
  background: var(--blue);
  border: 0;
  border-radius: 8px;
  font-weight: 800;
}

.form-card small {
  display: block;
  margin-top: 12px;
  color: var(--muted);
}

.login-message {
  min-height: 22px;
  margin: 10px 0 0;
  color: var(--coral) !important;
  font-size: 0.92rem !important;
  font-weight: 800;
}

.admin-view {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 28px;
  height: 100vh;
  padding: 24px;
  color: #dce6ea;
  background: #101b22;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 900;
}

.brand img {
  width: 76px;
  height: 58px;
  object-fit: contain;
  padding: 4px;
  background: #fff;
  border-radius: 8px;
}

.sidebar nav {
  display: grid;
  gap: 8px;
}

.tab-button {
  width: 100%;
  color: #b8c7ce;
  background: transparent;
  text-align: left;
}

.tab-button.is-active {
  color: #fff;
  background: rgba(255, 255, 255, 0.11);
}

.sidebar-actions {
  display: grid;
  gap: 10px;
  margin-top: auto;
}

.sidebar-actions button,
.sidebar-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#resetButton {
  color: var(--ink);
  background: #e8eef1;
}

.workspace {
  padding: 34px;
}

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

.workspace-header h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 4vw, 3.4rem);
}

.save-status {
  padding: 8px 12px;
  color: var(--blue);
  background: #e7f0ec;
  border-radius: 8px;
  font-weight: 800;
}

.panel {
  display: none;
}

.panel.is-active {
  display: block;
}

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

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

.list-editor {
  display: grid;
  gap: 16px;
}

.content-card {
  display: grid;
  gap: 16px;
}

.content-card-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
}

.content-card-header h3 {
  margin: 0;
}

.content-card-header h4,
.content-card-header h5 {
  margin: 0;
}

.remove-button {
  color: #fff;
  background: var(--coral);
}

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

.inline-check {
  display: flex;
  gap: 10px;
  align-items: center;
}

.inline-check input {
  width: auto;
}

.nested-editor {
  display: grid;
  gap: 12px;
  padding-top: 4px;
}

.action-editor {
  display: grid;
  gap: 12px;
}

.action-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.member-photo-row {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 18px;
  align-items: start;
}

.member-photo-preview {
  display: grid;
  place-items: center;
  width: 112px;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  color: #fff;
  background: var(--green);
  border-radius: 8px;
  font-weight: 900;
}

.member-photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

label small {
  color: var(--muted);
  font-weight: 500;
  line-height: 1.45;
}

@media (max-width: 900px) {
  .login-panel,
  .admin-view,
  .language-grid,
  .field-grid {
    grid-template-columns: 1fr;
  }

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

  .workspace {
    padding: 22px;
  }
}
