/* 等风 · 样式 */

:root {
  --bg: #f5f3ee;
  --surface: #ffffff;
  --surface-2: #eeebe4;
  --text: #23282c;
  --muted: #6b7378;
  --line: rgba(35, 40, 44, 0.1);
  --accent: #3b7a72;
  --accent-ink: #ffffff;
  --accent-soft: rgba(59, 122, 114, 0.12);
  --danger: #c2453d;
  --shadow: 0 1px 2px rgba(20, 30, 35, 0.06), 0 10px 28px rgba(20, 30, 35, 0.08);
  --radius: 14px;
  --nav-h: 64px;
  --serif: "Noto Serif SC", "Source Han Serif SC", "Source Han Serif CN", "Songti SC", "STSong", "SimSun", serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Microsoft YaHei", monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121618;
    --surface: #1a1f22;
    --surface-2: #232a2e;
    --text: #e4e7e8;
    --muted: #93a0a6;
    --line: rgba(255, 255, 255, 0.09);
    --accent: #6fb5aa;
    --accent-ink: #0e1a18;
    --accent-soft: rgba(111, 181, 170, 0.14);
    --danger: #ef7d73;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 28px rgba(0, 0, 0, 0.35);
    color-scheme: dark;
  }
}

/* ---------- 基础 ---------- */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.7 var(--sans);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
body.no-scroll { overflow: hidden; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, textarea, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }
body:not(.is-admin) .admin-only { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.icon { display: block; flex: none; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.spacer { flex: 1; }
.danger-text { color: var(--danger) !important; }

/* :where() 让这条通用规则不占优先级，组件里的输入框样式可以直接覆盖 */
:where(input:not([type=hidden], [type=file], [type=checkbox]), textarea, select) {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  font-size: 16px; /* 小于 16px 时 iPhone 会自动放大页面 */
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
:where(input, textarea, select):focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { resize: vertical; line-height: 1.65; }

/* ---------- 按钮 ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.1s, filter 0.15s;
}
.btn:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); color: var(--accent); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { color: var(--accent-ink); border-color: var(--accent); filter: brightness(1.07); }
.btn-ghost { background: transparent; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { color: #fff; border-color: var(--danger); filter: brightness(1.07); }
.btn-block { width: 100%; justify-content: center; height: 44px; font-size: 15px; }

.icon-btn {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  flex: none;
  border: 0;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.icon-btn:hover { background: var(--accent-soft); color: var(--accent); }

/* ---------- 顶栏 ---------- */

.nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 max(20px, env(safe-area-inset-right)) 0 max(24px, env(safe-area-inset-left));
  color: #fff;
  transition: background 0.3s, color 0.3s, box-shadow 0.3s;
}
.nav.solid {
  background: color-mix(in srgb, var(--surface) 84%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
  color: var(--text);
  box-shadow: 0 1px 0 var(--line);
}
.brand { font-family: var(--serif); font-size: 22px; font-weight: 600; letter-spacing: 0.14em; white-space: nowrap; }
.nav-title { font-size: 15px; color: var(--muted); padding-left: 14px; border-left: 1px solid var(--line); }
.nav-links { display: flex; gap: 24px; margin-left: auto; font-size: 15px; letter-spacing: 0.06em; }
.nav-links a { position: relative; opacity: 0.85; padding: 4px 0; transition: opacity 0.2s; }
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transition: transform 0.25s;
}
.nav-links a:hover { opacity: 1; }
.nav-links a:hover::after { transform: scaleX(1); }
.cloud-btn {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 50%;
  transition: background 0.2s, color 0.2s, transform 0.2s;
}
.cloud-btn:hover { background: rgba(255, 255, 255, 0.16); transform: translateY(-1px); }
.nav.solid .cloud-btn:hover, .cloud-btn.active { background: var(--accent-soft); color: var(--accent); }

/* ---------- 首屏 ---------- */

.hero { position: relative; height: 100vh; height: 100svh; min-height: 520px; overflow: hidden; color: #fff; background: #1d2a33; }
.hero-scene, .landscape, .slide { position: absolute; inset: 0; width: 100%; height: 100%; }
.landscape { display: block; }
.slide {
  background: center / cover no-repeat;
  opacity: 0;
  transform: scale(1.02);
  transition: opacity 1.6s ease, transform 0s linear 1.6s;
}
.slide.active { opacity: 1; transform: scale(1.1); transition: opacity 1.6s ease, transform 9s linear; }
.hero-shade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 60% 40% at 50% 38%, rgba(10, 15, 20, 0.16), transparent 70%),
    linear-gradient(to bottom, rgba(10, 15, 20, 0.38), transparent 28%, transparent 60%, rgba(10, 15, 20, 0.42));
}
/* 浅色天空或照片（亮度未知）时，加深标题后面的衬底 */
.hero.light-sky .hero-shade, .hero.has-photos .hero-shade {
  background:
    radial-gradient(ellipse 58% 36% at 50% 38%, rgba(12, 24, 36, 0.4), transparent 72%),
    linear-gradient(to bottom, rgba(10, 15, 20, 0.38), transparent 28%, transparent 60%, rgba(10, 15, 20, 0.42));
}
.hero.light-sky .hero-text, .hero.has-photos .hero-text { text-shadow: 0 2px 30px rgba(8, 20, 32, 0.55), 0 1px 3px rgba(8, 20, 32, 0.35); }
.hero-text {
  position: absolute;
  left: 0; right: 0; top: 38%;
  transform: translateY(-50%);
  padding: 0 24px;
  text-align: center;
  text-shadow: 0 2px 28px rgba(0, 0, 0, 0.35);
  animation: rise 1.2s ease both;
}
.hero-text h1 {
  margin: 0 0 0 0.3em;
  font-family: var(--serif);
  font-size: clamp(56px, 11vw, 120px);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: 0.3em;
}
.hero-text p { margin: 18px 0 0; font-family: var(--serif); font-size: clamp(16px, 2.2vw, 21px); letter-spacing: 0.16em; opacity: 0.94; }
.hero-caption { position: absolute; right: 24px; bottom: 26px; font-size: 13px; letter-spacing: 0.06em; opacity: 0.85; text-shadow: 0 1px 8px rgba(0, 0, 0, 0.4); }
.scroll-cue { position: absolute; left: 50%; bottom: 20px; opacity: 0.85; transform: translateX(-50%); animation: bob 2.4s ease-in-out infinite; }

.ls-cloud { animation: ls-drift linear infinite; }
.ls-star.tw { animation: ls-twinkle 3s ease-in-out infinite alternate; }

@keyframes bob { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, 6px); } }
@keyframes rise { from { opacity: 0; transform: translateY(-40%); } to { opacity: 1; transform: translateY(-50%); } }
@keyframes ls-drift { from { transform: translateX(-450px); } to { transform: translateX(2050px); } }
@keyframes ls-twinkle { from { opacity: 0.15; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: scale(0.96) translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- 区块 ---------- */

.section { max-width: 1200px; margin: 0 auto; padding: 88px 24px 8px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
.section-head h2 { margin: 0; font-family: var(--serif); font-size: 32px; font-weight: 600; letter-spacing: 0.14em; line-height: 1.3; }
.section-sub { margin: 4px 0 0; color: var(--muted); font-size: 14px; letter-spacing: 0.08em; }
.section-tools { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

.empty { text-align: center; padding: 52px 20px; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius); }
.empty p { margin: 4px 0; }

/* 相册：按图片比例分列，保持时间顺序 */
.masonry { display: flex; gap: 14px; align-items: flex-start; }
.masonry-col { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.tile { position: relative; margin: 0; overflow: hidden; border-radius: 12px; background: var(--surface-2); cursor: zoom-in; }
.tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.6s ease, transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.tile img.loaded { opacity: 1; }
.tile:hover img { transform: scale(1.04); }
.tile figcaption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 32px 14px 12px;
  color: #fff;
  font-size: 14px;
  letter-spacing: 0.04em;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.5));
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.3s, transform 0.3s;
}
.tile:hover figcaption { opacity: 1; transform: none; }
@media (hover: none) { .tile figcaption { opacity: 1; transform: none; } }

/* 随笔列表 */
.post-list { display: grid; gap: 16px; }
.post-card {
  display: flex;
  gap: 22px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: transform 0.2s, box-shadow 0.2s;
}
.post-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.post-cover { width: 200px; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; flex: none; background: var(--surface-2); }
.post-meta { min-width: 0; align-self: center; }
.post-meta time { font-size: 13px; color: var(--muted); letter-spacing: 0.05em; }
.post-meta h3 { margin: 2px 0 6px; font-family: var(--serif); font-size: 21px; font-weight: 600; line-height: 1.45; }
.post-meta p { margin: 0; color: var(--muted); font-size: 15px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* 正文排版 */
.prose { font-size: 17px; line-height: 1.95; overflow-wrap: anywhere; }
.prose > :first-child { margin-top: 0; }
.prose h1, .prose h2, .prose h3, .prose h4 { font-family: var(--serif); line-height: 1.45; margin: 1.7em 0 0.6em; }
.prose h1 { font-size: 1.6em; } .prose h2 { font-size: 1.35em; } .prose h3 { font-size: 1.15em; }
.prose p { margin: 0 0 1.1em; }
.prose img { margin: 1.4em auto; border-radius: 10px; }
.prose a { color: var(--accent); border-bottom: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); }
.prose blockquote { margin: 1.3em 0; padding: 0.3em 1.1em; border-left: 3px solid var(--accent); color: var(--muted); background: var(--accent-soft); border-radius: 0 8px 8px 0; }
.prose blockquote p { margin: 0.4em 0; }
.prose code { font-family: var(--mono); font-size: 0.86em; background: var(--surface-2); padding: 0.15em 0.4em; border-radius: 5px; }
.prose pre { background: var(--surface-2); padding: 14px 16px; border-radius: 10px; overflow-x: auto; line-height: 1.6; }
.prose pre code { background: none; padding: 0; }
.prose ul, .prose ol { padding-left: 1.5em; }
.prose table { border-collapse: collapse; display: block; overflow-x: auto; margin: 1.2em 0; }
.prose th, .prose td { border: 1px solid var(--line); padding: 6px 12px; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.2em 0; }
.about .prose { max-width: 720px; }

.footer {
  max-width: 1200px;
  margin: 80px auto 0;
  padding: 26px 24px calc(36px + env(safe-area-inset-bottom));
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 14px;
  border-top: 1px solid var(--line);
}
.footer-links { display: flex; gap: 8px; }
.footer-links a:hover { color: var(--accent); }

/* ---------- 大图浏览 ---------- */

.lightbox { position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; background: rgba(8, 10, 12, 0.95); color: #fff; animation: fade 0.2s ease; }
.lb-stage { flex: 1; min-height: 0; display: grid; place-items: center; padding: 60px 72px 8px; }
.lb-stage img { max-width: 100%; max-height: calc(100vh - 140px); max-height: calc(100dvh - 140px); object-fit: contain; border-radius: 4px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5); }
.lb-bar { display: flex; align-items: center; gap: 16px; min-height: 64px; padding: 10px 24px calc(14px + env(safe-area-inset-bottom)); }
.lb-caption { flex: 1; font-family: var(--serif); font-size: 16px; letter-spacing: 0.05em; }
.lb-count { font-size: 13px; opacity: 0.6; font-variant-numeric: tabular-nums; }
.lb-tools { display: flex; gap: 4px; }
.lightbox .icon-btn { color: #fff; }
.lightbox .icon-btn:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
.lb-close { position: absolute; top: 10px; right: 12px; width: 46px; height: 46px; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 54px; height: 54px; border-radius: 50%; }
.lb-prev { left: 10px; }
.lb-next { right: 10px; }

/* ---------- 提示、对话框、菜单 ---------- */

#toasts {
  position: fixed;
  top: calc(var(--nav-h) + 12px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: max-content;
  max-width: calc(100vw - 32px);
  pointer-events: none;
}
.toast {
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(28, 33, 36, 0.95);
  color: #fff;
  font-size: 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.25s, transform 0.25s;
}
.toast.show { opacity: 1; transform: none; }
.toast-error { background: #b23c35; }
.toast-success { background: #2f6b63; }

.dlg {
  width: min(420px, calc(100vw - 32px));
  padding: 0;
  border: 0;
  border-radius: 18px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.3);
}
.dlg-wide { width: min(640px, calc(100vw - 32px)); }
.dlg[open] { animation: pop 0.18s ease; }
.dlg::backdrop { background: rgba(10, 14, 18, 0.45); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.dlg-body { margin: 0; padding: 22px 22px 18px; display: flex; flex-direction: column; gap: 14px; }
.dlg-title { margin: 0; font-size: 18px; font-weight: 600; }
.dlg-html p { margin: 0; }
.dlg-html p + p { margin-top: 8px; }
.dlg-error { margin: 0; color: var(--danger); font-size: 14px; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.field > :not(span) { color: var(--text); }
.share-box input { font-family: var(--mono); font-size: 13px !important; }

.popmenu { position: fixed; z-index: 200; min-width: 168px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); animation: pop 0.12s ease; }
.popmenu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 0; border-radius: 8px; background: none; font-size: 15px; text-align: left; cursor: pointer; }
.popmenu button:hover { background: var(--accent-soft); }
.popmenu .danger { color: var(--danger); }

/* ---------- 随笔页 ---------- */

.page-post, .page-cloud { padding-top: var(--nav-h); }
.post-page { max-width: 760px; margin: 0 auto; padding: 32px 24px 48px; }
.back-link { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 24px; color: var(--muted); font-size: 14px; }
.back-link:hover { color: var(--accent); }
.article-head { margin-bottom: 32px; }
.article-head time { color: var(--muted); font-size: 14px; letter-spacing: 0.05em; }
.article-head h1 { margin: 6px 0 0; font-family: var(--serif); font-size: clamp(28px, 5vw, 40px); line-height: 1.35; letter-spacing: 0.03em; }
.article-admin { display: flex; gap: 8px; margin-top: 44px; padding-top: 20px; border-top: 1px solid var(--line); }

.editor { display: flex; flex-direction: column; gap: 12px; }
.editor .editor-title { padding: 6px 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; font-family: var(--serif); font-size: 28px; font-weight: 600; }
.editor-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.editor-bar input[type=date] { width: auto; padding: 6px 10px; }
.seg { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--surface-2); }
.seg button { padding: 5px 14px; border: 0; border-radius: 999px; background: none; color: var(--muted); font-size: 14px; cursor: pointer; }
.seg button.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); }
#editorText { min-height: 56vh; font-family: var(--mono); line-height: 1.75; background: var(--surface); }
.editor-preview { min-height: 56vh; padding: 16px 18px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.editor-actions { position: sticky; bottom: 0; display: flex; justify-content: flex-end; gap: 8px; padding: 14px 0 calc(14px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--bg) 35%); }

/* ---------- 云盘 ---------- */

.login-view { position: fixed; inset: 0; display: grid; place-items: center; padding: 20px; }
.login-scene { position: absolute; inset: 0; overflow: hidden; }
.login-card {
  position: relative;
  width: min(380px, 100%);
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 32px 28px 22px;
  border-radius: 22px;
  text-align: center;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  backdrop-filter: blur(18px) saturate(1.3);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.25);
  animation: pop 0.4s ease;
}
.login-icon { width: 64px; height: 64px; margin: 0 auto 2px; display: grid; place-items: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent); }
.login-card h1 { margin: 0; font-family: var(--serif); font-size: 26px; letter-spacing: 0.2em; text-indent: 0.2em; }
.login-card p { margin: 0; font-size: 14px; }
.login-card .login-error { color: var(--danger); }
.login-card a.small:hover { color: var(--accent); }

.cloud { max-width: 1100px; margin: 0 auto; padding: 24px 20px 140px; }
.cloud-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.crumbs { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; min-width: 0; font-size: 16px; }
.crumbs a { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 8px; color: var(--muted); }
.crumbs a:hover { background: var(--accent-soft); color: var(--accent); }
.crumbs .cur { padding: 4px 8px; font-weight: 600; overflow-wrap: anywhere; }
.crumbs .sep { color: var(--muted); opacity: 0.5; }
.cloud-tools { display: flex; align-items: center; gap: 8px; }
.search { display: flex; align-items: center; gap: 6px; height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--muted); }
.search:focus-within { border-color: var(--accent); }
.search input { width: 150px; padding: 0; border: 0; background: transparent; box-shadow: none !important; }
.search input::-webkit-search-cancel-button { cursor: pointer; }

.file-list { overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.file-list .empty { border: 0; }
.row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 96px 148px 176px;
  align-items: center;
  gap: 10px;
  min-height: 60px;
  padding: 8px 12px;
  border-top: 1px solid var(--line);
  transition: background 0.12s;
}
.row:first-child { border-top: 0; }
.row:not(.row-head):hover { background: color-mix(in srgb, var(--accent-soft) 55%, transparent); }
.row.row-head { min-height: 40px; padding-top: 6px; padding-bottom: 6px; font-size: 13px; color: var(--muted); }
.ficon { width: 40px; height: 40px; display: grid; place-items: center; flex: none; border-radius: 10px; background: var(--surface-2); color: var(--muted); }
.k-folder { color: #c08b22; background: rgba(214, 160, 50, 0.15); }
.k-package { color: var(--accent); background: var(--accent-soft); }
.k-archive { color: #8a6bbf; background: rgba(138, 107, 191, 0.14); }
.k-image { color: #3a8ac4; background: rgba(58, 138, 196, 0.13); }
.k-film { color: #cc5d78; background: rgba(204, 93, 120, 0.13); }
.k-music { color: #d38636; background: rgba(211, 134, 54, 0.14); }
.k-fileText { color: #5677d1; background: rgba(86, 119, 209, 0.13); }
.k-code { color: #4a9459; background: rgba(74, 148, 89, 0.14); }
.fname { display: flex; flex-direction: column; min-width: 0; padding: 4px 0; }
.fname-text { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 15px; }
.fname:hover .fname-text { color: var(--accent); }
.fsub { display: none; font-size: 12px; color: var(--muted); }
.fsize, .fdate { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.factions { display: flex; justify-content: flex-end; gap: 2px; color: var(--muted); }
.fmore { display: none; }

.cloud-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 14px; font-size: 13px; color: var(--muted); }
#diskInfo { display: inline-flex; align-items: center; gap: 10px; }
.disk-bar { display: inline-block; width: 120px; height: 6px; overflow: hidden; border-radius: 3px; background: var(--surface-2); }
.disk-bar i { display: block; height: 100%; border-radius: 3px; background: var(--accent); }

.drop-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--accent) 25%, rgba(10, 14, 18, 0.55));
  color: #fff;
  pointer-events: none;
  animation: fade 0.15s ease;
}
.drop-overlay > div { display: grid; justify-items: center; gap: 8px; padding: 40px 56px; border: 2px dashed rgba(255, 255, 255, 0.85); border-radius: 24px; font-size: 18px; }
.drop-overlay p { margin: 0; }

.upload-panel {
  position: fixed;
  right: 20px;
  bottom: calc(20px + env(safe-area-inset-bottom));
  z-index: 80;
  width: min(380px, calc(100vw - 24px));
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.18);
  animation: pop 0.2s ease;
}
.up-head { display: flex; align-items: center; gap: 2px; padding: 8px 8px 8px 16px; border-bottom: 1px solid var(--line); }
.up-head strong { flex: 1; font-size: 14px; font-weight: 600; }
.upload-panel.collapsed .up-list { display: none; }
.upload-panel.collapsed .up-head { border-bottom: 0; }
.upload-panel.collapsed #upToggle .icon { transform: rotate(180deg); }
.up-list { max-height: min(50vh, 360px); overflow-y: auto; }
.up-item { display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 14px; border-top: 1px solid var(--line); }
.up-item:first-child { border-top: 0; }
.up-item .ficon { width: 34px; height: 34px; }
.up-main { flex: 1; min-width: 0; }
.up-name { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 14px; }
.up-bar { height: 4px; margin: 6px 0 4px; overflow: hidden; border-radius: 2px; background: var(--surface-2); }
.up-bar i { display: block; width: 0; height: 100%; background: var(--accent); transition: width 0.2s; }
.up-status { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.up-item[data-status=done] .up-bar i { background: #4a9459; }
.up-item[data-status=error] .up-bar i { background: var(--danger); }
.up-item[data-status=error] .up-status { color: var(--danger); }
.up-item[data-status=canceled] { opacity: 0.55; }

/* ---------- 窄屏 ---------- */

@media (max-width: 760px) {
  .row { grid-template-columns: 44px minmax(0, 1fr) auto; }
  .row .fsize, .row .fdate, .row.row-head { display: none; }
  .fsub { display: block; }
  .factions > :not(.fmore) { display: none; }
  .fmore { display: inline-grid; }
  .cloud-tools { width: 100%; }
  .search { flex: 1; min-width: 0; }
  .search input { width: 100%; }
  .hide-sm { display: none; }
  .upload-panel { left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); width: auto; }
}

@media (max-width: 640px) {
  :root { --nav-h: 58px; }
  .nav { gap: 10px; padding-left: max(18px, env(safe-area-inset-left)); padding-right: max(10px, env(safe-area-inset-right)); }
  .brand { font-size: 20px; }
  .nav-links { gap: 16px; font-size: 14px; }
  .section { padding: 64px 16px 8px; }
  .section-head { margin-bottom: 20px; }
  .section-head h2 { font-size: 26px; }
  .masonry, .masonry-col { gap: 10px; }
  .post-card { flex-direction: column; gap: 12px; padding: 14px; }
  .post-cover { width: 100%; aspect-ratio: 16 / 9; }
  .post-page { padding: 20px 18px 40px; }
  .prose { font-size: 16.5px; }
  .lb-stage { padding: 56px 0 0; }
  .lb-nav { display: none; }
  .lb-bar { padding-left: 16px; padding-right: 12px; }
  .cloud { padding: 16px 12px 140px; }
  .row { padding: 6px 8px 6px 10px; gap: 8px; }
  .footer { margin-top: 56px; padding-left: 16px; padding-right: 16px; }
}

@media (max-width: 420px) {
  #mkdirBtn span { display: none; }
  #mkdirBtn { padding: 0 11px; }
  .section-tools .btn span { display: none; }
  .section-tools .btn { padding: 0 11px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
