:root {
  --bg: #f3f7ff;
  --panel: rgba(255, 255, 255, 0.26);
  --panel-strong: rgba(255, 255, 255, 0.18);
  --primary: #2f6ef7;
  --primary-dark: #1d57d7;
  --danger: #e54d4d;
  --text: #1d2433;
  --muted: #667085;
  --border: rgba(255, 255, 255, 0.3);
  --shadow: 0 18px 40px rgba(57, 72, 108, 0.18);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  width: 100%;
  min-height: 100%;
  font-family: Arial, "Microsoft YaHei", sans-serif;
  color: var(--text);
}

body {
  background:
    linear-gradient(rgba(17, 31, 55, 0.1), rgba(17, 31, 55, 0.2)),
    url('https://images.unsplash.com/photo-1500375592092-40eb2168fd21?auto=format&fit=crop&w=1800&q=80') center/cover no-repeat;
}

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

button {
  cursor: pointer;
}

.desktop-shell {
  width: 100%;
  min-height: 100vh;
  position: relative;
  padding: 18px 28px 24px;
}

.desktop-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 4px auto 18px;
  padding: 10px 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: var(--shadow);
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-weight: 700;
}

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f7f7f7, #d9eaf7);
  border: 2px solid rgba(255,255,255,0.8);
  color: #2d6df8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  box-shadow: 0 8px 20px rgba(17, 93, 180, 0.2);
}

.brand-text {
  font-size: 16px;
  letter-spacing: 1px;
}

.status-pill {
  min-width: 180px;
  text-align: center;
  background: rgba(255,255,255,0.2);
  color: #f9fbff;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 12px;
}

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

.top-action {
  border: 1px solid rgba(255,255,255,0.28);
  background: rgba(255,255,255,0.14);
  color: #fff;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 12px;
  cursor: pointer;
  box-shadow: inset 0 0 14px rgba(255,255,255,0.1);
}

.top-action.ghost {
  background: rgba(128, 199, 255, 0.15);
}

.desktop-window {
  max-width: 1200px;
  min-height: 700px;
  margin: 0 auto;
  border-radius: 22px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  backdrop-filter: blur(8px);
  box-shadow: 0 24px 60px rgba(24, 48, 77, 0.18);
  padding: 18px 18px 12px;
  position: relative;
}

.window-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px 18px;
  color: rgba(255,255,255,0.96);
  font-size: 14px;
}

.search-panel {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 160px;
  height: 44px;
  padding: 0 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255,255,255,0.18);
  backdrop-filter: blur(8px);
}

.search-icon {
  color: rgba(255,255,255,0.8);
  font-size: 22px;
  line-height: 1;
}

.resource-search {
  flex: 1;
  height: 100%;
  border: none;
  outline: none;
  background: transparent;
  color: #fff;
  font-size: 14px;
}

.resource-search::placeholder {
  color: rgba(255,255,255,0.7);
}

.window-badge {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
}

.desktop-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  padding: 10px 10px 0;
  align-content: flex-start;
}

.desktop-item {
  width: 104px;
  min-height: 110px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  text-align: center;
  padding: 6px 4px;
  border-radius: 12px;
  transition: transform 0.2s ease, background 0.2s ease;
}

.desktop-item:hover {
  background: rgba(255,255,255,0.08);
  transform: translateY(-2px);
}

.file-type-icon {
  width: 46px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 4px;
}

.file-type-icon i {
  font-size: 30px;
  line-height: 1;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.icon-folder i {
  color: #ffd86b;
}

.icon-archive i {
  color: #ffca4d;
}

.icon-disk i {
  color: #b4c9ff;
}

.icon-file i {
  color: #dfe9ff;
}

.desktop-name {
  width: 100%;
  font-size: 12px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.empty-state {
  width: 100%;
  height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.8);
  font-size: 18px;
  letter-spacing: 1px;
  text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.admin-shell {
  max-width: 1280px;
  margin: 40px auto;
  padding: 0 20px 40px;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  color: #fff;
}

.admin-header h1 {
  margin: 0;
}

.header-actions {
  display: flex;
  gap: 10px;
}

.admin-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.panel {
  background: rgba(255,255,255,0.82);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 18px;
  backdrop-filter: blur(10px);
}

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

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

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

.folder-breadcrumb {
  flex: 1;
  background: rgba(46,110,247,0.08);
  border: 1px solid rgba(46,110,247,0.14);
  border-radius: 12px;
  padding: 8px 10px;
  font-size: 12px;
  color: var(--primary-dark);
  word-break: break-word;
}

.folder-tree {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 200px;
}

.tree-empty {
  color: var(--muted);
  font-size: 12px;
  margin-left: 8px;
}

.folder-tree-item {
  background: #eef5ff;
  border: 1px solid #dbe7ff;
  border-radius: 10px;
  padding: 8px 10px;
  color: var(--text);
  text-align: left;
  width: 100%;
}

.folder-tree-item.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.admin-main {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-panel textarea {
  width: 100%;
  min-height: 180px;
  border: 1px solid #dfe7f5;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14px;
  font-family: Consolas, "Microsoft YaHei", monospace;
  resize: vertical;
}

.form-panel input {
  width: 100%;
  border: 1px solid #dfe7f5;
  border-radius: 10px;
  padding: 8px 10px;
}

.batch-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.preview-box {
  display: none;
}

.preview-box.visible {
  display: block;
}

.message {
  min-height: 24px;
  margin-top: 12px;
}

.message.success {
  color: #0b8d5a;
}

.message.error {
  color: #e54d4d;
}

.upload-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 12px 0;
  flex-wrap: wrap;
}

.upload-row input[type="file"] {
  flex: 1;
  min-width: 220px;
}

.current-folder-label {
  margin-bottom: 12px;
  font-weight: 600;
  color: #1d4fb7;
}

.primary,
.secondary,
.danger {
  border-radius: 10px;
  border: 1px solid transparent;
  padding: 8px 14px;
  font-size: 13px;
}

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

.primary.small,
.secondary.small,
.danger.small {
  padding: 6px 10px;
  font-size: 12px;
}

.secondary {
  background: #edf4ff;
  color: var(--primary-dark);
  border-color: #dce9ff;
}

.danger {
  background: #fff0f0;
  color: var(--danger);
  border-color: #ffd4d4;
}

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

.thank-you-panel textarea {
  width: 100%;
  min-height: 140px;
  resize: vertical;
  border: 1px solid #dfe7f5;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14px;
  font-family: Consolas, "Microsoft YaHei", monospace;
}

.thank-you-footer {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 30;
}

.thank-you-link {
  border: 1px solid rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.18);
  color: #fff;
  border-radius: 999px;
  padding: 10px 22px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 1px;
  cursor: pointer;
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.12);
}

.thank-you-modal {
  position: fixed;
  inset: 0;
  background: rgba(18, 27, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 40;
}

.thank-you-modal.hidden {
  display: none;
}

.thank-you-modal-panel {
  width: min(520px, 90vw);
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(255,255,255,0.65);
  border-radius: 20px;
  padding: 20px;
  box-shadow: var(--shadow);
}

.thank-you-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.thank-you-modal-header h3 {
  margin: 0;
  font-size: 20px;
}

.thank-you-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.thank-you-item {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f2f7ff;
  border: 1px solid #dfeaff;
  color: #1d4fb7;
  text-decoration: none;
  transition: background 0.2s ease;
}

.thank-you-item:hover {
  background: #e8f1ff;
}

.thank-you-empty {
  margin: 0;
  color: var(--muted);
  text-align: center;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
}

th, td {
  padding: 10px 8px;
  border-bottom: 1px solid #edf1f7;
  text-align: left;
  vertical-align: top;
  font-size: 13px;
  word-break: break-word;
}

th {
  background: rgba(46,110,247,0.04);
  color: var(--muted);
  font-weight: 700;
}

input[data-field] {
  width: 100%;
  min-width: 120px;
}

.move-select {
  margin-left: 6px;
  margin-right: 6px;
  border: 1px solid #dfe7f5;
  border-radius: 8px;
  padding: 6px 8px;
}

.tiny-link {
  color: #2f6ef7;
  text-decoration: none;
}

.empty {
  color: var(--muted);
}

.folder-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(17, 24, 39, 0.45);
  z-index: 1000;
}

.folder-modal.visible {
  display: flex;
}

.folder-modal-panel {
  width: min(420px, calc(100vw - 32px));
  background: rgba(255,255,255,0.96);
  border: 1px solid rgba(63, 98, 187, 0.14);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 20px 18px 16px;
}

.folder-modal-panel h3 {
  margin: 0 0 12px;
  font-size: 22px;
}

.folder-modal-label {
  display: block;
  margin-bottom: 10px;
  font-size: 13px;
  color: var(--muted);
}

.folder-modal-panel input {
  width: 100%;
  border: 1px solid #dfe7f5;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 16px;
}

.folder-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}


@media (max-width: 820px) {
  .desktop-shell {
    padding: 12px 12px 18px;
  }

  .desktop-topbar {
    padding: 10px 12px;
    gap: 10px;
    flex-wrap: wrap;
  }

  .desktop-window {
    min-height: 560px;
  }

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