:root,
:root[data-theme="light"] {
  color-scheme: light;
  --ink: #1c1a17;
  --ink-2: #6b6560;
  --ink-3: #9e9891;
  --bg: #f6f4ef;
  --panel: #fbfaf6;
  --panel-2: #f1eee8;
  --line: #e8e5df;
  --line-2: #d5d1ca;
  --accent: #2e8c92;
  --accent-soft: #ddf0f1;
  --accent-ink: #1a5c61;
  --ok: #2d9a46;
  --warn: #c58128;
  --danger: #c94444;
  --scrim: rgba(28, 26, 23, 0.42);
  --shadow-1: 0 1px 2px rgba(28, 26, 23, 0.05);
  --shadow-2: 0 2px 6px rgba(28, 26, 23, 0.06), 0 16px 40px rgba(28, 26, 23, 0.1);
  --row-hover: rgba(46, 140, 146, 0.05);
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #e8e5df;
  --ink-2: #9e9891;
  --ink-3: #6b6560;
  --bg: #1c1a17;
  --panel: #26231f;
  --panel-2: #211e1a;
  --line: #3a3630;
  --line-2: #4a4640;
  --accent: #3aa0a6;
  --accent-soft: #173c3f;
  --accent-ink: #8fd0d4;
  --ok: #3fb35b;
  --warn: #d4933b;
  --danger: #db5b5b;
  --scrim: rgba(10, 9, 8, 0.62);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.28);
  --shadow-2: 0 2px 6px rgba(0, 0, 0, 0.3), 0 16px 40px rgba(0, 0, 0, 0.45);
  --row-hover: rgba(58, 160, 166, 0.09);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  font-size: 13px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
select,
textarea {
  color: inherit;
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.35;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  border-radius: 4px;
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

::selection {
  background: var(--accent-soft);
  color: var(--accent-ink);
}

a {
  color: var(--accent-ink);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.mono,
code {
  color: inherit;
  font-family: var(--mono);
  font-size: 12px;
}

.icon {
  width: 14px;
  height: 14px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.logo,
.avatar {
  display: grid;
  flex: none;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-feature-settings: "tnum";
  font-weight: 600;
}

.logo {
  width: 24px;
  height: 24px;
  overflow: hidden;
  background: #fff;
  border-radius: 8px;
  font-size: 10px;
  letter-spacing: 0.4px;
}

.logo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.avatar {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  font-size: 11px;
  text-transform: uppercase;
}

/* Buttons and form controls */
.btn,
.btn-mini,
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  color: var(--ink-2);
  font-family: inherit;
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
  min-width: 0;
  max-width: 100%;
}

.btn {
  height: 32px;
  padding: 0 14px;
  font-size: 13px;
}

.btn-primary {
  border-color: var(--accent);
  color: var(--accent-ink);
  font-weight: 500;
}

.btn:hover:not(:disabled),
.btn-mini:hover:not(:disabled),
.icon-btn:hover:not(:disabled) {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-ink);
  text-decoration: none;
}

/* 危险动作可用时连边框一起标红，一眼能和旁边的普通按钮分开；禁用时退回中性
   的灰边灰字，再叠上全局的低透明度，两种状态不会看混。 */
.btn-danger:not(:disabled),
.btn-mini-danger:not(:disabled) {
  border-color: var(--danger);
  color: var(--danger);
}

.btn-danger:disabled,
.btn-mini-danger:disabled {
  border-color: var(--line-2);
  color: var(--ink-3);
}

.btn-danger:hover:not(:disabled),
.btn-mini-danger:hover:not(:disabled) {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

.btn-block {
  width: 100%;
  height: 36px;
}

.btn-mini {
  min-height: 24px;
  height: auto;
  padding: 0 8px;
  font-size: 11px;
  line-height: 1.3;
  overflow-wrap: anywhere;
  text-align: center;
}

/* 操作列里只放一个字形：一行五六个动作，写成文字就得横向滚。名字仍在
   title/aria-label 上，鼠标和读屏都拿得到。 */
/* 云盘的三个子页标签。放在卡片标题的位置，选中项用下划线标出——按钮排一行
   看起来像三个动作，加了下划线才一眼是标签页。 */
.drive-tabs {
  display: flex;
  align-items: flex-end;
  gap: 16px;
}

.drive-tab {
  padding: 0 0 6px;
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--ink-3);
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.drive-tab:hover { color: var(--ink); }

.drive-tab[aria-selected="true"] {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

/* 按功能分组的图标按钮：组内挨着，组间一条细线。 */
.btn-group {
  display: flex;
  align-items: center;
  gap: 2px;
}

.btn-group + .btn-group {
  margin-left: 5px;
  padding-left: 8px;
  border-left: 1px solid var(--line-2);
}

.btn-mini-primary {
  border-color: var(--accent);
  color: var(--accent-ink);
}

/* 预览窗：图片和纯文本直接在页面里看，不用先下载下来。 */
.drive-preview-modal {
  width: min(860px, calc(100vw - 48px));
}

.drive-preview-image {
  display: block;
  max-width: 100%;
  max-height: 68vh;
  margin: 0 auto;
}

.drive-preview-frame {
  display: block;
  width: 100%;
  height: 68vh;
  border: 0;
}

.drive-preview-media {
  display: block;
  width: 100%;
  max-height: 68vh;
  margin: 0 auto;
}

/* 压缩包目录：高度固定，进出目录不会带着弹窗一起变大变小。 */
.drive-archive {
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 68vh;
  min-height: 0;
}

.drive-archive .table-wrap {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.drive-preview-text {
  max-height: 68vh;
  margin: 0;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.6;
}

/* 翻页条：贴在表格右下角。 */
.drive-pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  padding: 8px 18px 12px;
  color: var(--ink-3);
  font-size: 12px;
}

/* 分页条上的每页条数与跳页输入框：与 btn-mini 同高，挤在一行里不突兀。 */
.pager-select,
.pager-input {
  height: 24px;
  margin: 0;
  padding: 0 4px;
  background: var(--bg);
  border: 1px solid var(--line-2);
  border-radius: 6px;
  color: var(--ink-2);
  font-family: inherit;
  font-size: 12px;
  outline: none;
  transition: border-color 0.15s ease;
}

.pager-select:focus,
.pager-input:focus {
  border-color: var(--accent);
}

/* 页码框只放两三位数字，去掉数字输入框自带的上下箭头省地方。 */
.pager-input {
  width: 56px;
  -moz-appearance: textfield;
  appearance: textfield;
}

.pager-input::-webkit-outer-spin-button,
.pager-input::-webkit-inner-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

.pager-jump {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0;
}

/* 选择列：一个复选框的宽度就够。 */
.table-check {
  width: 28px;
  padding-right: 0 !important;
}

.btn-mini-icon {
  width: 24px;
  padding: 0;
  font-size: 13px;
  line-height: 1;
}

.icon-btn {
  width: 28px;
  height: 28px;
  padding: 0;
}

.icon-btn.subtle {
  border-color: transparent;
  color: var(--ink-3);
}

.icon-btn.subtle:hover {
  border-color: var(--line-2);
}

.field {
  display: flex;
  margin: 0;
  flex-direction: column;
  gap: 6px;
}

.field label,
.field-label {
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.8px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  height: 34px;
  margin: 0;
  padding: 0 11px;
  background: var(--bg);
  border: 1px solid var(--line-2);
  border-radius: 8px;
  color: var(--ink);
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.field select {
  padding-right: 28px;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='%23888' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px 12px;
}

.field textarea {
  min-height: 88px;
  padding-top: 8px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--accent);
}

input::placeholder,
textarea::placeholder {
  color: var(--ink-3);
}

input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--accent);
}

/* .field 里那套 width:100%/height:34px 是给文本框写的，套在复选框上会撑成占满
   一行的大方块。勾选框拉回原尺寸，标签跟它并排。 */
.field input[type="checkbox"],
.field input[type="radio"] {
  width: auto;
  height: auto;
  padding: 0;
}

.field label.check {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0;
  cursor: pointer;
}

.form-help {
  color: var(--ink-3);
  font-size: 11px;
}

/* Alerts */
.alert {
  position: relative;
  display: none;
  margin: 0;
  padding: 9px 34px 9px 11px;
  border: 1px solid;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.55;
  animation: fade 0.2s ease both;
}

.alert.show {
  display: block;
}

.alert.error {
  background: #f5e8e8;
  border-color: #e8c4c4;
  color: #7a2020;
}

.alert.ok {
  background: #e8f5ec;
  border-color: #c4e6cf;
  color: #1f6b38;
}

.alert.warn {
  background: #f5ede0;
  border-color: #e8d4b8;
  color: #7a5010;
}

:root[data-theme="dark"] .alert.error {
  background: #3a2020;
  border-color: #4e2a2a;
  color: #e89191;
}

:root[data-theme="dark"] .alert.ok {
  background: #1b3323;
  border-color: #2c4a34;
  color: #7fd199;
}

:root[data-theme="dark"] .alert.warn {
  background: #3a2e1b;
  border-color: #4e3d23;
  color: #e0b36a;
}

.alert-close {
  position: absolute;
  top: 6px;
  right: 7px;
  width: 22px;
  height: 22px;
  padding: 0;
  background: transparent;
  border: 0;
  color: inherit;
  opacity: 0.65;
}

.alert-close:hover {
  opacity: 1;
}

/* Authentication pages */
.auth-page {
  position: relative;
  display: flex;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow: auto;
}

.auth-tools {
  position: fixed;
  z-index: 5;
  top: 16px;
  right: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.auth-theme {
  background: var(--panel);
}

.language-control {
  position: relative;
  display: flex;
  flex: none;
}

.language-control select {
  width: 112px;
  height: 28px;
  margin: 0;
  padding: 0 28px 0 9px;
  appearance: none;
  -webkit-appearance: none;
  background-color: var(--panel);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='%23888' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
  background-size: 12px 12px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  color: var(--ink-2);
  cursor: pointer;
  font-size: 12px;
  outline: none;
}

.language-control select:hover,
.language-control select:focus {
  border-color: var(--accent);
  color: var(--ink);
}

.auth-stack {
  display: flex;
  width: 400px;
  max-width: 100%;
  flex-direction: column;
  gap: 14px;
}

.auth-card {
  width: 100%;
  overflow: hidden;
  animation: rise 0.28s ease both;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-1);
}

.auth-card.register {
  width: 430px;
  align-self: center;
}

.auth-head {
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 12px;
  padding: 28px 28px 18px;
  border-bottom: 1px solid var(--line);
}

.auth-head .logo {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  font-size: 16px;
}

.auth-heading {
  text-align: center;
}

.auth-heading h1 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.auth-heading p {
  margin: 3px 0 0;
  color: var(--ink-3);
  font-size: 12px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 22px 28px 24px;
}

/* 谷歌登录：服务端没配 client_id 时整块保持 hidden。 */
.google-signin[hidden] {
  display: none;
}

.google-signin {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.or-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-3);
  font-size: 12px;
}

.or-divider::before,
.or-divider::after {
  content: '';
  flex: 1;
  border-top: 1px solid var(--line);
}

/* 按钮由 GIS 直接渲染；保持控件可见，点击手势才能由 SDK 可靠处理。 */
.google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  overflow: visible;
}

/* iOS 上那个按钮是我们自己出的（GIS 的按钮在它的 iframe 里开弹窗，被 WebKit
   拦掉），样式对齐 GIS 的 icon/circle/large。 */
.google-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  background: var(--panel);
  border: 1px solid var(--line-2);
  border-radius: 50%;
  cursor: pointer;
}

.google-icon-btn:hover { background: var(--accent-soft); }

/* GIS replaces this same-document fallback with its iframe after loading. */
.google-btn [role="button"] {
  visibility: hidden;
}

.auth-switch {
  color: var(--ink-3);
  font-size: 12px;
  text-align: center;
}

.auth-switch a {
  margin-left: 4px;
  color: var(--accent-ink);
  font-weight: 500;
}

.auth-inline-link {
  margin-top: -8px;
  font-size: 12px;
  text-align: right;
}

.recovery-stack {
  width: 520px;
  margin-top: auto;
  margin-bottom: auto;
  padding-top: 56px;
  padding-bottom: 24px;
}

.auth-page.recovery-page {
  align-items: flex-start;
}

.recovery-step {
  display: flex;
  margin: 0;
  flex-direction: column;
  gap: 14px;
}

.recovery-account {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink-2);
  font-size: 12px;
}

.recovery-account strong {
  overflow: hidden;
  flex: 1;
  color: var(--ink);
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recovery-questions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.recovery-question {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.recovery-question label {
  color: var(--ink-2);
  font-size: 12px;
  line-height: 1.55;
}

.foot-note {
  margin: 0;
  color: var(--ink-3);
  font-size: 11px;
  line-height: 1.7;
  text-align: center;
}

/* Account portal shell */
.portal-shell {
  display: flex;
  height: 100vh;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
}

.shell-top {
  z-index: 20;
  display: flex;
  height: 48px;
  flex: none;
  align-items: center;
  gap: 12px;
  padding: 0 14px 0 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  min-width: 0;
}

.security-questions-warning {
  display: flex;
  z-index: 19;
  flex: none;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 6px 14px;
  background: #f5ede0;
  border-bottom: 1px solid #e8d4b8;
  color: #7a5010;
  font-size: 12px;
}

.security-questions-warning .btn-mini {
  flex: none;
  border-color: currentColor;
  color: inherit;
}

:root[data-theme="dark"] .security-questions-warning {
  background: #3a2e1b;
  border-color: #4e3d23;
  color: #e0b36a;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.shell-title {
  min-width: 0;
  overflow: hidden;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.3px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.shell-product {
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 11px;
}

.shell-actions {
  display: flex;
  margin-left: auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.header-btn {
  height: 28px;
  padding: 0 10px;
  gap: 6px;
  color: var(--ink-2);
  font-size: 12px;
}

.shell-user {
  position: relative;
  display: flex;
  align-items: center;
  gap: 7px;
  padding-left: 12px;
  margin-left: 2px;
  border-left: 1px solid var(--line);
}

.shell-user-trigger {
  display: flex;
  align-items: center;
  padding: 3px 6px 3px 3px;
  gap: 7px;
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.shell-user-trigger:hover {
  background: var(--accent-soft);
}

.shell-user-trigger .chevron {
  width: 14px;
  height: 14px;
  flex: none;
  color: var(--ink-3);
  transition: transform 0.15s ease;
}

.shell-user-trigger[aria-expanded='true'] .chevron {
  transform: rotate(180deg);
}

.user-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 30;
  display: none;
  min-width: 150px;
  padding: 4px;
  background: var(--panel);
  border: 1px solid var(--line-2);
  border-radius: 8px;
  box-shadow: var(--shadow-2);
}

/* 上传/下载的传输方式菜单：点按钮时挂到 body 上，按钮位置由 JS 算。 */
.openwith-menu {
  position: fixed;
  z-index: 120;
  display: flex;
  flex-direction: column;
  min-width: 160px;
  padding: 4px;
  background: var(--panel);
  border: 1px solid var(--line-2);
  border-radius: 8px;
  box-shadow: var(--shadow-2);
}

.openwith-menu button {
  height: 30px;
  padding: 0 9px;
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: var(--ink);
  cursor: pointer;
  font-size: 12px;
  text-align: left;
}

.openwith-menu button:hover {
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.openwith-menu button.openwith-danger {
  color: var(--danger);
}

.user-menu.open {
  display: flex;
  flex-direction: column;
}

.user-menu button {
  height: 28px;
  padding: 0 9px;
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: var(--ink);
  cursor: pointer;
  font-size: 12px;
  text-align: left;
}

.user-menu button:hover {
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.user-menu button.danger {
  color: var(--danger);
}

.shell-user-copy {
  display: flex;
  min-width: 74px;
  flex-direction: column;
  line-height: 1.25;
}

.shell-user-copy .who {
  overflow: hidden;
  max-width: 156px;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shell-user-copy small {
  color: var(--ink-3);
  font-size: 10px;
}

.shell-body {
  display: flex;
  flex: 1;
  min-height: 0;
}

.shell-nav {
  display: flex;
  width: 196px;
  flex: none;
  flex-direction: column;
  gap: 16px;
  padding: 14px 10px;
  overflow-y: auto;
  background: var(--bg);
  border-right: 1px solid var(--line);
}

.nav-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav-label {
  padding: 0 8px 5px;
  color: var(--ink-3);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 1.1px;
}

.shell-nav button {
  display: flex;
  width: 100%;
  height: 30px;
  align-items: center;
  gap: 9px;
  padding: 0 9px;
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: var(--ink-2);
  font-size: 13px;
  text-align: left;
}

.shell-nav button .icon {
  width: 15px;
  height: 15px;
  opacity: 0.9;
}

.shell-nav button:hover {
  background: var(--panel-2);
  color: var(--ink);
}

.shell-nav button.active {
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.nav-text {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

.shell-view {
  flex: 1;
  min-width: 0;
  padding: 16px 20px 40px;
  overflow: auto;
}

.view-inner {
  display: flex;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  flex-direction: column;
  gap: 14px;
}

[data-view] {
  display: none;
}

[data-view].active {
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: fade 0.16s ease both;
}

.shell-view.transfer-view-active {
  display: flex;
  min-height: 0;
  flex-direction: column;
  padding: 16px;
  overflow: hidden;
}

.shell-view.transfer-view-active .view-inner {
  width: 100%;
  min-height: 0;
  flex: 1;
  max-width: none;
}

.shell-view.transfer-view-active [data-module-root] {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
}

#view-transfers.active {
  min-width: 0;
  min-height: 0;
  flex: 1;
}

#view-transfers > .card {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex: 1;
  flex-direction: column;
}

#view-transfers .card-header,
#view-transfers .pager {
  flex: none;
}

#view-transfers .table-wrap {
  width: 100%;
  min-height: 0;
  flex: 1;
}

/* Cards and account content */
.card {
  width: 100%;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}

.card-header > div,
.card-header .card-title,
.card-header .card-subtitle {
  min-width: 0;
  overflow-wrap: anywhere;
}

.card-title {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
}

.card-subtitle {
  margin: 3px 0 0;
  color: var(--ink-3);
  font-size: 12px;
  line-height: 1.55;
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 18px;
  background: var(--panel);
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.profile-item {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.profile-item span {
  color: var(--ink-3);
  font-size: 11px;
  letter-spacing: 0.5px;
}

.profile-item-line {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
}

.profile-item-line b {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-item b {
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  text-overflow: ellipsis;
}

.profile-item b.mono {
  font-size: 12px;
}

.kv {
  display: flex;
  min-height: 38px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.kv:last-child {
  border-bottom: 0;
}

.kv > span {
  color: var(--ink-2);
}

.kv > b {
  min-width: 0;
  overflow-wrap: anywhere;
  font-weight: 500;
}

.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.plan-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.plan-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.plan-card h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 500;
}

.plan-card p {
  min-height: 34px;
  margin: 0;
  color: var(--ink-3);
  font-size: 11px;
  line-height: 1.65;
}

.plan-card .plan-price {
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
}

.plan-card .btn {
  align-self: flex-end;
}

.inline-form {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.inline-form .field {
  flex: 1;
}

#view-password {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
}

#view-security-questions {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
}

.security-questions-lead {
  margin: 0;
  color: var(--ink-2);
}

.security-question-editor {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.security-question-row {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(180px, 1fr);
  gap: 12px;
  padding: 12px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.form-actions-end {
  display: flex;
  justify-content: flex-end;
}

/* Tables and statuses */
.table-wrap {
  max-width: 100%;
  overflow: auto;
  scrollbar-color: var(--line-2) transparent;
  scrollbar-width: thin;
}

.table-wrap::-webkit-scrollbar,
.shell-view::-webkit-scrollbar,
.shell-nav::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

.table-wrap::-webkit-scrollbar-thumb,
.shell-view::-webkit-scrollbar-thumb,
.shell-nav::-webkit-scrollbar-thumb {
  background: var(--line-2);
  background-clip: content-box;
  border: 2px solid transparent;
  border-radius: 4px;
}

.table {
  width: 100%;
  border-spacing: 0;
  border-collapse: separate;
  font-size: 13px;
}

.table th,
.table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

.table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--panel);
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.8px;
}

.table tbody tr:hover {
  background: var(--row-hover);
}

.table tbody tr:last-child td {
  border-bottom: 0;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 18px;
  border-top: 1px solid var(--line);
  color: var(--ink-3);
  font-feature-settings: "tnum";
  font-size: 12px;
  flex-wrap: wrap;
}

.pager-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.table-empty {
  height: 88px;
  color: var(--ink-3);
  font-size: 12px;
  text-align: center !important;
}

.table-actions {
  min-width: 1px;
  text-align: right !important;
}

.action-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 5px;
}

/* 云盘那几排动作按钮：靠左排，用量推到最右。 */
.action-row-left {
  justify-content: flex-start;
}

/* 每个子页一条，夹在标签栏与内容之间；不画分割线，与下面的内容连成一块。 */
.drive-actions {
  padding: 12px 18px;
}

/* 面包屑那一行紧挨着表头，底部间距交给 .drive-bar 自己的 margin。 */
.drive-body {
  gap: 8px;
  padding: 4px 18px 0;
}

.action-row-left .drive-usage {
  margin-left: auto;
}

.action-row .btn,
.action-row .btn-mini {
  flex: 0 1 auto;
}

.pill {
  display: inline-block;
  padding: 2px 8px;
  background: var(--panel);
  border: 1px solid var(--line-2);
  border-radius: 999px;
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.5;
}

.pill-ok {
  background: #e8f5ec;
  border-color: #c4e6cf;
  color: #1f6b38;
}

.pill-accent {
  background: var(--accent-soft);
  border-color: transparent;
  color: var(--accent-ink);
}

.pill-warn {
  background: #f5ede0;
  border-color: #e8d4b8;
  color: #7a5010;
}

.pill-danger {
  background: #f5e8e8;
  border-color: #e8c4c4;
  color: #7a2020;
}

.pill-info {
  background: #e8ecf5;
  border-color: #c4d0e8;
  color: #2a3f7a;
}

:root[data-theme="dark"] .pill-ok {
  background: #1b3323;
  border-color: #2c4a34;
  color: #7fd199;
}

:root[data-theme="dark"] .pill-warn {
  background: #3a2e1b;
  border-color: #4e3d23;
  color: #e0b36a;
}

:root[data-theme="dark"] .pill-danger {
  background: #3a2020;
  border-color: #4e2a2a;
  color: #e89191;
}

:root[data-theme="dark"] .pill-info {
  background: #1f2740;
  border-color: #2c3757;
  color: #97aee0;
}

/* Dialog */
dialog {
  width: min(460px, calc(100vw - 48px));
  max-width: none;
  max-height: calc(100vh - 48px);
  padding: 0;
  overflow: auto;
  animation: rise 0.2s cubic-bezier(0.2, 0.8, 0.3, 1) both;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-2);
  color: var(--ink);
}

dialog::backdrop {
  background: var(--scrim);
  animation: fade 0.16s ease both;
}

.dialog-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

.dialog-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

.dialog-subtitle {
  overflow: hidden;
  margin-top: 3px;
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 12px;
  text-overflow: ellipsis;
}

.dialog-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px 20px;
}

.dialog-actions {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 20px;
  background: var(--panel);
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}

/* 一行放两个字段：长的那个自己撑开，短的（密码）给个够用的固定宽度。 */
.field-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.field-row .field-grow {
  flex: 1;
  min-width: 0;
}

.field-row .field-password {
  flex: none;
  width: 140px;
}

dialog.wide {
  width: min(680px, calc(100vw - 48px));
}

.dialog-actions.center {
  justify-content: center;
}

.dialog-actions .btn-danger {
  border-color: var(--danger);
}

.dialog-message {
  padding: 11px 13px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink-2);
  font-size: 12px;
  line-height: 1.75;
}

.dialog-message.danger {
  background: #f5e8e8;
  border-color: #e8c4c4;
  color: #7a2020;
}

.dialog-message.warn {
  background: #f5ede0;
  border-color: #e8d4b8;
  color: #7a5010;
}

:root[data-theme="dark"] .dialog-message.danger {
  background: #3a2020;
  border-color: #4e2a2a;
  color: #e89191;
}

:root[data-theme="dark"] .dialog-message.warn {
  background: #3a2e1b;
  border-color: #4e3d23;
  color: #e0b36a;
}

/* Redirect fallback */
.redirect-page {
  display: grid;
  min-height: 100vh;
  padding: 24px;
  place-items: center;
}

.redirect-card {
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 12px;
  padding: 24px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink-2);
  text-align: center;
}

@keyframes fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(8px) scale(0.985); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 900px) {
  .shell-nav {
    width: 164px;
  }

  .shell-view {
    padding-right: 14px;
    padding-left: 14px;
  }

  .shell-view.transfer-view-active {
    padding-right: 14px;
    padding-left: 14px;
  }

  .shell-product,
  .shell-user-copy small {
    display: none;
  }
}

@media (max-width: 680px) {
  .pager {
    align-items: stretch;
    flex-direction: column;
  }

  .pager-actions {
    align-self: flex-end;
  }

  .portal-shell {
    min-height: 100vh;
    height: auto;
    overflow: visible;
  }

  .shell-top {
    position: sticky;
    top: 0;
    padding: 0 10px;
  }

  .shell-actions {
    gap: 5px;
  }

  .shell-actions .language-control select {
    width: 96px;
  }

  .header-btn span,
  .shell-user-copy,
  .shell-user-trigger .chevron {
    display: none;
  }

  .shell-user {
    padding-left: 6px;
  }

  .shell-body {
    flex-direction: column;
  }

  /* 窄屏上导航挪到底部做成标签栏：贴在顶部的那条横向滚动条既不好够到，也
     没人知道它能左右滑。分组标题在这里没有位置，用 display:contents 把两组
     的按钮摊平成同一排，七个按钮才能均分宽度。 */
  .shell-nav {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    top: auto;
    z-index: 30;
    width: 100%;
    flex-direction: row;
    gap: 0;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    overflow: visible;
    background: var(--panel);
    border-right: 0;
    border-top: 1px solid var(--line);
    box-shadow: 0 -4px 16px rgb(0 0 0 / 6%);
  }

  .nav-group {
    display: contents;
  }

  .nav-label {
    display: none;
  }

  .shell-nav button {
    width: auto;
    min-width: 0;
    height: auto;
    flex: 1 1 0;
    flex-direction: column;
    gap: 3px;
    padding: 5px 2px;
    font-size: 10px;
    line-height: 1.2;
    text-align: center;
    white-space: normal;
  }

  .shell-nav button .icon {
    width: 19px;
    height: 19px;
  }

  /* 最多两行：英文标签（Security questions 之类）一行放不下。 */
  .nav-text {
    display: -webkit-box;
    max-width: 100%;
    flex: none;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow-wrap: break-word;
  }

  /* 底部那条是浮在内容上的，正文得给它让出位置。 */
  .shell-view {
    padding: 12px 10px calc(82px + env(safe-area-inset-bottom));
    overflow: visible;
  }

  .shell-view.transfer-view-active {
    display: block;
    padding: 12px 10px calc(82px + env(safe-area-inset-bottom));
    overflow: visible;
  }

  .shell-view.transfer-view-active .view-inner {
    height: auto;
    min-height: 0;
    flex: none;
  }

  .shell-view.transfer-view-active [data-module-root] {
    display: block;
    min-height: 0;
    flex: none;
  }

  #view-transfers.active,
  #view-transfers > .card,
  #view-transfers .table-wrap {
    flex: none;
  }

  .profile-grid {
    grid-template-columns: 1fr;
  }

  .inline-form {
    align-items: stretch;
    flex-direction: column;
  }

  .inline-form .btn {
    align-self: flex-end;
  }

  .security-questions-warning {
    align-items: flex-start;
    justify-content: flex-start;
    flex-wrap: wrap;
    padding-right: 10px;
    padding-left: 10px;
  }

  .security-questions-warning span {
    flex: 1;
    min-width: 220px;
  }

  .security-question-row {
    grid-template-columns: 1fr;
  }

  .card-header,
  .card-body,
  .card-footer {
    padding-right: 14px;
    padding-left: 14px;
  }

  .card-header {
    flex-wrap: wrap;
  }

  .card-header > .action-row {
    width: 100%;
  }

  dialog {
    width: calc(100vw - 24px);
    max-height: calc(100vh - 24px);
  }
}

@media (max-width: 440px) {
  .auth-page {
    padding: 16px;
  }

  .auth-tools {
    top: 10px;
    right: 10px;
  }

  .auth-form {
    padding-right: 20px;
    padding-left: 20px;
  }
}

@media (max-width: 350px) {
  .shell-title {
    display: none;
  }

  .shell-actions .language-control select {
    width: 90px;
  }
}

/* Console login key (cli-login.html) */
.cli-key-box {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* 复制按钮不参与压缩，key 再长也不能把它挤没。 */
.cli-key-box .btn {
  flex: none;
}

/* key 有 24 位，卡片只有 400px：字号和字距按能整行放下来定，
   放不下时（窄屏 / 大字体）换行而不是撑破卡片。 */
.cli-key {
  flex: 1;
  min-width: 0;
  padding: 14px 12px;
  background: var(--panel-2);
  border: 1px solid var(--line-2);
  border-radius: 10px;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 1px;
  line-height: 1.5;
  text-align: center;
  overflow-wrap: anywhere;
  user-select: all;
}

.cli-key.expired {
  color: var(--ink-3);
  text-decoration: line-through;
}

.cli-countdown {
  margin: 0;
  color: var(--ink-2);
  font-size: 12px;
  text-align: center;
}

.cli-warning code {
  font-family: var(--mono);
}

/* .auth-form 的 gap 只作用于直接子元素，嵌套状态块里的内容拿不到间距。
   这些块各自排成一列，避免提示文本、警告条和按钮贴在一起。 */
#cli-confirm,
#cli-key-area,
#cli-return-area {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cli-confirm-lead {
  margin: 0;
  color: var(--ink-2);
  font-size: 14px;
}

/* 机器名 / 网卡 / IP：两列，值用等宽字体便于比对。 */
.cli-device {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 16px;
  margin: 0;
  padding: 14px 12px;
  background: var(--panel-2);
  border: 1px solid var(--line-2);
  border-radius: 10px;
}

.cli-device dt {
  color: var(--ink-2);
  font-size: 13px;
}

.cli-device dd {
  margin: 0;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.footer-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* 浮动提示：操作反馈不占据页面顶部的正常流，改为屏幕上方居中的浮层，
   3 秒后自动消失。颜色直接复用 .alert 的 ok/warn/error 分级。 */
#toast-stack {
  position: fixed;
  z-index: 100;
  inset: 16px auto auto 50%;
  transform: translateX(-50%);
  /* 它是个 popover（见 showToast），要盖掉 UA 给 [popover] 的边框、底色和内边距 */
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  overflow: visible;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: max-content;
  max-width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}

#toast-stack .alert {
  padding: 10px 13px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
  animation: drop 0.18s ease both;
}

@keyframes drop {
  from { opacity: 0; transform: translateY(-8px) scale(0.985); }
  to { opacity: 1; transform: none; }
}

/* ---- 云盘 / 分享落地页 ------------------------------------------------- */
/* 只用既有的颜色变量，因此浅色/深色两套主题自动跟随，不用再写一遍。 */

.drive-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.drive-crumbs {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  min-width: 0;
  font-size: 14px;
}

.drive-crumb {
  background: none;
  border: 0;
  padding: 2px 4px;
  border-radius: 6px;
  color: var(--accent-ink);
  cursor: pointer;
  font: inherit;
}

.drive-crumb:hover { background: var(--accent-soft); }

.drive-crumb.current {
  color: var(--ink);
  cursor: default;
  font-weight: 600;
}

.drive-crumb-sep { color: var(--ink-3); }

/* 复制/移动的暂存条 */
.drive-clip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-2);
  font-size: 12px;
}

.drive-clip-label {
  color: var(--ink-2);
  font-weight: 500;
  white-space: nowrap;
}

.drive-clip-items {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
  max-height: 96px;
  overflow-y: auto;
}

.drive-clip-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 4px 2px 8px;
  background: var(--panel);
  border: 1px solid var(--line-2);
  border-radius: 999px;
  max-width: 100%;
}

.drive-clip-path {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drive-clip-x {
  border: 0;
  background: none;
  padding: 0 2px;
  color: var(--ink-3);
  font-family: inherit;
  cursor: pointer;
}

.drive-clip-x:hover { color: var(--danger); }

.drive-usage {
  color: var(--ink-2);
  font-size: 13px;
  white-space: nowrap;
}

.drive-search {
  display: flex;
  align-items: center;
  gap: 4px;
}

.drive-search input {
  width: min(200px, 40vw);
  height: 24px;
  padding: 0 8px;
  font-size: 12px;
  background: var(--bg);
  border: 1px solid var(--line-2);
  border-radius: 8px;
  outline: none;
}

.drive-search input:focus { border-color: var(--accent); }

.drive-search-status {
  min-width: 0;
  color: var(--ink-3);
  font-size: 12px;
}

.drive-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  font-size: 13px;
  color: var(--ink-2);
}

.cloud-transfer-summary { margin: 0; padding: 10px 20px; border-bottom: 1px solid var(--line); }
.cloud-transfer-open {
  display: flex; flex: 1; flex-direction: column; gap: 6px;
  min-width: 0; padding: 6px 0; border: 0; background: none;
  color: inherit; font: inherit; text-align: left; cursor: pointer;
  overflow-wrap: anywhere;
}
.cloud-transfer-open:hover { color: var(--ink); }
.cloud-transfer-open:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.cloud-transfer-summary > button:last-child { flex: none; }
.cloud-transfer-summary progress, .cloud-transfer-dialog progress {
  display: block; width: 100%; height: 8px; accent-color: var(--accent);
}
.cloud-transfer-dialog { width: min(640px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); border-radius: 8px; }
.cloud-transfer-dialog[open] { display: flex; flex-direction: column; overflow: hidden; }
.cloud-transfer-dialog .dialog-header, .cloud-transfer-dialog .dialog-actions { flex: none; }
.cloud-transfer-dialog .dialog-title { min-width: 0; overflow-wrap: anywhere; }
.cloud-transfer-dialog .dialog-header > button { flex: none; }
.cloud-transfer-overview { display: grid; gap: 8px; padding: 16px 20px; overflow-wrap: anywhere; font-size: 13px; }
.cloud-transfer-files { overflow-y: auto; min-height: 0; border-top: 1px solid var(--line); }
.cloud-transfer-file { padding: 14px 20px; border-bottom: 1px solid var(--line); font-size: 13px; }
.cloud-transfer-file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cloud-transfer-file-meta { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; margin: 6px 0; color: var(--ink-3); overflow-wrap: anywhere; }
.cloud-transfer-file-bytes, #cloud-transfer-bytes { font-variant-numeric: tabular-nums; }
.cloud-transfer-dialog .dialog-actions .btn { height: auto; min-height: 32px; max-width: 100%; white-space: normal; overflow-wrap: anywhere; }

.drive-mutation-progress {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  font-size: 13px;
  color: var(--ink-2);
}

.drive-mutation-status {
  min-height: 1.5em;
  margin-bottom: 6px;
  overflow-wrap: anywhere;
}

.drive-mutation-detail {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 1.5em;
}

.drive-mutation-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drive-mutation-count {
  flex: none;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.drive-mutation-progress progress {
  display: block;
  width: 100%;
  height: 8px;
  accent-color: var(--accent);
}

.drive-mutation-dialog .dialog-header > div {
  flex: 1;
  min-width: 0;
}

.drive-mutation-dialog .dialog-subtitle {
  white-space: nowrap;
}

.drive-mutation-dialog .dialog-actions .btn {
  height: auto;
  min-height: 32px;
  max-width: 100%;
  padding-block: 6px;
  white-space: normal;
  overflow-wrap: anywhere;
}

/* 文件名：目录是可点的按钮，文件是纯文本，两者要长得一样。 */
.drive-name {
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
  font: inherit;
  text-align: left;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

button.drive-name {
  color: var(--accent-ink);
  cursor: pointer;
}

button.drive-name:hover { text-decoration: underline; }

.drive-result-path {
  display: block;
  max-width: 520px;
  margin-top: 3px;
  overflow: hidden;
  color: var(--ink-3);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

button.drive-result-path {
  width: fit-content;
  padding: 0;
  background: none;
  border: 0;
  cursor: pointer;
  text-align: left;
}

button.drive-result-path:hover { color: var(--accent-ink); }

@media (max-width: 560px) {
  .drive-search { flex-wrap: wrap; }
  .drive-search input { flex: 1 1 100%; }
  .drive-search-status { flex-basis: 100%; }

  #drive-table.drive-search-results {
    min-width: 0 !important;
    table-layout: fixed;
  }

  #drive-table.drive-search-results th:nth-child(2),
  #drive-table.drive-search-results th:nth-child(3),
  #drive-table.drive-search-results td:nth-child(2),
  #drive-table.drive-search-results td:nth-child(3) {
    display: none;
  }

  #drive-table.drive-search-results th:nth-child(4) { width: 90px; }
  #drive-table.drive-search-results td { vertical-align: top; }
}

/* 分享落地页的表格挤在 auth-card 里，给它一点呼吸空间。 */
#share-browser .table-wrap { margin-top: 12px; }
#share-browser .table { min-width: 0; }

.share-summary, .share-save-navigation {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.share-summary, .share-selection-count, .share-list-status {
  color: var(--ink-2);
  font-size: 12px;
}

.share-summary { flex-wrap: wrap; }
#share-total-size { font-variant-numeric: tabular-nums; }
#share-actions { flex-wrap: wrap; gap: 8px; }
#share-actions button { white-space: normal; overflow-wrap: anywhere; }
#share-table { table-layout: fixed; width: 100%; }
#share-table .table-check { width: 36px; }
#share-table th:last-child { width: 100px; }
#share-table .drive-name { max-width: 100%; overflow-wrap: anywhere; text-align: left; }
#share-crumbs { overflow-wrap: anywhere; }
#share-crumbs > * { min-width: 0; max-width: 100%; }

#share-save-modal { width: min(480px, calc(100vw - 32px)); }
#share-save-modal .dialog-header > div { min-width: 0; }
#share-save-sub { white-space: nowrap; }
#share-save-crumbs { overflow-wrap: anywhere; }
#share-save-crumbs > * { max-width: 100%; min-width: 0; }
.share-save-navigation { align-items: flex-start; }
.share-save-navigation > button { flex: none; }
.share-save-folders {
  height: 260px;
  min-height: 100px;
  flex: 0 1 260px;
  overflow: auto;
  border-block: 1px solid var(--line);
}
.share-save-folder {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 8px;
  background: transparent;
  color: var(--ink);
  border: 0;
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}
.share-save-folder:hover { background: var(--panel-2); }
.share-save-folder-name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
#share-save-status, .share-save-error { font-size: 13px; overflow-wrap: anywhere; }
.share-save-error { color: var(--danger); }
#share-save-retry { align-self: center; }

/* 验完密码进到浏览态：这一页就不再是一张登录卡片了，摊开成和门户云盘页一样
   宽的一块，顶部对齐——文件列表挤在 400px 里没法看。 */
.auth-page.browsing {
  align-items: flex-start;
  justify-content: center;
}

#share-stack.browsing {
  width: min(1080px, 100%);
}

/* 密码框右侧那个"看一眼明文"的按钮 */
.input-reveal {
  position: relative;
  display: flex;
}

.input-reveal input {
  padding-right: 34px;
}

.input-reveal-btn {
  position: absolute;
  top: 50%;
  right: 4px;
  transform: translateY(-50%);
  padding: 0 6px;
  border: 0;
  background: none;
  color: var(--ink-3);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}

.input-reveal-btn:hover { color: var(--ink); }

/* 浏览态下头部只留产品图标：分享名在面包屑里已经有一份了。 */
#share-stack.browsing .auth-head {
  padding: 18px 18px 14px;
}

#share-stack.browsing .auth-heading { display: none; }

#share-stack.browsing #share-browser { padding: 0 18px 18px; }

/* i18n.js runs from <head> and translates the Simplified Chinese markup once
   the DOM is parsed; hide the page until then so the source text never flashes. */
html[data-i18n-pending] body {
  visibility: hidden;
}

/* 弹窗自己不再滚动，改成内容区滚：滚动条贴在圆角上会把右侧那两个角切掉，
   包在 overflow:hidden 的外框里之后，滚动条被圆角干净地裁住。
   display 只对 [open] 写，否则会盖掉 UA 的 dialog:not([open]){display:none}。 */
dialog {
  overflow: hidden;
}

dialog[open] {
  display: flex;
  flex-direction: column;
}

.dialog-body {
  min-height: 0;
  overflow: auto;
}
