:root {
  --teal: #0f6e56;
  --teal-dark: #0a5342;
  --teal-deep: #04342c;
  --teal-50: #e1f5ee;
  --teal-100: #9fe1cb;
  --amber: #ba7517;
  --text: #2c2c2a;
  --muted: #5f5e5a;
  --hint: #8a887f;
  --line: #e5e3dc;
  --line-strong: #d3d1c7;
  --bg: #f6f5f1;
  --white: #fff;
  --red: #a32d2d;
  --green: #0f6e56;
  --r: 10px;
  --font: "Inter", "HarmonyOS Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0; font-weight: 500; line-height: 1.35; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
img { display: block; max-width: 100%; }

/* ---------- login ---------- */
.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(900px 480px at 15% 0%, #eaf2ee 0%, rgba(246, 245, 241, 0) 62%),
    var(--bg);
}
.login__card {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 36px 34px 30px;
}
.login__brand { display: flex; align-items: center; gap: 10px; margin-bottom: 26px; }
.login__mark {
  width: 34px; height: 34px; border-radius: 9px; background: var(--teal);
  color: #fff; display: grid; place-items: center; font-size: 15px; font-weight: 500;
}
.login__name { font-size: 15px; font-weight: 500; }
.login__en { font-size: 10px; letter-spacing: 0.2em; color: var(--hint); }
.login h1 { font-size: 21px; margin-bottom: 6px; }
.login__sub { font-size: 13px; color: var(--muted); margin-bottom: 24px; }
.login__hint {
  margin-top: 18px; font-size: 12px; color: var(--hint); text-align: center;
  background: var(--bg); border-radius: 8px; padding: 9px;
}
.login__err { display: none; font-size: 13px; color: var(--red); margin-bottom: 14px; }
.login__err.is-on { display: block; }

/* ---------- layout ---------- */
.app { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: #fff;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 20px 14px 14px;
}
.sidebar__brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 18px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.sidebar__mark { width: 30px; height: 30px; border-radius: 8px; background: var(--teal); color: #fff; display: grid; place-items: center; font-size: 14px; }
.sidebar__name { font-size: 14px; font-weight: 500; line-height: 1.2; }
.sidebar__en { font-size: 10px; letter-spacing: 0.16em; color: var(--hint); }

.menu { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.menu__label { font-size: 11px; color: var(--hint); letter-spacing: 0.1em; padding: 14px 10px 6px; }
.menu button {
  display: flex; align-items: center; gap: 10px; width: 100%;
  border: 0; background: transparent; text-align: left;
  padding: 9px 10px; border-radius: 8px; font-size: 13.5px; color: var(--muted);
  cursor: pointer; font-family: inherit; transition: background 0.15s, color 0.15s;
}
.menu button:hover { background: var(--bg); color: var(--text); }
.menu button.is-on { background: var(--teal-50); color: var(--teal); font-weight: 500; }
.menu button .badge-dot {
  margin-left: auto; font-size: 11px; background: var(--teal); color: #fff;
  border-radius: 999px; padding: 1px 7px; font-weight: 400;
}
.sidebar__foot { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 10px; display: flex; gap: 6px; }
.sidebar__foot a, .sidebar__foot button {
  flex: 1; text-align: center; font-size: 12px; padding: 8px;
  border: 1px solid var(--line-strong); border-radius: 7px; background: #fff;
  color: var(--muted); cursor: pointer; font-family: inherit;
}
.sidebar__foot a:hover, .sidebar__foot button:hover { border-color: var(--teal); color: var(--teal); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  padding: 0 28px;
  height: 64px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.topbar__title { font-size: 16px; font-weight: 500; }
.topbar__sub { font-size: 12px; color: var(--hint); }
.topbar__actions { display: flex; align-items: center; gap: 10px; }
.panels { padding: 26px 28px 80px; max-width: 1080px; width: 100%; }

/* ---------- components ---------- */
.card {
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 22px 24px; margin-bottom: 18px;
}
.card__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.card__title { font-size: 14.5px; font-weight: 500; }
.card__desc { font-size: 12.5px; color: var(--hint); margin-top: 3px; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.field { margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }
.field label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.field .hint { font-size: 11.5px; color: var(--hint); margin-top: 5px; }
.field input, .field select, .field textarea {
  width: 100%; border: 1px solid var(--line-strong); border-radius: 8px;
  padding: 9px 11px; font-size: 13.5px; font-family: inherit; color: var(--text);
  background: #fff; transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(15, 110, 86, 0.1);
}
.field textarea { resize: vertical; min-height: 80px; line-height: 1.65; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 16px; border-radius: 8px; font-size: 13px;
  font-family: inherit; cursor: pointer; border: 1px solid transparent;
  transition: all 0.15s; white-space: nowrap;
}
.btn--primary { background: var(--teal); color: #fff; }
.btn--primary:hover { background: var(--teal-dark); }
.btn--primary:disabled { opacity: 0.55; cursor: not-allowed; }
.btn--ghost { background: #fff; border-color: var(--line-strong); color: var(--muted); }
.btn--ghost:hover { border-color: var(--teal); color: var(--teal); }
.btn--sm { height: 30px; padding: 0 12px; font-size: 12.5px; }
.btn--danger { color: var(--red); border-color: #e8cccc; background: #fff; }
.btn--danger:hover { background: #fcebeb; }

.item { border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; margin-bottom: 12px; background: #fdfdfc; }
.item__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px dashed var(--line); }
.item__title { font-size: 13px; font-weight: 500; color: var(--text); }
.item__title span { color: var(--hint); font-weight: 400; margin-left: 8px; font-size: 12px; }
.item__ops { display: flex; gap: 4px; }
.item__ops button {
  width: 26px; height: 26px; border-radius: 6px; border: 1px solid var(--line-strong);
  background: #fff; color: var(--muted); cursor: pointer; font-size: 12px; line-height: 1;
  display: grid; place-items: center; padding: 0;
}
.item__ops button:hover { border-color: var(--teal); color: var(--teal); }
.item__ops button[data-action="del"]:hover { border-color: var(--red); color: var(--red); }

.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.metric {
  background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px;
}
.metric span { font-size: 12px; color: var(--hint); display: block; margin-bottom: 8px; }
.metric b { font-size: 26px; font-weight: 500; letter-spacing: -0.02em; color: var(--teal); line-height: 1; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  text-align: left; font-weight: 400; color: var(--hint); font-size: 12px;
  padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
td { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td .muted { color: var(--hint); font-size: 12px; }
.pill { display: inline-block; font-size: 11.5px; padding: 2px 9px; border-radius: 999px; background: var(--teal-50); color: var(--teal); }
.pill--gray { background: var(--bg); color: var(--muted); }
.empty { text-align: center; color: var(--hint); padding: 42px 20px; font-size: 13px; }

.media-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.media {
  border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff;
  display: flex; flex-direction: column;
}
.media__thumb { aspect-ratio: 4 / 3; background: var(--bg); display: grid; place-items: center; overflow: hidden; position: relative; }
.media__thumb img { width: 100%; height: 100%; object-fit: cover; }
.media__badge {
  position: absolute; left: 6px; top: 6px; background: rgba(4, 52, 44, 0.78); color: #fff;
  font-size: 10px; padding: 2px 6px; border-radius: 4px; letter-spacing: 0.04em;
}
.media__body { padding: 10px 11px 12px; }
.media__title { font-size: 12.5px; font-weight: 500; margin-bottom: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media__url { font-size: 11px; color: var(--hint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media__ops { display: flex; gap: 6px; margin-top: 8px; }
.media__ops button { flex: 1; font-size: 11.5px; padding: 5px 0; border-radius: 6px; border: 1px solid var(--line-strong); background: #fff; color: var(--muted); cursor: pointer; font-family: inherit; }
.media__ops button:hover { border-color: var(--teal); color: var(--teal); }

.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px);
  background: #1f2b26; color: #fff; font-size: 13px; padding: 11px 20px;
  border-radius: 9px; opacity: 0; pointer-events: none; transition: all 0.25s ease; z-index: 80;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.toast.is-err { background: #7f1d1d; }

.save-state { font-size: 12px; color: var(--hint); }
.save-state.is-dirty { color: var(--amber); }

.hint-box {
  background: var(--teal-50); border: 1px solid #cdeade; border-radius: 10px;
  padding: 12px 16px; font-size: 12.5px; color: #0a5342; line-height: 1.7; margin-bottom: 18px;
}

@media (max-width: 980px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; align-items: center; overflow-x: auto; padding: 10px 12px; }
  .sidebar__brand { border: 0; margin: 0 12px 0 0; padding: 0; }
  .menu { flex-direction: row; gap: 4px; }
  .menu__label { display: none; }
  .menu button { white-space: nowrap; }
  .sidebar__foot { border: 0; margin: 0 0 0 10px; padding: 0; }
  .panels { padding: 18px 16px 60px; }
  .topbar { padding: 0 16px; }
  .grid2, .grid3, .metrics, .media-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .grid2, .grid3, .metrics, .media-grid { grid-template-columns: 1fr; }
}
