/* ColorOS 16 简约风格管理后台 */
:root {
  --bg: #f2f3f5;
  --surface: rgba(255, 255, 255, 0.86);
  --surface-solid: #ffffff;
  --text: #1a1a1a;
  --text-sec: #6b7280;
  --accent: #2d6cff;
  --accent-soft: #e8efff;
  --danger: #e54d42;
  --danger-soft: #fdeceb;
  --border: rgba(0, 0, 0, 0.06);
  --radius: 20px;
  --radius-sm: 14px;
  --shadow: 0 8px 32px rgba(20, 30, 60, 0.06);
  --font: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 10% -10%, #dce8ff 0%, transparent 55%),
    radial-gradient(900px 500px at 100% 0%, #e8f5ef 0%, transparent 50%),
    var(--bg);
  min-height: 100vh;
}

.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 240px;
  padding: 28px 20px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  border-right: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(20px);
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 12px;
  background: linear-gradient(145deg, #4d8bff, #2d6cff);
  box-shadow: 0 6px 16px rgba(45, 108, 255, 0.35);
}
.brand-name { font-size: 18px; font-weight: 700; letter-spacing: 0.02em; }
.brand-sub { font-size: 12px; color: var(--text-sec); margin-top: 2px; }

.nav { display: flex; flex-direction: column; gap: 8px; flex: 1; }
.nav-item {
  text-decoration: none;
  color: var(--text-sec);
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  transition: 0.2s;
}
.nav-item:hover { background: rgba(255,255,255,0.7); color: var(--text); }
.nav-item.active {
  background: var(--surface-solid);
  color: var(--accent);
  box-shadow: var(--shadow);
}

.sidebar-foot {
  font-size: 12px;
  color: var(--text-sec);
  opacity: 0.7;
}
.logout-link {
  color: var(--text-sec);
  text-decoration: none;
  font-size: 13px;
}
.logout-link:hover { color: var(--danger); }

.main {
  flex: 1;
  padding: 40px 48px;
  max-width: 960px;
}

.page-head { margin-bottom: 28px; }
.page-head h1 {
  font-size: 28px;
  font-weight: 650;
  letter-spacing: -0.02em;
}
.page-head p {
  margin-top: 8px;
  color: var(--text-sec);
  font-size: 14px;
}

.section-title {
  font-size: 18px;
  font-weight: 650;
  margin-bottom: 6px;
}
.section-desc {
  font-size: 13px;
  color: var(--text-sec);
  margin-bottom: 20px;
}

.back-link {
  display: inline-block;
  margin-bottom: 12px;
  color: var(--accent);
  text-decoration: none;
  font-size: 14px;
}

.panel {
  background: var(--surface);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
}

.form-row { margin-bottom: 20px; }
.form-row label {
  display: block;
  font-size: 13px;
  color: var(--text-sec);
  margin-bottom: 8px;
  font-weight: 500;
}

.input, .textarea {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--surface-solid);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: 15px;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  font-family: inherit;
}
.input:focus, .textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.textarea { resize: vertical; line-height: 1.6; }

.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.btn {
  border: none;
  cursor: pointer;
  border-radius: 999px;
  padding: 11px 20px;
  font-size: 14px;
  font-weight: 560;
  transition: 0.2s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 6px 16px rgba(45, 108, 255, 0.3);
}
.btn-primary:hover { filter: brightness(1.05); }
.btn-ghost {
  background: var(--surface-solid);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-danger {
  background: var(--danger-soft);
  color: var(--danger);
}
.file-btn { cursor: pointer; }

.search-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}
.search-bar .input { flex: 1; }

.result-box {
  margin-top: 20px;
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  word-break: break-all;
}
.result-box a { color: var(--accent); }
.result-box.err { background: var(--danger-soft); color: var(--danger); }
.hidden { display: none !important; }

.record-list { display: flex; flex-direction: column; gap: 10px; }
.record-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border-radius: var(--radius-sm);
  background: var(--surface-solid);
  border: 1px solid var(--border);
  transition: 0.2s;
  color: inherit;
}
.record-item:hover {
  border-color: rgba(45, 108, 255, 0.25);
  box-shadow: 0 4px 16px rgba(45, 108, 255, 0.06);
}
.record-cover {
  width: 64px; height: 64px;
  border-radius: 12px;
  object-fit: cover;
  background: var(--bg);
  flex-shrink: 0;
}
.record-cover.placeholder {
  display: flex; align-items: center; justify-content: center;
  color: var(--text-sec); font-size: 12px;
}
.record-body { flex: 1; min-width: 0; }
.record-title {
  font-size: 15px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.record-meta {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-sec);
}
.record-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex-shrink: 0;
}
.btn-sm {
  padding: 8px 14px;
  font-size: 13px;
}

.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(15, 20, 35, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  backdrop-filter: blur(4px);
}
.modal-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface-solid);
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(20, 30, 60, 0.18);
  padding: 28px;
  border: 1px solid var(--border);
}
.modal-title {
  font-size: 18px;
  font-weight: 650;
  margin-bottom: 12px;
}
.modal-msg {
  font-size: 14px;
  color: var(--text-sec);
  line-height: 1.6;
  margin-bottom: 24px;
}
.modal-actions {
  justify-content: flex-end;
}

.pager {
  margin-top: 20px;
  display: flex;
  justify-content: center;
  gap: 8px;
  align-items: center;
  font-size: 13px;
  color: var(--text-sec);
}

.img-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
}
.img-card {
  position: relative;
  aspect-ratio: 1;
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg);
  border: 1px solid var(--border);
}
.img-card img {
  width: 100%; height: 100%; object-fit: cover; cursor: zoom-in;
}
.img-card .del {
  position: absolute; top: 6px; right: 6px;
  width: 24px; height: 24px; border-radius: 50%;
  border: none; background: rgba(0,0,0,0.55); color: #fff;
  cursor: pointer; font-size: 14px; line-height: 1;
}

.detail-title { font-size: 22px; margin-bottom: 16px; }
.detail-content {
  white-space: pre-wrap;
  line-height: 1.7;
  color: var(--text-sec);
  margin-bottom: 24px;
  font-size: 15px;
}

.lightbox {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.82);
  display: flex; align-items: center; justify-content: center;
  z-index: 100; padding: 24px;
}
.lightbox img {
  max-width: 100%; max-height: 100%;
  border-radius: 8px;
}

.empty {
  text-align: center;
  padding: 48px 16px;
  color: var(--text-sec);
  font-size: 14px;
}

@media (max-width: 768px) {
  .app-shell { flex-direction: column; }
  .sidebar {
    width: 100%;
    flex-direction: row;
    align-items: center;
    padding: 16px;
    gap: 16px;
  }
  .nav { flex-direction: row; }
  .sidebar-foot { display: none; }
  .main { padding: 24px 16px; }
}
