:root {
  --bg-mist: #eaf6ee;
  --bg-leaf: #d8f1e2;
  --ink: #1b2a24;
  --accent: #2bb673;
  --accent-dark: #1e7a51;
  --muted: #5b6f65;
  --card: #f6fff9;
  --shadow: rgba(27, 42, 36, 0.12);
}

html {
  overflow-x: hidden;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at 15% 20%, #f3fff7 0%, #e6f6ee 30%, #d8f1e2 70%);
  color: #1b2a24;
  color: var(--ink);
  font-family: "HarmonyOS Sans", "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  position: relative;
  overflow-x: hidden;
  transition: background 0.35s ease, color 0.35s ease;
}

body.theme-dark {
  --bg-mist: #0e1512;
  --bg-leaf: #0b1511;
  --ink: #e3f2e8;
  --accent: #3fbf85;
  --accent-dark: #7ed2a6;
  --muted: #a6beb2;
  --card: #18241f;
  --shadow: rgba(0, 0, 0, 0.45);
  background: radial-gradient(circle at 15% 20%, #13201b 0%, #0f1915 30%, #0b1511 70%);
  color: var(--ink);
}

.bg-orb {
  position: absolute;
  border-radius: 50%;
  opacity: 0.35;
}

.orb-a {
  width: 320px;
  height: 320px;
  background: radial-gradient(circle at 30% 30%, #e9ffe9, #8ed9a8);
  top: -80px;
  left: -60px;
}

.orb-b {
  width: 240px;
  height: 240px;
  background: radial-gradient(circle at 40% 40%, #f4fff7, #9dc7b0);
  top: 220px;
  right: -80px;
}

.orb-c {
  width: 260px;
  height: 260px;
  background: radial-gradient(circle at 40% 40%, #e5ffe8, #6ec48b);
  bottom: -100px;
  left: 60px;
}

.app {
  position: relative;
  z-index: 2;
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 20px 60px;
}

.hero {
  overflow: hidden;
  margin-bottom: 24px;
  animation: fadeIn 0.6s ease both;
}

.brand {
  float: left;
  display: inline-block;
}

.brand-mark {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: linear-gradient(135deg, #2bb673, #94e5b0);
  display: inline-block;
  vertical-align: middle;
  margin-right: 12px;
  box-shadow: 0 10px 25px rgba(43, 182, 115, 0.35);
  position: relative;
}

.brand-mark::before {
  content: "";
  position: absolute;
  width: 24px;
  height: 30px;
  background: #e6fff0;
  border-radius: 70% 70% 60% 60% / 75% 75% 45% 45%;
  top: 10px;
  left: 14px;
  transform: rotate(-18deg);
}

.brand-mark::after {
  content: "";
  position: absolute;
  width: 6px;
  height: 16px;
  background: #1e7a51;
  border-radius: 999px;
  top: 24px;
  left: 24px;
  transform: rotate(-18deg);
}

.brand-title {
  font-size: 28px;
  letter-spacing: 2px;
  font-weight: bold;
  display: inline-block;
  vertical-align: middle;
}

.brand-sub {
  font-size: 14px;
  color: #5b6f65;
  color: var(--muted);
  margin-top: 6px;
}

.hero-meta {
  float: right;
  text-align: right;
}

.hero-actions {
  margin-bottom: 8px;
}

.status {
  font-size: 13px;
  color: #5b6f65;
  color: var(--muted);
  margin-top: 8px;
}

.user-bar {
  margin-top: 8px;
}

.user-bar span {
  margin-right: 12px;
  font-weight: bold;
}

.hidden {
  display: none;
}

.card {
  background: #f6fff9;
  background: var(--card);
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 18px 45px rgba(27, 42, 36, 0.08), 0 2px 8px rgba(27, 42, 36, 0.08);
  margin-bottom: 24px;
  animation: riseIn 0.5s ease both;
}

.login-card {
  max-width: 420px;
}

.reset-card {
  max-width: 460px;
}

.share-view {
  max-width: 760px;
}

.workspace {
  overflow: hidden;
}

.clip-card {
  float: left;
  width: 60%;
  margin-right: 2%;
}

.admin-card {
  float: left;
  width: 38%;
}

.admin-panel .card {
  margin-bottom: 24px;
}

.card-header {
  overflow: hidden;
  margin-bottom: 16px;
}

.card-header h2 {
  margin: 0 0 6px;
}

.sub {
  font-size: 13px;
  color: #5b6f65;
  color: var(--muted);
}

.pill {
  float: right;
  background: #dff5e8;
  color: #1e7a51;
  color: var(--accent-dark);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  margin-top: 6px;
}

.pill.saved {
  background: #d9f4e2;
  color: #1e7a51;
}

.pill.unsaved {
  background: #f6e8d9;
  color: #9a6b25;
}

.form label {
  display: block;
  margin-bottom: 14px;
}

.form span {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  color: #5b6f65;
  color: var(--muted);
}

.form input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #cde4d7;
  background: #fff;
  font-size: 14px;
  font-family: "Trebuchet MS", "Lucida Grande", "Verdana", sans-serif;
}

.form select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #cde4d7;
  background: #fff;
  font-size: 14px;
  font-family: "Trebuchet MS", "Lucida Grande", "Verdana", sans-serif;
}

.inline-form label {
  display: inline-block;
  width: 45%;
  margin-right: 4%;
}

.inline-form label:last-child {
  margin-right: 0;
}

.inline-form .btn {
  margin-top: 4px;
}

.checkbox-row {
  display: inline-block;
  width: 45%;
  vertical-align: top;
}

.checkbox-row input {
  margin-top: 6px;
}

.hint {
  margin-top: 8px;
  font-size: 12px;
  color: #5b6f65;
  color: var(--muted);
}

.divider {
  height: 1px;
  background: #d7eadf;
  margin: 18px 0;
}

.toggle-links {
  margin-bottom: 10px;
}

.toggle-links .btn {
  margin-right: 8px;
}

.toolbar {
  margin-bottom: 14px;
}

.panel-hint {
  background: #f1fbf5;
  border: 1px dashed #bfe0cf;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 13px;
  color: #1e7a51;
  margin-bottom: 14px;
  overflow: hidden;
}

.panel-hint span {
  float: left;
}

.panel-hint .btn {
  float: right;
  margin-right: 0;
}

.btn {
  display: inline-block;
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid #b8d7c7;
  background: #eaf7f0;
  color: #1b2a24;
  text-decoration: none;
  cursor: pointer;
  font-size: 14px;
  font-family: "Trebuchet MS", "Lucida Grande", "Verdana", sans-serif;
  transition: all 0.2s ease;
  margin-right: 8px;
}

.btn.small {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 999px;
}

.btn.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: linear-gradient(120deg, #f0fff7, #ddf5e7);
  border-color: #bfe0cf;
  font-size: 13px;
  box-shadow: 0 10px 18px rgba(43, 182, 115, 0.18);
}

.btn.theme-toggle .toggle-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #2bb673;
  box-shadow: 0 0 0 4px rgba(43, 182, 115, 0.18);
}

.btn.theme-toggle.active {
  background: #1f2a26;
  border-color: #31433a;
  color: #e3f2e8;
}

.btn.theme-toggle.active .toggle-dot {
  background: #9be7c0;
  box-shadow: 0 0 0 4px rgba(155, 231, 192, 0.18);
}

.btn.primary {
  background: #2bb673;
  background: var(--accent);
  border-color: #2bb673;
  color: #fff;
  box-shadow: 0 10px 20px rgba(43, 182, 115, 0.25);
}

.btn.ghost {
  background: transparent;
  border-color: #cde4d7;
}

.btn:hover {
  transform: translateY(-1px);
}

.toggle {
  display: inline-block;
  margin-right: 12px;
  font-size: 13px;
  color: #5b6f65;
  color: var(--muted);
}

.toggle input {
  margin-right: 6px;
}

.clip-input {
  width: 100%;
  min-height: 340px;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid #cde4d7;
  background: #fff;
  font-size: 14px;
  line-height: 1.6;
  font-family: "Trebuchet MS", "Lucida Grande", "Verdana", sans-serif;
  resize: vertical;
}

.clip-input.code-mode {
  font-family: "Courier New", "Lucida Console", "Consolas", monospace;
  background: #f0fbf4;
}

.meta {
  margin-top: 10px;
  font-size: 12px;
  color: #5b6f65;
  color: var(--muted);
  overflow: hidden;
}

.meta div {
  float: left;
  margin-right: 18px;
}

.font-control {
  white-space: nowrap;
}

.font-control span {
  margin-right: 6px;
}

.font-control .btn {
  margin-right: 6px;
}

.user-list {
  margin-top: 16px;
}

.user-row {
  padding: 10px 0;
  border-bottom: 1px solid #d7eadf;
  overflow: hidden;
}

.user-row:last-child {
  border-bottom: none;
}

.user-info {
  float: left;
  width: 55%;
}

.user-actions {
  float: right;
  width: 45%;
  text-align: right;
}

.user-info strong {
  display: block;
}

.user-info span {
  font-size: 12px;
  color: #5b6f65;
  color: var(--muted);
  display: block;
  margin-top: 2px;
}

.admin-section {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px dashed #d7eadf;
}

.section-title {
  font-size: 13px;
  color: #5b6f65;
  color: var(--muted);
  margin-bottom: 10px;
}

.stats {
  font-size: 12px;
  color: #5b6f65;
  color: var(--muted);
  margin-top: 8px;
  overflow: hidden;
}

.stats div {
  float: left;
  margin-right: 16px;
}

.share-section {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px dashed #d7eadf;
}

.share-head {
  font-size: 13px;
  color: #5b6f65;
  color: var(--muted);
  margin-bottom: 8px;
}

.share-actions {
  margin-bottom: 10px;
}

.share-info label {
  margin-bottom: 10px;
}

.share-info {
  background: #f7fffb;
  border: 1px solid #d7eadf;
  border-radius: 14px;
  padding: 12px;
}

.share-row {
  overflow: hidden;
}

.share-row input {
  float: left;
  width: 70%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #cfe0d5;
  background: #fff;
  font-size: 13px;
}

.share-row .btn {
  float: right;
  width: 28%;
  margin-right: 0;
  padding: 10px 12px;
}

.share-exp {
  font-size: 12px;
  color: #5b6f65;
  color: var(--muted);
  margin-top: 6px;
}

.code-form .btn {
  margin-top: 4px;
}

.sidebar {
  float: left;
  width: 22%;
  margin-right: 2%;
}

.main {
  float: left;
  width: 34%;
  margin-right: 2%;
}

.editor {
  float: left;
  width: 40%;
}

.editor-hidden .editor {
  display: none;
}

.editor-hidden .sidebar,
.editor-hidden .main {
  float: none;
  width: 100%;
  margin-right: 0;
}

.page-mode .sidebar,
.page-mode .main {
  display: none;
}

.page-mode .editor {
  float: none;
  width: 100%;
}

.search-bar {
  margin-bottom: 16px;
  background: #f3fff8;
  border: 1px solid #cfe7d9;
  border-radius: 14px;
  padding: 8px;
  box-shadow: 0 8px 18px rgba(43, 182, 115, 0.08);
}

.search-bar input {
  width: 70%;
  margin-right: 6px;
  border: none;
  background: transparent;
  box-shadow: none;
  padding: 10px 12px;
  font-size: 14px;
}

.search-bar .btn {
  margin-right: 0;
}

.list {
  margin-bottom: 12px;
}

.list-item {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #d7eadf;
  margin-bottom: 8px;
  cursor: pointer;
  background: #ffffff;
}

.list-item.active {
  border-color: #2bb673;
  box-shadow: 0 8px 16px rgba(43, 182, 115, 0.15);
}

.note-list {
  margin-top: 10px;
}

.note-item-title {
  font-weight: bold;
  margin-bottom: 4px;
}

.note-item-meta {
  font-size: 12px;
  color: #5b6f65;
}

.note-preview {
  background: #ffffff;
  border: 1px solid #cde4d7;
  border-radius: 12px;
  padding: 16px;
  min-height: 220px;
  white-space: pre-wrap;
  line-height: 1.6;
}

.note-preview h1,
.note-preview h2,
.note-preview h3 {
  margin: 12px 0 8px;
}

.note-preview code {
  background: #edf8f2;
  padding: 2px 4px;
  border-radius: 6px;
}

.note-preview pre {
  background: #f3fbf6;
  border: 1px solid #cde4d7;
  border-radius: 12px;
  padding: 12px;
  margin: 10px 0;
  overflow-x: auto;
  line-height: 1.5;
  font-size: 13px;
}

.note-preview pre code {
  background: transparent;
  padding: 0;
}

body.theme-dark .bg-orb {
  opacity: 0.25;
}

body.theme-dark .orb-a {
  background: radial-gradient(circle at 30% 30%, #1f3a2f, #1a5a42);
}

body.theme-dark .orb-b {
  background: radial-gradient(circle at 40% 40%, #1b2f27, #264a3a);
}

body.theme-dark .orb-c {
  background: radial-gradient(circle at 40% 40%, #1b2f27, #1a5a42);
}

body.theme-dark .card {
  background: var(--card);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.35), 0 2px 8px rgba(0, 0, 0, 0.35);
}

body.theme-dark .btn {
  background: #223129;
  border-color: #31433a;
  color: #e3f2e8;
}

body.theme-dark .panel-hint {
  background: #142019;
  border-color: #2a4036;
  color: #9be7c0;
}

body.theme-dark .btn.theme-toggle {
  background: #1f2a26;
  border-color: #31433a;
  color: #e3f2e8;
}

body.theme-dark .btn.theme-toggle .toggle-dot {
  background: #9be7c0;
  box-shadow: 0 0 0 4px rgba(155, 231, 192, 0.18);
}

body.theme-dark .btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

body.theme-dark .btn.ghost {
  background: transparent;
  border-color: #31433a;
}

body.theme-dark .form input,
body.theme-dark .form select,
body.theme-dark .search-bar input,
body.theme-dark .clip-input {
  background: #101a16;
  border-color: #2a4036;
  color: #e3f2e8;
}

body.theme-dark .search-bar {
  background: #142019;
  border-color: #2a4036;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
}

body.theme-dark .share-info {
  background: #142019;
  border-color: #2a4036;
}

body.theme-dark .share-row input {
  background: #101a16;
  border-color: #2a4036;
  color: #e3f2e8;
}

body.theme-dark .list-item {
  background: #18241f;
  border-color: #2a4036;
}

body.theme-dark .list-item.active {
  border-color: var(--accent);
  box-shadow: 0 8px 16px rgba(63, 191, 133, 0.2);
}

body.theme-dark .note-preview {
  background: #101a16;
  border-color: #2a4036;
  color: #e3f2e8;
}

body.theme-dark .note-preview code {
  background: #223129;
}

body.theme-dark .note-preview pre {
  background: #101a16;
  border-color: #2a4036;
}

body.theme-dark .pill {
  background: #223129;
  color: #9be7c0;
}

body.theme-dark .pill.unsaved {
  background: #3b2f23;
  color: #e3b36c;
}

body.theme-dark .divider {
  border-color: #2a4036;
}

body.theme-dark .status,
body.theme-dark .sub,
body.theme-dark .note-item-meta,
body.theme-dark .share-exp,
body.theme-dark .form span,
body.theme-dark .toggle {
  color: var(--muted);
}

.version-panel {
  margin-top: 16px;
  border-top: 1px dashed #d7eadf;
  padding-top: 12px;
}

.share-panel {
  margin-top: 16px;
  border-top: 1px dashed #d7eadf;
  padding-top: 12px;
}

.panel-head {
  overflow: hidden;
  margin-bottom: 8px;
}

.panel-head .section-title {
  float: left;
}

.panel-head .btn {
  float: right;
  margin-right: 0;
}

.list-card {
  min-height: 420px;
}

@media (max-width: 900px) {
  .brand,
  .hero-meta {
    float: none;
    text-align: left;
  }

  .clip-card,
  .admin-card {
    float: none;
    width: 100%;
    margin-right: 0;
  }

  .sidebar,
  .main,
  .editor {
    float: none;
    width: 100%;
    margin-right: 0;
  }

  .editor-hidden .main {
    width: 100%;
  }

  .search-bar input {
    display: block;
    width: 100%;
    margin-bottom: 8px;
  }

  .search-bar .btn {
    display: block;
    width: 100%;
  }

  .inline-form label {
    display: block;
    width: 100%;
    margin-right: 0;
  }

  .user-actions {
    text-align: left;
    margin-top: 6px;
  }

  .share-row input,
  .share-row .btn {
    float: none;
    width: 100%;
    margin-right: 0;
    margin-bottom: 6px;
  }

  .checkbox-row {
    width: 100%;
  }

  .stats div {
    float: none;
    margin-right: 0;
    margin-bottom: 4px;
  }

  .meta div {
    float: none;
    margin-right: 0;
    margin-bottom: 6px;
  }
}

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

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
