/*
 * DSH 门户样式 —— 视觉语言取自 deepseek.com 官网。
 *
 * 令牌不是凭印象猜的，而是用 Chrome DevTools Protocol 从 deepseek.com 上
 * 读出的真实计算样式：
 *   页面底色      #F9F8F8        （暖白）
 *   首屏渐变      linear-gradient(#9CC1E7 0%, rgba(250,250,250,0) 100%)
 *   正文文字      #1E232C        标题文字 #152443（深藏青，opacity .92）
 *   次要文字      #61666B / #979DA6
 *   主操作蓝      #4176E6        品牌蓝阶 #3964FE / #5686FE / #679EFE
 *   描边          rgba(9,45,78,.18)（官网药丸按钮的边框）
 *                 #E1E5EE（neutral-bluish-200）/ #E9ECF2
 *   药丸按钮      border-radius:100px，半透明白底，15px/500，padding 12px 20px
 *   圆形主按钮    36px，#4176E6，白字
 *   首屏标题      46px / weight 400 / letter-spacing .4em（宽字距是它的签名）
 *   字体          "DM Sans" + system-ui + Noto Sans SC / PingFang SC
 */

:root {
  /* 品牌蓝阶 */
  --ds-blue: #4176e6;
  --ds-blue-hover: #3567d2;
  --ds-blue-press: #2c58bb;
  --ds-blue-50: #edf3fe;
  --ds-blue-100: #e4edfd;
  --ds-blue-200: #d3e2ff;
  --ds-brand-500: #3964fe;

  /* 文字 */
  --ds-ink: #152443;
  --ds-text: #1e232c;
  --ds-text-2: #61666b;
  --ds-text-3: #979da6;

  /* 描边与底色 */
  --ds-line: #e1e5ee;
  --ds-line-soft: #e9ecf2;
  --ds-hairline: rgba(9, 45, 78, 0.18);
  --ds-bg: #f9f8f8;
  --ds-surface: #ffffff;
  --ds-surface-2: #f9fafb;
  --ds-surface-3: #f4f6f9;

  /* 语义色（取自官网 static 令牌） */
  --ds-green: #22c55e;
  --ds-green-text: #16803c;
  --ds-green-bg: #e6faed;
  --ds-green-line: rgba(34, 197, 94, 0.3);
  --ds-amber: #dd8629;
  --ds-amber-bg: #fef5e7;
  --ds-amber-line: rgba(221, 134, 41, 0.3);
  --ds-red: #e5484d;
  --ds-red-bg: #feecec;
  --ds-red-line: rgba(229, 72, 77, 0.28);

  --ds-shadow-sm: 0 1px 2px rgba(9, 45, 78, 0.05);
  --ds-shadow: 0 1px 3px rgba(9, 45, 78, 0.05), 0 10px 30px rgba(9, 45, 78, 0.06);
  --ds-shadow-lift: 0 2px 8px rgba(9, 45, 78, 0.07), 0 18px 44px rgba(9, 45, 78, 0.1);
  --ds-ring: 0 0 0 3.5px rgba(65, 118, 230, 0.14);

  --ds-r-card: 20px;
  --ds-r-panel: 14px;
  --ds-r-input: 12px;
  --ds-r-pill: 100px;

  --ds-font: "DM Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --ds-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--ds-bg);
  color: var(--ds-text);
  font: 400 16px/1.6 var(--ds-font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--ds-blue);
  text-decoration: none;
  transition: color 0.18s;
}
a:hover {
  color: var(--ds-blue-hover);
}

.mono {
  font-family: var(--ds-mono);
  font-size: 12.5px;
}

/* 工作页保留一道很淡的品牌渐变，够有辨识度又不干扰卡片阅读。
   登录页由 .auth 的不透明两栏完全覆盖，所以这里无需特例。 */
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto 0;
  height: 100vh;
  background: linear-gradient(180deg, #9cc1e7 0%, rgba(156, 193, 231, 0.3) 38%, rgba(250, 250, 250, 0) 78%);
  opacity: 0.24;
  pointer-events: none;
  z-index: 0;
}

/* ============================================================ 登录 / 初始化 */

/* 两栏全屏：左侧品牌与那句 slogan，右侧表单 */
.auth {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
}

.auth-brand {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 44px 56px 48px;
  /* deepseek.com 首屏渐变原值 #9CC1E7 → 透明，落在暖白底上 */
  background:
    linear-gradient(180deg, #9cc1e7 0%, rgba(156, 193, 231, 0.34) 52%, rgba(249, 248, 248, 0) 100%),
    var(--ds-bg);
}

.auth-brand .brand {
  position: absolute;
  top: 44px;
  left: 56px;
}

/* 左栏只有这一句。字号/字重/字距取官网 hero 的原值（宽字距是它的签名） */
.auth-hero {
  margin: 0;
  font-size: 46px;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: 0.4em;
  /* 补掉末字之后那半个字距，视觉上才是真居中 */
  text-indent: 0.4em;
  color: var(--ds-ink);
  opacity: 0.92;
}

.auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 32px;
  background: var(--ds-surface);
}
.auth-form {
  width: 100%;
  max-width: 400px;
}
.auth-form h2 {
  margin: 0 0 6px;
  font-size: 25px;
  font-weight: 500;
  color: var(--ds-ink);
  letter-spacing: 0.02em;
}
.auth-form .auth-form-sub {
  margin: 0 0 26px;
  font-size: 14px;
  color: var(--ds-text-2);
}
.auth-form .actions {
  margin-top: 24px;
}
.auth-form .actions .btn {
  width: 100%;
  padding: 12px 19px;
}
.auth-form .field input {
  max-width: none;
}
.auth-switch {
  margin: 20px 0 0;
  font-size: 13px;
  color: var(--ds-text-2);
}

/* ============================================================ 顶栏（工作页） */

.top {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 30px;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--ds-line-soft);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 16.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--ds-ink);
}
.brand:hover {
  color: var(--ds-ink);
}
.brand span {
  color: var(--ds-blue);
  font-weight: 700;
}

/* 官方鲸鱼标以 mask 方式染色，随主题走 */
.brand-mark {
  width: 23px;
  height: 23px;
  flex: 0 0 auto;
  background-color: var(--ds-blue);
  -webkit-mask: url("/portal/static/logo.svg") center / contain no-repeat;
  mask: url("/portal/static/logo.svg") center / contain no-repeat;
}

.top nav {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 14.5px;
}

/* 导航项做成官网那种分段药丸（中文 / EN 切换器的语言） */
.top nav a,
.top nav button.link {
  display: inline-flex;
  align-items: center;
  padding: 7px 15px;
  border-radius: var(--ds-r-pill);
  border: 1px solid transparent;
  color: var(--ds-text-2);
  font: 500 14.5px/1.35 var(--ds-font);
  background: none;
  cursor: pointer;
  transition: background-color 0.18s, color 0.18s, border-color 0.18s, box-shadow 0.18s;
}
.top nav a:hover,
.top nav button.link:hover {
  background: rgba(255, 255, 255, 0.85);
  border-color: var(--ds-line-soft);
  color: var(--ds-ink);
  text-decoration: none;
}
.top nav a.on {
  background: var(--ds-surface);
  border-color: var(--ds-line-soft);
  color: var(--ds-ink);
  box-shadow: var(--ds-shadow-sm);
}
.top nav .who {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 4px 6px 16px;
  margin-left: 6px;
  color: var(--ds-text-2);
  font-size: 14px;
  border-left: 1px solid var(--ds-line-soft);
}
.top nav .who em {
  font-style: normal;
  padding: 2px 9px;
  border-radius: var(--ds-r-pill);
  background: var(--ds-blue-50);
  border: 1px solid var(--ds-blue-200);
  color: var(--ds-blue);
  font-size: 11.5px;
  font-weight: 500;
}

/* ================================================================== 布局 */

main {
  position: relative;
  z-index: 1;
  max-width: 1080px;
  margin: 0 auto;
  padding: 30px 30px 72px;
  display: grid;
  gap: 18px;
}

/* 页面标题：不属于任何卡片，先回答"这是哪一页、现在什么状态" */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  padding: 6px 2px 2px;
}
.page-head h1 {
  margin: 0 0 5px;
  font-size: 27px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--ds-ink);
}
.page-head .page-sub {
  margin: 0;
  font-size: 14px;
  color: var(--ds-text-2);
}
.page-head .page-side {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.card {
  background: var(--ds-surface);
  border: 1px solid var(--ds-line-soft);
  border-radius: var(--ds-r-card);
  padding: 22px 24px;
  box-shadow: var(--ds-shadow-sm);
  transition: box-shadow 0.22s, border-color 0.22s;
}
.card:hover {
  box-shadow: var(--ds-shadow);
}

.card h1 {
  margin: 0 0 6px;
  font-size: 24px;
  font-weight: 600;
  color: var(--ds-ink);
}
.card h2 {
  margin: 0;
  font-size: 16.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--ds-ink);
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}
.card-head + .card-sub {
  margin: 0 0 18px;
  font-size: 13.5px;
  color: var(--ds-text-2);
  line-height: 1.7;
}

/* 单独一屏的提示卡（错误页、实例未运行页） */
.card.solo {
  max-width: 520px;
  margin: 8vh auto 0;
}
.card.solo.center {
  text-align: center;
}

/* 宽屏两栏，把相关但独立的卡片并排，减少纵向滚动 */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 18px;
  align-items: start;
}

/* 未配置 Key 时的引导条 */
.banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 20px 15px 18px;
  border-radius: var(--ds-r-panel);
  background: linear-gradient(180deg, #f2f7ff 0%, #eef4ff 100%);
  border: 1px solid var(--ds-blue-200);
  color: var(--ds-ink);
}
.banner .banner-mark {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--ds-blue-100);
  border: 1px solid var(--ds-blue-200);
  display: grid;
  place-items: center;
  color: var(--ds-blue);
  font-weight: 700;
  font-size: 15px;
}
.banner strong {
  display: block;
  font-size: 14.5px;
  color: var(--ds-ink);
}
.banner p {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--ds-text-2);
}
.banner .btn {
  margin-left: auto;
  flex: 0 0 auto;
}

.hint {
  color: var(--ds-text-2);
  font-size: 13.5px;
  line-height: 1.7;
  margin: 14px 0 0;
}
/* 正文里的标识符（路径、环境变量名）做成浅色内联小片，比裸等宽字好认 */
.hint .mono {
  display: inline-block;
  padding: 1px 7px;
  margin: 0 1px;
  border-radius: 6px;
  background: #f2f5f9;
  border: 1px solid var(--ds-line);
  color: var(--ds-ink);
  font-size: 12px;
  line-height: 1.6;
}
.err {
  color: var(--ds-red);
  font-size: 13.5px;
}
.ok-text {
  color: var(--ds-green-text);
}

/* ================================================================ 状态签 */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px 4px 10px;
  border-radius: var(--ds-r-pill);
  border: 1px solid var(--ds-line);
  background: var(--ds-surface-2);
  color: var(--ds-text-2);
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
}
.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.85;
}
.badge.ok {
  color: var(--ds-green-text);
  background: var(--ds-green-bg);
  border-color: var(--ds-green-line);
}
.badge.warn {
  color: var(--ds-amber);
  background: var(--ds-amber-bg);
  border-color: var(--ds-amber-line);
}
.badge.bad {
  color: var(--ds-red);
  background: var(--ds-red-bg);
  border-color: var(--ds-red-line);
}
.badge.idle {
  color: var(--ds-text-3);
  background: var(--ds-surface-2);
}
.badge.lg {
  padding: 6px 15px 6px 13px;
  font-size: 13.5px;
}

/* ================================================================ 数据行 */

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px 22px;
  margin: 0 0 20px;
  padding: 16px 18px;
  background: var(--ds-surface-2);
  border: 1px solid var(--ds-line-soft);
  border-radius: var(--ds-r-panel);
}
.facts > div {
  min-width: 0;
}
.facts .wide {
  grid-column: 1 / -1;
}
.facts dt {
  color: var(--ds-text-3);
  font-size: 12.5px;
  margin-bottom: 3px;
}
.facts dd {
  margin: 0;
  color: var(--ds-text);
  font-size: 14.5px;
  overflow-wrap: anywhere;
}
.facts dd.mono {
  color: var(--ds-ink);
  font-size: 12px;
}

/* 统计条（管理页顶部概览） */
.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
}
.stat {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 9px 16px;
  border-radius: var(--ds-r-pill);
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--ds-line-soft);
  box-shadow: var(--ds-shadow-sm);
}
.stat b {
  font-size: 17px;
  font-weight: 600;
  color: var(--ds-ink);
  font-variant-numeric: tabular-nums;
}
.stat span {
  font-size: 12.5px;
  color: var(--ds-text-2);
}
.stat.ok b {
  color: var(--ds-green-text);
}
.stat.warn b {
  color: var(--ds-amber);
}

/* ================================================================ 按钮 */

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 19px;
  border-radius: var(--ds-r-pill);
  border: 1px solid var(--ds-hairline);
  background: rgba(255, 255, 255, 0.75);
  color: var(--ds-text);
  font: 500 14.5px/1.3 var(--ds-font);
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.18s, border-color 0.18s, box-shadow 0.18s, transform 0.18s,
    color 0.18s;
}
.btn:hover:not(:disabled) {
  background: #fff;
  border-color: rgba(9, 45, 78, 0.26);
  box-shadow: var(--ds-shadow-sm);
}
.btn:active:not(:disabled) {
  transform: translateY(1px);
}
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.btn.primary {
  background: var(--ds-blue);
  border-color: var(--ds-blue);
  color: #fff;
  box-shadow: 0 1px 2px rgba(65, 118, 230, 0.3);
}
.btn.primary:hover:not(:disabled) {
  background: var(--ds-blue-hover);
  border-color: var(--ds-blue-hover);
  box-shadow: 0 4px 14px rgba(65, 118, 230, 0.32);
  transform: translateY(-1px);
}
.btn.primary:active:not(:disabled) {
  background: var(--ds-blue-press);
  transform: translateY(0);
}
.btn.danger {
  color: var(--ds-red);
  border-color: var(--ds-red-line);
  background: rgba(255, 255, 255, 0.75);
}
.btn.danger:hover:not(:disabled) {
  background: var(--ds-red-bg);
  border-color: rgba(229, 72, 77, 0.45);
}
/* 次级强调：列表行里的主操作。实心蓝留给每页唯一的主行动，避免一排蓝按钮 */
.btn.accent {
  background: var(--ds-blue-50);
  border-color: var(--ds-blue-200);
  color: var(--ds-blue);
}
.btn.accent:hover:not(:disabled) {
  background: var(--ds-blue-100);
  border-color: var(--ds-blue-200);
  box-shadow: 0 2px 10px rgba(65, 118, 230, 0.16);
}
.btn.small {
  padding: 7px 14px;
  font-size: 13.5px;
}
.btn.tiny {
  padding: 5px 12px;
  font-size: 12.5px;
}

/* ================================================================ 表单 */

.field {
  display: block;
  margin-bottom: 15px;
}
.field > span {
  display: block;
  margin-bottom: 7px;
  color: var(--ds-text-2);
  font-size: 13px;
  font-weight: 500;
}
.field > span.mono {
  color: var(--ds-text);
  font-size: 12.5px;
  font-weight: 500;
}
.field > em {
  display: block;
  margin-top: 6px;
  color: var(--ds-text-3);
  font-size: 12px;
  font-style: normal;
}
.field input {
  width: 100%;
  max-width: 440px;
  padding: 11px 14px;
  border-radius: var(--ds-r-input);
  border: 1px solid var(--ds-line);
  background: var(--ds-surface);
  color: var(--ds-text);
  font: 400 14.5px/1.5 var(--ds-font);
  transition: border-color 0.18s, box-shadow 0.18s;
}
.field input::placeholder {
  color: var(--ds-text-3);
}
.field input:hover {
  border-color: #cfd3d6;
}
.field input:focus {
  outline: none;
  border-color: var(--ds-blue);
  box-shadow: var(--ds-ring);
}
.field .field-hint {
  display: block;
  margin-top: 6px;
  color: var(--ds-text-3);
  font-size: 12px;
  font-style: normal;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ds-text-2);
  font-size: 13.5px;
  cursor: pointer;
}
.check input {
  width: 16px;
  height: 16px;
  accent-color: var(--ds-blue);
  cursor: pointer;
}

/* 新建用户：固定两列。auto-fit 在 1080px 容器里会摊成 5 列，
   两个输入框只占前两列、右边空一片。 */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 20px;
  align-items: start;
}
.form-grid .field {
  margin-bottom: 0;
}
.form-grid .form-foot {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 2px;
}
.form-grid .form-foot .btn {
  margin-left: auto;
}

/* ================================================================ 日志 */

.logs {
  margin: 0;
  padding: 15px 17px;
  max-height: 320px;
  overflow: auto;
  background: var(--ds-surface-2);
  border: 1px solid var(--ds-line-soft);
  border-radius: var(--ds-r-panel);
  font-family: var(--ds-mono);
  font-size: 12.5px;
  line-height: 1.62;
  color: #3c3c3d;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* ========================================================== 用户管理列表 */

.users {
  display: grid;
  gap: 12px;
}
.user-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) auto minmax(0, 1fr);
  gap: 12px 20px;
  align-items: center;
  padding: 16px 18px;
  background: var(--ds-surface);
  border: 1px solid var(--ds-line-soft);
  border-radius: 16px;
  transition: box-shadow 0.2s, border-color 0.2s, transform 0.2s;
}
.user-row:hover {
  box-shadow: var(--ds-shadow-lift);
  border-color: var(--ds-line);
  transform: translateY(-1px);
}
.user-row .name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15.5px;
  font-weight: 600;
  color: var(--ds-ink);
}
.user-row .name em {
  font-style: normal;
  padding: 2px 9px;
  border-radius: var(--ds-r-pill);
  background: var(--ds-blue-50);
  border: 1px solid var(--ds-blue-200);
  color: var(--ds-blue);
  font-size: 11.5px;
  font-weight: 500;
}
.user-row .name em.muted {
  background: var(--ds-surface-2);
  border-color: var(--ds-line);
  color: var(--ds-text-3);
}
.user-row .meta {
  color: var(--ds-text-2);
  font-size: 13px;
}
.user-row .meta.mono {
  color: var(--ds-text-3);
  font-size: 12.5px;
  margin-top: 3px;
}
.user-row .meta.err {
  color: var(--ds-red);
}
.user-row .row-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding-top: 12px;
  margin-top: 2px;
  border-top: 1px dashed var(--ds-line-soft);
}
/* 操作分组：实例操作 / 账号操作之间用一道细分隔 */
.user-row .row-actions .sep {
  width: 1px;
  height: 18px;
  background: var(--ds-line);
  margin: 0 3px;
}
.empty {
  padding: 28px 20px;
  text-align: center;
  color: var(--ds-text-3);
  font-size: 14px;
  background: var(--ds-surface-2);
  border: 1px dashed var(--ds-line);
  border-radius: var(--ds-r-panel);
}

/* ============================================================ 我的文件 */

.crumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 13.5px;
  color: var(--ds-text-2);
  min-width: 0;
}
.crumbs .crumb-sep {
  color: var(--ds-text-3);
}
.crumbs a:last-child {
  color: var(--ds-ink);
  font-weight: 500;
}

.file-list {
  display: grid;
  gap: 2px;
  border: 1px solid var(--ds-line-soft);
  border-radius: var(--ds-r-panel);
  overflow: hidden;
}
.file-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 90px 170px auto;
  align-items: center;
  gap: 12px;
  padding: 11px 15px;
  background: var(--ds-surface);
  border-bottom: 1px solid var(--ds-line-soft);
  transition: background-color 0.15s;
}
.file-row:last-child {
  border-bottom: 0;
}
.file-row:hover {
  background: var(--ds-surface-2);
}
.file-name {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.file-name a {
  color: var(--ds-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-name a:hover {
  color: var(--ds-blue);
}
/* 目录/文件的小图标：纯 CSS，不依赖 emoji 字体 */
.file-kind {
  position: relative;
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  border: 1.5px solid var(--ds-text-3);
  border-radius: 3.5px;
}
.file-kind.dir {
  border-color: var(--ds-blue);
  border-radius: 3px 3px 4px 4px;
}
.file-kind.dir::before {
  content: "";
  position: absolute;
  left: -1.5px;
  top: -5px;
  width: 7px;
  height: 4px;
  border: 1.5px solid var(--ds-blue);
  border-bottom: 0;
  border-radius: 3px 3px 0 0;
  background: var(--ds-surface);
}
.file-row:hover .file-kind.dir::before {
  background: var(--ds-surface-2);
}
.file-meta {
  color: var(--ds-text-3);
  font-size: 12.5px;
  text-align: right;
  white-space: nowrap;
}
.file-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ================================================================ 提示 */

.notice {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  max-width: min(560px, calc(100vw - 36px));
  padding: 12px 22px;
  border-radius: var(--ds-r-pill);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  border: 1px solid var(--ds-line);
  box-shadow: var(--ds-shadow-lift);
  color: var(--ds-text);
  font-size: 14px;
  z-index: 50;
  animation: notice-in 0.22s ease-out;
}
.notice.bad {
  color: var(--ds-red);
  border-color: var(--ds-red-line);
}
.notice.ok {
  color: var(--ds-green-text);
  border-color: var(--ds-green-line);
}
@keyframes notice-in {
  from {
    opacity: 0;
    transform: translate(-50%, 8px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

.spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  opacity: 0.75;
  animation: spin 0.7s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ================================================================ 响应式 */

@media (max-width: 960px) {
  .auth {
    grid-template-columns: 1fr;
  }
  /* 左栏收成一条 banner：slogan 仍居中，品牌标回到正常流。
     容器保留 min-height:100vh，白底表单区才会填满剩余高度，
     否则手机底部会露出一条灰色页面底色。 */
  .auth-brand {
    min-height: 220px;
    padding: 30px 24px 34px;
  }
  .auth-brand .brand {
    top: 26px;
    left: 24px;
    font-size: 15.5px;
  }
  .auth-hero {
    font-size: 27px;
    letter-spacing: 0.26em;
    text-indent: 0.26em;
  }
  .auth-panel {
    padding: 34px 24px 56px;
    align-items: flex-start;
  }
}

@media (max-width: 720px) {
  .user-row,
  .form-grid {
    grid-template-columns: 1fr;
  }
  /* 文件行：名称占一行，大小/时间/操作折到第二行 */
  .file-row {
    grid-template-columns: minmax(0, 1fr) auto;
    row-gap: 6px;
  }
  .file-meta {
    text-align: left;
  }
  .file-actions {
    grid-column: 2;
    grid-row: 1;
  }
  main {
    padding: 20px 16px 52px;
  }
  .top {
    padding: 10px 16px;
    flex-wrap: wrap;
    gap: 10px;
  }
  .top nav {
    flex-wrap: wrap;
    gap: 3px;
  }
  /* 收紧药丸内边距，让「工作台 / 用户管理 / 身份 / 退出」在 390px 上也排成一行 */
  .top nav a,
  .top nav button.link {
    padding: 6px 11px;
    font-size: 14px;
  }
  .top nav .who {
    border-left: none;
    padding: 5px 2px 5px 6px;
    gap: 6px;
    font-size: 13.5px;
  }
  .card {
    padding: 18px 16px;
  }
  .page-head h1 {
    font-size: 22px;
  }
  .banner {
    flex-wrap: wrap;
  }
  .banner .btn {
    margin-left: 0;
    width: 100%;
  }
  .stat {
    padding: 7px 13px;
  }
  .actions .btn {
    flex: 1 1 auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* 普通用户登录后的等待页：不是工作台，只报告实例启动进度 */
.card.solo.boot {
  max-width: 440px;
  margin-top: 13vh;
}
.card.solo.boot h1 {
  font-size: 22px;
  margin-bottom: 10px;
}
.boot-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: var(--ds-blue-50);
  color: var(--ds-blue);
  font-size: 24px;
  font-weight: 600;
}
.boot-mark .spinner {
  width: 22px;
  height: 22px;
  border-width: 2.5px;
}
.boot-mark.bad {
  background: var(--ds-red-bg);
  color: var(--ds-red);
}
