/* Alongwith v0.0.1 — complete stylesheet */

:root {
  --bg: #f7f7f5;
  --surface: #ffffff;
  --border: #e2e0dc;
  --text: #2c2c2c;
  --text-muted: #7a7a7a;
  --accent: #4a6cf7;
  --accent-dim: #eef0ff;
  --accent-bold: #3b55d9;
  --danger: #dc2626;
  --danger-dim: #fef2f2;
  --success: #166534;
  --success-dim: #dcfce7;
  --warn-bg: #fef3c7;
  --warn-text: #92400e;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

/* --- Typography --- */
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.3; margin: 1.5rem 0 0.5rem; }
h1 { font-size: 1.8rem; color: var(--text); }
h2 { font-size: 1.4rem; color: var(--text); }
h3 { font-size: 1.15rem; color: var(--text); }
p { margin: 0.6rem 0; }
code { background: var(--border); color: var(--text); padding: 0.15rem 0.4rem; border-radius: 4px; font-size: 0.9em; }
pre { background: #1e1e1e; color: #d4d4d4; padding: 1rem; border-radius: 6px; overflow-x: auto; margin: 1rem 0; }
pre code { background: none; padding: 0; }
blockquote { border-left: 3px solid var(--accent); padding-left: 1rem; color: var(--text-muted); margin: 1rem 0; }
img { max-width: 100%; border-radius: 4px; }

/* --- Layout --- */
.site-header { margin-bottom: 2rem; border-bottom: 1px solid var(--border); padding-bottom: 0.75rem; }
.site-header h1 { margin: 0 0 0.4rem; font-size: 1.3rem; }
.site-header h1 a { color: var(--text); }
.site-header .tagline { color: var(--text-muted); font-size: 0.9rem; }

/* --- Navigation --- */
.site-nav { display: flex; gap: 0.25rem; flex-wrap: wrap; align-items: center; }
.site-nav a {
  padding: 0.3rem 0.75rem; border-radius: 6px; color: var(--text-muted);
  font-size: 0.9rem; transition: background 0.15s, color 0.15s;
}
.site-nav a:hover { background: var(--accent-dim); color: var(--accent); text-decoration: none; }
.site-nav a.active { color: var(--accent); font-weight: 600; background: var(--accent-dim); }
.theme-picker {
  padding: 0.3rem 0.5rem; border: 1px solid var(--border); border-radius: 6px;
  background: var(--surface); color: var(--text); font-size: 0.85rem; cursor: pointer;
  margin-left: 0.5rem;
}
.theme-picker:focus { outline: none; border-color: var(--accent); }
.site-footer { margin-top: 3rem; padding-top: 1rem; border-top: 1px solid var(--border); color: var(--text-muted); font-size: 0.85rem; text-align: center; }

/* --- Article list --- */
.article-list { list-style: none; }
.article-item { padding: 1rem 0; border-bottom: 1px solid var(--border); }
.article-item:hover { background: rgba(0,0,0,0.01); margin: 0 -0.5rem; padding-left: 0.5rem; padding-right: 0.5rem; border-radius: 4px; }
.article-item .meta { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.2rem; }
.article-item h3 { margin: 0.2rem 0; font-size: 1.1rem; }
.article-item .author { font-size: 0.85rem; color: var(--text-muted); }

/* --- Search + toolbar --- */
.toolbar { display: flex; gap: 0.5rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.toolbar input, .toolbar select, .toolbar button {
  padding: 0.5rem 0.75rem; border: 1px solid var(--border); border-radius: 8px;
  font-size: 0.95rem; background: var(--surface); color: var(--text);
}
.toolbar input { flex: 1; min-width: 200px; }
.toolbar input:focus, .toolbar select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-dim); }
.toolbar button { background: var(--accent); color: #fff; border-color: var(--accent); cursor: pointer; font-weight: 600; }
.toolbar button:hover { background: var(--accent-bold); border-color: var(--accent-bold); }

/* --- Pagination --- */
.pagination { display: flex; gap: 0.5rem; justify-content: center; margin: 1.5rem 0; }
.pagination a { padding: 0.4rem 0.8rem; border: 1px solid var(--border); border-radius: 6px; color: var(--text); transition: background 0.15s; }
.pagination a:hover { background: var(--accent-dim); text-decoration: none; }
.pagination a.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* --- Review queue (homepage) --- */
.review-queue { margin-top: 2rem; }
.review-queue h2 { font-size: 1.1rem; color: var(--warn-text); margin-bottom: 0.5rem; }
.review-item { padding: 0.5rem 0; border-bottom: 1px dashed var(--border); font-size: 0.9rem; }
.review-item .badge { background: var(--warn-bg); color: var(--warn-text); padding: 0.1rem 0.5rem; border-radius: 4px; font-size: 0.8rem; margin-left: 0.5rem; }

/* --- Article detail --- */
.article-full h1 { margin-top: 0; }
.article-full .meta { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 1.5rem; }
.cc0-notice { margin-top: 2rem; padding: 1rem; background: var(--accent-dim); border-radius: 8px; font-size: 0.85rem; color: var(--text-muted); }

/* --- Forms --- */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; margin-bottom: 0.3rem; font-weight: 600; font-size: 0.9rem; color: var(--text); }
.form-group input, .form-group textarea, .form-group select {
  width: 100%; padding: 0.6rem; border: 1px solid var(--border); border-radius: 8px;
  font-size: 0.95rem; font-family: inherit; background: var(--surface); color: var(--text); transition: border-color 0.15s, box-shadow 0.15s;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-dim); }
.form-group textarea { min-height: 300px; resize: vertical; }
.form-group .hint { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.2rem; }
.form-actions { display: flex; gap: 0.5rem; margin-top: 1.5rem; }

/* --- File input styling --- */
input[type="file"] { font-size: 0.9rem; padding: 0.4rem 0; color: var(--text-muted); }
input[type="file"]::file-selector-button {
  padding: 0.35rem 0.75rem; border: 1px solid var(--border); border-radius: 6px;
  background: var(--surface); color: var(--text); cursor: pointer; font-size: 0.85rem;
  margin-right: 0.5rem; transition: background 0.15s, border-color 0.15s;
}
input[type="file"]::file-selector-button:hover { background: var(--accent-dim); border-color: var(--accent); }

/* --- Token area --- */
.token-area { border: 1px solid var(--border); border-radius: 8px; padding: 1rem; margin: 1rem 0; background: var(--bg); }

/* --- Editor (submit page) --- */
.editor-container { margin: 1rem 0; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.editor-container textarea {
  width: 100%; height: 400px; border: none; resize: vertical; padding: 1rem;
  font-family: "SF Mono", "Menlo", monospace; font-size: 0.9rem; display: block;
  background: var(--surface); color: var(--text);
}
.editor-preview { padding: 1rem; overflow-y: auto; min-height: 400px; background: var(--surface); color: var(--text); }
.editor-toolbar { display: flex; justify-content: space-between; align-items: stretch; border-bottom: 1px solid var(--border); }
.toolbar-editor { display: flex; gap: 0.25rem; padding: 0.4rem; flex-wrap: wrap; }
.toolbar-editor button {
  padding: 0.3rem 0.6rem; border: 1px solid var(--border); border-radius: 5px;
  background: var(--surface); color: var(--text); cursor: pointer; font-size: 0.85rem; transition: background 0.15s;
}
.toolbar-editor button:hover { background: var(--accent-dim); }
.toggle-btn {
  padding: 0.3rem 0.8rem; border: none; border-left: 1px solid var(--border);
  background: var(--surface); color: var(--accent); font-weight: 600;
  cursor: pointer; font-size: 0.85rem; white-space: nowrap;
}
.toggle-btn:hover { background: var(--accent-dim); }
.img-highlight { background: var(--warn-bg); padding: 2px 0; cursor: pointer; border-radius: 3px; }

/* --- Step indicator --- */
.step-bar { display: flex; align-items: center; gap: 0; margin-bottom: 1.5rem; font-size: 0.9rem; }
.step { display: flex; align-items: center; gap: 0.35rem; padding: 0.4rem 0.75rem; border-radius: 6px; color: var(--text-muted); background: var(--bg); }
.step.active { color: var(--accent); background: var(--accent-dim); font-weight: 600; }
.step-num { display: inline-flex; width: 22px; height: 22px; align-items: center; justify-content: center; border-radius: 50%; background: var(--border); color: var(--text-muted); font-size: 0.75rem; font-weight: 700; }
.step.active .step-num { background: var(--accent); color: #fff; }
.step-arrow { color: var(--border); padding: 0 0.35rem; font-size: 0.8rem; }
.step-badge { background: var(--accent); color: #fff; font-size: 0.65rem; padding: 0 0.35rem; border-radius: 8px; }
.step-panel { min-height: 200px; }
.step-desc { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 1rem; }
.btn-primary { padding: 0.5rem 1.25rem; background: var(--accent); color: #fff; border: none; border-radius: 8px; cursor: pointer; font-size: 0.95rem; font-weight: 600; transition: background 0.15s; }
.btn-primary:hover { background: var(--accent-bold); }

/* --- Image cards (submit step 2) --- */
.image-grid { display: flex; flex-direction: column; gap: 0.5rem; }
.img-card { border: 1px solid var(--border); border-radius: 8px; padding: 0.75rem; background: var(--surface); }
.img-card.done { border-color: var(--success); background: var(--success-dim); }
.img-card-header { display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem; margin-bottom: 0.3rem; }
.img-card-name { font-weight: 700; font-size: 0.95rem; }
.img-card-status { font-size: 0.8rem; white-space: nowrap; }
.img-card.done .img-card-status { color: var(--success); }
.img-card-src { font-size: 0.8rem; color: var(--text-muted); display: block; margin-bottom: 0.5rem; word-break: break-all; }
.img-card-actions { display: flex; gap: 0.5rem; }

/* --- Messages --- */
.error-msg { color: var(--danger); background: var(--danger-dim); padding: 0.5rem 1rem; border-radius: 6px; margin: 0.5rem 0; font-size: 0.9rem; }
.success-msg { color: var(--success); background: var(--success-dim); padding: 0.5rem 1rem; border-radius: 6px; margin: 0.5rem 0; font-size: 0.9rem; }
.hidden { display: none; }

/* --- Buttons --- */
.btn-sm {
  padding: 0.35rem 0.65rem; font-size: 0.8rem; border-radius: 6px; border: 1px solid var(--border);
  cursor: pointer; background: var(--surface); color: var(--text);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.btn-sm:hover { background: var(--accent-dim); text-decoration: none; }
.btn-sm.primary { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 500; }
.btn-sm.primary:hover { background: var(--accent-bold); border-color: var(--accent-bold); }
.btn-sm.danger { color: var(--danger); border-color: var(--border); }
.btn-sm.danger:hover { background: var(--danger-dim); border-color: var(--danger); }

/* --- Admin layout --- */
.admin-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 1.5rem; flex-wrap: wrap; gap: 0.5rem; }
.admin-header h2 { margin: 0; }
.admin-meta { color: var(--text-muted); font-size: 0.9rem; }

/* --- Admin tabs --- */
.admin-tabs { display: flex; gap: 0; margin-bottom: 1.5rem; border-bottom: 1px solid var(--border); }
.admin-tab {
  padding: 0.5rem 1rem; font-size: 0.95rem; color: var(--text-muted); text-decoration: none;
  border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color 0.15s, border-color 0.15s;
}
.admin-tab:hover { color: var(--text); text-decoration: none; }
.admin-tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.tab-badge { background: var(--accent); color: #fff; font-size: 0.7rem; padding: 0.05rem 0.4rem; border-radius: 8px; margin-left: 0.3rem; }

/* --- Admin cards --- */
.tab-panel { min-height: 200px; }
.admin-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.admin-card { border: 1px solid var(--border); border-radius: 8px; padding: 1rem; background: var(--surface); }
.admin-card h3 { margin: 0 0 0.75rem; font-size: 1rem; }
.card-desc { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 0.75rem; }

/* --- Inline forms --- */
.inline-form { display: flex; gap: 0.5rem; margin-bottom: 0.75rem; flex-wrap: wrap; }
.inline-form input { padding: 0.35rem 0.5rem; border: 1px solid var(--border); border-radius: 6px; font-size: 0.9rem; background: var(--surface); color: var(--text); }
.inline-form input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-dim); }

/* --- List rows (admin) --- */
.list-row { display: flex; justify-content: space-between; align-items: center; padding: 0.45rem 0; border-bottom: 1px solid var(--border); gap: 0.5rem; }
.list-row:last-child { border-bottom: none; }
.empty-state { color: var(--text-muted); font-size: 0.9rem; padding: 1rem 0; }

/* --- Search bar --- */
.search-bar { display: flex; gap: 0.5rem; margin-bottom: 0.75rem; }
.search-bar input { flex: 1; padding: 0.4rem 0.5rem; border: 1px solid var(--border); border-radius: 6px; font-size: 0.9rem; background: var(--surface); color: var(--text); }
.search-bar input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-dim); }

/* --- Review rows (admin) --- */
.review-row {
  padding: 0.5rem 0; border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center; gap: 0.5rem;
}
.review-mine { flex-direction: column; align-items: stretch; }
.review-header {
  display: flex; justify-content: space-between; align-items: center;
  cursor: pointer; padding: 0.25rem 0;
}
.review-header:hover { color: var(--accent); }
.expand-icon { font-size: 0.75rem; color: var(--text-muted); }
.review-preview {
  border: 1px solid var(--border); border-radius: 6px; padding: 1rem;
  margin: 0.5rem 0; background: var(--surface); color: var(--text); max-height: 400px; overflow-y: auto;
  font-size: 0.9rem; line-height: 1.6;
}
.review-preview h1, .review-preview h2, .review-preview h3 { margin-top: 0.5rem; margin-bottom: 0.3rem; font-size: 1rem; }
.review-preview p { margin: 0.4rem 0; }
.review-preview pre { max-height: 200px; overflow-x: auto; }
.review-preview img { max-width: 100%; }
.review-actions { display: flex; gap: 0.35rem; margin-top: 0.25rem; }
.review-content img { max-width: 100%; }

/* --- File drop zone --- */
.drop-zone {
  border: 2px dashed var(--border); border-radius: 10px; padding: 2rem;
  text-align: center; color: var(--text-muted); cursor: pointer;
  transition: border-color 0.2s, background 0.2s; margin-bottom: 1.5rem;
}
.drop-zone:hover, .drop-zone.drag-over { border-color: var(--accent); background: var(--accent-dim); color: var(--accent); }
.drop-zone .dz-icon { font-size: 2rem; margin-bottom: 0.5rem; display: block; }
.drop-zone .dz-hint { font-size: 0.85rem; }

/* --- Action cards (homepage) --- */
.action-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0.75rem; margin: 1.5rem 0; }
.action-card {
  border: 1px solid var(--border); border-radius: 10px; padding: 1rem;
  text-decoration: none; color: var(--text); transition: border-color 0.2s, box-shadow 0.2s;
  display: flex; flex-direction: column; gap: 0.25rem; background: var(--surface);
}
.action-card:hover { border-color: var(--accent); box-shadow: 0 2px 8px rgba(0,0,0,0.06); text-decoration: none; }
.action-card .ac-icon { font-size: 1.4rem; }
.action-card .ac-label { font-weight: 600; font-size: 0.95rem; }
.action-card .ac-desc { font-size: 0.82rem; color: var(--text-muted); }
.action-card .ac-badge { align-self: flex-start; background: var(--warn-bg); color: var(--warn-text); padding: 0.1rem 0.5rem; border-radius: 4px; font-size: 0.75rem; margin-top: 0.25rem; }

/* --- Responsive --- */
@media (max-width: 700px) {
  .editor-container { grid-template-columns: 1fr; }
  .toolbar { flex-direction: column; }
  .admin-columns { grid-template-columns: 1fr; }
  .admin-tabs { overflow-x: auto; }
}
