:root {
  --accent: #2e6be6;
  --accent-dark: #2157c4;
  --bg: #f4f5f7;
  --surface: #ffffff;
  --text: #17191e;
  --muted: #7b8391;
  --line: #e9ecf2;
  --danger: #d64545;
  --ok: #1f9d63;
  --radius: 16px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 236px;
  flex: 0 0 236px;
  background: #161b24;
  color: #cbd2dd;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px 24px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 11px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.brand-title {
  color: #fff;
  font-size: 15px;
  font-weight: 700;
}

.brand-sub {
  color: #8b94a3;
  font-size: 12px;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav a {
  color: #c2c9d4;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 14px;
}

.nav a:hover {
  background: #242b37;
  text-decoration: none;
}

.nav a.active {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}

.sidebar-foot {
  margin-top: auto;
  padding: 16px 8px 0;
  border-top: 1px solid #2a3240;
  color: #aab3c0;
}

.who {
  color: #fff;
  font-weight: 600;
  font-size: 14px;
}

.who-phone {
  font-size: 12px;
  color: #8b94a3;
  margin-bottom: 8px;
}

.link-btn {
  background: none;
  border: none;
  padding: 0;
  color: #c2c9d4;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.link-btn:hover {
  color: #fff;
  text-decoration: underline;
}

.link-btn.danger {
  color: var(--danger);
}

.main {
  flex: 1;
  min-width: 0;
  padding: 32px;
  max-width: 1360px;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.page-head h1 {
  margin: 0;
  font-size: 26px;
  letter-spacing: -0.02em;
}

.page-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.back {
  display: inline-block;
  margin-bottom: 8px;
  font-size: 13px;
}

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

.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 1px 0 rgba(23, 25, 30, 0.03);
}

.card-label {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 8px;
}

.card-value {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: 20px;
}

.panel {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  overflow: hidden;
}

.panel + .panel {
  margin-top: 20px;
}

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

.panel h2 {
  margin: 0 0 14px;
  font-size: 16px;
}

.panel-head h2 {
  margin: 0;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 11px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  font-size: 13px;
}

th {
  color: var(--muted);
  font-weight: 600;
  background: #fafbfc;
}

tr:last-child td {
  border-bottom: none;
}

.muted {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.nowrap {
  white-space: nowrap;
}

.ellipsis {
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
}

.badge.on {
  color: var(--ok);
  background: #e8f7ef;
}

.badge.off {
  color: #8a929f;
  background: #eef0f4;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  padding: 0 16px;
  border-radius: 10px;
  border: 1px solid transparent;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

.btn:hover {
  text-decoration: none;
}

.btn.primary {
  background: var(--accent);
  color: #fff;
}

.btn.primary:hover {
  background: var(--accent-dark);
}

.btn.ghost {
  background: #fff;
  border-color: var(--line);
  color: var(--text);
}

.btn.wide {
  width: 100%;
  height: 44px;
  font-size: 14px;
}

.actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.actions form {
  display: inline;
}

.flash {
  border-radius: 12px;
  padding: 11px 14px;
  margin: 0 0 18px;
  font-size: 13px;
}

.flash.ok {
  background: #e8f7ef;
  color: #13784a;
}

.flash.err {
  background: #fdecec;
  color: #a83232;
}

.empty {
  color: var(--muted);
  padding: 28px 8px;
  text-align: center;
  font-size: 13px;
}

.searchbar {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
}

.searchbar input {
  flex: 1;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 14px;
  font: inherit;
  font-size: 13px;
  background: #fff;
}

.audit-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.audit-list li {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: baseline;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}

.audit-list li:last-child {
  border-bottom: none;
}

.audit-action {
  font-weight: 600;
  color: var(--accent);
}

.audit-time {
  color: var(--muted);
  white-space: nowrap;
}

.form-panel {
  max-width: 560px;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
}

.field input {
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 0 13px;
  font: inherit;
  font-size: 14px;
  font-weight: 400;
  background: #fff;
  color: var(--text);
}

.field input:focus {
  outline: 2px solid rgba(46, 107, 230, 0.25);
  border-color: var(--accent);
}

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.hint {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.form-actions {
  display: flex;
  gap: 10px;
  padding-top: 4px;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.folder-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.folder-card {
  display: block;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  color: var(--text);
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.folder-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(23, 25, 30, 0.08);
  text-decoration: none;
}

.folder-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.folder-icon {
  position: relative;
  width: 42px;
  height: 34px;
  flex: 0 0 42px;
  border-radius: 8px;
  background: #eaf1fe;
}

.folder-icon::before {
  content: "";
  position: absolute;
  left: 5px;
  top: -5px;
  width: 18px;
  height: 11px;
  border-radius: 5px 5px 0 0;
  background: #eaf1fe;
}

.folder-icon::after {
  content: "";
  position: absolute;
  left: 11px;
  right: 11px;
  top: 14px;
  height: 3px;
  border-radius: 2px;
  background: var(--accent);
  opacity: 0.45;
}

.folder-name {
  font-size: 17px;
  font-weight: 700;
  word-break: break-all;
}

.folder-meta {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 10px;
}

.folder-stats {
  display: flex;
  justify-content: space-between;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.folder-time {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 16px;
}

.photo-card {
  display: block;
  background: var(--surface);
  border-radius: 14px;
  overflow: hidden;
  color: var(--text);
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.photo-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(23, 25, 30, 0.09);
  text-decoration: none;
}

.photo-card img {
  display: block;
  width: 100%;
  height: 150px;
  object-fit: cover;
  background: #eef0f4;
}

.photo-meta {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 12px;
}

.photo-meta .muted {
  font-size: 11px;
}

.pagination {
  display: flex;
  align-items: center;
  gap: 14px;
  justify-content: center;
  margin-top: 22px;
  color: var(--muted);
  font-size: 13px;
}

.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  background: linear-gradient(160deg, #f7f9fc 0%, #eef2f9 100%);
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border-radius: 22px;
  padding: 32px;
  box-shadow: 0 20px 60px rgba(23, 25, 30, 0.09);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}

.login-brand h1 {
  margin: 0;
  font-size: 20px;
}

.login-brand p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.login-hint {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

@media (max-width: 1080px) {
  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .split {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .layout {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    flex: 0 0 auto;
    height: auto;
    min-height: 0;
    position: static;
    padding: 16px;
  }

  .nav {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .sidebar-foot {
    display: none;
  }

  .main {
    padding: 20px 16px 40px;
  }

  .page-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .cards {
    grid-template-columns: 1fr 1fr;
  }

  .ellipsis {
    max-width: 160px;
  }

  table {
    display: block;
    overflow-x: auto;
  }
}
