:root {
  color-scheme: dark;
  --bg: #07120f;
  --bg-soft: #0c1b16;
  --panel: rgba(14, 32, 26, .92);
  --panel-solid: #10221c;
  --panel-2: rgba(255, 255, 255, .045);
  --border: rgba(167, 243, 208, .12);
  --text: #edfdf6;
  --muted: #8ca39a;
  --green: #35e29e;
  --green-strong: #18b87a;
  --danger: #ff6b76;
  --amber: #f5c66b;
  --shadow: 0 28px 80px rgba(0, 0, 0, .4);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 5%, rgba(53, 226, 158, .11), transparent 28rem),
    radial-gradient(circle at 87% 95%, rgba(34, 211, 238, .08), transparent 32rem),
    var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

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

.login-card {
  width: min(100%, 430px);
  padding: 34px;
  border: 1px solid var(--border);
  border-radius: 28px;
  background: linear-gradient(145deg, rgba(18, 43, 35, .96), rgba(8, 20, 17, .94));
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .05);
}

.login-brand,
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  overflow: hidden;
  border-radius: 13px;
  background: transparent;
  box-shadow: 0 9px 24px rgba(13, 132, 88, .22);
}

.brand-mark img { display: block; width: 100%; height: 100%; }

.brand-copy strong {
  display: block;
  font-size: 14px;
  letter-spacing: .09em;
}

.brand-copy span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.login-heading {
  margin: 30px 0 8px;
  font-size: 30px;
  letter-spacing: -.04em;
}

.login-subtitle {
  margin: 0 0 26px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.field {
  display: block;
  margin-bottom: 16px;
}

.field-label {
  display: block;
  margin-bottom: 8px;
  color: #b9cec5;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
}

.input {
  width: 100%;
  height: 48px;
  padding: 0 15px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 12px;
  outline: none;
  color: var(--text);
  background: rgba(255, 255, 255, .045);
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.input:focus {
  border-color: rgba(53, 226, 158, .55);
  background: rgba(255, 255, 255, .06);
  box-shadow: 0 0 0 4px rgba(53, 226, 158, .08);
}

.captcha-row {
  display: grid;
  grid-template-columns: 1fr 190px;
  gap: 12px;
  align-items: center;
}

.captcha-image {
  display: block;
  width: 190px;
  height: 64px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 12px;
  object-fit: cover;
  background: #f3fbf6;
}

.button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 15px;
  border: 1px solid var(--border);
  border-radius: 11px;
  cursor: pointer;
  color: var(--text);
  background: rgba(255, 255, 255, .055);
  text-decoration: none;
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}

.button:hover {
  transform: translateY(-1px);
  border-color: rgba(53, 226, 158, .28);
  background: rgba(53, 226, 158, .08);
}

.button:disabled {
  cursor: wait;
  opacity: .55;
  transform: none;
}

.button.primary {
  border-color: transparent;
  color: #05120d;
  background: var(--green);
  font-weight: 750;
}

.button.primary:hover {
  background: #55edb1;
}

.button.danger {
  color: #ffdde0;
  border-color: rgba(255, 107, 118, .25);
  background: rgba(255, 107, 118, .08);
}

.button.ghost {
  border-color: transparent;
  background: transparent;
}

.button.small {
  min-height: 32px;
  padding: 0 10px;
  border-radius: 9px;
  font-size: 12px;
}

.login-submit {
  width: 100%;
  height: 48px;
  margin-top: 6px;
}

.notice {
  margin: 0 0 16px;
  padding: 11px 13px;
  border: 1px solid rgba(245, 198, 107, .2);
  border-radius: 10px;
  color: #ffe4a7;
  background: rgba(245, 198, 107, .07);
  font-size: 13px;
  line-height: 1.55;
}

.login-foot {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-top: 22px;
  color: #678077;
  font-size: 11px;
}

.app-shell {
  width: min(1440px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0 34px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

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

.user-pill {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: #bcd1c8;
  background: rgba(255, 255, 255, .035);
  font-size: 12px;
}

.workspace {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--panel);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .04);
  backdrop-filter: blur(18px);
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}

.breadcrumbs {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: center;
  gap: 6px;
  overflow: auto;
  white-space: nowrap;
  scrollbar-width: none;
}

.crumb {
  padding: 6px 8px;
  border: 0;
  border-radius: 7px;
  cursor: pointer;
  color: #b9cec5;
  background: transparent;
}

.crumb:hover,
.crumb.current {
  color: var(--text);
  background: rgba(255, 255, 255, .055);
}

.crumb-separator {
  color: #496158;
}

.disk-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: 11px;
}

.disk-bar {
  width: min(250px, 30vw);
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
}

.disk-bar span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.file-search {
  width: min(240px, 28vw);
  height: 38px;
}

.file-area {
  min-height: 470px;
}

.file-table-head,
.file-row {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 120px 165px 238px;
  align-items: center;
}

.file-table-head {
  padding: 11px 18px;
  color: #698078;
  background: rgba(255, 255, 255, .025);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.file-row {
  min-height: 62px;
  padding: 7px 18px;
  border-top: 1px solid rgba(255, 255, 255, .045);
}

.file-row:hover {
  background: rgba(53, 226, 158, .035);
}

.file-main {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
}

.file-icon {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 10px;
  color: #a7d8c3;
  background: rgba(255, 255, 255, .055);
}

.file-icon.folder {
  color: var(--amber);
  background: rgba(245, 198, 107, .08);
}

.file-icon.image {
  color: #7dd3fc;
  background: rgba(125, 211, 252, .08);
}

.file-icon.video {
  color: #c4b5fd;
  background: rgba(196, 181, 253, .08);
}

.file-icon.audio {
  color: #f9a8d4;
  background: rgba(249, 168, 212, .08);
}

.file-name {
  overflow: hidden;
  cursor: pointer;
  color: #eafbf3;
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-name:hover {
  color: #72f6be;
}

.file-meta {
  color: #748c82;
  font-size: 12px;
}

.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.empty-state {
  display: grid;
  min-height: 430px;
  place-content: center;
  gap: 12px;
  color: #71887f;
  text-align: center;
}

.empty-state .icon {
  width: 54px;
  height: 54px;
  margin: 0 auto;
  opacity: .55;
}

.loading {
  opacity: .45;
  pointer-events: none;
}

.drop-active {
  outline: 2px dashed rgba(53, 226, 158, .6);
  outline-offset: -12px;
}

.toast {
  position: fixed;
  z-index: 40;
  right: 22px;
  bottom: 22px;
  max-width: min(430px, calc(100vw - 44px));
  padding: 13px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  background: #142a22;
  box-shadow: 0 16px 50px rgba(0, 0, 0, .4);
  font-size: 13px;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .2s ease, transform .2s ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.error {
  border-color: rgba(255, 107, 118, .3);
  background: #38191d;
}

.modal {
  position: fixed;
  z-index: 50;
  inset: 0;
  display: none;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, .72);
  backdrop-filter: blur(10px);
}

.modal.open {
  display: grid;
}

.modal-box {
  width: min(960px, 100%);
  max-height: 91vh;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: #0a1814;
  box-shadow: var(--shadow);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--border);
}

.modal-title {
  overflow: hidden;
  font-size: 14px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal-content {
  display: grid;
  min-height: 260px;
  place-items: center;
  padding: 18px;
}

.preview-image {
  display: block;
  max-width: 100%;
  max-height: 72vh;
  border-radius: 12px;
  object-fit: contain;
}

.preview-gallery {
  position: relative;
  display: grid;
  width: 100%;
  min-height: 260px;
  place-items: center;
  touch-action: pan-y;
  user-select: none;
}

.preview-gallery-nav {
  position: absolute;
  z-index: 2;
  top: 50%;
  display: grid;
  width: 48px;
  height: 48px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 50%;
  color: #fff;
  background: rgba(5, 17, 14, .68);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .32);
  cursor: pointer;
  font: 34px/1 Georgia, serif;
  transform: translateY(-50%);
  transition: background .18s ease, border-color .18s ease, transform .18s ease;
  backdrop-filter: blur(12px);
}

.preview-gallery-nav:hover {
  border-color: rgba(255, 255, 255, .5);
  background: rgba(8, 82, 62, .9);
  transform: translateY(-50%) scale(1.04);
}

.preview-gallery-nav:focus-visible {
  outline: 2px solid #35e29e;
  outline-offset: 3px;
}

.preview-gallery-nav.previous {
  left: 12px;
}

.preview-gallery-nav.next {
  right: 12px;
}

.preview-gallery-counter {
  position: absolute;
  bottom: 12px;
  left: 50%;
  min-width: 72px;
  padding: 6px 12px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 999px;
  color: #eafff7;
  background: rgba(5, 17, 14, .72);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  text-align: center;
  transform: translateX(-50%);
  backdrop-filter: blur(10px);
}

.preview-video {
  display: block;
  width: 100%;
  max-height: 72vh;
  border-radius: 12px;
  background: #000;
}

.preview-audio {
  display: block;
  width: min(680px, 100%);
  border-radius: 12px;
  background: #0b1713;
}

.share-box {
  width: min(540px, 100%);
  padding: 26px;
}

.share-title {
  margin: 0 0 8px;
  font-size: 24px;
  letter-spacing: -.03em;
}

.share-subtitle {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.share-result {
  display: flex;
  gap: 9px;
  margin-top: 16px;
}

.share-result .input {
  height: 42px;
  font-size: 12px;
}

.share-page {
  width: min(1100px, calc(100% - 28px));
  margin: 0 auto;
  padding: 26px 0;
}

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

.share-file-card {
  padding: 38px 22px;
}

.share-file-card .icon {
  width: 58px;
  height: 58px;
}

.admin-page-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}

.member-list {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.member-card {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1.2fr) auto;
  gap: 16px;
  align-items: center;
  padding: 17px 18px;
  border: 1px solid rgba(255, 255, 255, .07);
  border-radius: 15px;
  background: rgba(255, 255, 255, .025);
}

.member-name {
  font-size: 14px;
  font-weight: 700;
}

.member-username {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 999px;
  color: #a9f0ce;
  background: rgba(53, 226, 158, .09);
  font-size: 10px;
  font-weight: 700;
}

.status-badge.off {
  color: #c6a6aa;
  background: rgba(255, 107, 118, .08);
}

.folder-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.folder-chip {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 7px;
  color: #b8d0c5;
  background: rgba(255, 255, 255, .035);
  font-size: 11px;
}

.folder-chip button {
  padding: 0;
  border: 0;
  cursor: pointer;
  color: #91a79e;
  background: transparent;
}

.member-actions {
  display: flex;
  gap: 7px;
}

.admin-editor {
  width: min(760px, 100%);
  padding: 24px;
}

.admin-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 14px;
}

.folder-picker {
  overflow: hidden;
  margin-top: 18px;
  border: 1px solid var(--border);
  border-radius: 13px;
}

.folder-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 12px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, .025);
}

.folder-picker-list {
  max-height: 250px;
  overflow: auto;
}

.folder-option {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, .045);
  cursor: pointer;
  color: var(--text);
  background: transparent;
  text-align: left;
}

.folder-option:hover {
  background: rgba(53, 226, 158, .045);
}

.folder-option span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.folder-option .icon {
  color: var(--amber);
}

.switch-line {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 4px 0 12px;
  color: #b9cec5;
  font-size: 13px;
}

.switch-line input {
  width: 18px;
  height: 18px;
  accent-color: var(--green);
}

.hidden {
  display: none !important;
}

@media (max-width: 900px) {
  .file-table-head {
    display: none;
  }

  .file-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
  }

  .file-meta,
  .file-modified {
    display: none;
  }

  .row-actions {
    grid-column: 2;
  }

  .row-actions .button span {
    display: none;
  }

  .row-actions .button {
    width: 34px;
    padding: 0;
  }

  .member-card {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .app-shell {
    width: calc(100% - 16px);
    padding-top: 12px;
  }

  .topbar {
    align-items: flex-start;
  }

  .user-pill {
    display: none;
  }

  .toolbar {
    flex-wrap: wrap;
  }

  .breadcrumbs {
    order: 1;
    width: 100%;
    flex-basis: 100%;
  }

  .file-search {
    width: 100%;
  }

  .disk-summary {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .disk-bar {
    width: 100%;
  }

  .login-card {
    padding: 26px 20px;
  }

  .captcha-row {
    grid-template-columns: 1fr;
  }

  .captcha-image {
    width: 100%;
    max-width: 240px;
  }

  .modal {
    padding: 8px;
  }

  .modal-content {
    padding: 10px;
  }

  .preview-gallery-nav {
    width: 42px;
    height: 42px;
    font-size: 30px;
  }

  .preview-gallery-nav.previous {
    left: 7px;
  }

  .preview-gallery-nav.next {
    right: 7px;
  }

  .share-header {
    align-items: flex-start;
    flex-direction: column;
  }

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