:root {
  --bg: #0b1020;
  --bg-soft: #121933;
  --card: rgba(255, 255, 255, 0.08);
  --card-border: rgba(255, 255, 255, 0.14);
  --text: #f4f7ff;
  --muted: #b8c2e0;
  --primary: #5da8ff;
  --primary-hover: #3f95f6;
  --secondary: rgba(255, 255, 255, 0.08);
  --secondary-hover: rgba(255, 255, 255, 0.14);
  --success: #2ecc71;
  --danger: #ff6b6b;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}

body.light-mode {
  --bg: #eef4ff;
  --bg-soft: #dce8ff;
  --card: rgba(255, 255, 255, 0.7);
  --card-border: rgba(255, 255, 255, 0.9);
  --text: #11203f;
  --muted: #5a6c92;
  --primary: #1677ff;
  --primary-hover: #0e62d6;
  --secondary: rgba(17, 32, 63, 0.06);
  --secondary-hover: rgba(17, 32, 63, 0.12);
  --shadow: 0 20px 50px rgba(60, 90, 160, 0.18);
}

* {
  box-sizing: border-box;
}

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

body {
  min-height: 100vh;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background:
    radial-gradient(circle at top left, var(--bg-soft), transparent 35%),
    radial-gradient(circle at bottom right, #13254f, transparent 25%),
    var(--bg);
  color: var(--text);
  transition: background 0.3s ease, color 0.3s ease;
}

.bg-blur {
  position: fixed;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.25;
  pointer-events: none;
  z-index: 0;
}

.bg-blur-1 {
  width: 220px;
  height: 220px;
  top: 80px;
  left: -40px;
  background: #3a86ff;
}

.bg-blur-2 {
  width: 260px;
  height: 260px;
  right: -60px;
  bottom: 120px;
  background: #7b61ff;
}

.topbar,
.container,
.footer {
  position: relative;
  z-index: 1;
}

.topbar {
  padding: 24px 20px 10px;
}

.topbar-inner,
.container {
  width: min(1100px, calc(100% - 32px));
  margin: 0 auto;
}

.topbar-inner {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-logo {
  width: 62px;
  height: 62px;
  object-fit: contain;
  border-radius: 18px;
  background: rgba(255,255,255,0.08);
  padding: 8px;
  backdrop-filter: blur(12px);
}

.brand-kicker {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand h1 {
  margin: 0;
  font-size: clamp(26px, 4vw, 38px);
}

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

.icon-button,
.primary-button,
.secondary-button {
  border: none;
  border-radius: 14px;
  cursor: pointer;
  transition: 0.2s ease;
  font-size: 15px;
}

.icon-button {
  width: 48px;
  height: 48px;
  background: var(--secondary);
  color: var(--text);
  backdrop-filter: blur(12px);
  border: 1px solid var(--card-border);
}

.icon-button:hover {
  background: var(--secondary-hover);
  transform: translateY(-1px);
}

.container {
  padding: 18px 0 40px;
}

.hero-card,
.panel {
  background: var(--card);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(16px);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.hero-card {
  padding: 28px;
  margin-bottom: 22px;
}

.hero-badge {
  display: inline-block;
  margin: 0 0 10px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(93, 168, 255, 0.16);
  color: #9fcbff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

body.light-mode .hero-badge {
  color: #0f62d6;
}

.hero-card h2 {
  margin: 0 0 10px;
  font-size: clamp(24px, 3vw, 36px);
}

.hero-text {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  max-width: 700px;
}

.panel {
  padding: 22px;
  margin-bottom: 22px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}

.panel-header h3 {
  margin: 0 0 6px;
  font-size: 22px;
}

.panel-header p {
  margin: 0;
  color: var(--muted);
}

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

.secondary-button,
.primary-button {
  padding: 12px 18px;
}

.secondary-button {
  background: var(--secondary);
  color: var(--text);
  border: 1px solid var(--card-border);
}

.secondary-button:hover {
  background: var(--secondary-hover);
}

.primary-button {
  background: var(--primary);
  color: white;
  font-weight: 700;
}

.primary-button:hover {
  background: var(--primary-hover);
}

.current-path {
  word-break: break-word;
}

.folder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
}

.item-card {
  padding: 18px;
  border-radius: 20px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  transition: 0.2s ease;
  min-height: 92px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.item-card.clickable {
  cursor: pointer;
}

.item-card.clickable:hover {
  transform: translateY(-2px);
  border-color: rgba(93, 168, 255, 0.45);
  box-shadow: 0 14px 30px rgba(0,0,0,0.14);
}

.item-icon {
  font-size: 28px;
  margin-bottom: 10px;
}

.item-name {
  font-weight: 700;
  line-height: 1.4;
  word-break: break-word;
}

.item-sub {
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
  word-break: break-word;
}

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

input[type="file"] {
  flex: 1 1 260px;
  min-width: 200px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--card-border);
  color: var(--text);
  padding: 14px;
  border-radius: 14px;
}

.status-message {
  margin-bottom: 16px;
  padding: 14px 16px;
  border-radius: 14px;
  font-weight: 600;
}

.status-message.info {
  background: rgba(93, 168, 255, 0.12);
  color: #a9d1ff;
}

.status-message.success {
  background: rgba(46, 204, 113, 0.14);
  color: #8df0b8;
}

.status-message.error {
  background: rgba(255, 107, 107, 0.14);
  color: #ffb0b0;
}

body.light-mode .status-message.info {
  color: #0f62d6;
}

body.light-mode .status-message.success {
  color: #0c8c46;
}

body.light-mode .status-message.error {
  color: #c73c3c;
}

.footer {
  padding: 10px 20px 30px;
  text-align: center;
  color: var(--muted);
}

.hidden {
  display: none !important;
}

.error-page {
  width: min(700px, calc(100% - 32px));
  margin: 80px auto;
  padding: 30px;
  text-align: center;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.error-page .logo {
  width: 90px;
  margin-bottom: 20px;
}

.error-page h1 {
  margin: 0 0 10px;
  font-size: 76px;
}

.error-page h2 {
  margin: 0 0 12px;
}

.error-page p {
  color: var(--muted);
}

.error-page a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 700;
}

@media (max-width: 700px) {
  .topbar-inner,
  .panel-header {
    flex-direction: column;
    align-items: stretch;
  }

  .topbar-actions {
    justify-content: flex-end;
  }

  .upload-box {
    flex-direction: column;
    align-items: stretch;
  }

  .primary-button,
  .secondary-button {
    width: 100%;
  }

  .icon-button {
    width: 46px;
    height: 46px;
  }
}