:root {
    --bg: #f5efe5;
    --bg-accent: #efe1cb;
    --panel: rgba(255, 251, 245, 0.92);
    --line: rgba(91, 63, 37, 0.14);
    --ink: #2f2419;
    --muted: #746250;
    --brand: #a24717;
    --brand-dark: #7f340e;
    --ok: #20603d;
    --warn: #8e5a12;
    --shared: #d97706;
    --shared-ink: #9a3412;
    --danger: #b42318;
    --sort-btn-w: 68px;
    --side-btn-w: 108px;
    --fold-btn-w: 40px;
    /* 全站等宽字体：西文用等宽字体，中文回退到系统中文字体（等宽字体不含汉字） */
    --font-mono: "SFMono-Regular", Menlo, Consolas, "Liberation Mono", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", monospace;
}

* {
    box-sizing: border-box;
}

/* 表单控件默认不继承页面字体，显式继承以统一为等宽字体 */
button,
input,
textarea,
select {
    font-family: inherit;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    background:
        radial-gradient(circle at top right, rgba(162, 71, 23, 0.16), transparent 28%),
        radial-gradient(circle at left center, rgba(87, 119, 72, 0.18), transparent 24%),
        linear-gradient(135deg, var(--bg), var(--bg-accent));
    font-family: var(--font-mono);
}

.page-shell {
    width: 80vw;
    min-width: 320px;
    margin: 0 auto;
    padding: 28px 0 40px;
}

.hero {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    padding: 28px;
    border-radius: 28px;
    background: rgba(255, 249, 240, 0.74);
    border: 1px solid var(--line);
    backdrop-filter: blur(12px);
    box-shadow: 0 24px 60px rgba(80, 54, 28, 0.08);
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--brand);
    font-size: 13px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

h1 {
    margin: 0;
    font-size: clamp(32px, 5vw, 54px);
    line-height: 1.05;
}

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

/* 标题下方的系统版本号与启动时间, 由 app.js 拉取 /api/system/info 后填充 */
.hero > div {
    flex: 1;
    min-width: 0;
}

.hero-meta {
    /* 版本 · 启动时间 · 当前用户 · Token [复制] ……… [退出登录]（退出按钮贴最右） */
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    row-gap: 6px;
    margin: 10px 0 0;
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 13px;
    letter-spacing: 0.02em;
}

.layout {
    display: grid;
    /* minmax(0, 1fr)：防止宽表格（权限矩阵）把整列撑出页面，改由表格自身横向滚动 */
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
    margin-top: 18px;
}

.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 26px;
    padding: 24px;
    box-shadow: 0 18px 42px rgba(80, 54, 28, 0.06);
}

.panel-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 14px;
}

.panel-head {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
}

.stack-form {
    display: grid;
    gap: 14px;
}

label span {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 14px;
}

input {
    width: 100%;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid rgba(105, 74, 45, 0.18);
    background: rgba(255, 255, 255, 0.84);
    font-size: 15px;
}

button,
.file-picker span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 18px;
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
    color: #fff;
    font-size: 15px;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

button:hover,
.file-picker span:hover {
    transform: translateY(-1px);
    opacity: 0.94;
}

.ghost-button {
    background: rgba(47, 36, 25, 0.08);
    color: var(--ink);
}

.message,
.subtle,
.duplicate-notice {
    color: var(--muted);
    line-height: 1.6;
}

/* 标题说明行里紧跟当前用户名的 upx-cli Token(由 app.js 拉取 /api/auth/token 填充) + 小号复制按钮 */
.token-meta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    vertical-align: middle;
}

/* 标题说明行里的小按钮（下载客户端），外观与退出登录一致 */
.meta-mini-btn {
    flex: none;
    min-height: 0;
    height: 22px;
    margin-left: 4px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(162, 71, 23, 0.10);
    color: var(--brand);
    font-family: inherit;
    font-size: 12px;
}

.meta-mini-btn:hover {
    background: rgba(162, 71, 23, 0.18);
}

.logout-mini {
    margin-left: auto;
    min-height: 0;
    height: 24px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(47, 36, 25, 0.06);
    color: var(--muted);
    font-family: inherit;
    font-size: 12px;
}

.logout-mini:hover {
    background: rgba(162, 71, 23, 0.12);
    color: var(--brand);
}

/* "删除所有"在"退出登录"左边：由它占据右对齐，退出按钮紧随其后 */
.reset-mini:not(.hidden) + .logout-mini {
    margin-left: 6px;
}

/* 已用空间标签：在"删除所有"左边，占据右对齐，后面的按钮紧随 */
.storage-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 24px;
    margin-left: auto;
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid rgba(32, 96, 61, 0.22);
    background: rgba(32, 96, 61, 0.08);
    color: var(--ok);
    font-size: 12px;
    white-space: nowrap;
    cursor: default;
}

.storage-tag:not(.hidden) ~ .logout-mini:not(.hidden) {
    margin-left: 6px;
}

.reset-mini:hover {
    background: rgba(185, 28, 28, 0.12);
    color: var(--danger);
}

.meta-sep {
    margin: 0 4px 0 6px;
}

.token-label {
    flex: none;
}

/* Token 为 40 位十六进制, 等宽字体便于核对; 窄屏时省略而不折行 */
.token-value {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: inherit;
}

.token-copy {
    flex: none;
    min-height: 0;
    width: 22px;
    height: 22px;
    padding: 0;
    border-radius: 6px;
    background: rgba(47, 36, 25, 0.06);
    color: var(--muted);
}

.token-copy:hover {
    background: rgba(162, 71, 23, 0.12);
    color: var(--brand);
}

.token-copy.copied {
    color: var(--ok);
}

.token-copy:disabled {
    display: none;
}

.path-bar {
    /* 存储路径输入框 | 选择文件上传 | 选择文件夹上传，按钮与输入框底边对齐 */
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto auto;
    gap: 12px;
    margin: 16px 0 12px;
    align-items: end;
}

.file-picker input {
    display: none;
}

/* 存储路径校验提示：紧跟在"存储路径"标签文字后面的浅色小字 */
.path-hint {
    margin-left: 10px;
    color: #b8875a;
    font-size: 12px;
}

/* 选择上传按钮是 label 内的 span，抵消通用 "label span" 的下边距，使其与存储路径输入框底边齐平 */
.file-picker span {
    margin-bottom: 0;
}

.queue-list {
    display: grid;
    gap: 8px;
    margin-top: 14px;
}

/* 一次上传（一个文件夹或一批文件）为一组，组内文件行过多时组内滚动 */
.queue-batch {
    display: grid;
    gap: 3px;
    max-height: 50vh;
    overflow-y: auto;
}

/* 单行上传条：背景色 .queue-fill 宽度即进度，文字直接压在进度上 */
.queue-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 28px;
    padding: 2px 4px 2px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.66);
    font-size: 13px;
    overflow: hidden;
}

.queue-fill {
    position: absolute;
    inset: 0 auto 0 0;
    width: 0;
    background: rgba(90, 141, 78, 0.22);
    transition: width 0.2s ease;
}

.queue-item.is-failed {
    border-color: rgba(185, 28, 28, 0.35);
}

.queue-item.is-failed .queue-fill {
    background: rgba(220, 38, 38, 0.16);
}

.queue-item > :not(.queue-fill) {
    position: relative; /* 文字与按钮浮在进度背景之上 */
}

.queue-item .name {
    flex: 1;
    min-width: 0;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.queue-item .status {
    flex-shrink: 0;
    max-width: 50%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--muted);
    font-size: 12px;
}

.queue-item .percent {
    flex-shrink: 0;
    width: 3.2em;
    text-align: right;
    color: var(--ink);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

.queue-cancel {
    flex-shrink: 0;
    min-height: 22px;
    padding: 0 10px;
    background: rgba(47, 36, 25, 0.1);
    color: var(--ink);
    font-size: 12px;
}

/* 文件夹整组上传结束后的总结行，取代该组的进度条 */
.queue-summary {
    padding: 6px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.66);
    font-size: 13px;
}

.queue-summary.has-failed {
    border-color: rgba(185, 28, 28, 0.35);
}

.queue-summary .fail-count {
    color: #b91c1c;
    font-weight: 600;
}

.uncancelable-tag {
    margin-left: 8px;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(47, 36, 25, 0.06);
    color: var(--muted);
    font-size: 11px;
    font-weight: 400;
}

.queue-cancel[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
}

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

.tree-root {
    display: grid;
    gap: 10px;
}

.tree-folder {
    border: 1px solid rgba(91, 63, 37, 0.1);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.6);
    padding: 10px 12px;
}

.tree-folder > summary {
    cursor: pointer;
    list-style: none;
    font-weight: 700;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    /* 撑满文件夹卡片的内边距，悬停高亮覆盖整行 */
    margin: -10px -12px;
    padding: 10px 12px;
    border-radius: 16px;
    transition: background 0.15s ease;
}

.tree-folder[open] > summary {
    margin-bottom: 0;
}

/* 鼠标划过文件 / 文件夹行：浅品牌色底 + 描边，标明当前所在行 */
.tree-folder > summary:hover {
    background: rgba(162, 71, 23, 0.08);
}

.tree-file {
    transition: background 0.15s ease, border-color 0.15s ease;
}

.tree-file:hover {
    background: rgba(162, 71, 23, 0.08);
    border-color: rgba(162, 71, 23, 0.32);
}

.tree-folder-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-shrink: 0;
    width: 210px;
    justify-content: flex-end;
}

.tree-folder-actions a {
    min-height: 34px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    color: var(--brand-dark);
    text-decoration: none;
    font-size: 14px;
    font-weight: 400;
    border-radius: 999px;
    background: rgba(47, 36, 25, 0.06);
    transition: transform 0.2s ease;
}

.tree-folder-actions a:hover {
    transform: translateY(-1px);
}

.tree-folder-actions .folder-delete {
    min-height: 34px;
    padding: 0 12px;
    background: rgba(47, 36, 25, 0.08);
    color: var(--ink);
    font-size: 14px;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.tree-folder-actions .folder-delete:hover {
    transform: translateY(-1px);
    opacity: 0.94;
}

.tree-folder > summary::-webkit-details-marker {
    display: none;
}

.tree-folder-name::before {
    content: "▾ ";
    color: var(--brand-dark);
}

.tree-folder:not([open]) .tree-folder-name::before {
    content: "▸ ";
}

.tree-children {
    display: grid;
    gap: 8px;
    margin-top: 10px;
    padding-left: 14px;
}

.tree-children > .tree-folder,
.tree-children > .tree-file {
    margin-right: -14px;
}

.tree-file {
    /* 单行表格式布局：文件名 | 所在目录 | 大小 | 上传时间 | 操作 */
    display: grid;
    /* 屏幕外的行跳过布局与绘制，文件很多时滚动更流畅；44px 为单行的估计高度 */
    content-visibility: auto;
    contain-intrinsic-size: auto 44px;
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) 76px 148px 210px;
    gap: 12px;
    align-items: center;
    padding: 6px 14px;
    border-radius: 12px;
    background: rgba(255, 249, 240, 0.88);
    border: 1px solid rgba(91, 63, 37, 0.08);
}

.tree-file-name {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    font-weight: 700;
}

.tree-file-name-text,
.tree-file-path {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tree-file-path,
.tree-file-size,
.tree-file-time {
    color: var(--muted);
    font-size: 13px;
    min-width: 0;
}

.tree-file-size {
    text-align: right;
}

.tree-file-time {
    white-space: nowrap;
}

/* 分享中的文件：琥珀色警示底色 + 左侧色条 + 标签 */
.tree-file.is-shared {
    background: rgba(245, 158, 11, 0.14);
    border-color: rgba(217, 119, 6, 0.45);
    box-shadow: inset 4px 0 0 var(--shared);
}

.tree-file.is-shared:hover {
    background: rgba(245, 158, 11, 0.24);
    border-color: rgba(217, 119, 6, 0.7);
}

.tree-file.is-shared .tree-file-name-text {
    color: var(--shared-ink);
}

.shared-tag {
    flex-shrink: 0;
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--shared);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
}

.file-search {
    margin-bottom: 12px;
}

.tree-file-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-shrink: 0;
    width: 210px;
    justify-content: flex-end;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    text-align: left;
    padding: 14px 10px;
    border-bottom: 1px solid rgba(91, 63, 37, 0.1);
    vertical-align: top;
}

th {
    color: var(--muted);
    font-weight: 600;
}

a {
    color: var(--brand-dark);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.table-delete {
    margin-left: 10px;
    min-height: 34px;
    padding: 0 12px;
    background: rgba(47, 36, 25, 0.1);
    color: var(--ink);
    font-size: 14px;
}

.status-ok {
    color: var(--ok);
}

.status-expired {
    color: var(--ink);
}

.status-warn {
    color: var(--warn);
}

.tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 18px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 0;
}

.tab {
    min-height: 40px;
    padding: 0 20px;
    border: none;
    border-radius: 999px 999px 0 0;
    background: transparent;
    color: var(--muted);
    font-size: 15px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.tab:hover {
    background: rgba(47, 36, 25, 0.06);
}

.tab.active {
    background: rgba(162, 71, 23, 0.10);
    color: var(--brand);
    font-weight: 600;
}

.tab-content {
    padding-top: 4px;
}

.tab-tools {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-left: auto;
}

.toggle-folders-btn {
    min-height: 34px;
    padding: 0 14px;
    border: none;
    border-radius: 999px;
    background: rgba(47, 36, 25, 0.06);
    color: var(--muted);
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
    line-height: 1;
}

.toggle-folders-btn:hover {
    background: rgba(47, 36, 25, 0.12);
}

/* 排序按钮沿用 toggle-folders-btn 外观，仅字号适配文字，当前排序项高亮 */
.sort-btn {
    font-size: 14px;
    font-weight: 600;
}

/* 文件面板标签栏的“时间 / 名称 / +”定宽，便签列表的编辑/删除按钮据此对齐 */
#sortByTimeButton,
#sortByNameButton {
    width: var(--sort-btn-w);
    padding: 0;
}

#toggleFoldersButton {
    width: var(--fold-btn-w);
    padding: 0;
}

.sort-btn.active {
    background: rgba(162, 71, 23, 0.10);
    color: var(--brand);
}

.share-button, .folder-share-button, .copy-share-link {
    border: none;
    border-radius: 999px;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.share-button:hover, .folder-share-button:hover, .copy-share-link:hover {
    transform: translateY(-1px);
    opacity: 0.94;
}

.share-button.copied, .folder-share-button.copied {
    background: linear-gradient(135deg, var(--ok), #2d7a4e);
    color: #fff;
}

.share-button:disabled, .folder-share-button:disabled, .copy-share-link:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.folder-share-button {
    margin-left: 8px;
    min-height: 28px;
    padding: 0 10px;
    background: rgba(47, 36, 25, 0.06);
    color: var(--muted);
    font-size: 12px;
    vertical-align: middle;
}

.share-button {
    min-height: 34px;
    padding: 0 12px;
    background: rgba(47, 36, 25, 0.08);
    color: var(--ink);
    font-size: 14px;
}

.share-records-list {
    display: grid;
    gap: 10px;
}

.share-record-item {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(255, 249, 240, 0.88);
    border: 1px solid rgba(91, 63, 37, 0.08);
}

.share-record-item.used {
    opacity: 0.7;
}

.share-record-main {
    min-width: 0;
}

.share-record-name {
    font-weight: 700;
    word-break: break-all;
}

.share-record-name.active {
    color: var(--ok);
}

.share-record-name.expired {
    color: var(--ink);
}

.share-record-meta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 6px;
    color: var(--muted);
    font-size: 13px;
}

.share-record-status {
    font-weight: 600;
}

.share-record-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-shrink: 0;
}

.time-limit-btn {
    min-height: 34px;
    padding: 0 12px;
    background: linear-gradient(135deg, #5a8d4e, #3d6b35);
    color: #fff;
    font-size: 14px;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.time-limit-btn:hover {
    transform: translateY(-1px);
    opacity: 0.94;
}

.time-limit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.delete-record-btn {
    min-height: 34px;
    padding: 0 12px;
    background: rgba(47, 36, 25, 0.06);
    color: var(--muted);
    font-size: 14px;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.delete-record-btn:hover {
    transform: translateY(-1px);
    opacity: 0.94;
}

.copy-share-link {
    min-height: 34px;
    padding: 0 12px;
    background: rgba(47, 36, 25, 0.08);
    color: var(--ink);
    font-size: 14px;
}

/* 分享弹框 */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(47, 36, 25, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 16px;
}

.modal {
    background: var(--panel);
    border: 1px solid rgba(47, 36, 25, 0.08);
    border-radius: 24px;
    box-shadow: 0 24px 64px rgba(47, 36, 25, 0.28);
    /* 940px 保证 6 列用户网格每格 ~133px, 可完整容纳 6 字中文用户名 */
    width: min(940px, 100%);
    max-height: 85vh;
    overflow-y: auto;
    padding: 26px 28px;
}

.modal-head {
    margin-bottom: 16px;
}

.modal-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px;
}

.modal-file-name {
    word-break: break-all;
}

/* 分享方式卡片（可同时勾选） */
.share-type-cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 14px;
}

.share-type-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: 1.5px solid var(--line);
    border-radius: 16px;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.share-type-card:hover {
    background: rgba(162, 71, 23, 0.04);
    border-color: rgba(162, 71, 23, 0.35);
}

.share-type-card input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}

.share-type-check {
    flex: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1.5px solid rgba(91, 63, 37, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.share-type-check::after {
    content: "";
    width: 9px;
    height: 5px;
    border-left: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: rotate(-45deg) translateY(-1px);
    opacity: 0;
    transition: opacity 0.15s ease;
}

.share-type-card input:checked + .share-type-check {
    background: var(--brand);
    border-color: var(--brand);
}

.share-type-card input:checked + .share-type-check::after {
    opacity: 1;
}

.share-type-card input:focus-visible + .share-type-check {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}

.share-type-card.selected {
    border-color: var(--brand);
    background: rgba(162, 71, 23, 0.06);
    box-shadow: 0 2px 12px rgba(162, 71, 23, 0.12);
}

.share-type-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.share-type-body strong {
    font-size: 15px;
}

.share-type-body em {
    font-style: normal;
    color: var(--muted);
    font-size: 13px;
}

/* 分享方式展开面板 */
.share-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 0 0 14px;
    padding: 14px 16px;
    border-left: 3px solid var(--brand);
    border-radius: 0 14px 14px 0;
    background: rgba(162, 71, 23, 0.045);
}

.share-panel-label {
    color: var(--muted);
    font-size: 13px;
}

/* 链接分享结果 */
.link-result-text {
    display: block;
    width: 100%;
    padding: 9px 12px;
    background: rgba(47, 36, 25, 0.05);
    border: 1px solid var(--line);
    border-radius: 12px;
    font-size: 13px;
    color: var(--ink);
    white-space: normal;
    word-break: break-all;
}

.link-auto-copied {
    color: var(--ok);
    font-size: 13px;
}

/* 接收用户选择：列数随用户数动态自适应(1~6 列), 默认展示 3 行, 超出滚动 */
.share-user-list {
    display: grid;
    /* 每行固定 5 列；有效期选项（.share-days-list）用同一网格，4 个选项与上方用户列逐列对齐 */
    grid-template-columns: repeat(5, minmax(0, 1fr));
    grid-auto-rows: 40px;
    gap: 10px;
    max-height: 194px; /* 40px × 4 行 + 10px × 3 间距 + 上下 2px 内边距，超出滚动 */
    overflow-y: auto;
    padding: 2px;
}

.share-user-list .subtle {
    grid-column: 1 / -1;
    align-self: center;
}

.share-days-list {
    max-height: none;
    overflow: visible;
}

.share-panel-head {
    display: flex;
    align-items: center;
    gap: 12px;
}

.share-user-search {
    width: 220px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 13px;
}

.share-user-search:focus {
    outline: 2px solid var(--brand);
    outline-offset: 1px;
}

/* 链接分享卡片 + 右侧下载次数设定 */
.share-type-row {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.share-type-row .share-type-card {
    flex: 1;
    min-width: 0;
}

.share-count {
    display: flex;
    flex: none;
    align-items: center;
    gap: 6px;
    padding: 0 14px;
    border: 1.5px solid var(--line);
    border-radius: 16px;
    color: var(--muted);
    font-size: 13px;
    white-space: nowrap;
}

.share-count span {
    display: inline;
    margin: 0;
    font-size: 13px;
}

.share-count input {
    width: 64px;
    padding: 6px 8px;
    border-radius: 10px;
    font-size: 14px;
    text-align: center;
}

.share-count input:focus {
    outline: 2px solid var(--brand);
    outline-offset: 1px;
}

/* 下载链接：浏览器 / 命令行两行，每行最右一个复制按钮 */
.link-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
}

.link-kind {
    color: var(--muted);
    font-size: 12px;
    white-space: nowrap;
}

.link-copy {
    flex: none;
}

.share-user-option {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    cursor: pointer;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255, 251, 245, 0.72);
    transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.share-user-option:hover {
    border-color: rgba(162, 71, 23, 0.45);
    background: rgba(162, 71, 23, 0.06);
}

.share-user-option.selected {
    border-color: var(--brand);
    background: rgba(162, 71, 23, 0.09);
    box-shadow: 0 1px 6px rgba(162, 71, 23, 0.15);
}

.share-user-option input[type="checkbox"],
.share-user-option input[type="radio"] {
    /* 重置全局 input 样式(width:100%/大 padding), 否则 checkbox 会撑满格子挤压用户名 */
    flex: none;
    width: 14px;
    height: 14px;
    padding: 0;
    margin: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    accent-color: var(--brand);
}

.share-user-option span {
    /* 全局 label span 带 display:block + margin-bottom:8px，会把文字顶高与勾选框错位，这里清掉 */
    display: block;
    margin: 0;
    line-height: 1.2;
    flex: 1;
    min-width: 0;
    font-size: 13.5px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 8px;
}

.message-ok {
    color: var(--ok);
}

.delete-record-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}

.hidden {
    display: none;
}

.modal-overlay.hidden {
    display: none;
}

/* ===== 通用确认弹框 (showConfirm) ===== */
.confirm-modal {
    width: min(440px, 100%);
    padding: 24px 24px 20px;
    animation: confirm-pop 0.16s ease-out;
}

@keyframes confirm-pop {
    from { opacity: 0; transform: translateY(8px) scale(0.97); }
    to { opacity: 1; transform: none; }
}

.confirm-main {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 20px;
}

.confirm-icon {
    flex-shrink: 0;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(180, 35, 24, 0.10);
    color: var(--danger);
    font-size: 22px;
    font-weight: 800;
}

.confirm-body {
    min-width: 0;
}

.confirm-message {
    color: var(--ink);
    line-height: 1.6;
    word-break: break-all;
}

.confirm-message strong {
    color: var(--brand-dark);
}

.confirm-detail {
    margin-top: 6px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

.confirm-detail:empty {
    display: none;
}

/* 提示类弹框（报错 / 手动复制）的图标配色：报错偏红、提示用品牌色 */
.confirm-icon.tone-info {
    background: rgba(162, 71, 23, 0.10);
    color: var(--brand);
}

/* 剪贴板不可用时供手动复制的只读文本框 */
.confirm-copy {
    margin-top: 10px;
    padding: 8px 10px;
    border-radius: 10px;
    font-size: 13px;
}

.confirm-copy:focus {
    outline: 2px solid rgba(162, 71, 23, 0.35);
    outline-offset: 1px;
}

.confirm-modal .modal-actions button {
    min-height: 40px;
    min-width: 84px;
}

.confirm-modal .modal-actions button:focus-visible {
    outline: 2px solid rgba(162, 71, 23, 0.45);
    outline-offset: 2px;
}

/* ===== upx-cli 客户端下载弹框 ===== */
.client-modal {
    width: min(640px, 100%);
    padding: 24px;
    animation: confirm-pop 0.16s ease-out;
}

.client-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
}

.client-sub {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
}

.client-close {
    flex: none;
    min-height: 0;
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 50%;
    background: rgba(47, 36, 25, 0.06);
    color: var(--muted);
    font-size: 20px;
    line-height: 1;
}

.client-close:hover {
    background: rgba(47, 36, 25, 0.12);
    color: var(--ink);
}

.client-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

/* 单个版本卡片：左侧系统徽标，中间系统/芯片说明，右侧大小与下载箭头 */
.client-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.7);
    color: var(--ink);
    text-decoration: none;
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

a.client-card:hover {
    text-decoration: none;
    border-color: rgba(162, 71, 23, 0.45);
    box-shadow: 0 6px 18px rgba(80, 54, 28, 0.10);
    transform: translateY(-1px);
}

.client-card.is-recommended {
    border-color: rgba(162, 71, 23, 0.55);
    background: rgba(162, 71, 23, 0.06);
}

.client-card.is-disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.client-os {
    flex: none;
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
}

.client-os.os-darwin {
    background: linear-gradient(135deg, #5b5b5f, #2f2f33);
}

.client-os.os-linux {
    background: linear-gradient(135deg, #d97706, #a24717);
}

.client-card-body {
    flex: 1;
    min-width: 0;
    display: grid;
    gap: 2px;
}

.client-name {
    font-weight: 700;
}

.client-arch {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
}

.client-size {
    flex: none;
    color: var(--muted);
    font-size: 12px;
}

.client-arrow {
    flex: none;
    color: var(--brand);
    font-size: 16px;
    font-weight: 700;
}

.client-badge {
    position: absolute;
    top: -9px;
    right: 12px;
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--brand);
    color: #fff;
    font-size: 11px;
}

.client-usage {
    margin-top: 18px;
    padding: 14px 16px;
    border-radius: 14px;
    background: rgba(47, 36, 25, 0.04);
    font-size: 13px;
}

.client-usage-title {
    margin-bottom: 8px;
    font-weight: 700;
}

.client-cmd {
    display: block;
    padding: 8px 12px;
    border-radius: 10px;
    background: #2f2419;
    color: #f5efe5;
    overflow-x: auto;
    white-space: nowrap;
}

.client-tips {
    margin: 10px 0 0;
    padding-left: 18px;
    color: var(--muted);
    line-height: 1.7;
}

.client-tips code {
    padding: 0 4px;
    border-radius: 4px;
    background: rgba(47, 36, 25, 0.08);
}

.client-empty {
    grid-column: 1 / -1;
    color: var(--muted);
}

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

.danger-button {
    background: linear-gradient(135deg, #c2410c, var(--danger));
    color: #fff;
}

@media (max-width: 768px) {
    .share-user-list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .share-type-row,
    .share-panel-head {
        flex-direction: column;
        align-items: stretch;
    }

    .share-count {
        padding: 10px 14px;
    }

    .share-user-search {
        width: 100%;
    }

    .page-shell {
        width: min(calc(100vw - 18px), 100%);
        padding-top: 18px;
    }

    .modal {
        padding: 20px 16px;
    }

    .hero,
    .panel-head {
        flex-direction: column;
        align-items: stretch;
    }

    .path-bar {
        grid-template-columns: 1fr 1fr;
    }

    .drop-link-button {
        grid-column: 1 / -1;
    }

    .path-bar > label:first-child {
        grid-column: 1 / -1;
    }

    .tree-file {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .tree-file-name,
    .tree-file-path,
    .tree-file-actions {
        grid-column: 1 / -1;
    }

    .tree-file-size {
        text-align: left;
    }

    .tree-file-actions {
        width: 100%;
    }

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

    .share-record-actions {
        width: 100%;
    }

}

/* ===== 个人便签 (note-editor) ===== */
.note-editor {
    /* 输入框 | 保存按钮 同行；按钮贴底与输入框右下齐平，右缘与"创建文件夹"按钮对齐；提示信息在下一行 */
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    column-gap: 12px;
    margin: 12px 0 10px;
}

.note-editor textarea {
    display: block;
    width: 100%;
    min-height: 48px; /* 默认 1 行文字，与按钮同高，随内容由 JS 自动增高 */
    max-height: 42vh;
    padding: 11px 16px;
    border-radius: 16px;
    border: 1px solid rgba(105, 74, 45, 0.18);
    background: rgba(255, 255, 255, 0.84);
    color: var(--ink);
    font-family: inherit;
    font-size: 15px;
    line-height: 1.6;
    resize: none; /* 高度由 autoGrow 控制 */
    overflow-y: auto;
}

.note-editor textarea:focus {
    outline: 2px solid rgba(162, 71, 23, 0.35);
    outline-offset: 1px;
}

.note-editor .message {
    grid-column: 1 / -1;
    font-size: 13px;
}

.note-editor .message:empty {
    display: none;
}

.note-editor button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

/* ===== 我的便签 (notes panel) ===== */
.note-search {
    margin-bottom: 12px;
}

.notes-list-wrap {
    max-height: 60vh;
    overflow-y: auto;
    display: grid;
    gap: 10px;
    padding-right: 4px;
}

.note-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    padding: 12px 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.66);
}

.note-item-main {
    min-width: 0;
}

.note-item-content {
    color: var(--ink);
    font-size: 14px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}

.note-item-time {
    margin-top: 6px;
    color: var(--muted);
    font-size: 12px;
}

.note-item-textarea {
    width: 100%;
    min-height: 72px;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid rgba(105, 74, 45, 0.25);
    background: rgba(255, 255, 255, 0.9);
    color: var(--ink);
    font-family: inherit;
    font-size: 14px;
    line-height: 1.6;
    resize: none;
    overflow-y: auto;
}

.note-item-textarea:focus {
    outline: 2px solid rgba(162, 71, 23, 0.35);
    outline-offset: 1px;
}

/* 编辑 / 删除左右排列，与标签栏右侧“时间 / 名称”两个按钮逐列上下对齐：
 * 按钮同宽（--sort-btn-w），间距同为 6px；右侧留出“+”按钮宽度 + 间距，
 * 再减去列表右内边距(4) 与卡片边框(1)、右内边距(16)。 */
.note-item-actions {
    display: flex;
    flex-direction: row;
    gap: 6px;
    align-items: flex-start;
    margin-right: calc(var(--fold-btn-w) + 6px - 4px - 1px - 16px);
}

.note-item-btn {
    width: var(--sort-btn-w);
    min-height: 34px;
    padding: 0;
    background: rgba(47, 36, 25, 0.08);
    color: var(--ink);
    font-size: 13px;
}

.note-item-btn.delete {
    color: var(--brand);
}

.note-item-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

/* 保存成功提示：我的便签 tab 字体变绿 2 秒 */
.tab-note-saved,
.tab-note-saved.active {
    color: var(--ok) !important;
}

/* ===================================================================
 * 登录身份切换（用户 / 管理员）
 * =================================================================== */
.login-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.login-head .panel-title {
    margin-bottom: 0;
}

.login-mode {
    display: inline-flex;
    padding: 3px;
    border-radius: 999px;
    background: rgba(47, 36, 25, 0.06);
}

.login-mode-btn {
    min-height: 30px;
    padding: 0 14px;
    border-radius: 999px;
    background: transparent;
    color: var(--muted);
    font-size: 13px;
}

.login-mode-btn:hover {
    transform: none;
    background: rgba(47, 36, 25, 0.06);
}

.login-mode-btn.active {
    background: #fff;
    color: var(--brand);
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(80, 54, 28, 0.12);
}

.login-mode-btn:focus-visible,
.switch:focus-visible,
.mini-btn:focus-visible,
.link-btn:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}

/* 管理员模式：用户名固定为 admin，输入框显示为锁定样式 */
.is-admin-mode #username {
    background: rgba(162, 71, 23, 0.06);
    color: var(--brand);
    font-weight: 600;
    cursor: not-allowed;
}

/* ===================================================================
 * 管理后台
 * =================================================================== */
.admin-stats {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.stat-card {
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.6);
}

.stat-label {
    color: var(--muted);
    font-size: 13px;
}

.stat-value {
    margin: 6px 0 4px;
    font-size: 26px;
    font-weight: 700;
    color: var(--ink);
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stat-sub {
    color: var(--muted);
    font-size: 12px;
}

.admin-hint {
    margin: 0 0 12px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.7;
}

.admin-state {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 28px 12px;
    color: var(--muted);
    font-size: 14px;
    text-align: center;
}

.admin-state.is-error {
    color: var(--danger);
}

/* 用户表：用户 | 登录 | 客户端 | 文件 | 占用 | 便签 | 分享中 | 最近上传 | 操作 */
.admin-row {
    display: grid;
    grid-template-columns: minmax(150px, 1fr) 48px 56px 56px 96px 48px 60px 160px 248px;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
    font-size: 14px;
}

.admin-row:hover {
    background: rgba(162, 71, 23, 0.04);
}

.admin-row-head {
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    border-bottom-color: rgba(91, 63, 37, 0.22);
}

.admin-row-head:hover {
    background: transparent;
}

.admin-row.is-disabled .admin-user .link-btn {
    color: var(--muted);
    text-decoration: line-through;
}

.admin-user {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    min-width: 0;
}

.num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.admin-time,
.muted {
    color: var(--muted);
    font-size: 13px;
}

.admin-time {
    white-space: nowrap;
}

.admin-actions,
.admin-actions-head {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
}

.admin-tag {
    display: inline-flex;
    align-items: center;
    height: 20px;
    padding: 0 8px;
    border-radius: 999px;
    background: rgba(47, 36, 25, 0.07);
    color: var(--muted);
    font-size: 11px;
    white-space: nowrap;
}

.admin-tag.tag-danger {
    background: rgba(180, 35, 24, 0.10);
    color: var(--danger);
}

.admin-tag.tag-brand {
    background: rgba(162, 71, 23, 0.10);
    color: var(--brand);
}

.link-btn {
    min-height: 0;
    padding: 0;
    border-radius: 4px;
    background: none;
    color: var(--ink);
    font-size: 14px;
    font-weight: 600;
    text-align: left;
    word-break: break-all;
}

.link-btn:hover {
    transform: none;
    color: var(--brand);
    text-decoration: underline;
}

.mini-btn {
    min-height: 28px;
    padding: 0 11px;
    border-radius: 999px;
    background: rgba(47, 36, 25, 0.06);
    color: var(--ink);
    font-size: 12px;
    white-space: nowrap;
}

.mini-btn:hover {
    transform: none;
    background: rgba(162, 71, 23, 0.12);
    color: var(--brand);
}

.mini-btn.mini-danger {
    color: var(--danger);
}

.mini-btn.mini-danger:hover {
    background: rgba(180, 35, 24, 0.12);
    color: var(--danger);
}

.mini-btn:disabled,
.switch:disabled {
    opacity: 0.5;
    cursor: progress;
}

/* 开关（role=switch）：开=品牌色，关=灰色 */
.switch {
    position: relative;
    flex: none;
    width: 36px;
    min-height: 0;
    height: 20px;
    padding: 0;
    border-radius: 999px;
    background: rgba(47, 36, 25, 0.18);
    transition: background 0.18s ease;
}

.switch:hover {
    transform: none;
    opacity: 1;
    background: rgba(47, 36, 25, 0.26);
}

.switch.on {
    background: var(--brand);
}

.switch.on:hover {
    background: var(--brand-dark);
}

.switch-knob {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(47, 36, 25, 0.3);
    transition: transform 0.18s ease;
}

.switch.on .switch-knob {
    transform: translateX(16px);
}

.switch.is-busy {
    animation: switch-pulse 0.8s ease-in-out infinite;
}

@keyframes switch-pulse {
    50% { opacity: 0.45; }
}

@media (prefers-reduced-motion: reduce) {
    .switch,
    .switch-knob {
        transition: none;
    }

    .switch.is-busy {
        animation: none;
    }
}

/* 权限矩阵：横向可滚动，首列（用户）固定 */
.matrix-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.45);
}

.matrix {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
}

.matrix th,
.matrix td {
    padding: 9px 8px;
    border-bottom: 1px solid var(--line);
    text-align: center;
    vertical-align: middle;
    white-space: nowrap;
}

.matrix thead th {
    color: var(--muted);
    font-weight: 600;
    font-size: 12px;
    background: rgba(247, 239, 228, 0.96);
}

.matrix-groups th {
    color: var(--ink);
    border-left: 1px solid var(--line);
}

.matrix-groups th:first-child {
    border-left: none;
}

.matrix-labels th span {
    cursor: help;
    border-bottom: 1px dotted rgba(116, 98, 80, 0.5);
}

.matrix-sticky {
    position: sticky;
    left: 0;
    z-index: 1;
    min-width: 150px;
    max-width: 200px;
    text-align: left !important;
    background: rgba(250, 244, 236, 0.98);
}

.matrix tbody tr:hover td,
.matrix tbody tr:hover .matrix-sticky {
    background: rgba(162, 71, 23, 0.04);
}

.matrix-user {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.matrix-user .ellipsis {
    font-weight: 600;
    color: var(--ink);
}

.matrix-note {
    color: var(--muted);
    font-size: 11px;
    font-weight: 400;
}

.matrix-user .admin-tag {
    align-self: flex-start;
}

/* 默认模板行：品牌色淡底，与用户行区分 */
.matrix-default td,
.matrix-default .matrix-sticky {
    background: rgba(162, 71, 23, 0.07);
}

.matrix-default .matrix-user .ellipsis {
    color: var(--brand);
}

/* 跟随默认的用户行：开关显示为淡色，表示值来自默认模板 */
.matrix .is-inherit .switch {
    opacity: 0.55;
}

.matrix .is-inherit .switch:hover {
    opacity: 1;
}

.limit-field {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.limit-field span {
    display: inline;
    margin: 0;
    font-size: 12px;
}

.limit-input {
    width: 84px;
    padding: 5px 8px;
    border-radius: 10px;
    font-size: 13px;
    text-align: right;
}

.limit-input:focus {
    outline: 2px solid var(--brand);
    outline-offset: 1px;
}

/* 新建用户 / 重置口令表单 */
.user-form-modal {
    display: grid;
    gap: 14px;
    width: min(520px, 100%);
}

.user-form-modal .modal-title {
    margin-bottom: 0;
}

.user-form-modal .confirm-detail {
    margin-top: -8px;
}

.user-form-modal input:focus {
    outline: 2px solid var(--brand);
    outline-offset: 1px;
}

.password-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.password-row input {
    flex: 1;
    min-width: 0;
    font-size: 14px;
}

.password-row .toggle-folders-btn {
    flex: none;
    min-height: 44px;
}

/* 用户详情弹框 */
.admin-user-modal {
    width: min(860px, 100%);
}

.admin-user-modal .tabs {
    margin-top: 14px;
}

.admin-detail-body {
    max-height: 56vh;
    overflow-y: auto;
}

.detail-row {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1.4fr) 90px 150px;
    gap: 10px;
    align-items: center;
    padding: 8px 6px;
    border-bottom: 1px solid var(--line);
    font-size: 13px;
}

.detail-row-head {
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

.detail-row.is-shared {
    background: rgba(217, 119, 6, 0.06);
}

.detail-row .shared-tag {
    margin-left: 6px;
}

.ellipsis {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    min-width: 0;
}

.detail-note {
    padding: 12px 6px;
    border-bottom: 1px solid var(--line);
}

.detail-note-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.detail-note-content {
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 14px;
    line-height: 1.6;
}

/* 分享弹框：没有权限的分享方式置灰 */
.share-type-card.is-disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

@media (max-width: 1100px) {
    .admin-stats {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

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

    .admin-row-head {
        display: none;
    }

    .admin-row > .num,
    .admin-row > .admin-time {
        display: none;
    }

    .admin-row > .admin-actions {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }
}

@media (max-width: 640px) {
    .admin-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .detail-row {
        grid-template-columns: minmax(0, 1fr) 80px;
    }

    .detail-row > :nth-child(2),
    .detail-row > :nth-child(4) {
        display: none;
    }

    .login-head {
        flex-wrap: wrap;
    }
}

/* 文件列表分批渲染的“继续加载”占位：滚动到附近自动加载，也可点击 */
.tree-more {
    width: 100%;
    min-height: 36px;
    margin-top: 6px;
    border-radius: 12px;
    background: rgba(47, 36, 25, 0.05);
    color: var(--muted);
    font-size: 13px;
}

.tree-more:hover {
    transform: none;
    background: rgba(162, 71, 23, 0.10);
    color: var(--brand);
}

/* “生成链接”与上方“保存便签”同宽，两按钮左右边缘上下对齐（外观沿用通用主按钮） */
#saveNoteButton,
.drop-link-button {
    width: var(--side-btn-w);
    padding: 0;
}

/* 生成临时上传链接弹框 */
.drop-modal {
    display: grid;
    gap: 14px;
    width: min(540px, 100%);
}

.drop-modal .modal-title {
    margin-bottom: 0;
}

.drop-tips {
    margin: 0;
    padding-left: 18px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.8;
}

.drop-tips code {
    padding: 1px 6px;
    border-radius: 6px;
    background: rgba(47, 36, 25, 0.06);
    color: var(--ink);
}

.drop-count-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 手动输入框收窄（最多 4 位数），空间留给右侧 10 个快捷数量 */
.drop-count-row input {
    flex: none;
    width: 64px;
    padding: 6px 4px;
    border-radius: 10px;
    font-size: 14px;
    text-align: center;
}

.drop-count-row input:focus {
    outline: 2px solid var(--brand);
    outline-offset: 1px;
}

/* 1、2、4 … 512 共 10 个快捷数量，等宽排成一行 */
.drop-presets {
    flex: 1;
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(10, minmax(0, 1fr));
    gap: 4px;
}

.drop-presets .mini-btn {
    min-width: 0;
    height: 32px;
    min-height: 0;
    padding: 0;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

.drop-presets .mini-btn.active {
    background: rgba(162, 71, 23, 0.14);
    color: var(--brand);
    font-weight: 600;
    box-shadow: inset 0 0 0 1px rgba(162, 71, 23, 0.45);
}


/* 临时上传链接生成结果：宽度按一行放下整条链接（约 72 个等宽字符）设计 */
.drop-result-modal {
    display: grid;
    gap: 14px;
    width: min(720px, 100%);
    padding: 24px 26px 22px;
}

.drop-result-head {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.drop-result-head .modal-title {
    margin-bottom: 6px;
}

.drop-result-sub {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.7;
}

.drop-result-sub strong {
    color: var(--brand);
}

.drop-result-sub code {
    padding: 1px 6px;
    border-radius: 6px;
    background: rgba(47, 36, 25, 0.06);
    color: var(--ink);
}

.drop-result-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 10px 10px 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(47, 36, 25, 0.04);
}

.drop-result-link code {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    color: var(--ink);
    white-space: nowrap;
    overflow-wrap: anywhere;
}

.drop-result-hint {
    margin-top: -6px;
}

.drop-result-hint.is-warn {
    color: var(--warn);
}

.drop-result-actions {
    display: flex;
    justify-content: center;
}

.drop-result-actions button {
    min-width: 120px;
}

/* 窄屏一行放不下 10 个快捷数量时分两行（放在文件末尾，确保覆盖上面的基础样式） */
@media (max-width: 768px) {
    .drop-presets {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }

    /* 窄屏放不下整条链接时允许折行 */
    .drop-result-link code {
        white-space: normal;
    }
}
