/* ============================================================
   Design tokens / 设计变量
   ============================================================ */
:root {
  /* 主题：浅天蓝（流线渐变） */
  --teal: #4aa8e8;          /* 主色 */
  --teal-deep: #1c6fae;     /* 深天蓝：文字、描边、链接 */
  --emerald: #7cc9f7;       /* 亮天蓝：点缀、图标 */
  --brand-ink: #0b2f4a;     /* 渐变按钮上的深色文字 */
  --ink: #0f2233;           /* 深色底（首屏 / 页脚 / 深色卡片） */
  --ink-2: #2a3d4a;
  --text: #2b3a45;
  --muted: #6a7d8c;
  --paper: #f4f9fd;
  --card: #ffffff;
  --line: #e2eef7;
  /* 流线感渐变：色标不均匀，且可随 hover 流动 */
  --gradient: linear-gradient(115deg, #7fc8f8 0%, #4aa8e8 26%, #6db9ee 54%, #a9dfff 80%, #d3ecff 100%);
  --gradient-flow: linear-gradient(115deg, #8fd0fa 0%, #4aa8e8 20%, #7cc4f2 46%, #b8e3ff 72%, #e6f4ff 100%);
  --radius: 16px;
  --shadow: 0 20px 50px -20px rgba(15, 34, 51, 0.28);
  --shadow-sm: 0 8px 24px -12px rgba(15, 34, 51, 0.28);
  --nav-h: 68px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* 修复：display 属性覆盖 [hidden]，导致未登录也显示编辑按钮 */
[hidden] { display: none !important; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-h);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--text);
  line-height: 1.75;
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }

.container {
  width: min(1120px, 92%);
  margin: 0 auto;
}

/* ============================================================
   按钮
   ============================================================ */
.btn {
  display: inline-block;
  padding: 0.75rem 1.6rem;
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.3px;
  font-size: 0.95rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
  white-space: nowrap;
}
.btn--solid {
  background: var(--gradient);
  color: #0b2f4a;
  box-shadow:
    0 12px 30px -10px rgba(74, 168, 232, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
  position: relative;
  overflow: hidden;
}
.btn--solid::after {
  content: "";
  position: absolute;
  top: 0;
  left: -80%;
  width: 50%;
  height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  transform: skewX(-20deg);
  transition: left 0.55s ease;
}
.btn--solid:hover::after { left: 130%; }
.btn--solid:hover { transform: translateY(-3px); box-shadow: 0 16px 36px -10px rgba(74, 168, 232, 0.7); }
.btn--3d {
  background: var(--gradient);
  color: #0b2f4a;
  box-shadow:
    0 6px 0 var(--teal-deep),
    0 14px 28px -8px rgba(74, 168, 232, 0.5);
}
.btn--3d:hover {
  transform: translateY(-2px);
  box-shadow:
    0 8px 0 var(--teal-deep),
    0 18px 32px -8px rgba(74, 168, 232, 0.55);
}
.btn--3d:active {
  transform: translateY(3px);
  box-shadow:
    0 2px 0 var(--teal-deep),
    0 8px 18px -8px rgba(74, 168, 232, 0.5);
}
.btn--ghost {
  color: #fff;
  border: 1.5px solid rgba(255, 255, 255, 0.55);
}
.btn--ghost:hover { background: rgba(255, 255, 255, 0.12); transform: translateY(-3px); }
.btn--light {
  background: #fff;
  color: var(--teal-deep);
  box-shadow: var(--shadow-sm);
}
.btn--light:hover { transform: translateY(-3px); }
.btn--small { padding: 0.45rem 1rem; font-size: 0.85rem; }
.btn--text { color: var(--ink-2); padding: 0.45rem 0.6rem; }
.btn--text:hover { color: var(--teal-deep); }
.btn.is-busy { opacity: 0.75; cursor: wait; pointer-events: none; }

/* ============================================================
   导航
   ============================================================ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-h);
  background: rgba(255, 255, 255, 0);
  transition: background 0.3s ease, box-shadow 0.3s ease;
}
.nav.is-scrolled {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 var(--line);
}
.nav__inner {
  width: min(1120px, 92%);
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav__brand { display: flex; align-items: center; gap: 0.6rem; }
.nav__logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--gradient);
  color: #0b2f4a;
  font-weight: 800;
  display: grid;
  place-items: center;
  font-size: 1.15rem;
}
.nav__name { font-weight: 700; color: #fff; transition: color 0.3s ease; }
.nav.is-scrolled .nav__name { color: var(--ink); }
.nav__menu { display: flex; align-items: center; gap: 1.6rem; }
.nav__link {
  color: #fff;
  font-weight: 500;
  position: relative;
  padding: 0.2rem 0;
  transition: color 0.2s ease;
}
.nav.is-scrolled .nav__link { color: var(--ink-2); }
.nav__link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0;
  height: 2px;
  background: var(--gradient);
  transition: width 0.25s ease;
}
.nav__link:hover::after,
.nav__link.is-active::after { width: 100%; }
.nav__link--cta {
  color: var(--teal);
  border: 1.5px solid var(--teal);
  padding: 0.45rem 1.1rem;
  border-radius: 999px;
}
.nav.is-scrolled .nav__link--cta { color: var(--teal-deep); border-color: var(--teal-deep); }
.nav__link--cta::after { display: none; }
.nav__link--cta:hover { background: var(--teal); color: #fff; }
.nav__toggle { display: none; }

/* ============================================================
   ① 首屏
   ============================================================ */
.hero {
  position: sticky;
  top: 0;
  z-index: 0;
  height: 100vh;
  min-height: 540px;
  display: grid;
  place-items: center;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #fff;
  padding: 4rem 1rem;
  overflow: hidden;
  will-change: filter, opacity, transform;
}
.hero__bg {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(120deg, rgba(3, 14, 20, 0.88) 0%, rgba(6, 32, 36, 0.6) 55%, rgba(0, 120, 130, 0.28) 100%),
    url("assets/img/landscape-5.jpg");
  background-size: cover;
  background-position: center;
  transform: scale(1.05);
  animation: hero-zoom 26s ease-out forwards;
}
@keyframes hero-zoom {
  from { transform: scale(1.12); }
  to { transform: scale(1.02); }
}
.hero__stars {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(1.6px 1.6px at 14% 22%, rgba(255, 255, 255, 0.95), transparent 62%),
    radial-gradient(1.2px 1.2px at 68% 14%, rgba(255, 255, 255, 0.8), transparent 62%),
    radial-gradient(1.8px 1.8px at 34% 66%, rgba(255, 255, 255, 0.9), transparent 62%),
    radial-gradient(1.1px 1.1px at 82% 52%, rgba(255, 255, 255, 0.7), transparent 62%),
    radial-gradient(1.4px 1.4px at 52% 36%, rgba(255, 255, 255, 0.85), transparent 62%);
  background-size: 340px 340px;
  animation: twinkle 6s ease-in-out infinite alternate;
}
.hero__stars--far {
  background-size: 620px 620px;
  opacity: 0.55;
  animation-delay: 1.6s;
}
@keyframes twinkle {
  from { opacity: 0.35; }
  to { opacity: 0.9; }
}

.hero__inner {
  position: relative;
  z-index: 2;
  padding: 0 1.2rem;
  animation: fade-up 1s ease both;
}
.hero__hello {
  font-size: clamp(2rem, 6.4vw, 3.8rem);
  font-weight: 800;
  letter-spacing: 0.05em;
  text-shadow: 0 14px 44px rgba(0, 0, 0, 0.55);
}

/* 双箭头：点击或下滑进入主界面 */
.hero__arrow {
  position: absolute;
  bottom: 2.4rem;
  left: 50%;
  z-index: 3;
  width: 56px;
  height: 56px;
  border: none;
  border-radius: 999px;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(6px);
  transition: background 0.25s ease, box-shadow 0.25s ease;
  animation: arrow-float 2.4s ease-in-out infinite;
}
.hero__arrow:hover {
  background: rgba(255, 255, 255, 0.2);
  box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.08);
}
.hero__arrow svg { width: 26px; height: 26px; }
@keyframes arrow-float {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, 9px); }
}
@keyframes fade-up {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   通用区块
   ============================================================ */
.section { padding: 6.5rem 0; }
.section__title {
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  text-align: center;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 0.8rem;
  position: relative;
}
.section__title--light { color: #fff; }
.section__title--light::after,
.section__title::after {
  content: "";
  display: block;
  width: 68px;
  height: 4px;
  margin: 1rem auto 0;
  border-radius: 2px;
  background: var(--gradient);
}
.section__sub {
  text-align: center;
  color: var(--muted);
  max-width: 520px;
  margin: 0 auto 3rem;
}

/* ============================================================
   ② 关于
   ============================================================ */
.about {
  display: block;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 2.4rem 2.8rem;
}
.about__media { display: flex; justify-content: center; }
.about__avatar {
  width: 260px;
  height: 260px;
  object-fit: cover;
  border-radius: 20px;
  box-shadow: var(--shadow);
}
.about__lead { font-size: 1.35rem; font-weight: 700; color: var(--ink); margin-bottom: 0.8rem; }
.about__text { color: var(--muted); margin-bottom: 1rem; }
.about__facts {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.9rem;
  margin: 1.4rem 0 1.8rem;
}
.about__facts li {
  background: var(--paper);
  border-radius: 12px;
  padding: 0.8rem 1rem;
  text-align: center;
}
.about__facts strong { display: block; font-size: 0.8rem; color: var(--ink); margin-bottom: 0.1rem; }
.about__facts span { font-size: 0.9rem; color: var(--muted); }

/* ============================================================
   ③ 光影集
   ============================================================ */
.section--gallery {
  background: var(--ink);
}
.section--gallery .section__sub { color: rgba(255, 255, 255, 0.65); }
.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.gallery__item {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: #162b2a;
  margin: 0;
}
.gallery__item.is-hidden { display: none; }
.gallery__link {
  display: block;
  position: relative;
}
.gallery__link img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  transition: transform 0.5s ease, opacity 0.3s ease;
  opacity: 0;
}
.gallery__item.is-loaded .gallery__link img { opacity: 1; }
.gallery__link::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(10, 38, 58, 0.55), transparent 55%);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.gallery__item:hover .gallery__link img { transform: scale(1.06); }
.gallery__item:hover .gallery__link::after { opacity: 1; }
.gallery__link:focus-visible { outline: 2px solid var(--emerald); outline-offset: -2px; }
.gallery__skeleton {
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, #162b2a 8%, #1f3b38 18%, #162b2a 33%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
  transition: opacity 0.4s ease;
}
.gallery__item.is-loaded .gallery__skeleton {
  opacity: 0;
  pointer-events: none;
}
@keyframes shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}
.gallery__like {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 2;
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: #fff;
  background: rgba(10, 38, 58, 0.45);
  backdrop-filter: blur(4px);
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}
.gallery__like:hover { transform: scale(1.12); }
.gallery__like.is-liked { color: #ff5b89; }
.gallery__like svg { fill: currentColor; }
.gallery__like.is-liked {
  animation: heart-pop 0.45s ease;
}
@keyframes heart-pop {
  0% { transform: scale(0.6); }
  45% { transform: scale(1.25); }
  100% { transform: scale(1); }
}
.gallery__count {
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.9rem;
  white-space: nowrap;
}
.gallery__empty {
  text-align: center;
  color: rgba(255, 255, 255, 0.75);
  padding: 3rem 1rem;
  border: 1px dashed rgba(255, 255, 255, 0.25);
  border-radius: 12px;
}

/* ============================================================
   ④ 作品卡片
   ============================================================ */
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.8rem;
}
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.card__cover {
  height: 168px;
  display: grid;
  place-items: center;
  color: #fff;
}
.card__cover--1 { background: linear-gradient(135deg, #4aa8e8, #7cc9f7); }
.card__cover--2 { background: linear-gradient(135deg, #1c6fae, #4aa8e8); }
.card__cover--3 { background: linear-gradient(135deg, #123b38, #1c6fae); }
.card__icon { font-size: 2.4rem; opacity: 0.9; }
.card__body { padding: 1.5rem 1.5rem 1.6rem; }
.card__title { font-size: 1.2rem; font-weight: 700; color: var(--ink); margin-bottom: 0.5rem; }
.card__text { color: var(--muted); font-size: 0.95rem; margin-bottom: 1rem; }
.card__tags { display: flex; gap: 0.5rem; margin-bottom: 1.2rem; flex-wrap: wrap; }
.tag {
  font-size: 0.75rem;
  background: var(--paper);
  color: var(--ink-2);
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
}
.card__links { display: flex; gap: 0.4rem; align-items: center; }

/* ============================================================
   ⑤ 联系
   ============================================================ */
.section--contact {
  background: var(--gradient);
  color: #0b2f4a;
  text-align: center;
}
.section--contact .section__title { color: #0b2f4a; }
.section--contact .section__title::after { background: rgba(10, 38, 58, 0.4); }
.contact__text {
  font-size: 1.15rem;
  max-width: 520px;
  margin: 0 auto 2rem;
}

/* ============================================================
   页脚
   ============================================================ */
.footer {
  background: #071413;
  color: #fff;
  padding: 3rem 0;
  text-align: center;
}
.footer__nav {
  display: flex;
  justify-content: center;
  gap: 1.6rem;
  margin-bottom: 1.6rem;
  flex-wrap: wrap;
}
.footer__nav a { color: rgba(255, 255, 255, 0.75); font-size: 0.95rem; transition: color 0.2s ease; }
.footer__nav a:hover { color: #fff; }
.footer__social {
  display: flex;
  justify-content: center;
  gap: 1.4rem;
  margin-bottom: 1.4rem;
}
.footer__social a {
  color: var(--emerald);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.06);
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}
.footer__social a:hover { transform: translateY(-4px); background: var(--gradient); color: #0b2f4a; }
.footer__copy { font-size: 0.85rem; opacity: 0.6; }

/* ============================================================
   灯箱
   ============================================================ */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(7, 20, 19, 0.92);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.lightbox.is-open { display: flex; }
.lightbox__figure { max-height: 90vh; display: flex; flex-direction: column; }
.lightbox__img {
  max-width: 92vw;
  max-height: 78vh;
  border-radius: 10px;
  object-fit: contain;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.7);
}
.lightbox__caption { color: rgba(255, 255, 255, 0.85); text-align: center; margin-top: 1rem; font-size: 0.95rem; }
.lightbox__close,
.lightbox__nav {
  position: absolute;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  cursor: pointer;
  border-radius: 50%;
  display: grid;
  place-items: center;
  transition: background 0.2s ease, transform 0.2s ease;
}
.lightbox__close:hover,
.lightbox__nav:hover { background: var(--gradient); color: #0b2f4a; }
.lightbox__close { top: 1.2rem; right: 1.2rem; width: 44px; height: 44px; font-size: 1.6rem; }
.lightbox__nav { top: 50%; transform: translateY(-50%); width: 52px; height: 52px; font-size: 1.4rem; }
.lightbox__nav:hover { transform: translateY(-50%) scale(1.05); }
.lightbox__nav--prev { left: 1.2rem; }
.lightbox__nav--next { right: 1.2rem; }
body.lightbox-open { overflow: hidden; }

/* ============================================================
   滚动进入动画
   ============================================================ */
.reveal {
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.js-ready .reveal:not(.in-view) {
  opacity: 0;
  transform: translateY(28px);
}
.reveal.in-view { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 900px) {
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .about { padding: 1.8rem 1.5rem; text-align: left; }
  .about__facts { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 720px) {
  :root { --nav-h: 60px; }
  .nav__toggle {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
  }
  .nav__toggle span {
    width: 22px;
    height: 2px;
    background: #fff;
    transition: transform 0.3s ease, opacity 0.3s ease;
  }
  .nav.is-scrolled .nav__toggle span { background: var(--ink-2); }
  .nav__menu {
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    background: #0f2233;
    flex-direction: column;
    gap: 1.1rem;
    padding: 1.6rem 1rem 2rem;
    transform: translateY(-130%);
    transition: transform 0.3s ease;
    box-shadow: var(--shadow);
  }
  .nav__menu.is-open { transform: translateY(0); }
  .nav__link { color: #fff !important; }
  .nav__link--cta { color: var(--emerald) !important; border-color: var(--emerald); }
  .about__facts { grid-template-columns: 1fr 1fr; }
  .gallery { grid-template-columns: 1fr; }
  .cards { grid-template-columns: 1fr; }
  .lightbox__nav { width: 44px; height: 44px; }
  .lightbox__nav--prev { left: 0.5rem; }
  .lightbox__nav--next { right: 0.5rem; }
}

/* ============================================================
   UI 组件（参考素材适配版）
   搜索 / 筛选复选框 / 心形喜欢 / 加载动画 / 登录卡片
   ============================================================ */

/* ---- 光影集工具栏 ---- */
.gallery-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
}
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  align-items: center;
}

/* ---- 搜索框（参考 搜索1：玻璃质感） ---- */
.search {
  position: relative;
  display: flex;
  align-items: center;
  width: min(320px, 100%);
  border-radius: 999px;
  padding: 4px 6px 4px 16px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(8px);
  transition: border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}
.search:focus-within {
  border-color: var(--emerald);
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 0 4px rgba(124, 201, 247, 0.12);
}
.search__input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  color: #fff;
  font-size: 0.95rem;
  padding: 0.6rem 0;
}
.search__input::placeholder { color: rgba(255, 255, 255, 0.5); }
.search__icon {
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--gradient);
  color: #0b2f4a;
  transition: transform 0.2s ease;
}
.search__icon:hover { transform: scale(1.06); }
.search__icon svg { width: 18px; height: 18px; fill: currentColor; }

/* ---- 筛选复选框（参考 复选框1：描边勾选动画） ---- */
.check {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.92rem;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  user-select: none;
}
.check:hover { border-color: rgba(255, 255, 255, 0.4); }
.check input { position: absolute; opacity: 0; pointer-events: none; }
.check__box {
  width: 20px;
  height: 20px;
  border-radius: 7px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  display: grid;
  place-items: center;
  background: transparent;
  transition: background 0.25s ease, border-color 0.25s ease;
}
.check__path {
  fill: none;
  stroke: #0b2f4a;
  stroke-width: 8;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 100 100;
  stroke-dashoffset: 100;
  transition: stroke-dashoffset 0.35s ease;
}
.check input:checked ~ .check__box {
  background: var(--gradient);
  border-color: transparent;
}
.check input:checked ~ .check__box .check__path { stroke-dashoffset: 0; }
.check input:focus-visible ~ .check__box { outline: 2px solid var(--emerald); outline-offset: 2px; }

/* ---- 加载动画（参考 加载2：圆环、 加载1：弹跳点） ---- */
.spinner {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.18);
  border-top-color: var(--emerald);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.dots {
  display: flex;
  gap: 0.6rem;
  align-items: flex-end;
  height: 36px;
}
.dots span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--gradient);
  animation: dot-bounce 0.6s ease-in-out infinite alternate;
}
.dots span:nth-child(2) { animation-delay: 0.2s; }
.dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes dot-bounce {
  from { transform: translateY(0); }
  to { transform: translateY(-14px); }
}

/* ---- 登录卡片（参考 登录1：圆角胶囊卡片） ---- */
.login-card {
  width: min(370px, 100%);
  background: linear-gradient(0deg, #ffffff 0%, #f2f8f7 100%);
  border-radius: 40px;
  padding: 26px 34px 22px;
  border: 5px solid #fff;
  box-shadow: rgba(74, 168, 232, 0.45) 0 30px 30px -20px, 0 12px 40px -24px rgba(15, 34, 51, 0.35);
}
.login-card__title {
  text-align: center;
  font-size: 1.7rem;
  font-weight: 900;
  color: var(--teal-deep);
  margin-bottom: 0.4rem;
}
.login-card .field { margin-bottom: 0.9rem; }
.login-card input[type="email"],
.login-card input[type="password"],
.login-card input[type="text"] {
  width: 100%;
  border: none;
  border-inline: 2px solid transparent;
  background: #fff;
  color: var(--text);
  border-radius: 20px;
  padding: 15px 20px;
  margin-top: 15px;
  font-size: 0.95rem;
  outline: none;
  box-shadow: #d6ecfb 0 10px 10px -5px;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.login-card input::placeholder { color: #aaa; }
.login-card input:focus { border-inline: 2px solid var(--teal); background: #fff; }
.login-card .login-card__submit {
  width: 100%;
  border: none;
  border-radius: 20px;
  padding: 15px;
  margin: 20px auto 12px;
  font-family: inherit;
  font-weight: 800;
  font-size: 0.98rem;
  color: #0b2f4a;
  background: var(--gradient);
  cursor: pointer;
  box-shadow: rgba(74, 168, 232, 0.55) 0 20px 10px -15px;
  transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}
.login-card .login-card__submit:hover { transform: scale(1.03); box-shadow: rgba(74, 168, 232, 0.6) 0 23px 10px -20px; }
.login-card .login-card__submit:active { transform: scale(0.95); box-shadow: rgba(74, 168, 232, 0.6) 0 15px 10px -10px; }
.login-card .login-card__forgot {
  display: block;
  text-align: right;
  font-size: 0.8rem;
  color: var(--teal-deep);
  margin-top: 0.5rem;
}
.login-card .login-card__or {
  display: block;
  text-align: center;
  font-size: 0.75rem;
  color: var(--muted);
  margin: 1.1rem 0 0.7rem;
}
.login-card .login-card__social {
  display: flex;
  justify-content: center;
  gap: 0.9rem;
}
.login-card .login-card__social a {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--ink-2);
  transition: transform 0.2s ease, background 0.2s ease;
}
.login-card .login-card__social a:hover { transform: scale(1.12); background: var(--teal-deep); }
.login-card .login-card__social svg { width: 18px; height: 18px; fill: currentColor; }

/* ---- 组件展示页布局 ---- */
.ui-page { background: var(--paper); padding-top: calc(var(--nav-h) + 2rem); }
.ui-section {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin: 1.5rem auto;
  padding: 2rem;
}
.ui-section--dark { background: var(--ink); }
.ui-section h2 { color: var(--ink); margin-bottom: 1.4rem; font-size: 1.35rem; }
.ui-section--dark h2 { color: #fff; }
.ui-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: center;
}
.ui-note { color: var(--muted); font-size: 0.85rem; margin-top: 1rem; }

@media (max-width: 720px) {
  .gallery-toolbar { flex-direction: column; align-items: stretch; }
  .search { width: 100%; }
  .filters { justify-content: flex-start; }
  .gallery__count { order: -1; }
}

/* ============================================================
   主界面（Codex 风格：左侧栏 + 内容面板）
   ============================================================ */
.app {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  margin-top: -2.4rem;
  min-height: 100vh;
  border-radius: 28px 28px 0 0;
  background: var(--paper);
  box-shadow: 0 -34px 70px -34px rgba(0, 0, 0, 0.6);
  overflow: clip;
}

/* ---- 侧边栏 ---- */
.sidebar {
  position: sticky;
  top: var(--topbar-h, 54px);
  align-self: start;
  flex: none;
  width: 300px;
  height: calc(100vh - var(--topbar-h, 54px));
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 2.2rem 1.5rem 1.6rem;
  background: #fff;
  border-right: 1px solid var(--line);
  transition: width 0.28s ease, padding 0.28s ease;
}
.sidebar__head { display: flex; align-items: center; gap: 0.9rem; }
.sidebar__meta { min-width: 0; }
.sidebar__actions {
  margin-left: auto;
  display: flex;
  gap: 0.35rem;
}
.icon-btn {
  width: 32px;
  height: 32px;
  flex: none;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--ink-2);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.icon-btn:hover {
  background: var(--gradient);
  color: #0b2f4a;
  border-color: transparent;
  transform: translateY(-2px);
}
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn--collapse svg { transition: transform 0.28s ease; }
.app.is-collapsed .icon-btn--collapse svg { transform: rotate(180deg); }
.sidebar__avatar {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  object-fit: cover;
  box-shadow: var(--shadow-sm);
  flex: none;
}
.sidebar__name { font-size: 1.05rem; font-weight: 800; color: var(--ink); }
.sidebar__role { font-size: 0.8rem; color: var(--muted); }
.sidebar__intro {
  font-size: 0.88rem;
  line-height: 1.75;
  color: var(--muted);
  padding-bottom: 1.2rem;
  border-bottom: 1px solid var(--line);
}
.sidebar__nav { display: flex; flex-direction: column; gap: 0.3rem; }
.side-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.72rem 0.85rem;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: var(--ink-2);
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.side-item:hover { background: var(--paper); transform: translateX(2px); }
.side-item.is-active {
  background: var(--gradient);
  color: #0b2f4a;
  box-shadow: 0 12px 24px -14px rgba(74, 168, 232, 0.8);
}
.side-item__icon { width: 20px; height: 20px; flex: none; }
.side-item__count {
  margin-left: auto;
  font-size: 0.75rem;
  font-weight: 700;
  opacity: 0.65;
}
.sidebar__foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}
.sidebar__social { display: flex; gap: 0.55rem; }
.sidebar__social a {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--paper);
  color: var(--ink-2);
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.sidebar__social a:hover { background: var(--gradient); color: #0b2f4a; transform: translateY(-3px); }
.sidebar__copy { font-size: 0.75rem; color: var(--muted); }
.sidebar__icp {
  font-size: 0.75rem;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s ease;
}
.sidebar__icp:hover { color: var(--teal-deep); }

/* ---- 文章卡片（Markdown 笔记 · 参考 卡片_3D） ---- */
.notes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 1rem;
}
.note-card {
  /* 三种配色（默认青色系） */
  --card-text: #05564a;
  --card-sub: rgba(5, 86, 74, 0.75);
  --card-meta: rgba(5, 86, 74, 0.62);
  --card-ring: rgba(0, 249, 203, 0.22);
  --card-bg: linear-gradient(135deg, #8ceadb 0%, #cdf3dd 100%);
  position: relative;
  display: block;
  width: 100%;
  max-width: 360px;
  min-height: 168px;
  border: none;
  border-radius: 16px;
  background: var(--card-bg);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  transform-style: preserve-3d;
  box-shadow: rgba(5, 71, 17, 0) 40px 50px 25px -40px,
    rgba(5, 71, 17, 0.18) 0 22px 22px -6px;
  transition: transform 0.5s ease, box-shadow 0.5s ease;
}
.note-card[data-color="blue"] {
  --card-text: #10456b;
  --card-sub: rgba(16, 69, 107, 0.75);
  --card-meta: rgba(16, 69, 107, 0.6);
  --card-ring: rgba(124, 200, 250, 0.3);
  --card-bg: linear-gradient(135deg, #a8d8f8 0%, #d9edfc 100%);
}
.note-card[data-color="rose"] {
  --card-text: #7d2b33;
  --card-sub: rgba(125, 43, 51, 0.75);
  --card-meta: rgba(125, 43, 51, 0.6);
  --card-ring: rgba(250, 152, 160, 0.3);
  --card-bg: linear-gradient(135deg, #f7b8bd 0%, #fbe1e2 100%);
}
/* 卡片自身的透视：无论页面多宽、卡片在什么位置，倾斜效果都一致 */
.note-card:hover {
  transform: perspective(820px) rotate3d(1, 1, 0, 12deg) translateZ(6px);
  box-shadow: rgba(5, 71, 17, 0.28) 30px 45px 25px -40px,
    rgba(5, 71, 17, 0.12) 0 22px 26px 0;
}
.note-card__open {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 1rem 1.1rem 2.4rem;
  border: none;
  background: transparent;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  border-radius: inherit;
  transform-style: preserve-3d;
}
.note-card__thumb {
  width: calc(100% + 2.2rem);
  margin: -1rem -1.1rem 0.2rem;
  height: 92px;
  object-fit: cover;
}
.note-card__glass {
  position: absolute;
  inset: 7px;
  border-radius: 13px;
  border-top-right-radius: 100%;
  background: linear-gradient(0deg, rgba(255, 255, 255, 0.34) 0%, rgba(255, 255, 255, 0.75) 100%);
  border-left: 1px solid rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid rgba(255, 255, 255, 0.9);
  transform: translate3d(0, 0, 14px);
  pointer-events: none;
  transition: inset 0.5s ease;
}
.note-card__rings {
  position: absolute;
  top: 0;
  right: 0;
  width: 112px;
  height: 112px;
  pointer-events: none;
  transform-style: preserve-3d;
}
.note-card__ring {
  position: absolute;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--card-ring);
  box-shadow: rgba(100, 100, 111, 0.18) -8px 8px 16px 0;
  backdrop-filter: blur(4px);
  transition: transform 0.5s ease;
}
.note-card__ring--1 { width: 96px; top: 5px; right: 5px; transform: translate3d(0, 0, 8px); }
.note-card__ring--2 { width: 72px; top: 10px; right: 10px; transform: translate3d(0, 0, 18px); transition-delay: 0.15s; }
.note-card__ring--3 { width: 48px; top: 16px; right: 16px; transform: translate3d(0, 0, 28px); transition-delay: 0.3s; }
.note-card:hover .note-card__ring--1 { transform: translate3d(0, 0, 26px); }
.note-card:hover .note-card__ring--2 { transform: translate3d(0, 0, 42px); }
.note-card:hover .note-card__ring--3 { transform: translate3d(0, 0, 58px); }
.note-card__title {
  position: relative;
  padding-right: 62px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--card-text);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transform: translateZ(20px);
}
.note-card__preview {
  position: relative;
  font-size: 0.84rem;
  color: var(--card-sub);
  line-height: 1.65;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transform: translateZ(18px);
}
.note-card__meta {
  position: relative;
  font-size: 0.74rem;
  color: var(--card-meta);
  transform: translateZ(16px);
}
.note-card__tags { display: flex; gap: 0.3rem; flex-wrap: wrap; transform: translateZ(16px); }
.note-card__tags .tag { background: rgba(255, 255, 255, 0.55); color: var(--card-text); font-size: 0.68rem; padding: 0.12rem 0.5rem; }

/* 左下角：颜色选择器（悬停后三个小圆点向右滑出） */
.note-card__palette {
  position: absolute;
  left: 10px;
  bottom: 9px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 6px;
  transform: translateZ(24px);
}
.palette__btn {
  width: 22px;
  height: 22px;
  flex: none;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.72);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.25s ease, background 0.25s ease;
}
.palette__btn:hover { transform: scale(1.1); background: #fff; }
.palette__btn svg { width: 13px; height: 13px; color: var(--card-text); opacity: 0.85; }
.palette__opts {
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-width 0.45s ease, opacity 0.3s ease;
}
.note-card__palette:hover .palette__opts,
.note-card__palette:focus-within .palette__opts { max-width: 76px; opacity: 1; }
.palette__opt {
  width: 18px;
  height: 18px;
  flex: none;
  padding: 0;
  border-radius: 50%;
  border: 2px solid #fff;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(15, 34, 51, 0.18);
  transform: translateX(-8px);
  transition: transform 0.35s ease, box-shadow 0.25s ease;
}
.note-card__palette:hover .palette__opt { transform: none; }
.palette__opt:hover { box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.6); }
.palette__opt--mint { background: linear-gradient(135deg, #8ceadb, #cdf3dd); }
.palette__opt--blue { background: linear-gradient(135deg, #a8d8f8, #d9edfc); }
.palette__opt--rose { background: linear-gradient(135deg, #f7b8bd, #fbe1e2); }
.palette__opt:nth-child(1) { transition-delay: 0.02s; }
.palette__opt:nth-child(2) { transition-delay: 0.08s; }
.palette__opt:nth-child(3) { transition-delay: 0.14s; }
.palette__opt.is-current { outline: 2px solid var(--card-text); outline-offset: 1px; }

/* 右下角：时间 */
.note-card__date {
  position: absolute;
  right: 12px;
  bottom: 11px;
  z-index: 3;
  font-size: 0.72rem;
  color: var(--card-meta);
  transform: translateZ(20px);
}
.note-card--add {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  border: 1.5px dashed var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 0.88rem;
  box-shadow: none;
  transform-style: flat;
}
.note-card--add:hover { border-color: var(--teal); color: var(--teal-deep); background: rgba(124, 201, 247, 0.04); }
.note-card__plus { font-size: 1.7rem; line-height: 1; }

/* ---- 下载按钮（参考 按钮_下载） ---- */
.dl-btn {
  --dl-h: 42px;
  --dl-w: 138px;
  position: relative;
  display: inline-block;
  width: var(--dl-w);
  height: var(--dl-h);
  border: none;
  border-radius: 0.55em;
  background: var(--teal-deep);
  color: #fff;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  transition: background 0.3s ease;
}
.dl-btn__inner {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  overflow: hidden;
  display: block;
}
.dl-btn__text,
.dl-btn__icon {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  transition: top 0.45s ease;
}
.dl-btn__text { top: 0; }
.dl-btn__icon { top: 100%; }
.dl-btn__icon svg { width: 22px; height: 22px; }
.dl-btn:hover { background: var(--ink); }
.dl-btn:hover .dl-btn__text { top: -100%; }
.dl-btn:hover .dl-btn__icon { top: 0; }
.dl-btn::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(var(--dl-h) + 14px);
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  color: var(--ink);
  font-size: 0.76rem;
  font-weight: 600;
  padding: 0.35rem 0.65rem;
  border-radius: 0.4em;
  box-shadow: 0 10px 24px -12px rgba(15, 34, 51, 0.5);
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease, bottom 0.35s ease;
  pointer-events: none;
  z-index: 3;
}
.dl-btn::after {
  content: "";
  position: absolute;
  bottom: calc(var(--dl-h) + 6px);
  left: 50%;
  margin-left: -6px;
  border: 6px solid transparent;
  border-top-color: #fff;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease, bottom 0.35s ease;
  pointer-events: none;
  z-index: 3;
}
.dl-btn:hover::before { opacity: 1; visibility: visible; bottom: calc(var(--dl-h) + 18px); }
.dl-btn:hover::after { opacity: 1; visibility: visible; bottom: calc(var(--dl-h) + 10px); }

/* ---- 描边填充按钮（参考 按钮4） ---- */
.sweep-btn {
  position: relative;
  display: inline-block;
  padding: 0.3rem 0.2rem;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 2px;
  cursor: pointer;
  color: transparent;
  -webkit-text-stroke: 1px rgba(15, 34, 51, 0.5);
  transition: -webkit-text-stroke 0.3s ease;
}
.sweep-btn__fill {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  width: 0%;
  overflow: hidden;
  white-space: nowrap;
  color: var(--teal-deep);
  -webkit-text-stroke: 1px var(--teal-deep);
  border-right: 4px solid var(--teal);
  transition: width 0.5s ease, filter 0.5s ease;
}
.sweep-btn:hover .sweep-btn__fill {
  width: 100%;
  filter: drop-shadow(0 0 12px rgba(74, 168, 232, 0.75));
}
.sweep-btn:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; }

/* ---- 文章阅读页 ---- */
.reader { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 1.6rem 2rem 2.2rem; }
.reader__bar { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 1.4rem; }
.reader__tools { display: flex; gap: 0.4rem; }
.reader__title { font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 800; color: var(--ink); line-height: 1.35; }
.reader__meta { color: var(--muted); font-size: 0.82rem; margin: 0.5rem 0 1.6rem; }

/* ---- Markdown 正文 ---- */
.md { color: var(--text); line-height: 1.85; font-size: 0.98rem; word-wrap: break-word; }
.md h1, .md h2, .md h3, .md h4, .md h5, .md h6 {
  color: var(--ink);
  font-weight: 800;
  line-height: 1.4;
  margin: 1.6em 0 0.6em;
}
.md h1 { font-size: 1.6rem; border-bottom: 1px solid var(--line); padding-bottom: 0.4rem; }
.md h2 { font-size: 1.3rem; }
.md h3 { font-size: 1.12rem; }
.md h4, .md h5, .md h6 { font-size: 1rem; }
.md p { margin: 0.85em 0; }
.md ul, .md ol { margin: 0.85em 0 0.85em 1.4em; }
.md li { margin: 0.3em 0; }
.md a { color: var(--teal-deep); text-decoration: underline; text-underline-offset: 2px; }
.md code {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.1em 0.4em;
  font-size: 0.88em;
  font-family: Consolas, Monaco, "Courier New", monospace;
}
.md pre {
  background: #0f2233;
  color: #e6f2f0;
  border-radius: 12px;
  padding: 1rem 1.1rem;
  overflow-x: auto;
  margin: 1em 0;
}
.md pre code { background: transparent; border: none; color: inherit; padding: 0; font-size: 0.86rem; line-height: 1.65; }
.md blockquote {
  margin: 1em 0;
  padding: 0.4em 1em;
  border-left: 3px solid var(--teal);
  background: var(--paper);
  color: var(--muted);
  border-radius: 0 10px 10px 0;
}
.md img { max-width: 100%; border-radius: 12px; margin: 0.6em 0; }
.md hr { border: none; border-top: 1px solid var(--line); margin: 1.6em 0; }
.md table { border-collapse: collapse; width: 100%; margin: 1em 0; font-size: 0.9rem; }
.md th, .md td { border: 1px solid var(--line); padding: 0.5em 0.7em; text-align: left; }
.md th { background: var(--paper); }
.md del { color: var(--muted); }

/* ---- Markdown 编辑器 ---- */
.notes-bar {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.notes-search { position: relative; flex: 1; min-width: 190px; }
.notes-search svg {
  position: absolute;
  left: 0.7rem;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--muted);
  pointer-events: none;
}
.notes-search input {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 0.6rem 0.9rem 0.6rem 2.2rem;
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.notes-search input:focus { border-color: var(--teal); box-shadow: 0 0 0 4px rgba(124, 201, 247, 0.1); }
.notes-select {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 0.58rem 0.7rem;
  font-family: inherit;
  font-size: 0.86rem;
  color: var(--ink-2);
  outline: none;
  cursor: pointer;
}
.notes-select:focus { border-color: var(--teal); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.seg button {
  border: none;
  background: transparent;
  padding: 0.55rem 0.75rem;
  font-family: inherit;
  font-size: 0.84rem;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}
.seg button.is-active { background: var(--gradient); color: #0b2f4a; font-weight: 700; }
.notes-count { font-size: 0.78rem; color: var(--muted); }

/* 快速记录（参考 Memos 的顶部输入框） */
.quick {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0.85rem 0.95rem;
  margin-bottom: 1.2rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.quick:focus-within { border-color: var(--teal); box-shadow: 0 0 0 4px rgba(124, 201, 247, 0.1); }
.quick textarea {
  flex: 1;
  border: none;
  outline: none;
  resize: vertical;
  min-height: 46px;
  font-family: inherit;
  font-size: 0.93rem;
  line-height: 1.7;
  color: var(--text);
  background: transparent;
}
.quick__side { display: flex; flex-direction: column; align-items: flex-end; gap: 0.35rem; }
.quick__hint { font-size: 0.72rem; color: var(--muted); white-space: nowrap; }

/* 列表视图（参考笔记软件的列表行） */
.notes-list { display: flex; flex-direction: column; gap: 0.4rem; }
.note-row {
  --row-accent: #7fd9c6;
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  width: 100%;
  text-align: left;
  padding: 0.7rem 0.9rem 0.7rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.note-row:hover { border-color: rgba(74, 168, 232, 0.5); transform: translateX(3px); box-shadow: var(--shadow-sm); }
.note-row[data-color="blue"] { --row-accent: #8cc8f0; }
.note-row[data-color="rose"] { --row-accent: #f0a3aa; }
.note-row::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  bottom: 7px;
  width: 3px;
  border-radius: 3px;
  background: var(--row-accent);
}
.note-row__icon { width: 17px; height: 17px; flex: none; color: var(--teal); margin-top: 0.25rem; }
.note-row__main { flex: 1; min-width: 0; }
.note-row__title { font-size: 0.95rem; font-weight: 700; color: var(--ink); }
.note-row__preview {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 0.15rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.note-row__meta { font-size: 0.72rem; color: var(--muted); white-space: nowrap; margin-top: 0.25rem; }

/* 沉浸式文档编辑器（参考 Obsidian / 思源） */
.panel-wrap--doc { padding: 0 !important; }
.panel-wrap--doc .panel__head { display: none; }

.doc {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - var(--topbar-h, 54px));
  background: #fff;
}
.doc__bar {
  position: sticky;
  top: var(--topbar-h, 54px);
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  height: 48px;
  padding: 0 0.85rem;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.doc__back {
  width: 30px;
  height: 30px;
  flex: none;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.doc__back:hover { background: var(--paper); color: var(--teal-deep); border-color: var(--line); }
.doc__back svg { width: 18px; height: 18px; }
.crumbs { display: flex; align-items: center; gap: 0.3rem; min-width: 0; overflow: hidden; }
.crumb {
  border: none;
  background: transparent;
  padding: 0.18rem 0.4rem;
  border-radius: 7px;
  font-family: inherit;
  font-size: 0.84rem;
  color: var(--muted);
  white-space: nowrap;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
}
button.crumb { cursor: pointer; transition: background 0.18s ease, color 0.18s ease; }
button.crumb:hover { background: var(--paper); color: var(--teal-deep); }
.crumb--doc { color: var(--ink); font-weight: 700; }
.crumb-sep { color: #c9dcea; font-size: 0.8rem; }
.doc__bar-right { margin-left: auto; display: flex; align-items: center; gap: 0.5rem; flex: none; }

/* 编辑 / 预览 开关（Toggle switch） */
.switch { display: inline-flex; align-items: center; gap: 0.45rem; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch__track {
  position: relative;
  width: 42px;
  height: 22px;
  border-radius: 999px;
  background: #d7e6f2;
  transition: background 0.25s ease;
}
.switch input:checked ~ .switch__track { background-image: var(--gradient); background-size: 200% 100%; background-position: 100% 50%; }
.switch__thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(15, 34, 51, 0.28);
  transition: transform 0.25s ease;
}
.switch input:checked ~ .switch__track .switch__thumb { transform: translateX(20px); }
.switch__label { font-size: 0.8rem; color: var(--muted); min-width: 2.4em; }
.switch input:focus-visible ~ .switch__track { outline: 2px solid var(--teal); outline-offset: 2px; }

.doc__del {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: #c0504a;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.doc__del:hover { background: #fdf3f2; border-color: #efc9c5; }
.doc__del svg { width: 16px; height: 16px; }

.doc__scroll {
  flex: 1;
  width: 100%;
  max-width: none;
  padding: 1.1rem clamp(1rem, 2.4vw, 2.2rem) 2.5rem;
}
.doc__title {
  width: 100%;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: clamp(1.5rem, 3.4vw, 2.1rem);
  font-weight: 800;
  color: var(--ink);
  padding: 0.3rem 0 0.1rem;
  background: transparent;
}
.doc__meta { display: flex; align-items: center; gap: 0.5rem; padding: 0.15rem 0 0.9rem; flex-wrap: wrap; }
.doc__tags { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.doc__tags input {
  border: none;
  outline: none;
  background: transparent;
  font-family: inherit;
  font-size: 0.82rem;
  color: var(--muted);
  min-width: 140px;
}
.md-toolbar {
  position: sticky;
  top: calc(var(--topbar-h, 54px) + 48px);
  z-index: 3;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(244, 249, 253, 0.95);
  backdrop-filter: blur(6px);
  margin-bottom: 0.7rem;
}
.doc__source {
  width: 100%;
  min-height: 58vh;
  border: none;
  outline: none;
  resize: vertical;
  padding: 0.4rem 0;
  font-family: Consolas, Monaco, "Courier New", monospace;
  font-size: 0.95rem;
  line-height: 1.9;
  color: var(--text);
  background: transparent;
}
.doc__preview { padding: 0.4rem 0; }
.doc__foot {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
  padding: 0.55rem 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--line);
}

/* 文档状态 / 工具栏 / 附件 */
.doc__status { font-size: 0.75rem; color: var(--muted); }
.doc__status.is-saving { color: var(--teal-deep); }
.doc__tags .tag { background: var(--paper); }
.md-toolbar {
  display: flex;
  gap: 0.25rem;
  align-items: center;
  flex-wrap: wrap;
  padding: 0.4rem 0.6rem;
}
.md-tool {
  min-width: 32px;
  height: 30px;
  padding: 0 0.45rem;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  font-family: inherit;
  font-size: 0.82rem;
  color: var(--ink-2);
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}
.md-tool:hover { background: #fff; border-color: var(--line); color: var(--teal-deep); }
.md-tool--sep { width: 1px; min-width: 1px; height: 20px; background: var(--line); margin: 0 0.2rem; padding: 0; border: none; }
.doc__attach { font-size: 0.8rem; color: var(--muted); }
.doc__attach a { color: var(--teal-deep); }

/* ---- Markdown 编辑器（旧的弹窗版，保留给小组件页使用） ---- */
.md-tabs { display: flex; align-items: center; gap: 0.4rem; margin-bottom: 0.5rem; }
.md-tab {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-2);
  font-family: inherit;
  font-size: 0.82rem;
  padding: 0.28rem 0.8rem;
  border-radius: 999px;
  cursor: pointer;
}
.md-tab.is-active { background: var(--gradient); border-color: transparent; color: #0b2f4a; font-weight: 700; }
.md-hint { font-size: 0.72rem; color: var(--muted); margin-left: 0.4rem; }
.md-input {
  width: 100%;
  border: 2px solid var(--line);
  border-radius: 12px;
  padding: 0.8rem 1rem;
  font-family: Consolas, Monaco, "Courier New", monospace;
  font-size: 0.9rem;
  line-height: 1.75;
  color: var(--text);
  background: var(--paper);
  outline: none;
  resize: vertical;
}
.md-input:focus { border-color: var(--teal); background: #fff; }
.md-preview {
  border: 2px solid var(--line);
  border-radius: 12px;
  padding: 1rem 1.2rem;
  min-height: 240px;
  max-height: 46vh;
  overflow: auto;
  background: #fff;
}

/* ---- 侧边栏收起（类似 Codex：只留图标轨道） ---- */
.app.is-collapsed .sidebar {
  width: 68px;
  padding: 1.2rem 0.7rem 1rem;
  align-items: center;
}
.app.is-collapsed .sidebar__head {
  flex-direction: column;
  gap: 0.55rem;
  width: 100%;
}
.app.is-collapsed .sidebar__meta,
.app.is-collapsed .sidebar__intro,
.app.is-collapsed .side-item__label,
.app.is-collapsed .side-item__count,
.app.is-collapsed .sidebar__foot { display: none; }
.app.is-collapsed .sidebar__avatar {
  width: 38px;
  height: 38px;
  border-radius: 12px;
}
.app.is-collapsed .sidebar__actions {
  margin-left: 0;
  flex-direction: column;
}
.app.is-collapsed .sidebar__nav { width: 100%; }
.app.is-collapsed .side-item {
  justify-content: center;
  padding: 0.7rem 0.4rem;
}

/* ---- 内容面板 ---- */
.panel-wrap {
  flex: 1 1 auto;
  min-width: 0;
  padding: 2.6rem 3rem 4rem;
}
.panel { display: none; }
.panel.is-active { display: block; animation: panel-in 0.5s ease both; }
@keyframes panel-in {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}
.panel__title {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 0.35rem;
}
.panel__sub { color: var(--muted); margin-bottom: 2rem; }

/* 光影集：深色卡片，让照片更突出 */
.gallery-card {
  background: var(--ink);
  border-radius: 20px;
  padding: 1.5rem 1.5rem 1.7rem;
}

/* 联系卡片 */
.contact-card {
  background: var(--gradient);
  color: #0b2f4a;
  border-radius: 20px;
  padding: 3rem 2rem;
  text-align: center;
}
.contact-card .contact__text { max-width: 460px; margin: 0 auto 1.6rem; font-size: 1.05rem; }

/* ---- 主界面响应式 ---- */
@media (max-width: 1000px) {
  .app__body { display: block; }
  .sidebar,
  .app.is-collapsed .sidebar {
    width: 100%;
    position: static;
    height: auto;
    align-items: stretch;
    border-right: none;
    border-bottom: 1px solid var(--line);
    padding: 1.4rem 1.2rem 1.1rem;
    gap: 1rem;
  }
  /* 手机上不做收起，恢复被收起样式隐藏的元素 */
  .app.is-collapsed .sidebar__meta { display: block; }
  .app.is-collapsed .sidebar__intro { display: block; }
  .app.is-collapsed .sidebar__foot { display: flex; }
  .app.is-collapsed .sidebar__head { flex-direction: row; width: auto; }
  .app.is-collapsed .sidebar__actions { flex-direction: row; margin-left: auto; }
  .app.is-collapsed .sidebar__avatar { width: 56px; height: 56px; border-radius: 18px; }
  .app.is-collapsed .side-item { justify-content: flex-start; padding: 0.6rem 0.9rem; }
  .app.is-collapsed .side-item__label { display: inline; }
  .app.is-collapsed .side-item__count { display: inline; }
  .icon-btn--collapse { display: none; }
  .sidebar__intro { padding-bottom: 0; border-bottom: none; }
  .sidebar__nav {
    flex-direction: row;
    overflow-x: auto;
    gap: 0.5rem;
    padding-bottom: 0.3rem;
    -webkit-overflow-scrolling: touch;
  }
  .side-item { width: auto; white-space: nowrap; padding: 0.6rem 0.9rem; }
  .side-item__count { margin-left: 0.35rem; }
  .sidebar__foot { display: none; }
  .panel-wrap { padding: 1.6rem 1.2rem 3rem; }
}

@media (max-width: 720px) {
  .hero__hello { font-size: 1.9rem; }
  .hero__arrow { bottom: 1.6rem; width: 50px; height: 50px; }
  .app { margin-top: -1.4rem; border-radius: 22px 22px 0 0; }
  .gallery-card { padding: 1.1rem 1rem 1.3rem; border-radius: 16px; }
  .panel__title { font-size: 1.5rem; }
}

/* ============================================================
   顶部面板 · 分享 · 登录 / 编辑弹窗 · 作品分类
   ============================================================ */
:root { --topbar-h: 54px; }

.app__body {
  display: flex;
  align-items: stretch;
  flex: 1;
  min-height: 0;
}

/* ---- 顶部面板（尽量薄） ---- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 6;
  height: var(--topbar-h);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.6rem;
  padding: 0 1rem;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar__side { display: flex; align-items: center; gap: 0.55rem; min-width: 0; }
.topbar__side--right { justify-content: flex-end; }
.topbar__center { display: flex; justify-content: center; }
.topbar__time {
  font-weight: 800;
  color: var(--ink);
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.topbar__weather {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.85rem;
  min-width: 0;
}
.topbar__weather svg { width: 16px; height: 16px; color: var(--teal); flex: none; }
.topbar__weather-icon {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  flex: none;
  color: var(--teal);
}
.topbar__weather-icon svg {
  width: 18px;
  height: 18px;
  display: block;
  animation: weather-icon-in 0.35s ease;
}
@keyframes weather-icon-in {
  from { opacity: 0; transform: scale(0.7) rotate(-10deg); }
  to { opacity: 1; transform: none; }
}
#weatherText {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 240px;
}
.icon-btn--up { width: 36px; height: 36px; border-radius: 999px; }

/* ---- 小按钮 ---- */
.chip {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-2);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.38rem 0.9rem;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.2s ease, color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}
.chip:hover { border-color: var(--teal); color: var(--teal-deep); transform: translateY(-1px); }
.chip--primary {
  background: var(--gradient);
  color: #0b2f4a;
  border-color: transparent;
  box-shadow: 0 10px 20px -12px rgba(74, 168, 232, 0.9);
}
.chip--primary:hover { color: #0b2f4a; }
.chip--danger { border-color: #f0c9c6; color: #b3261e; }
.chip[disabled] { opacity: 0.55; cursor: not-allowed; transform: none; }

/* ---- 面板标题行 ---- */
.panel__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.panel__actions { display: flex; align-items: center; gap: 0.5rem; }
.admin-badge {
  font-size: 0.72rem;
  font-weight: 700;
  color: #0b2f4a;
  background: rgba(124, 201, 247, 0.22);
  border: 1px solid rgba(74, 168, 232, 0.5);
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
}

/* ---- 侧栏分类树 ---- */
.side-subnav {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding-left: 1.9rem;
  margin: -0.15rem 0 0.15rem;
}
.side-subitem {
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.85rem;
  text-align: left;
  padding: 0.36rem 0.6rem;
  border-radius: 9px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}
.side-subitem:hover { background: var(--paper); color: var(--ink-2); }
.side-subitem.is-active { background: var(--paper); color: var(--teal-deep); font-weight: 700; }
.app.is-collapsed .side-subnav { display: none; }

/* ============================================================
   可编辑侧栏：树形标签 + ⋯ 菜单 + 长按拖动排序
   ============================================================ */
.sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
}
.nav-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.15rem;
  border-radius: 10px;
  transition: background 0.18s ease;
}
.nav-row:hover { background: var(--paper); }
.nav-row.is-active { background: var(--gradient); }
.nav-row.is-active .nav-item,
.nav-row.is-active .nav-item__more { color: #0b2f4a; }
.nav-item {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.52rem 0.6rem;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink-2);
  text-align: left;
  border-radius: 10px;
  cursor: pointer;
}
.nav-item__icon { width: 18px; height: 18px; flex: none; opacity: 0.85; }
.nav-item__label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item__more {
  flex: none;
  width: 26px;
  height: 26px;
  margin-right: 0.2rem;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.nav-row:hover .nav-item__more,
.nav-row.is-menu-open .nav-item__more { opacity: 1; }
.nav-item__more:hover { background: rgba(0, 0, 0, 0.07); color: var(--ink); }
.nav-children {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding-left: 0.85rem;
  margin-left: 0.6rem;
  border-left: 1px solid var(--line);
}
.nav-row.is-dragging { opacity: 0.35; }
.nav-row.is-drop-before::before,
.nav-row.is-drop-after::after {
  content: "";
  position: absolute;
  left: 0.35rem;
  right: 0.35rem;
  height: 2px;
  border-radius: 2px;
  background: var(--teal);
}
.nav-row.is-drop-before::before { top: -1px; }
.nav-row.is-drop-after::after { bottom: -1px; }
.drag-ghost {
  position: fixed;
  z-index: 90;
  transform: translate(-50%, -50%);
  pointer-events: none;
  padding: 0.45rem 0.9rem;
  border-radius: 10px;
  background: var(--gradient);
  color: #0b2f4a;
  font-size: 0.9rem;
  font-weight: 700;
  box-shadow: var(--shadow);
}
.app.is-collapsed .nav-item__more,
.app.is-collapsed .nav-children { display: none; }

/* ⋯ 菜单 */
.menu {
  position: fixed;
  z-index: 80;
  min-width: 156px;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.35rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 22px 48px -22px rgba(15, 34, 51, 0.5);
}
.menu[hidden] { display: none; }
.menu button {
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 0.88rem;
  color: var(--ink-2);
  text-align: left;
  padding: 0.5rem 0.7rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.menu button:hover { background: var(--paper); color: var(--teal-deep); }
.menu .menu__danger { color: #b3261e; }
.menu .menu__danger:hover { background: #fdf2f1; }

/* 文字页 / 子区块 */
.text-page {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 2rem 2.2rem;
}
.text-page p { color: var(--muted); line-height: 1.9; margin-bottom: 1rem; }
.text-page p:last-of-type { margin-bottom: 0; }
.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.8rem;
  margin: 1.5rem 0 1.2rem;
}
.facts div { background: var(--paper); border-radius: 12px; padding: 0.8rem 1rem; text-align: center; }
.facts strong { display: block; font-size: 0.76rem; color: var(--ink); margin-bottom: 0.1rem; }
.facts span { font-size: 0.9rem; color: var(--muted); }
.node-section { margin-top: 2.4rem; }
.node-section__head { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 1rem; }
.node-section__title { font-size: 1.05rem; font-weight: 800; color: var(--ink); }

/* 表单里的下拉框 */
.field select {
  width: 100%;
  border: 2px solid var(--line);
  border-radius: 12px;
  padding: 0.6rem 0.85rem;
  font-family: inherit;
  font-size: 0.92rem;
  color: var(--text);
  background: var(--paper);
  outline: none;
}
.field select:focus { border-color: var(--teal); background: #fff; }

/* ---- 作品分类与卡片（JS 渲染） ---- */
.cat-block { margin-bottom: 2.2rem; }
.cat-block__head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.9rem;
  flex-wrap: wrap;
}
.cat-block__name { font-size: 1.08rem; font-weight: 800; color: var(--ink); }
.cat-block__count { font-size: 0.8rem; color: var(--muted); }
.cat-block__tools { display: flex; gap: 0.4rem; margin-left: auto; }
.works-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.1rem;
}
.work {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.work:hover { transform: translateY(-4px); box-shadow: var(--shadow-sm); }
.work__cover {
  aspect-ratio: 16 / 10;
  background: linear-gradient(135deg, #1c6fae, #4aa8e8 60%, #7cc9f7);
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.9rem;
  overflow: hidden;
}
.work__cover img { width: 100%; height: 100%; object-fit: cover; }
.work__body {
  padding: 1rem 1.1rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}
.work__title { font-size: 1.03rem; font-weight: 700; color: var(--ink); }
.work__summary { color: var(--muted); font-size: 0.9rem; line-height: 1.65; }
.work__tags { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.work__links { display: flex; gap: 0.5rem; align-items: center; margin-top: auto; flex-wrap: wrap; }
.work__admin {
  display: flex;
  gap: 0.4rem;
  padding: 0.65rem 1.1rem 0.9rem;
  border-top: 1px dashed var(--line);
}
.work__admin button {
  font-family: inherit;
  font-size: 0.78rem;
  padding: 0.3rem 0.7rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-2);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.work__admin button:hover { background: var(--paper); border-color: var(--teal); color: var(--teal-deep); }
.work__admin button[data-act="del"]:hover { border-color: #e0a9a4; color: #b3261e; }
.empty-hint {
  color: var(--muted);
  font-size: 0.9rem;
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 1.4rem;
  text-align: center;
}

/* ---- 分享气泡 ---- */
.popover {
  position: fixed;
  top: calc(var(--topbar-h) + 8px);
  right: 12px;
  z-index: 40;
  width: 216px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 26px 60px -26px rgba(15, 34, 51, 0.45);
  padding: 0.55rem;
}
.popover[hidden] { display: none; }
.popover__title { font-size: 0.78rem; color: var(--muted); padding: 0.3rem 0.6rem 0.45rem; }
.popover__item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.55rem 0.6rem;
  border: none;
  background: transparent;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--ink-2);
  cursor: pointer;
  text-align: left;
  transition: background 0.2s ease, color 0.2s ease;
}
.popover__item:hover { background: var(--paper); color: var(--teal-deep); }
.popover__item svg { width: 16px; height: 16px; flex: none; }
.popover__msg { font-size: 0.78rem; color: var(--teal-deep); padding: 0.35rem 0.6rem 0.1rem; }

/* ---- 弹窗 ---- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal.is-open { display: flex; }
.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 20, 19, 0.55);
  backdrop-filter: blur(3px);
}
.modal__close {
  position: absolute;
  top: 0.75rem;
  right: 0.8rem;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--paper);
  color: var(--ink-2);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}
.modal__close:hover { background: var(--gradient); color: #0b2f4a; }
.modal .login-card,
.edit-card { position: relative; z-index: 1; }

/* 登录卡片（参考组件 登录1，配色改为本站青绿） */
.login-card__hint { font-size: 0.85rem; color: var(--muted); text-align: center; margin-bottom: 1.1rem; }
.login-card__msg { font-size: 0.82rem; color: #b3261e; text-align: center; margin-top: 0.7rem; }
.login-card__msg.is-ok { color: var(--teal-deep); }
.login-card__foot { font-size: 0.72rem; color: var(--muted); text-align: center; margin-top: 0.9rem; line-height: 1.6; }
.login-card__foot code { background: var(--paper); padding: 0.1rem 0.3rem; border-radius: 5px; }
.check--light {
  color: var(--muted);
  border-color: var(--line);
  background: var(--paper);
  margin: 0.2rem 0 0.2rem;
  font-size: 0.85rem;
}
.check--light .check__box { border-color: #c6d4d2; }
.check--light .check__path { stroke: #0b2f4a; }

/* 编辑作品表单 */
.edit-card {
  width: min(560px, 100%);
  max-height: 88vh;
  overflow: auto;
  background: #fff;
  border-radius: 22px;
  padding: 1.8rem 1.9rem 1.4rem;
  box-shadow: 0 30px 70px -30px rgba(15, 34, 51, 0.55);
}
.edit-card__title { font-size: 1.15rem; font-weight: 800; color: var(--ink); margin-bottom: 1.1rem; }
.edit-card--small { width: min(380px, 100%); }
.field { margin-bottom: 0.85rem; }
.field label { display: block; font-size: 0.8rem; color: var(--muted); margin-bottom: 0.3rem; }
.field input[type="text"],
.field input[type="url"],
.field input[type="password"],
.field input[type="email"],
.field textarea {
  width: 100%;
  border: 2px solid var(--line);
  border-radius: 12px;
  padding: 0.6rem 0.85rem;
  font-family: inherit;
  font-size: 0.92rem;
  color: var(--text);
  background: var(--paper);
  outline: none;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.field input:focus,
.field textarea:focus { border-color: var(--teal); background: #fff; }
.field input[type="file"] { font-size: 0.85rem; color: var(--muted); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; }
.field__hint { font-size: 0.76rem; color: var(--teal-deep); margin-top: 0.3rem; }
.edit-card__actions { display: flex; align-items: center; gap: 0.6rem; margin-top: 1.1rem; }
.edit-card__msg { font-size: 0.82rem; color: #b3261e; margin-top: 0.7rem; }
.edit-card__msg.is-ok { color: var(--teal-deep); }

@media (max-width: 720px) {
  .topbar { padding: 0 0.6rem; gap: 0.35rem; }
  .topbar__time { font-size: 0.85rem; }
  #weatherText { max-width: 110px; font-size: 0.78rem; }
  .chip { padding: 0.32rem 0.7rem; font-size: 0.8rem; }
  .field-row { grid-template-columns: 1fr; }
  .side-subnav { padding-left: 0; flex-direction: row; overflow-x: auto; gap: 0.3rem; }
  .side-subitem { white-space: nowrap; }
}

/* ============================================================
   流线感：主色渐变（色标不均匀 + 悬停时渐变流动）
   ============================================================ */
.btn--solid,
.btn--3d,
.chip--primary,
.login-card .login-card__submit,
.seg button.is-active,
.nav-row.is-active,
.side-item.is-active,
.search__icon,
.icon-btn:hover,
.sidebar__social a:hover,
.switch input:checked ~ .switch__track {
  background-image: var(--gradient-flow);
  background-size: 240% 100%;
  background-position: 0% 50%;
  background-repeat: no-repeat;
}
.btn--solid,
.btn--3d,
.chip--primary,
.login-card .login-card__submit {
  transition: background-position 0.75s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.btn--solid:hover,
.btn--3d:hover,
.chip--primary:hover,
.login-card .login-card__submit:hover {
  background-position: 100% 50%;
}

/* 文档模式下让编辑区真正铺满整个右侧区域 */
.panel-wrap--doc .doc__scroll { max-width: none; }
.panel-wrap--doc .doc__source,
.panel-wrap--doc .doc__preview { max-height: none; }
