/* 共享目录 */
.share-badge { display:inline-block; min-width:18px; height:18px; padding:0 5px; margin-left:4px; border-radius:9px;
  background:#f5222d; color:#fff; font-size:12px; line-height:18px; text-align:center; vertical-align:top; }
.share-badge[hidden] { display:none; }
.share-messages { margin-bottom:1rem; }
.share-msg { background:#fff; border-left:4px solid var(--primary-color); border-radius:8px; padding:.75rem 1rem;
  margin-bottom:.5rem; box-shadow:var(--shadow); word-break:break-all; }
.share-msg-success { border-left-color:var(--success-color); }
.share-msg-error { border-left-color:var(--error-color); color:#a8071a; }
.share-msg-warning { border-left-color:#faad14; }

.sh-wrap { max-width:860px; margin:0 auto; }
.sh-narrow { max-width:440px; margin:0 auto; }
.sh-card { background:#fff; border-radius:16px; box-shadow:0 8px 32px rgba(0,0,0,.1); padding:1.5rem; margin-bottom:1.25rem; }
.sh-card h2 { font-size:1.4rem; margin-bottom:.75rem; }
.sh-card h3 { font-size:1.1rem; margin-bottom:.75rem; display:flex; align-items:center; gap:.5rem; }
.sh-muted { color:var(--text-light); font-size:.9rem; }
.sh-desc { white-space:pre-wrap; color:var(--text-light); margin:.25rem 0 .75rem; }
.sh-row { display:flex; gap:.5rem; flex-wrap:wrap; align-items:center; }
.sh-row .form-input { flex:1 1 160px; width:auto; }
.sh-actions { display:flex; gap:.5rem; flex-wrap:wrap; margin-top:1rem; }
.sh-btn-sm { padding:.35rem .8rem; font-size:.875rem; border-radius:6px; }
.btn-danger { background:#fff1f0; color:#cf1322; border:1px solid #ffa39e; }
.btn-danger:hover { background:#ffccc7; }
.btn-ghost { background:#fff; color:var(--primary-color); border:1px solid var(--primary-color); }
.sh-tag { display:inline-block; padding:0 .5rem; border-radius:10px; font-size:.75rem; line-height:1.6;
  background:#f0f5ff; color:#2f54eb; white-space:nowrap; }
.sh-tag-warn { background:#fff7e6; color:#d46b08; }
.sh-tag-ok { background:#f6ffed; color:#389e0d; }
.sh-tag-bad { background:#fff1f0; color:#cf1322; }
.sh-list { list-style:none; }
.sh-list li { padding:.75rem 0; border-top:1px solid var(--border-color); display:flex; gap:.75rem;
  align-items:center; flex-wrap:wrap; }
.sh-list li:first-child { border-top:none; }
.sh-list .sh-grow { flex:1 1 200px; min-width:0; }
.sh-name { font-weight:600; word-break:break-all; }
.sh-check { display:flex; align-items:center; gap:.5rem; margin-bottom:1rem; }
.sh-check input { width:18px; height:18px; }
.sh-link { color:var(--primary-color); }
.sh-copy { font-family:ui-monospace,Menlo,monospace; font-size:.8rem; word-break:break-all; background:#f5f7fa;
  padding:.25rem .5rem; border-radius:6px; }
.sh-head { color:#fff; margin-bottom:1.25rem; }
.sh-head h2 { font-size:1.8rem; text-shadow:1px 1px 3px rgba(0,0,0,.2); word-break:break-all; }
.sh-head .sh-desc { color:rgba(255,255,255,.9); }
.sh-head a { color:#fff; }
.sh-temp-pw { background:#fffbe6; border:1px solid #ffe58f; border-radius:10px; padding:1rem; margin-bottom:1rem; }
.sh-temp-pw code { font-size:1.3rem; font-weight:700; letter-spacing:1px; }

/* 文件列表 */
.sh-files li { align-items:flex-start; }
.sh-thumb { width:64px; height:64px; border-radius:8px; object-fit:cover; background:#f5f7fa; cursor:pointer; flex:none; }
.sh-icon { width:64px; height:64px; border-radius:8px; background:#f5f7fa; display:flex; align-items:center;
  justify-content:center; font-size:28px; flex:none; text-decoration:none; }
.sh-files audio, .sh-files video { width:100%; max-width:520px; margin-top:.5rem; display:block; }
.sh-files video { max-height:320px; background:#000; border-radius:8px; }
.sh-file-btns { display:flex; gap:.4rem; flex-wrap:wrap; margin-top:.5rem; }

/* 上传 */
.sh-progress { height:8px; background:#f0f0f0; border-radius:4px; overflow:hidden; margin-top:.75rem; display:none; }
.sh-progress > div { height:100%; width:0; background:linear-gradient(135deg,#667eea 0%,#764ba2 100%); transition:width .2s; }
.sh-upload-status { margin-top:.5rem; font-size:.9rem; }

/* 首页底部 */
.sh-home { margin-top:2.5rem; }
.sh-home-title { color:#fff; font-size:1.3rem; margin-bottom:1rem; text-align:center; }
.sh-home-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(220px,1fr)); gap:1rem; }
.sh-home-item { background:rgba(255,255,255,.95); border-radius:12px; padding:1rem; text-decoration:none;
  color:var(--text-color); box-shadow:var(--shadow); transition:transform .2s; display:block; }
.sh-home-item:hover { transform:translateY(-2px); box-shadow:var(--shadow-hover); }
.sh-home-item .sh-muted { display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.sh-home-apply { text-align:center; margin-top:1.25rem; }
.sh-home-apply a { color:#fff; text-decoration:underline; }

@media (max-width:600px) {
  .sh-card { padding:1rem; border-radius:12px; }
  .sh-head h2 { font-size:1.4rem; }
  .sh-list .sh-actions-inline { width:100%; }
}

/* 登录后导航多了一项：手机上收紧间距，避免折行（未登录时导航样式不变） */
.nav-link { white-space:nowrap; }
@media (max-width:480px) {
  .nav:has(#shareNavLink) { gap:.25rem; }
  .nav:has(#shareNavLink) .nav-link { padding:.4rem .55rem; font-size:.95rem; }
}

/* 登录后页头下方的用户栏：昵称 + 退出登录 */
.share-userbar { display:flex; justify-content:flex-end; align-items:center; gap:.75rem; margin-top:-1rem; margin-bottom:1rem; font-size:.9rem; }
.share-userbar a { color:#fff; text-decoration:none; opacity:.95; max-width:12em; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.share-userbar a:hover { text-decoration:underline; }
.share-userbar form { margin:0; }
.share-userbar button { background:rgba(255,255,255,.18); color:#fff; border:1px solid rgba(255,255,255,.45); border-radius:999px; padding:.2rem .8rem; font-size:.85rem; cursor:pointer; }
.share-userbar button:hover { background:rgba(255,255,255,.3); }

/* 目录页：查看和上传优先，其它操作放次要位置 */
.sh-dir-head { margin-bottom:1rem; }
.sh-dir-title { display:flex; align-items:flex-start; justify-content:space-between; gap:.75rem; }
.sh-dir-title h2 { flex:1; min-width:0; }
.sh-pill { flex:none; display:inline-flex; align-items:center; margin-top:.35rem; padding:.25rem .75rem; border-radius:999px;
  background:rgba(255,255,255,.18); border:1px solid rgba(255,255,255,.45); color:#fff; font-size:.85rem; text-decoration:none; white-space:nowrap; }
.sh-pill:hover { background:rgba(255,255,255,.3); }
.sh-dir-meta { display:flex; flex-wrap:wrap; align-items:center; gap:.5rem; font-size:.9rem; opacity:.95; margin-top:.35rem; }
.sh-desc-clamp { display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; cursor:pointer; margin-bottom:0; }
.sh-desc-clamp.open { display:block; }

.sh-upload { margin-bottom:1rem; }
.sh-upload-btn { display:flex; align-items:center; justify-content:center; width:100%; min-height:52px; border-radius:14px;
  background:#fff; color:var(--primary-color); font-size:1.1rem; font-weight:700; cursor:pointer;
  box-shadow:0 6px 20px rgba(0,0,0,.12); transition:transform .15s; -webkit-tap-highlight-color:transparent; }
.sh-upload-btn:active { transform:scale(.98); }
.sh-upload-btn.busy { opacity:.7; pointer-events:none; }
.sh-upload .sh-progress { background:rgba(255,255,255,.3); margin-top:.6rem; }
.sh-upload .sh-progress > div { background:#fff; }
.sh-upload .sh-upload-status { color:rgba(255,255,255,.9); text-align:center; font-size:.85rem; word-break:break-all; }

.sh-files-card { padding-top:.5rem; padding-bottom:.5rem; }
.sh-empty { padding:1rem 0; text-align:center; }
.sh-file-title { display:block; color:var(--text-color); text-decoration:none; line-height:1.4; }
a.sh-file-title:hover { color:var(--primary-color); }
.sh-file-meta { font-size:.8rem; margin-top:.15rem; }
.sh-file-btns { align-items:center; }
.sh-del { margin-left:auto; background:none; border:none; color:#999; font-size:.85rem; padding:.35rem .25rem; cursor:pointer; }
.sh-del:hover { color:#cf1322; }

.sh-more { display:flex; justify-content:center; flex-wrap:wrap; gap:1.5rem; margin:.5rem 0 1rem; }
.sh-more form { margin:0; }
.sh-more button, .sh-more span { background:none; border:none; color:rgba(255,255,255,.8); font-size:.85rem; text-decoration:underline; cursor:pointer; }
.sh-more span { text-decoration:none; }
.sh-small { font-size:.85rem; white-space:nowrap; }
.sh-dirlist li { padding:.85rem 0; }

@media (max-width:600px) {
  .sh-files-card { padding:.25rem .85rem; }
  .sh-files .sh-thumb, .sh-files .sh-icon { width:48px; height:48px; font-size:22px; }
  .sh-files li { gap:.65rem; }
  .sh-files .sh-grow { flex-basis:0; }
  .share-userbar { margin-top:-1.25rem; margin-bottom:.5rem; }
}
.sh-dirlist a.sh-name { text-decoration:none; color:var(--text-color); }
.sh-dirlist a.sh-name:hover { color:var(--primary-color); }

/* 文件 / 留言 标签页 */
.sh-tabs { display:flex; gap:.25rem; background:rgba(255,255,255,.18); border-radius:12px; padding:4px; margin-bottom:1rem; }
.sh-tab { flex:1; border:none; background:none; color:#fff; font-size:1rem; font-weight:600; padding:.55rem .5rem; border-radius:9px; cursor:pointer;
  display:flex; align-items:center; justify-content:center; gap:.3rem; -webkit-tap-highlight-color:transparent; }
.sh-tab.active { background:#fff; color:var(--primary-color); box-shadow:0 2px 8px rgba(0,0,0,.1); }
.sh-tab .share-badge { margin-left:0; vertical-align:middle; }
.sh-tab-n { font-weight:400; opacity:.75; font-size:.9rem; }
.sh-new { display:inline-block; background:#f5222d; color:#fff; font-size:.7rem; line-height:1.5; padding:0 .4rem; border-radius:6px;
  font-weight:600; vertical-align:middle; margin-left:.2rem; }
.sh-file-meta .sh-new { margin:0 .15rem 0 0; }

/* 留言板 */
.sh-msg-form { padding:.85rem; margin-bottom:.75rem; }
.sh-msg-form textarea { width:100%; resize:vertical; min-height:3.2rem; font-size:1rem; }
.sh-msg-form-row { display:flex; gap:.5rem; margin-top:.5rem; align-items:center; }
.sh-msg-form-row select { flex:1; min-width:0; padding:.4rem .5rem; font-size:.85rem; }
.sh-msg-form-row .btn { margin-left:auto; flex:none; padding-left:1.2rem; padding-right:1.2rem; }
.sh-msg-status { color:#cf1322; margin-top:.25rem; min-height:0; }
.sh-msg-viewer { color:rgba(255,255,255,.9); text-align:center; font-size:.9rem; margin-bottom:.75rem; }
.sh-msgs-card { padding:.25rem 1rem; }
.sh-msgs { list-style:none; }
.sh-msg { padding:.75rem 0; border-top:1px solid var(--border-color); }
.sh-msg:first-child { border-top:none; }
.sh-msg.is-new { background:linear-gradient(90deg, rgba(245,34,45,.06), transparent); margin:0 -1rem; padding-left:1rem; padding-right:1rem; }
.sh-msg-head { display:flex; align-items:center; gap:.5rem; font-size:.85rem; }
.sh-msg-name { font-weight:600; color:var(--text-color); }
.sh-msg-time { color:var(--text-light); }
.sh-msg-del { margin-left:auto; background:none; border:none; color:#aaa; font-size:.8rem; cursor:pointer; padding:.1rem .25rem; }
.sh-msg-del:hover { color:#cf1322; }
.sh-msg-text { margin-top:.3rem; line-height:1.6; word-break:break-word; white-space:normal; }
.sh-msg-text a { color:var(--primary-color); word-break:break-all; }
.sh-msg-ref { display:inline-block; margin-top:.4rem; background:#f5f7fa; border-radius:8px; padding:.25rem .6rem; font-size:.85rem;
  color:var(--primary-color); text-decoration:none; max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.sh-more-btn { display:block; width:100%; background:none; border:none; border-top:1px solid var(--border-color); color:var(--primary-color);
  padding:.75rem; cursor:pointer; font-size:.9rem; }

/* “我的目录”里的新内容提示 */
.sh-unread { font-size:.8rem; color:#cf1322; white-space:nowrap; }
.sh-push-steps { margin:.5rem 0 0 1.2rem; line-height:1.9; font-size:.92rem; }
.sh-push-steps b { color:var(--primary-color); }
/* hidden 属性优先于 display:flex 等布局样式 */
.sh-wrap [hidden] { display:none !important; }

/* 首页底部：登录 / 进入共享目录入口 */
.sh-home-entry { display:flex; flex-direction:column; align-items:center; gap:.75rem; margin-top:1.25rem; }
.sh-home-btn { display:inline-block; min-width:180px; text-align:center; padding:.7rem 2rem; border-radius:999px; background:#fff;
  color:var(--primary-color); font-weight:700; text-decoration:none; box-shadow:0 6px 20px rgba(0,0,0,.12); }
.sh-home-btn:hover { transform:translateY(-1px); }
.sh-home-links { display:flex; gap:.6rem; color:rgba(255,255,255,.7); font-size:.9rem; }
.sh-home-links a { color:#fff; text-decoration:underline; }
