:root {
  --bg: #ffffff;
  --bg-secondary: #f4f4f5;
  --text: #18181b;
  --text-hint: #71717a;
  --accent: #2aabee;
  --accent-text: #ffffff;
  --border: #e4e4e7;
  --danger: #e5484d;
}

[data-theme="dark"] {
  --bg: #1f1f1f;
  --bg-secondary: #2a2a2b;
  --text: #f4f4f5;
  --text-hint: #a1a1aa;
  --accent: #2aabee;
  --accent-text: #ffffff;
  --border: #3f3f46;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

header {
  position: sticky;
  top: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
  z-index: 10;
}

header .title {
  font-size: 18px;
  font-weight: 700;
  margin: 0;
}

main {
  padding: 16px;
  max-width: 720px;
  margin: 0 auto;
}

.search {
  width: 100%;
  padding: 10px 12px;
  font-size: 15px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-secondary);
  color: var(--text);
  margin-bottom: 16px;
}

.article-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.article-item {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
}

.article-item:hover {
  border-color: var(--accent);
}

.article-view {
  display: none;
}

.article-view h1 {
  font-size: 22px;
  margin: 8px 0 12px;
}

.back-btn,
.btn {
  background: var(--accent);
  color: var(--accent-text);
  border: none;
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.btn-secondary {
  background: var(--bg-secondary);
  color: var(--text);
  border: 1px solid var(--border);
}

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

.btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

.back-btn {
  margin-bottom: 8px;
}

.content-body {
  font-size: 15px;
  overflow-wrap: anywhere;
}

.content-body h1,
.content-body h2,
.content-body h3 {
  margin: 18px 0 8px;
  line-height: 1.3;
}

.content-body p {
  margin: 8px 0;
}

.content-body ul,
.content-body ol {
  padding-left: 22px;
}

.content-body li {
  margin: 4px 0;
}

.content-body a {
  color: var(--accent);
}

.content-body code {
  background: var(--bg-secondary);
  padding: 2px 5px;
  border-radius: 4px;
  font-size: 13px;
}

.content-body blockquote {
  margin: 8px 0;
  padding: 6px 12px;
  border-left: 3px solid var(--accent);
  background: var(--bg-secondary);
  border-radius: 0 8px 8px 0;
}

.admin-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.empty {
  color: var(--text-hint);
  text-align: center;
  padding: 32px 0;
}

.notice {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text-hint);
  margin-bottom: 16px;
}

/* Admin */
.input,
.textarea {
  width: 100%;
  padding: 10px 12px;
  font-size: 15px;
  font-family: inherit;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-secondary);
  color: var(--text);
  margin-bottom: 12px;
}

.textarea {
  min-height: 260px;
  resize: vertical;
}

.form-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.admin-list-item {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.admin-list-item .item-title {
  font-weight: 600;
  font-size: 15px;
}

.row-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.badge {
  display: inline-block;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-text);
}