:root {
  --bg: #f5f8ff;
  --panel: rgba(255, 255, 255, 0.96);
  --panel-strong: #ffffff;
  --line: rgba(0, 0, 0, 0.12);
  --text: #000000;
  --muted: rgba(0, 0, 0, 0.64);
  --accent: #0b57d0;
  --accent-dark: #0b57d0;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
}

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

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

button,
.ghost {
  border: 0;
  border-radius: 6px;
  padding: 12px 16px;
  background: var(--accent);
  color: #ffffff;
  cursor: pointer;
}

.ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--accent-dark);
  border: 1px solid var(--line);
}

input,
textarea,
select {
  width: 100%;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #ffffff;
  padding: 12px 14px;
  color: var(--text);
}

textarea {
  min-height: 100px;
  resize: vertical;
}

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

.eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--accent-dark);
}

.muted,
.form-message,
.form-hint {
  color: var(--muted);
}

.hidden {
  display: none !important;
}

.panel,
.login-card,
.admin-user-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.panel {
  padding: 10px;
  border-radius: 8px;
}

.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.dashboard-stat-card {
  border: 1px solid rgba(11, 87, 208, 0.12);
  border-radius: 8px;
  background: #f9fbff;
  padding: 18px 16px;
  display: grid;
  gap: 8px;
}

.dashboard-stat-card span {
  color: var(--muted);
  font-size: 13px;
}

.dashboard-stat-card strong {
  font-size: 28px;
  line-height: 1.1;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
}

.login-card {
  width: 100%;
  padding: 34px 36px;
  border-radius: 24px;
}

.login-layout {
  width: min(1240px, 100%);
  min-height: min(760px, calc(100vh - 56px));
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(420px, 500px);
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(11, 87, 208, 0.08);
  border-radius: 28px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.login-visual {
  position: relative;
  min-height: 100%;
  display: grid;
  align-items: end;
  padding: 42px;
  background:
    linear-gradient(135deg, rgba(9, 51, 125, 0.76), rgba(16, 98, 210, 0.28)),
    linear-gradient(160deg, #0b57d0 0%, #123a7a 100%);
  color: #ffffff;
}

.login-visual-cover {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(9, 24, 48, 0.08), rgba(9, 24, 48, 0.64)),
    url("https://bassballpic.oss-cn-beijing.aliyuncs.com/photoesshow/20260626/img_6a3e3f05748434.91690752.jpg");
  background-size: cover;
  background-position: center;
  mix-blend-mode: soft-light;
}

.login-visual-copy {
  position: relative;
  z-index: 1;
  max-width: 520px;
  display: grid;
  gap: 16px;
}

.login-visual-copy .eyebrow,
.login-visual-copy h1,
.login-visual-copy p {
  color: #ffffff;
}

.login-visual-copy .eyebrow {
  font-size: 13px;
  letter-spacing: 0.14em;
  opacity: 0.86;
}

.login-visual-copy h1 {
  margin-bottom: 0;
  font-size: clamp(34px, 4vw, 52px);
  line-height: 1.08;
}

.login-visual-copy p:last-child {
  margin-bottom: 0;
  max-width: 460px;
  font-size: 17px;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.84);
}

.login-card h2 {
  margin-bottom: 10px;
  font-size: 40px;
}

body[data-page="admin-login"] .eyebrow {
  text-transform: none;
  letter-spacing: 0;
}

body[data-page="admin-login"] .muted {
  margin-bottom: 24px;
}

body[data-page="admin-login"] #login-form button {
  min-height: 52px;
  font-size: 18px;
}

.stack-form {
  display: grid;
  gap: 12px;
}

.admin-layout {
  width: 100%;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 236px 1fr;
}

.admin-sidebar {
  padding: 10px 12px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  background: var(--accent);
  color: #ffffff;
}

.admin-brand {
  margin-bottom: 10px;
  padding: 8px 10px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.admin-brand .eyebrow,
.admin-brand h1 {
  color: #ffffff;
}

.admin-brand h1 {
  margin-bottom: 0;
  font-size: 28px;
  line-height: 1.2;
}

.admin-menu {
  display: grid;
  gap: 10px;
}

.admin-menu-group {
  display: grid;
  gap: 4px;
}

.admin-menu-label {
  margin: 0;
  padding: 0 10px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.admin-menu-item {
  width: 100%;
  text-align: left;
  background: transparent;
  color: rgba(255, 255, 255, 0.92);
  border: 0;
  font-weight: 600;
  padding: 11px 14px;
  border-radius: 4px;
}

.admin-menu-item.active {
  background: #ffffff;
  color: var(--accent);
}

.admin-content {
  display: grid;
  grid-template-rows: auto 1fr;
  min-width: 0;
  background: var(--bg);
}

.admin-topbar {
  min-height: 68px;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
}

.admin-topbar h2 {
  margin-bottom: 0;
  font-size: 24px;
}

.admin-topbar .eyebrow {
  margin-bottom: 4px;
}

#admin-page-title {
  margin-top: 4px;
  margin-bottom: 0;
}

.admin-userbar,
.admin-user-trigger-wrap {
  position: relative;
}

.admin-user-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  width: 180px;
  padding: 8px;
  border-radius: 4px;
  display: grid;
  gap: 4px;
  z-index: 20;
}

.admin-user-menu-item {
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.admin-user-menu-item:hover {
  background: rgba(11, 87, 208, 0.06);
  color: var(--accent);
}

.admin-modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 60;
  padding: 24px;
}

.admin-modal-card {
  width: min(420px, 100%);
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 18px;
  display: grid;
  gap: 14px;
}

.info-pair {
  display: grid;
  gap: 6px;
}

.info-pair span {
  color: var(--muted);
  font-size: 13px;
}

.admin-panels {
  display: block;
  padding: 10px 16px 16px;
}

.empty-panel {
  min-height: 360px;
  display: grid;
  align-content: start;
}

.admin-section .panel {
  box-shadow: none;
  border-color: rgba(11, 87, 208, 0.12);
}

.admin-section .panel h3 {
  margin-bottom: 10px;
  font-size: 18px;
}

.section-toolbar,
.detail-panel-header,
.detail-header,
.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.section-toolbar {
  margin-bottom: 10px;
}

.toolbar-group,
.row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.toolbar-search {
  min-width: 320px;
}

.data-table {
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
  background: #ffffff;
}

.data-row {
  display: grid;
  align-items: center;
  gap: 16px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

.data-row:last-child {
  border-bottom: 0;
}

.data-head {
  background: rgba(11, 87, 208, 0.06);
  font-weight: 600;
}

.data-row:not(.data-head):hover {
  background: rgba(11, 87, 208, 0.03);
}

.project-row {
  grid-template-columns: 1.4fr 120px .7fr .7fr .7fr .8fr 1.3fr;
}

.folder-row {
  grid-template-columns: 1.6fr .7fr 1.4fr;
}

.user-row {
  grid-template-columns: 1fr 1fr 1fr .7fr 1.2fr;
}

.role-row {
  grid-template-columns: 1fr 1.6fr .7fr 1fr;
}

.operation-log-row {
  grid-template-columns: 1.1fr .9fr .9fr .9fr 1fr 1.3fr 1fr;
}

.log-request {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 12px;
  color: var(--muted);
}

.permission-groups {
  display: grid;
  gap: 12px;
}

.permission-group {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #f9fbff;
  padding: 12px;
  display: grid;
  gap: 10px;
}

.permission-group h4 {
  margin: 0;
  font-size: 14px;
}

.permission-options {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
}

.permission-option {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
  padding: 0;
  border: 0;
  background: transparent;
  min-width: auto;
}

.permission-option input {
  margin: 0;
  flex: 0 0 auto;
}

.row-actions .ghost {
  background: #ffffff;
  color: var(--accent);
}

.table-empty {
  border: 1px dashed var(--line);
  border-radius: 4px;
  padding: 20px;
  color: var(--muted);
  background: #ffffff;
}

.primary-cell {
  display: grid;
  gap: 4px;
}

.primary-cell span {
  color: var(--muted);
  font-size: 13px;
}

.table-thumb {
  width: 88px;
  height: 56px;
  border-radius: 4px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: #eef4ff;
}

.placeholder-thumb {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
}

.detail-header-panel {
  margin-bottom: 10px;
}

.detail-header {
  align-items: start;
}

.detail-hero {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 10px;
  align-items: start;
}

.detail-main {
  min-width: 0;
}

.detail-cover-card {
  border: 1px solid rgba(11, 87, 208, 0.12);
  background: #ffffff;
  padding: 12px;
  border-radius: 4px;
}

.detail-cover {
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 4px;
  background: #eef4ff;
}

.detail-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-stats {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.stat-chip {
  border: 1px solid rgba(11, 87, 208, 0.12);
  border-radius: 4px;
  padding: 14px;
  background: #f9fbff;
  display: grid;
  gap: 6px;
}

.stat-chip span {
  color: var(--muted);
  font-size: 12px;
}

.stat-chip strong {
  font-size: 18px;
}

.folder-link-btn {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.folder-link-btn strong {
  font-size: 14px;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.22);
  z-index: 40;
}

.side-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(460px, 100%);
  height: 100vh;
  background: #ffffff;
  border-left: 1px solid var(--line);
  box-shadow: -10px 0 28px rgba(0, 0, 0, 0.12);
  z-index: 50;
  padding: 10px;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 10px;
  border-radius: 4px 0 0 4px;
}

.drawer-form {
  align-content: start;
}

.form-field {
  display: grid;
  gap: 8px;
}

.form-field label {
  font-size: 14px;
  font-weight: 600;
}

#project-cover-preview {
  display: grid;
  gap: 8px;
}

#project-cover-preview img {
  width: 100%;
  max-width: 220px;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: #eef4ff;
}

.list-card,
.image-card {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #ffffff;
}

.image-grid {
  display: grid;
  gap: 10px;
}

#folder-image-list.image-grid {
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}

#folder-image-list .image-card {
  position: relative;
  padding: 6px;
  overflow: hidden;
}

#folder-image-list .image-card img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: rgba(0, 0, 0, 0.04);
}

#folder-image-list .image-card video {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: #0a0a0a;
}

#folder-image-list .image-meta {
  font-size: 12px;
  padding-top: 6px;
}

.image-title-line {
  display: grid;
  gap: 4px;
}

.image-delete-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.68);
  color: #ffffff;
  font-size: 14px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.image-delete-btn:hover {
  background: rgba(0, 0, 0, 0.82);
}

.cover-upload-status {
  display: grid;
  gap: 8px;
}

.cover-upload-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.progress-track {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(11, 87, 208, 0.12);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0;
  background: var(--accent);
}

@media (max-width: 980px) {
  .login-layout {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .login-visual {
    min-height: 280px;
    padding: 28px 24px;
  }

  .login-card {
    padding: 28px 24px;
    border-radius: 0;
  }

  .admin-layout,
  .detail-hero {
    grid-template-columns: 1fr;
  }

  .project-row,
  .folder-row,
  .user-row,
  .role-row {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    position: static;
    height: auto;
    padding: 16px 12px;
  }

  .admin-topbar,
  .detail-header,
  .section-toolbar {
    align-items: start;
    flex-direction: column;
  }

  .toolbar-group {
    width: 100%;
  }

  .toolbar-search {
    min-width: 0;
  }

  .detail-stats {
    grid-template-columns: 1fr;
  }

  .dashboard-stats {
    grid-template-columns: 1fr;
  }

  #folder-image-list.image-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }

  .side-drawer {
    width: 100%;
  }
}

@media (min-width: 1440px) {
  #folder-image-list.image-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }
}
