:root {
  --bg: #071522;
  --panel: rgba(255, 255, 255, 0.78);
  --panel-strong: rgba(255, 255, 255, 0.9);
  --line: rgba(24, 48, 72, 0.14);
  --ink: #102033;
  --sub: #617384;
  --accent: #0f766e;
  --accent-deep: #164e63;
  --accent-soft: rgba(15, 118, 110, 0.1);
  --accent-glow: rgba(20, 78, 99, 0.22);
  --shadow: 0 24px 70px rgba(17, 32, 51, 0.12);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
}

* {
  box-sizing: border-box;
}

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

body.portal-body {
  position: relative;
  overflow-x: hidden;
  font-family: "IBM Plex Sans", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 16% 12%, rgba(20, 184, 166, 0.2), transparent 30%),
    radial-gradient(circle at 82% 72%, rgba(59, 130, 246, 0.16), transparent 36%),
    linear-gradient(145deg, #030912 0%, #071522 54%, #102033 100%);
  background-size: 150% 150%;
  animation: portalAmbientShift 18s ease-in-out infinite alternate;
}

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

.portal-video-backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    linear-gradient(135deg, rgba(2, 8, 16, 0.98), rgba(5, 18, 31, 0.88)),
    radial-gradient(circle at 82% 16%, rgba(45, 212, 191, 0.12), transparent 32%);
}

.portal-video-backdrop__media {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.4;
  filter: saturate(1.08) contrast(1.08) brightness(0.56);
  transform: scale(1.08);
}

.portal-video-backdrop__wash {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(3, 10, 20, 0.78) 0%, rgba(5, 15, 28, 0.6) 44%, rgba(5, 15, 28, 0.46) 100%),
    radial-gradient(circle at 46% 34%, rgba(15, 118, 110, 0.1), transparent 32%),
    linear-gradient(180deg, rgba(2, 8, 16, 0.22), rgba(2, 8, 16, 0.5));
}

.portal-video-backdrop__wash::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(90deg, rgba(0, 0, 0, 0.08), #000 48%, rgba(0, 0, 0, 0.28));
}

.portal-video-backdrop::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  width: clamp(220px, 24vw, 460px);
  height: clamp(120px, 18vh, 260px);
  background:
    radial-gradient(circle at 100% 100%, rgba(2, 8, 16, 0.98) 0%, rgba(2, 8, 16, 0.9) 38%, rgba(2, 8, 16, 0.62) 62%, transparent 100%),
    linear-gradient(135deg, transparent 0%, rgba(2, 8, 16, 0.78) 100%);
  backdrop-filter: blur(8px);
}

@keyframes portalAmbientShift {
  0% {
    background-position: 0% 12%;
  }

  100% {
    background-position: 100% 88%;
  }
}

.login-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  max-width: 1360px;
  margin: 0 auto;
  padding: 32px;
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: 28px;
}

.login-story,
.login-card,
.dashboard-hero,
.module-card,
.topbar {
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.login-story {
  border-radius: var(--radius-xl);
  padding: 42px;
  color: #eff6ff;
  background:
    radial-gradient(circle at top right, rgba(94, 234, 212, 0.16), transparent 24%),
    linear-gradient(145deg, rgba(15, 23, 42, 0.98), rgba(22, 78, 99, 0.96));
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
  overflow: hidden;
  position: relative;
}

.login-story::after {
  content: "";
  position: absolute;
  right: -120px;
  bottom: -120px;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  filter: blur(8px);
}

.brand-lockup {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand-mark {
  width: 72px;
  height: 72px;
  border-radius: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #f8fffe;
  background:
    linear-gradient(135deg, rgba(94, 234, 212, 0.2), rgba(255, 255, 255, 0.14)),
    linear-gradient(135deg, var(--accent), var(--accent-deep));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.brand-mark-small {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  font-size: 16px;
}

.brand-copy {
  min-width: 0;
}

.story-eyebrow,
.section-eyebrow {
  display: inline-flex;
  align-items: center;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 12px;
  opacity: 0.8;
}

.login-story h1,
.dashboard-hero h1 {
  margin: 14px 0 10px;
  font-size: clamp(36px, 5vw, 58px);
  line-height: 1.04;
}

.story-copy,
.hero-copy {
  max-width: 520px;
  margin: 0;
  font-size: 17px;
  line-height: 1.68;
  opacity: 0.9;
}

.story-stage {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 18px;
}

.stage-card {
  padding: 22px 24px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.08);
}

.stage-card-primary {
  background:
    linear-gradient(135deg, rgba(94, 234, 212, 0.12), rgba(255, 255, 255, 0.04)),
    rgba(255, 255, 255, 0.08);
}

.stage-label {
  display: inline-flex;
  margin-bottom: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.12);
}

.stage-card strong {
  display: block;
  margin-bottom: 8px;
  font-size: 28px;
}

.stage-card p {
  margin: 0;
  font-size: 14px;
  line-height: 1.7;
  opacity: 0.88;
}

.story-points {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.story-pill {
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.08);
}

.story-pill strong {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
}

.story-pill span {
  display: block;
  font-size: 13px;
  line-height: 1.6;
  opacity: 0.86;
}

.login-card {
  align-self: center;
  border-radius: var(--radius-xl);
  padding: 40px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.78));
}

.login-card h2 {
  margin: 14px 0 8px;
  font-size: 30px;
}

.card-subtitle {
  margin: 0 0 24px;
  color: var(--sub);
  line-height: 1.6;
}

.login-form {
  display: grid;
  gap: 16px;
}

.field-block label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--sub);
}

.field-block input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid rgba(24, 48, 72, 0.12);
  border-radius: var(--radius-md);
  background: rgba(248, 250, 252, 0.96);
  color: var(--ink);
  font-size: 15px;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.field-block input:focus {
  border-color: rgba(15, 118, 110, 0.46);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12);
}

.remember-line {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--sub);
  font-size: 13px;
  cursor: pointer;
  user-select: none;
}

.remember-line input {
  width: auto;
  accent-color: var(--accent);
}

.form-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 88px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.text-link {
  color: var(--accent-deep);
  font-size: 13px;
  font-weight: 600;
}

.primary-button,
.secondary-button,
.ghost-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.primary-button {
  border: none;
  padding: 14px 18px;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #f8fffe;
  box-shadow: 0 14px 28px var(--accent-glow);
}

.secondary-button {
  border: 1px solid rgba(15, 118, 110, 0.18);
  padding: 12px 16px;
  background: rgba(15, 118, 110, 0.06);
  color: var(--accent);
}

.ghost-link {
  border: 1px solid rgba(24, 48, 72, 0.12);
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--ink);
}

.primary-button:hover,
.secondary-button:hover,
.ghost-link:hover {
  transform: translateY(-1px);
}

.form-error {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(190, 24, 93, 0.08);
  border: 1px solid rgba(190, 24, 93, 0.16);
  color: #9d174d;
  font-size: 14px;
}

.form-notice {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(15, 118, 110, 0.08);
  border: 1px solid rgba(15, 118, 110, 0.16);
  color: var(--accent-deep);
  font-size: 14px;
}

.login-footer-note {
  margin-top: 18px;
  color: var(--sub);
  font-size: 13px;
  line-height: 1.6;
}

.card-links {
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.assist-copy {
  color: var(--sub);
  font-size: 13px;
}

.app-shell-root {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  max-width: 1360px;
  margin: 0 auto;
  padding: 24px 32px 32px;
}

.topbar {
  border-radius: 24px;
  padding: 18px 24px;
  background: rgba(255, 255, 255, 0.68);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

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

.brand-block strong {
  display: block;
  font-size: 20px;
}

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

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--line);
  color: var(--ink);
}

.dashboard-main {
  padding-top: 22px;
  display: grid;
  gap: 22px;
}

.dashboard-hero {
  border-radius: var(--radius-xl);
  padding: 34px;
  background:
    radial-gradient(circle at top right, rgba(14, 116, 144, 0.12), transparent 24%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.88), rgba(239, 246, 255, 0.76));
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 26px 0 0;
}

.hero-stat-grid {
  margin-top: 26px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.hero-stat-card {
  padding: 18px 18px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(24, 48, 72, 0.08);
}

.hero-stat-card span {
  display: block;
  margin-bottom: 10px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--sub);
}

.hero-stat-card strong {
  font-size: 16px;
  line-height: 1.5;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.module-card {
  border-radius: var(--radius-lg);
  padding: 24px;
  background: rgba(255, 255, 255, 0.76);
}

.module-card.active {
  border-color: rgba(15, 118, 110, 0.18);
}

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

.module-status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.module-status.active {
  background: rgba(15, 118, 110, 0.1);
  color: var(--accent);
}

.module-status.planned {
  background: rgba(100, 116, 139, 0.1);
  color: #64748b;
}

.module-hint {
  font-size: 12px;
  color: var(--sub);
}

.module-card h3 {
  margin: 0 0 8px;
  font-size: 24px;
}

.module-card p {
  margin: 0 0 18px;
  color: var(--sub);
  line-height: 1.65;
}

.module-card .secondary-button[aria-disabled="true"] {
  opacity: 0.65;
  cursor: default;
}

@media (max-width: 1080px) {
  .login-shell,
  .module-grid,
  .story-points,
  .hero-stat-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .login-shell,
  .app-shell-root {
    padding: 18px;
  }

  .login-story,
  .login-card,
  .dashboard-hero,
  .module-card,
  .topbar {
    padding: 22px;
  }

  .brand-lockup,
  .brand-block,
  .toolbar-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .toolbar-actions {
    width: 100%;
  }

  .user-chip {
    width: 100%;
    justify-content: space-between;
  }

  .hero-actions .primary-button,
  .module-card .secondary-button,
  .ghost-link {
    width: 100%;
  }

  .form-meta,
  .card-links {
    flex-direction: column;
    align-items: flex-start;
  }
}

.storage-page {
  display: grid;
  gap: 24px;
}

.inline-notice {
  margin-top: -4px;
}

.storage-grid {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  gap: 24px;
}

.storage-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

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

.panel-heading h2 {
  margin: 8px 0 0;
  font-size: 28px;
}

.panel-tip {
  color: var(--sub);
  font-size: 13px;
}

.storage-form {
  display: grid;
  gap: 16px;
}

.storage-dropzone {
  width: 100%;
  min-height: 180px;
  padding: 28px;
  border: 1.5px dashed rgba(15, 118, 110, 0.28);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(15, 118, 110, 0.05), rgba(22, 78, 99, 0.02)),
    rgba(247, 250, 252, 0.92);
  color: var(--ink);
  display: grid;
  place-items: center;
  gap: 8px;
  text-align: center;
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.storage-dropzone strong {
  font-size: 20px;
}

.storage-dropzone span {
  color: var(--sub);
}

.storage-dropzone:hover,
.storage-dropzone.is-dragover {
  border-color: rgba(15, 118, 110, 0.6);
  box-shadow: 0 0 0 6px rgba(15, 118, 110, 0.08);
  transform: translateY(-1px);
}

.storage-dropzone:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.upload-toolbar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.storage-progress {
  display: flex;
  align-items: center;
  gap: 12px;
}

.storage-progress-bar {
  flex: 1;
  height: 10px;
  border-radius: 999px;
  background: rgba(16, 32, 51, 0.08);
  overflow: hidden;
}

.storage-progress-bar span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-deep));
  border-radius: inherit;
}

.storage-feedback {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(15, 118, 110, 0.08);
  color: var(--accent-deep);
  font-size: 14px;
  line-height: 1.5;
}

.storage-feedback[data-tone="error"] {
  background: rgba(190, 24, 93, 0.08);
  color: #9d174d;
}

.storage-feedback[data-tone="warn"] {
  background: rgba(217, 119, 6, 0.1);
  color: #92400e;
}

.storage-feedback[data-tone="success"] {
  background: rgba(15, 118, 110, 0.1);
  color: #0f766e;
}

.storage-feedback.muted,
.storage-feedback[data-tone="muted"] {
  background: rgba(16, 32, 51, 0.06);
  color: var(--sub);
}

.selected-file-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.selected-file-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(16, 32, 51, 0.04);
  border: 1px solid rgba(16, 32, 51, 0.06);
}

.selected-file-item strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selected-file-item span {
  color: var(--sub);
  font-size: 13px;
  flex-shrink: 0;
}

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

.storage-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 700px;
}

.storage-table th,
.storage-table td {
  padding: 14px 12px;
  border-bottom: 1px solid rgba(16, 32, 51, 0.08);
  text-align: left;
  vertical-align: top;
}

.storage-table th {
  color: var(--sub);
  font-size: 13px;
  font-weight: 600;
}

.object-cell {
  display: grid;
  gap: 6px;
}

.object-cell strong {
  font-size: 15px;
}

.object-cell code {
  font-family: "IBM Plex Mono", "SFMono-Regular", monospace;
  font-size: 12px;
  color: var(--sub);
  word-break: break-all;
}

.row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.compact {
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 12px;
}

.ghost-link.compact {
  background: rgba(16, 32, 51, 0.04);
}

.ghost-link.compact.danger {
  color: #b91c1c;
}

.storage-empty {
  padding: 32px 8px;
  text-align: center;
  color: var(--sub);
}

@media (max-width: 1080px) {
  .storage-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .storage-panel {
    padding: 22px;
  }

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

  .storage-table {
    min-width: 560px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.portal-body {
    animation: none;
  }

  .portal-video-backdrop__media {
    display: none;
  }
}
