/* ==========================================================
   云屿 Cloudnest — 胶囊风格设计系统 (Capsule UI)
   ========================================================== */

:root {
  --iris: #6c5ce7;
  --ink: #141428;
  --muted: #8b8ba7;
  --mint: #12c2a0;
  --line: #ecedf5;
}

* { -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; }

body {
  font-family: "Inter", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  background: #f4f5fa;
  color: var(--ink);
  margin: 0;
}

/* 背景光斑 */
.aurora {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(880px 520px at 8% -10%, #e8e3ff 0%, transparent 62%),
    radial-gradient(720px 480px at 96% -4%, #dff6f1 0%, transparent 58%),
    radial-gradient(900px 620px at 55% 112%, #e9efff 0%, transparent 60%),
    #f4f5fa;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb {
  background: #dcddef;
  border-radius: 999px;
  border: 3px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: #c9cae2; background-clip: content-box; }
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* 侧栏导航 */
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 18px; border-radius: 999px;
  font-size: 14px; font-weight: 500; color: #7c7c98;
  text-decoration: none;
  transition: all .22s cubic-bezier(.4, 0, .2, 1);
}
.nav-item:hover { background: #f2f2fb; color: var(--ink); transform: translateX(2px); }
.nav-item.active {
  background: linear-gradient(135deg, #7c6bff 0%, #6c5ce7 100%);
  color: #fff;
  box-shadow: 0 12px 26px -12px rgba(108, 92, 231, .85);
}
.nav-item.active:hover { transform: none; }

/* 输入框 */
.capsule-input {
  width: 100%; box-sizing: border-box;
  border-radius: 999px; border: 1px solid transparent;
  background: #f4f5fa; padding: 13px 22px;
  font-size: 14px; color: var(--ink);
  transition: all .2s; outline: none;
  font-family: inherit;
}
.capsule-input::placeholder { color: #a7a7bd; }
.capsule-input:focus {
  background: #fff; border-color: #cdc6ff;
  box-shadow: 0 0 0 4px rgba(108, 92, 231, .12);
}
textarea.capsule-input { border-radius: 24px; resize: vertical; }

/* 按钮 */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 999px; padding: 12px 22px; border: 0;
  font-size: 14px; font-weight: 600; color: #fff; cursor: pointer;
  background: linear-gradient(135deg, #7c6bff 0%, #6c5ce7 100%);
  box-shadow: 0 14px 28px -14px rgba(108, 92, 231, .95);
  transition: all .22s; text-decoration: none; font-family: inherit;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 18px 32px -14px rgba(108, 92, 231, 1); color: #fff; }
.btn-primary:active { transform: translateY(0) scale(.98); }
.btn-primary:disabled { opacity: .55; cursor: not-allowed; transform: none; }

.btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 999px; padding: 11px 20px; cursor: pointer;
  font-size: 14px; font-weight: 500; color: #4a4a66;
  background: #fff; border: 1px solid #ecedf5;
  transition: all .2s; text-decoration: none; font-family: inherit;
}
.btn-ghost:hover { border-color: #d9d8f5; color: var(--ink); background: #fbfbff; }

/* 筛选胶囊 */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: 999px; padding: 9px 18px; cursor: pointer;
  font-size: 13px; font-weight: 500; color: #75758f;
  background: #fff; border: 1px solid #ecedf5;
  transition: all .2s; white-space: nowrap; text-decoration: none;
  font-family: inherit;
}
.chip:hover { border-color: #d5d3f5; color: var(--ink); }
.chip.active {
  background: var(--ink); border-color: var(--ink); color: #fff;
  box-shadow: 0 10px 22px -12px rgba(20, 20, 60, .7);
}

/* 徽标 */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  border-radius: 999px; padding: 4px 11px;
  font-size: 11px; font-weight: 600; letter-spacing: .01em;
}
.badge-public { background: #e7f8f3; color: #0f9e83; }
.badge-private { background: #f1f1f8; color: #6f6f8c; }
.badge-lock { background: #fff3e4; color: #c98016; }
.badge-danger { background: #fdeaea; color: #c33; }

/* 卡片 */
.card {
  background: #fff;
  border-radius: 30px;
  border: 1px solid rgba(236, 237, 245, .9);
  box-shadow: 0 18px 46px -30px rgba(20, 20, 60, .45);
}
.card-hover { transition: all .26s cubic-bezier(.4, 0, .2, 1); }
.card-hover:hover {
  transform: translateY(-4px);
  box-shadow: 0 26px 56px -30px rgba(20, 20, 60, .55);
  border-color: #e0dcff;
}

/* 图片容器 */
.thumb { position: relative; overflow: hidden; background: #eef0f8; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s cubic-bezier(.2, .8, .2, 1); }
.thumb:hover img { transform: scale(1.06); }

/* 遮罩 / 弹窗 */
.scrim {
  position: fixed; inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(18, 18, 40, .55);
  backdrop-filter: blur(6px);
  z-index: 100;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.scrim > .pop {
  margin: auto;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
}

/* 灯箱 */
.lightbox {
  position: fixed; inset: 0; z-index: 110;
  display: none;
  grid-template-columns: 1fr 348px;
  background: rgba(10, 10, 18, .95);
  backdrop-filter: blur(4px);
}
.lightbox.open { display: grid; }
.lightbox-stage {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  min-height: 0; padding: 24px;
  overflow: hidden;
}
.lightbox-stage img {
  max-width: 100%; max-height: 100%;
  object-fit: contain;
  border-radius: 18px;
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .9);
}
.lb-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  display: grid; place-items: center;
  height: 46px; width: 46px;
  border: 0; border-radius: 999px;
  background: rgba(255, 255, 255, .12);
  color: #fff; cursor: pointer;
  transition: background .2s;
}
.lb-nav:hover { background: rgba(255, 255, 255, .24); }
.lb-nav[disabled] { opacity: .25; cursor: default; }
.lb-panel {
  display: flex; flex-direction: column;
  gap: 14px;
  padding: 22px;
  background: #fff;
  overflow-y: auto;
}
.lb-field-label {
  display: block; margin: 0 0 6px;
  font-size: 11px; font-weight: 500; color: #8b8ba7;
}
.lb-actions { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 900px) {
  .lightbox { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .lightbox-stage { padding: 12px 12px 0; }
  .lb-panel { max-height: 46vh; border-radius: 26px 26px 0 0; padding: 18px; }
  .lb-nav { height: 40px; width: 40px; }
}
@keyframes pop {
  from { opacity: 0; transform: translateY(14px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.pop { animation: pop .28s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fadeUp .4s ease both; }

/* 拖拽上传 */
.dropzone {
  border: 2px dashed #d6d3f4;
  border-radius: 34px;
  background: linear-gradient(180deg, #fbfaff 0%, #f6f5ff 100%);
  transition: all .25s;
  cursor: pointer;
}
.dropzone:hover, .dropzone.drag {
  border-color: #9d8dff;
  background: linear-gradient(180deg, #f8f6ff 0%, #efeaff 100%);
  box-shadow: inset 0 0 0 4px rgba(108, 92, 231, .05);
}

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 34px; z-index: 120;
  transform: translate(-50%, 22px); opacity: 0; pointer-events: none;
  transition: all .3s cubic-bezier(.2, .8, .2, 1);
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }

/* 环形进度 */
.ring-track { stroke: #f0f0f9; }
.ring-value { stroke-linecap: round; transition: stroke-dashoffset .9s cubic-bezier(.2, .8, .2, 1); }

.row-hover:hover { background: #fafaff; }

.code-pill {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px; letter-spacing: -.01em;
}

[x-cloak] { display: none !important; }

/* 空状态 */
.empty-ring {
  border: 2px dashed #e2e1f2;
  border-radius: 34px;
  background: rgba(255, 255, 255, .6);
}

/* 侧边栏 / 底部导航断点控制（不依赖 Tailwind 的 hidden 与内联 display 冲突） */
.cloud-sidebar { display: none; }
.cloud-mobile-nav { display: flex; }
@media (min-width: 1024px) {
  .cloud-sidebar { display: flex; }
  .cloud-mobile-nav { display: none; }
}
/* ==========================================================================
   v1.2 — AJAX 导航进度条 / 视图过渡 / 头像
   ========================================================================== */

.cloud-progress {
	position: fixed;
	left: 0;
	top: 0;
	right: 0;
	height: 2px;
	z-index: 120;
	opacity: 0;
	transition: opacity .2s ease;
	pointer-events: none;
}

.cloud-progress.on {
	opacity: 1;
}

.cloud-progress span {
	display: block;
	height: 100%;
	width: 32%;
	border-radius: 99px;
	background: linear-gradient(90deg, #8a7dff, #2fd6b4);
	animation: cloudNavBar 1.05s ease-in-out infinite;
}

.cloud-progress.done span {
	width: 100%;
	animation: none;
	transition: width .24s ease;
}

@keyframes cloudNavBar {
	0% { transform: translateX(-110%); }
	100% { transform: translateX(340%); }
}

#cloud-view.view-in {
	animation: cloudViewIn .26s ease both;
}

@keyframes cloudViewIn {
	from { opacity: 0; transform: translateY(6px); }
	to { opacity: 1; transform: none; }
}

.pill-btn:disabled,
.btn-primary:disabled {
	opacity: .55;
	cursor: default;
}

#cloud-avatar-preview {
	transition: box-shadow .2s ease;
}

#cloud-avatar-preview:hover {
	box-shadow: 0 16px 34px -18px rgba(108, 92, 231, .8);
}
