:root {
  --ink: #0c1218;
  --ink-soft: #151e28;
  --panel: rgba(18, 28, 38, 0.72);
  --line: rgba(180, 210, 230, 0.12);
  --text: #e8eef4;
  --muted: #8fa3b5;
  --flash: #3ecfb2;
  --flash-deep: #1a9f8a;
  --warn: #e07a5f;
  --radius: 14px;
  --font-display: "Songti SC", "STSong", "SimSun", "Noto Serif CJK SC", serif;
  --font-body: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--ink);
  line-height: 1.6;
  overflow-x: hidden;
}

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(62, 207, 178, 0.16), transparent 55%),
    radial-gradient(900px 500px at 95% 10%, rgba(90, 140, 200, 0.14), transparent 50%),
    linear-gradient(165deg, #0a1016 0%, #101820 45%, #0c141c 100%);
}

.glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.55;
  animation: drift 14s ease-in-out infinite alternate;
}

.glow-a {
  width: 420px;
  height: 420px;
  left: -80px;
  top: 20%;
  background: rgba(62, 207, 178, 0.22);
}

.glow-b {
  width: 360px;
  height: 360px;
  right: -60px;
  bottom: 10%;
  background: rgba(100, 150, 210, 0.18);
  animation-delay: -4s;
}

.grain {
  position: absolute;
  inset: 0;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

@keyframes drift {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(30px, -24px) scale(1.08); }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem clamp(1.2rem, 4vw, 2.5rem);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(14px);
  background: rgba(12, 18, 24, 0.55);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: var(--text);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  background: linear-gradient(145deg, var(--flash), var(--flash-deep));
  color: #06221c;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  box-shadow: 0 0 24px rgba(62, 207, 178, 0.35);
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.06em;
}

.nav {
  display: flex;
  gap: 0.35rem;
}

.nav-link {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.95rem;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
}

.nav-link:hover,
.nav-link.is-active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.view[hidden] {
  display: none !important;
}

.view-home.is-active {
  animation: rise 0.7s ease both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero {
  min-height: calc(100vh - 4.5rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: clamp(2rem, 8vh, 5rem) clamp(1.2rem, 4vw, 2.5rem) 4rem;
  max-width: 920px;
}

.hero-brand {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(4.2rem, 14vw, 7.5rem);
  line-height: 1;
  letter-spacing: 0.08em;
  background: linear-gradient(120deg, #f4faf8 20%, var(--flash) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: brand-in 1s ease both;
}

.hero-tagline {
  margin: 1.1rem 0 0;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 3.5vw, 1.85rem);
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.18em;
  animation: brand-in 1s ease 0.12s both;
}

.hero-lead {
  margin: 1.25rem 0 0;
  max-width: 28rem;
  color: var(--muted);
  font-size: 1.05rem;
  animation: brand-in 1s ease 0.22s both;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
  animation: brand-in 1s ease 0.32s both;
}

@keyframes brand-in {
  from { opacity: 0; transform: translateY(18px); filter: blur(4px); }
  to { opacity: 1; transform: translateY(0); filter: blur(0); }
}

.btn {
  appearance: none;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 500;
  font-size: 0.98rem;
  padding: 0.75rem 1.35rem;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s, background 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: linear-gradient(135deg, var(--flash), var(--flash-deep));
  color: #04241c;
  box-shadow: 0 10px 30px rgba(62, 207, 178, 0.28);
}

.btn-primary:hover {
  box-shadow: 0 14px 36px rgba(62, 207, 178, 0.4);
}

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: rgba(62, 207, 178, 0.45);
  background: rgba(62, 207, 178, 0.08);
}

.btn-small {
  padding: 0.4rem 0.85rem;
  font-size: 0.88rem;
}

.btn-danger {
  background: transparent;
  border-color: rgba(224, 122, 95, 0.45);
  color: #f0b4a4;
}

.btn-danger:hover {
  background: rgba(224, 122, 95, 0.12);
}

.features {
  padding: 4rem clamp(1.2rem, 4vw, 2.5rem) 6rem;
  max-width: 1100px;
  margin: 0 auto;
  border-top: 1px solid var(--line);
}

.section-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  letter-spacing: 0.06em;
}

.section-sub {
  margin: 0.6rem 0 2.2rem;
  color: var(--muted);
}

.feature-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.feature-list li {
  padding: 0.2rem 0;
}

.feature-index {
  display: block;
  font-family: var(--font-display);
  color: var(--flash);
  font-size: 0.95rem;
  letter-spacing: 0.12em;
  margin-bottom: 0.7rem;
}

.feature-list h3 {
  margin: 0 0 0.45rem;
  font-size: 1.15rem;
  font-weight: 700;
}

.feature-list p {
  margin: 0;
  color: var(--muted);
  font-size: 0.96rem;
}

.view-app {
  padding: 1rem clamp(0.8rem, 2.5vw, 1.5rem) 2rem;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(240px, 300px) 1fr;
  gap: 1rem;
  min-height: calc(100vh - 8rem);
  max-width: 1200px;
  margin: 0 auto;
}

.sidebar,
.editor-pane {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.sidebar {
  display: flex;
  flex-direction: column;
  padding: 1rem;
  min-height: 420px;
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.sidebar-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: 0.04em;
}

.search-wrap input {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  border-radius: 10px;
  padding: 0.55rem 0.75rem;
  font: inherit;
  margin-bottom: 0.75rem;
}

.search-wrap input:focus {
  outline: 2px solid rgba(62, 207, 178, 0.45);
  outline-offset: 1px;
}

.note-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.note-item {
  width: 100%;
  text-align: left;
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: inherit;
  font: inherit;
  padding: 0.7rem 0.75rem;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.note-item:hover {
  background: rgba(255, 255, 255, 0.04);
}

.note-item.is-active {
  background: rgba(62, 207, 178, 0.1);
  border-color: rgba(62, 207, 178, 0.28);
}

.note-item-title {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.note-attach-badge {
  flex-shrink: 0;
  display: inline-grid;
  place-items: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  background: rgba(62, 207, 178, 0.18);
  color: var(--flash);
  font-size: 0.72rem;
  font-weight: 700;
}

.note-item-preview {
  display: block;
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.82rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-empty {
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.sidebar-empty[hidden] {
  display: none;
}

.editor-pane {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 1.15rem 1.25rem 1rem;
  min-height: 420px;
}

.editor-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.note-title {
  flex: 1;
  min-width: 12rem;
  border: 0;
  background: transparent;
  color: var(--text);
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 3vw, 1.7rem);
  font-weight: 700;
  padding: 0.2rem 0;
}

.note-title:focus {
  outline: none;
}

.note-time {
  color: var(--muted);
  font-size: 0.85rem;
}

.note-body {
  flex: 1;
  width: 100%;
  min-height: 180px;
  resize: vertical;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 1.05rem;
  line-height: 1.75;
  padding: 0.35rem 0;
}

.note-body:focus {
  outline: none;
}

.attach-toolbar {
  position: relative;
  z-index: 6;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  padding: 0.65rem 0 0.35rem;
  border-top: 1px solid var(--line);
}

.attach-toolbar .btn {
  cursor: pointer;
  user-select: none;
}

.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.attach-hint {
  color: var(--muted);
  font-size: 0.8rem;
  margin-left: 0.25rem;
}

.btn-tiny {
  padding: 0.28rem 0.65rem;
  font-size: 0.78rem;
}

.attachments {
  display: grid;
  gap: 0.85rem;
  margin: 0.75rem 0 0.25rem;
  max-height: 42vh;
  overflow: auto;
  padding-right: 0.15rem;
}

.attachments[hidden] {
  display: none;
}

.attach-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.22);
  padding: 0.7rem;
  overflow: hidden;
}

.attach-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.55rem;
}

.attach-name {
  flex: 1;
  min-width: 0;
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.attach-size {
  color: var(--muted);
  font-size: 0.78rem;
}

.attach-actions {
  display: flex;
  gap: 0.35rem;
  margin-left: auto;
}

.attach-preview-img {
  display: block;
  width: 100%;
  max-height: 320px;
  object-fit: contain;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.35);
}

.attach-preview-video {
  display: block;
  width: 100%;
  max-height: 360px;
  border-radius: 8px;
  background: #000;
}

.attach-file-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.55rem 0.85rem;
  border-radius: 8px;
  background: rgba(62, 207, 178, 0.1);
  color: var(--flash);
  font-size: 0.85rem;
  font-weight: 500;
}

.drop-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  border-radius: inherit;
  background: rgba(12, 28, 26, 0.82);
  border: 2px dashed rgba(62, 207, 178, 0.55);
  pointer-events: none;
}

.drop-overlay[hidden] {
  display: none;
}

.drop-overlay p {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.25rem;
  letter-spacing: 0.08em;
  color: var(--flash);
}

.editor-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
  margin-top: 0.5rem;
}

.save-hint {
  color: var(--muted);
  font-size: 0.85rem;
  transition: color 0.2s;
}

.save-hint.is-saving {
  color: var(--flash);
}

.sync-dialog {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0;
  background: #121a22;
  color: var(--text);
  max-width: min(520px, 92vw);
  box-shadow: var(--shadow);
}

.sync-dialog::backdrop {
  background: rgba(4, 8, 12, 0.72);
  backdrop-filter: blur(4px);
}

.sync-panel {
  margin: 0;
  padding: 1.35rem 1.4rem 1.2rem;
}

.sync-panel h2 {
  margin: 0 0 0.55rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: 0.04em;
}

.sync-panel p {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.sync-label {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.88rem;
  color: var(--muted);
}

.sync-label input {
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.28);
  color: var(--text);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  font: inherit;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
}

.sync-label input:focus {
  outline: 2px solid rgba(62, 207, 178, 0.45);
  outline-offset: 1px;
}

.sync-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 1rem;
}

.sync-tip {
  margin: 0.85rem 0 0 !important;
  min-height: 1.2em;
  color: var(--flash) !important;
  font-size: 0.85rem !important;
}

.site-footer {
  padding: 1.5rem clamp(1.2rem, 4vw, 2.5rem) 2rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}

.footer-brand {
  font-family: var(--font-display);
  color: var(--text);
}

@media (max-width: 820px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    max-height: 280px;
  }

  .hero {
    min-height: calc(100svh - 4.5rem);
  }

  .attach-hint {
    width: 100%;
    margin-left: 0;
  }

  .attachments {
    max-height: 36vh;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
