﻿:root {
  --bg: #f3f7f9;
  --surface: #ffffff;
  --surface-2: #eef3f6;
  --text: #102027;
  --muted: #5b6d75;
  --line: #d8e2e8;
  --primary: #0f766e;
  --primary-strong: #0b5f59;
  --success: #166534;
  --danger: #b42318;
  --shadow: 0 20px 45px -28px rgba(16, 32, 39, 0.35);
  --radius-lg: 18px;
  --radius-md: 12px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1418;
    --surface: #142028;
    --surface-2: #1a2a34;
    --text: #e9f2f7;
    --muted: #b6c6cf;
    --line: #2d3f4b;
    --primary: #2fb7ab;
    --primary-strong: #23958b;
    --success: #3db676;
    --danger: #f97066;
    --shadow: 0 20px 45px -28px rgba(0, 0, 0, 0.55);
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: "Segoe UI", "IBM Plex Sans", "Trebuchet MS", sans-serif;
  background: radial-gradient(circle at top left, rgba(15, 118, 110, 0.14), transparent 44%), var(--bg);
  color: var(--text);
}

a {
  color: inherit;
  text-decoration: none;
}

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

.nav {
  position: sticky;
  top: 0;
  backdrop-filter: blur(10px);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  z-index: 20;
  border-bottom: 1px solid var(--line);
}

.nav-inner {
  height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.15rem;
  font-weight: 700;
}

.brand-badge {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), #5ccfb8);
  box-shadow: var(--shadow);
}

.nav-links,
.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-links a {
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--muted);
  transition: 0.2s ease;
}

.nav-links a:hover {
  color: var(--text);
  background: var(--surface-2);
}

.btn {
  border: 0;
  border-radius: 10px;
  font-size: 0.94rem;
  font-weight: 600;
  padding: 10px 15px;
  cursor: pointer;
  transition: 0.2s ease;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-strong);
}

.btn-soft {
  background: var(--surface-2);
  color: var(--text);
}

.btn-soft:hover {
  filter: brightness(0.98);
}

.hero {
  margin-top: 34px;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 22px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.hero-copy {
  padding: 30px;
}

.hero-copy h1 {
  margin: 0 0 12px;
  font-size: clamp(1.7rem, 2.8vw, 2.6rem);
  line-height: 1.1;
}

.hero-copy p {
  margin: 0;
  color: var(--muted);
  max-width: 48ch;
}

.hero-forms {
  padding: 20px;
}

.quick-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--surface-2);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 16px;
}

.quick-toggle button {
  border: 0;
  background: transparent;
  padding: 10px;
  border-radius: 9px;
  font-weight: 600;
  cursor: pointer;
  color: var(--muted);
}

.quick-toggle button.active {
  background: var(--surface);
  color: var(--text);
}

.quick-pane {
  display: none;
}

.quick-pane.active {
  display: block;
}

.form-row {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 12px;
  font-size: 0.95rem;
  background: var(--surface);
  color: var(--text);
}

textarea {
  min-height: 115px;
  resize: vertical;
}

.section {
  margin-top: 28px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.section h2 {
  margin: 0;
  font-size: 1.2rem;
}

.muted {
  color: var(--muted);
  font-size: 0.92rem;
}

label {
  font-size: 0.9rem;
  color: var(--muted);
}

.banner {
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 12px;
  font-weight: 600;
}

.banner.success {
  background: color-mix(in srgb, var(--success) 15%, transparent);
  border: 1px solid color-mix(in srgb, var(--success) 45%, transparent);
  color: var(--success);
}

.banner.error {
  background: color-mix(in srgb, var(--danger) 15%, transparent);
  border: 1px solid color-mix(in srgb, var(--danger) 45%, transparent);
  color: var(--danger);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 14px;
}

.card {
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.card h3 {
  margin: 0 0 8px;
  font-size: 1.03rem;
  overflow-wrap: anywhere;
}

.card p {
  margin: 0;
  color: var(--muted);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.note-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.note-snippet {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.note-read-content {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 13px;
  color: var(--muted);
  font-size: 0.83rem;
}

.badge {
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
}

.badge.public {
  background: color-mix(in srgb, var(--primary) 18%, transparent);
  color: var(--primary-strong);
}

.badge.private {
  background: color-mix(in srgb, var(--danger) 16%, transparent);
  color: var(--danger);
}

.lock-icon {
  margin-right: 5px;
}

.upload-progress {
  display: none;
  margin-top: 10px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
  height: 12px;
  border: 1px solid var(--line);
  position: relative;
}

.upload-progress.active {
  display: block;
}

.upload-bar {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #5ccfb8);
  transition: width 0.18s linear;
}

.upload-percent {
  display: block;
  margin-top: 8px;
  font-size: 0.82rem;
  color: var(--muted);
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(4, 12, 16, 0.55);
  z-index: 50;
  padding: 20px;
}

.modal.open {
  display: flex;
}

.modal-card {
  width: min(460px, 96vw);
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.upload-result-body {
  color: var(--muted);
  margin: 10px 0 16px;
}

.upload-result-url-wrap {
  margin: 0 0 14px;
  font-size: 0.92rem;
  color: var(--muted);
  word-break: break-all;
}

.upload-result-url-wrap a {
  color: var(--primary);
  text-decoration: underline;
}

.share-modal-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.share-input {
  flex: 1;
}

.share-btn-row {
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
}

.focus-item-image {
  width: 100%;
  max-height: 340px;
  object-fit: contain;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  margin-bottom: 12px;
}

.pagination {
  margin-top: 16px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pagination a,
.pagination span {
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font-size: 0.9rem;
}

.pagination .active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.close-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1.2rem;
  cursor: pointer;
}

.toast-wrap {
  position: fixed;
  right: 18px;
  bottom: 18px;
  display: grid;
  gap: 10px;
  z-index: 60;
}

.toast {
  min-width: 260px;
  max-width: 380px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 12px;
  box-shadow: var(--shadow);
  animation: toast-in 0.24s ease;
}

.toast.success {
  border-left: 5px solid var(--success);
}

.toast.error {
  border-left: 5px solid var(--danger);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.footer {
  margin: 30px 0;
  padding: 18px 0;
  color: var(--muted);
  border-top: 1px solid var(--line);
  text-align: center;
}

@media (max-width: 920px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .nav-inner {
    flex-wrap: wrap;
    height: auto;
    padding: 12px 0;
  }

  .nav-links {
    order: 3;
    width: 100%;
    overflow: auto;
    padding-bottom: 6px;
  }
}

@media (max-width: 640px) {
  .nav-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .hero-copy,
  .hero-forms,
  .modal-card {
    padding: 18px;
  }
}
