*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:           #0d1117;
  --bg-2:         #161b22;
  --bg-3:         #1c2128;

  --border:       #30363d;
  --border-muted: #21262d;
  --border-focus: #388bfd;

  --text:         #e6edf3;
  --text-muted:   #8b949e;
  --text-dim:     #484f58;
  --text-link:    #58a6ff;

  --green:        #238636;
  --green-h:      #2ea043;
  --blue:         #1f6feb;
  --blue-h:       #388bfd;
  --red:          #da3633;
  --red-muted:    #67060c;
  --red-fg:       #ffa198;
  --orange:       #d29922;
  --success:      #3fb950;

  --r:    6px;
  --r-sm: 4px;
  --r-lg: 8px;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --ease: 80ms ease;
  --ease2: 150ms ease;
}

html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: inherit; text-decoration: none; }
input[type="hidden"] { display: none !important; }
code, pre { font-family: var(--mono); }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

.topbar {
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 200;
}
.topbar-inner {
  max-width: 1012px;
  margin: 0 auto;
  padding: 0 16px;
  height: 62px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.wordmark {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  flex-shrink: 0;
}
.wordmark .dot { color: var(--green-h); }

.topbar-search {
  flex: 1;
  max-width: 272px;
  position: relative;
}
.topbar-search-icon {
  position: absolute;
  left: 9px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  pointer-events: none;
  width: 16px;
  height: 16px;
}
.topbar-search-input {
  width: 100%;
  height: 28px;
  padding: 0 56px 0 30px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text);
  font-family: var(--font);
  font-size: 12px;
  outline: none;
  transition: border-color var(--ease2);
}
.topbar-search-input::placeholder { color: var(--text-dim); }
.topbar-search-input:focus { border-color: var(--border-focus); }

.topbar-search-kbd {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 5px;
  font-family: var(--mono);
  pointer-events: none;
}

.nav-links { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.nav-link {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  padding: 5px 10px;
  border-radius: var(--r-sm);
  transition: color var(--ease), background var(--ease);
  white-space: nowrap;
}
.nav-link:hover { color: var(--text); background: var(--bg-3); }

.cta-nav {
  background: var(--green) !important;
  color: #fff !important;
  border-radius: var(--r);
  padding: 5px 14px !important;
  font-weight: 600;
  border: 1px solid rgba(240,246,252,.1) !important;
  margin-left: 6px;
}
.cta-nav:hover { background: var(--green-h) !important; }

.page {
  max-width: 1012px;
  margin: 0 auto;
  padding: 32px 16px 80px;
  flex: 1;
  width: 100%;
}

.page h1 { font-size: 20px; font-weight: 600; margin-bottom: 4px; }
.page h2 { font-size: 15px; font-weight: 600; margin: 28px 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.page p  { color: var(--text-muted); line-height: 1.6; margin-bottom: 12px; font-size: 14px; }
.page ul, .page ol { margin: 0 0 16px 20px; color: var(--text-muted); font-size: 14px; line-height: 1.7; }
.page li { margin-bottom: 3px; }
.page a { color: var(--text-link); }

.back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--text-link);
  margin-bottom: 16px;
}

.back-arrow, .forward-arrow {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.inline-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-link);
}

.btn-primary, .btn-ghost, .btn-danger, .btn-blue {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  padding: 0 14px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--r);
  cursor: pointer;
  text-decoration: none !important;
  border: 1px solid;
  white-space: nowrap;
  transition: background var(--ease), border-color var(--ease);
  user-select: none;
  flex-shrink: 0;
  outline: none;
}
.btn-primary {
  background: var(--green);
  color: #fff !important;
  border-color: rgba(240,246,252,.1);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.1);
}
.btn-primary:hover { background: var(--green-h); }
.btn-blue {
  background: var(--blue);
  color: #fff !important;
  border-color: rgba(240,246,252,.1);
}
.btn-blue:hover { background: var(--blue-h); }
.btn-ghost {
  background: var(--bg-3);
  color: var(--text-muted) !important;
  border-color: var(--border);
}
.btn-ghost:hover { background: var(--bg-2); color: var(--text) !important; border-color: var(--text-dim); }
.btn-danger {
  background: transparent;
  color: var(--red-fg) !important;
  border-color: var(--red-muted);
}
.btn-danger:hover { background: rgba(218,54,51,.12); border-color: var(--red); }
.btn-reset-avatar { width: 100%; }
.hero-btn { height: 34px; }

.alert {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 12px 16px;
  border-radius: var(--r);
  margin-bottom: 16px;
  font-size: 13px;
  line-height: 1.5;
  border: 1px solid;
  text-align: left;
}
.alert.error   { background: rgba(218,54,51,.1);  color: var(--red-fg);  border-color: rgba(218,54,51,.4); }
.alert.success { background: rgba(63,185,80,.1);  color: var(--success); border-color: rgba(63,185,80,.4); }
.alert.warning { background: rgba(210,153,34,.1); color: var(--orange);  border-color: rgba(210,153,34,.4); }

.empty-state {
  padding: 48px 24px;
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
  border: 1px dashed var(--border);
  border-radius: var(--r-lg);
}
.empty-state a { color: var(--text-link); }

.hero {
  padding: 48px 0 40px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
  text-align: center;
}
.hero-title {
  font-size: clamp(22px, 3.5vw, 32px);
  font-weight: 600;
  letter-spacing: -0.4px;
  line-height: 1.3;
  margin-bottom: 12px;
}
.hero-sub {
  font-size: 15px;
  color: var(--text-muted);
  margin: 0 auto 24px auto;
  line-height: 1.6;
  max-width: 540px;
}

.section { margin-bottom: 32px; }
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.section-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-count {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0 6px;
  border-radius: 2em;
  line-height: 18px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}
.card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 14px 16px;
  text-decoration: none !important;
  transition: background var(--ease2), border-color var(--ease2);
}
.card:hover { background: var(--bg-3); border-color: var(--text-dim); }
.card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-link);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}
.card-meta {
  display: flex;
  gap: 10px;
  font-size: 11px;
  color: var(--text-dim);
  font-family: var(--mono);
  align-items: center;
}

.badge {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  padding: 1px 8px;
  border-radius: 2em;
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--text-muted);
  flex-shrink: 0;
  white-space: nowrap;
}
.badge-private {
  font-family: var(--mono);
  font-size: 11px;
  padding: 1px 8px;
  border-radius: 2em;
  background: rgba(218,54,51,.12);
  border: 1px solid rgba(218,54,51,.4);
  color: var(--red-fg);
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.label-optional { font-weight: 400; color: var(--text-dim); font-size: 12px; }

.form-input {
  display: block;
  width: 100%;
  height: 32px;
  padding: 0 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r);
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  outline: none;
  appearance: none;
  transition: border-color var(--ease2);
}
.form-input::placeholder { color: var(--text-dim); }
.form-input:focus { border-color: var(--border-focus); }
.form-input:hover:not(:focus) { border-color: var(--text-dim); }

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%238b949e'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
  cursor: pointer;
}

.form-textarea {
  display: block;
  width: 100%;
  padding: 8px 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r);
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.6;
  resize: none;
  outline: none;
  transition: border-color var(--ease2);
}
.form-textarea:focus { border-color: var(--border-focus); }

.form-group { display: flex; flex-direction: column; gap: 4px; }
.form-row   { display: flex; gap: 12px; flex-wrap: wrap; }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row-inline { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }

.form-note { font-size: 12px; color: var(--text-dim); margin-top: 4px; line-height: 1.5; }
.form-note a { color: var(--text-link); }

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1.5;
}
.checkbox-label input[type="checkbox"] {
  width: 15px; height: 15px;
  margin-top: 2px;
  accent-color: var(--blue);
  flex-shrink: 0;
  cursor: pointer;
}

.field-rules {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 6px;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border-muted);
  border-radius: var(--r);
}
.rule { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); }
.rule.pass { color: var(--success); }
.rule.fail { color: var(--red-fg); }
.rule-icon { display: none; }
.rule.pass::before {
  content: '';
  display: inline-flex;
  width: 13px; height: 13px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%233fb950' stroke-width='2'%3E%3Ccircle cx='8' cy='8' r='7'/%3E%3Cpath d='M5 8l2 2 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  flex-shrink: 0;
}
.turnstile-group { margin-top: 8px; }

.new-paste-header { margin-bottom: 20px; }
.new-paste-header h1 { font-size: 20px; font-weight: 600; }
.page-subtitle { font-size: 13px; color: var(--text-muted); margin-top: 3px; }

.paste-form { display: flex; flex-direction: column; gap: 0; }

.paste-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.paste-card-section {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.paste-card-section:last-child { border-bottom: none; }
.paste-title-section { background: var(--bg); }

.form-input-title {
  width: 100%;
  height: 36px;
  background: transparent;
  border: none;
  outline: none;
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  font-family: var(--font);
  padding: 0;
}
.form-input-title::placeholder { color: var(--text-dim); }

.paste-card-section--editor { padding: 0; }
.editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 14px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
}
.editor-header-left { display: flex; align-items: center; gap: 8px; }
.editor-header-right { display: flex; align-items: center; gap: 6px; }

.lang-select {
  height: 24px;
  padding: 0 22px 0 7px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text-muted);
  font-family: var(--mono);
  font-size: 11px;
  cursor: pointer;
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%238b949e'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 6px center;
  transition: border-color var(--ease), color var(--ease), border-color var(--ease);
}
.lang-select:hover { border-color: var(--text-dim); color: var(--text); }
.lang-select:focus { border-color: var(--border-focus); }

.code-editor {
  display: block;
  width: 100%;
  padding: 14px 16px;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.6;
  background: var(--bg);
  color: #c9d1d9;
  border: none;
  outline: none;
  resize: none;
  min-height: 340px;
  tab-size: 4;
}
.editor-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 6px 14px;
  background: var(--bg-2);
  border-top: 1px solid var(--border);
}
.char-count { font-size: 11px; color: var(--text-dim); font-family: var(--mono); }
.char-count.near-limit { color: var(--orange); }
.char-count.at-limit   { color: var(--red-fg); }

.paste-options-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--bg-2);
}
.paste-options-selects { display: flex; gap: 12px; flex-wrap: wrap; }
.paste-options-selects .form-group { flex: 1; min-width: 130px; }
.paste-options-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.paste-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.paste-header-left { min-width: 0; flex: 1; }
.paste-title {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.3px;
  margin-bottom: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.paste-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--mono);
  flex-wrap: wrap;
}
.paste-meta-sep { color: var(--border); }
.paste-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: flex-start; }

.code-wrap {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  margin-bottom: 16px;
}
.code-wrap-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
}
.code-wrap-filename {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-muted);
}
.code-wrap-actions { display: flex; gap: 6px; }
.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 24px;
  padding: 0 8px;
  font-size: 11px;
  font-family: var(--font);
  font-weight: 500;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text-muted);
  cursor: pointer;
  outline: none;
  transition: background var(--ease), color var(--ease), border-color var(--ease);
}
.copy-btn:hover { background: var(--bg-2); color: var(--text); border-color: var(--text-dim); }
.copy-btn.copied { color: var(--success); border-color: rgba(63,185,80,.4); background: rgba(63,185,80,.08); }

.code-block {
  padding: 14px 16px;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.6;
  color: #c9d1d9;
  overflow-x: auto;
  white-space: pre;
  tab-size: 4;
}

.share-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  margin-bottom: 16px;
}
.share-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  white-space: nowrap;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: .4px;
}
.share-input {
  flex: 1;
  height: 28px;
  padding: 0 8px;
  font-family: var(--mono);
  font-size: 12px;
  background: var(--bg);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  outline: none;
}
.share-input:focus {
  border-color: var(--border-focus);
}

.paste-author-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text);
  border-radius: 2em;
  padding: 3px 10px 3px 3px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  transition: border-color var(--ease2), background var(--ease2);
}
.paste-author-chip:hover { border-color: var(--text-dim); background: var(--bg-2); }
.paste-author-chip:hover .paste-author-chip-name { color: var(--text-link); }
.paste-author-chip-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  font-family: var(--font);
  transition: color var(--ease);
}
.paste-meta-dot { color: var(--text-dim); font-size: 11px; }
.paste-meta-date { font-size: 12px; color: var(--text-dim); font-family: var(--mono); }

.paste-author-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--bg-3);
  color: var(--text-muted);
  font-size: 13px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
  overflow: hidden;
  border: 1.5px solid var(--border);
  flex-shrink: 0;
}
.paste-author-avatar-img  { width: 100%; height: 100%; object-fit: cover; }
.paste-author-avatar-char { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }

.paste-author-bio {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 13px;
}
.bio-label { font-size: 10px; font-weight: 600; color: var(--text-dim); text-transform: uppercase; letter-spacing: .4px; display: block; margin-bottom: 4px; }
.bio-text  { margin: 0 !important; color: var(--text-muted); line-height: 1.5; }

.auth-wrap {
  max-width: 340px;
  margin: 48px auto 0;
  text-align: center;
}
.auth-wrap h1 { font-size: 20px; font-weight: 600; margin-bottom: 4px; }
.auth-sub { color: var(--text-muted); font-size: 13px; margin-bottom: 0; }
.auth-switch {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  text-align: center;
}
.auth-switch a { color: var(--text-link); }

.auth-wrap .form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px;
  margin-top: 16px;
  text-align: left;
}

.account-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.account-avatar {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--bg-3);
  color: var(--text);
  font-size: 26px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  border: 2px solid var(--border);
  flex-shrink: 0;
}
.account-avatar-img  { width: 100%; height: 100%; object-fit: cover; }
.account-avatar-char { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }
.account-sub { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.account-header-info { flex: 1; min-width: 0; }
.account-username { font-size: 22px; font-weight: 700; letter-spacing: -0.3px; margin-bottom: 2px; }
.account-profile-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text-link);
  margin-top: 6px;
}

.profile-settings-section .form {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.profile-layout {
  display: grid;
  grid-template-columns: 176px 1fr;
  align-items: start;
}

.avatar-upload-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 20px 16px;
  border-right: 1px solid var(--border);
  min-height: 100%;
  box-sizing: border-box;
}

#avatarPreviewContainer {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 600;
  color: var(--text-muted);
  flex-shrink: 0;
}
#avatarPreviewContainer img { width: 100%; height: 100%; object-fit: cover; }

.avatar-controls {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}
.avatar-controls .btn-ghost {
  width: 100%;
  height: 28px;
  font-size: 12px;
  padding: 0 8px;
}
.resolution-select-group { display: flex; flex-direction: column; gap: 4px; }
.resolution-select-group .form-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--text-dim);
  margin-bottom: 0;
}
.resolution-select-group .form-input { height: 28px; font-size: 12px; }
.avatar-upload-hint {
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.4;
  text-align: center;
}

.profile-about-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
}

.profile-about-textarea {
  height: 108px;
  resize: none;
  overflow-y: auto;
}

.paste-list {
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.paste-row {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 12px;
  align-items: center;
  padding: 10px 16px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border-muted);
  transition: background var(--ease);
}
.paste-row:last-child { border-bottom: none; }
.paste-row:hover { background: var(--bg-3); }
.paste-row-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-link);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.paste-row-date { font-size: 11px; color: var(--text-dim); font-family: var(--mono); white-space: nowrap; }

.delete-btn {
  font-size: 12px;
  color: var(--text-dim);
  padding: 3px 8px;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  transition: color var(--ease), background var(--ease), border-color var(--ease);
  white-space: nowrap;
}
.delete-btn:hover { color: var(--red-fg); background: rgba(218,54,51,.1); border-color: var(--red-muted); }

.legal-page { margin-top: 16px; margin-bottom: 40px; }
.legal-header {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
.legal-header h1 { 
  font-size: 26px; 
  font-weight: 700; 
  letter-spacing: -0.5px; 
  margin: 0; 
  color: var(--text);
}
.legal-content h2 { 
  margin: 40px 0 16px; 
  font-size: 18px; 
  font-weight: 600;
  color: var(--text); 
  border-bottom: none; 
  padding-bottom: 0; 
}
.legal-content p, .legal-content li { 
  color: var(--text-muted); 
  font-size: 14px; 
  line-height: 1.7; 
}
.legal-content ul { margin-bottom: 24px; margin-left: 20px; }
.lead { 
  font-size: 16px !important; 
  color: var(--text) !important; 
  margin-bottom: 28px !important; 
  line-height: 1.6 !important;
}

.table-responsive { 
  width: 100%; 
  overflow-x: auto; 
  margin: 24px 0 32px; 
}
.legal-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.legal-table th, .legal-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-muted);
  font-size: 13px;
  line-height: 1.5;
}
.legal-table th {
  background: var(--bg-2);
  color: var(--text);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 11px;
}
.legal-table tbody tr { transition: background var(--ease); }
.legal-table tbody tr:hover td { background: rgba(255,255,255,0.02); }
.legal-table tbody tr:last-child td { border-bottom: none; }
.legal-table strong { color: var(--text); }
.legal-table code { 
  font-family: var(--mono); 
  font-size: 11px; 
  background: var(--bg-3); 
  padding: 2px 6px; 
  border-radius: var(--r-sm); 
  border: 1px solid var(--border); 
}

.form-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 24px;
  margin-top: 32px;
}
.form-card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-muted);
}

.cookie-banner {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: min(520px, calc(100vw - 32px));
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 14px 16px;
  z-index: 500;
  box-shadow: 0 8px 24px rgba(0,0,0,.6), 0 0 0 1px rgba(255,255,255,.04);
}
.cookie-content { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.cookie-text { font-size: 12px; color: var(--text-muted); flex: 1; line-height: 1.5; }
.cookie-text strong { color: var(--text); }
.cookie-text a { color: var(--text-link); text-decoration: underline; font-weight: 500; }
.cookie-text a:hover { color: var(--blue-h); }
.cookie-actions { display: flex; gap: 8px; }

.cookie-actions button, .cookie-actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  padding: 0 12px;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 500;
  border-radius: var(--r-sm);
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg-3);
  color: var(--text-muted);
  outline: none;
  transition: background var(--ease), color var(--ease), border-color var(--ease);
}
.cookie-actions button:hover, .cookie-actions .btn:hover {
  background: var(--bg-2);
  color: var(--text);
  border-color: var(--text-dim);
}
.cookie-actions button.accept, .cookie-actions button:first-of-type, .cookie-actions .btn-primary {
  background: var(--green);
  color: #fff;
  border-color: rgba(240,246,252,.1);
}
.cookie-actions button.accept:hover, .cookie-actions button:first-of-type:hover, .cookie-actions .btn-primary:hover {
  background: var(--green-h);
}

.footer {
  border-top: 1px solid var(--border);
  padding: 14px 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  align-items: center;
  font-size: 12px;
  color: var(--text-dim);
  max-width: 1012px;
  width: 100%;
  margin: auto auto 0 auto;
}
.footer-copy { margin-right: auto; }
.footer a { color: var(--text-dim); transition: color var(--ease); }
.footer a:hover { color: var(--text-muted); }

.notice-banner {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 12px 16px;
  border-radius: var(--r);
  border-left: 3px solid var(--blue);
  background: rgba(31,111,235,.08);
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
  line-height: 1.5;
}

@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  width: 13px; height: 13px;
  border: 2px solid var(--border);
  border-top-color: var(--text-muted);
  border-radius: 50%;
  animation: spin .6s linear infinite;
  flex-shrink: 0;
}

.profile-header {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  padding: 28px 0 32px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
}
.profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--border);
  background: var(--bg-3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 700;
  color: var(--text-muted);
  flex-shrink: 0;
}
.profile-avatar-img { width: 100%; height: 100%; object-fit: cover; }
.profile-avatar-char { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }
.profile-info { flex: 1; min-width: 0; padding-top: 4px; }
.profile-username {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.4px;
  margin-bottom: 8px;
  color: var(--text);
}
.profile-bio {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.65;
  max-width: 560px;
  margin-bottom: 0;
}
.profile-bio a { color: var(--text-link); }
.profile-bio-empty {
  font-size: 13px;
  color: var(--text-dim);
  font-style: italic;
}
.author-link { color: inherit; }
.author-link:hover { color: var(--text-link); }

@media (max-width: 480px) {
  .profile-header { gap: 16px; }
  .profile-avatar { width: 64px; height: 64px; font-size: 24px; }
  .profile-username { font-size: 20px; }
}
.comments-section {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.comments-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.comments-scroll-block {
  max-height: 520px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--bg);
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.comments-scroll-block .empty-state {
  border: none;
  border-radius: 0;
}

.comment {
  background: var(--bg-2);
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-muted);
  transition: background var(--ease);
}
.comment:last-child { border-bottom: none; }
.comment:hover { background: var(--bg-3); }

.comment-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.comment-author-link {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  flex-shrink: 0;
}
.comment-author-link:hover .comment-author-name { color: var(--text-link); }
.comment-author-link:hover .comment-avatar { border-color: var(--border-focus); }

.comment-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  border: 1.5px solid var(--border);
  background: var(--bg-3);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: border-color var(--ease2);
}
.comment-avatar-img { width: 100%; height: 100%; object-fit: cover; }
.comment-avatar-char {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  text-transform: uppercase;
}

.comment-author-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  transition: color var(--ease);
}
.comment-date {
  font-size: 11px;
  color: var(--text-dim);
  font-family: var(--mono);
  margin-left: auto;
  white-space: nowrap;
}
.comment-body {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  white-space: pre-wrap;
  padding-left: 46px;
}

.paste-comment-form {
  margin-top: 16px;
  background: var(--bg-2);
  padding: 16px;
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
}

@media (max-width: 768px) {
  .profile-layout {
    grid-template-columns: 1fr;
    align-items: start;
  }
  .avatar-upload-zone {
    min-height: unset;
    border-right: none;
    border-bottom: 1px solid var(--border);
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    padding: 16px;
  }
  #avatarPreviewContainer { width: 64px; height: 64px; font-size: 22px; }
  .avatar-controls { flex: 1; min-width: 120px; }
  .avatar-upload-hint { text-align: left; }
  .paste-row { grid-template-columns: 1fr auto auto; gap: 8px; }
  .paste-row-date { display: none; }
  .form-row-2 { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .topbar-inner { height: auto; padding: 10px 12px; flex-wrap: wrap; gap: 8px; }
  .topbar-search { max-width: 100%; order: 3; flex: 1 1 100%; }
  .nav-links { gap: 2px; }
  .nav-link { padding: 4px 8px; font-size: 12px; }

  .page { padding: 20px 12px 64px; }
  .hero { padding: 28px 0 24px; }
  .hero-title { font-size: 20px; }
  .hero-sub { font-size: 13px; }

  .grid { grid-template-columns: 1fr; }
  .paste-header { flex-direction: column; gap: 10px; }
  .paste-actions { width: 100%; }
  .paste-actions .btn-ghost,
  .paste-actions .btn-danger { flex: 1; }
  .share-box { flex-direction: column; gap: 8px; }
  .share-input { width: 100%; }
  .paste-options-bottom { flex-direction: column; }
  .paste-options-bottom .btn-primary { width: 100%; }
  .form-row { flex-direction: column; }
  .auth-wrap { margin-top: 24px; }
  .code-editor { font-size: 14px; min-height: 240px; }
  .code-block { font-size: 13px; }
  .cookie-banner { bottom: 0; border-radius: var(--r-lg) var(--r-lg) 0 0; width: 100%; }
}