:root {
  --bg: #0f1419;
  --bg-card: #1a1f2e;
  --bg-hover: #252b3d;
  --border: #2d3548;
  --text: #e1e4eb;
  --text-dim: #8892a4;
  --accent: #58a6ff;
  --accent2: #3fb950;
  --accent3: #d29922;
  --accent4: #f97583;
  --code-bg: #161b26;
  --header-bg: #0d1117;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans KR', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 15px;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }

/* Header */
.header {
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
  position: sticky; top: 0; z-index: 100;
}
.header .container { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.header h1 { font-size: 18px; font-weight: 700; white-space: nowrap; }
.header h1 span { color: var(--accent); }
.header h1 a { color: var(--text); }
.header .subtitle { color: var(--text-dim); font-size: 12px; white-space: nowrap; }
.header .nav-links { margin-left: auto; display: flex; gap: 8px; }
.header .nav-links a { font-size: 12px; color: var(--text-dim); padding: 2px 8px; border-radius: 4px; }
.header .nav-links a:hover { color: var(--accent); background: var(--bg-hover); text-decoration: none; }

/* Hero */
.hero {
  text-align: center;
  padding: 48px 0 24px;
}
.hero h2 { font-size: 28px; font-weight: 700; margin-bottom: 8px; }
.hero h2 small { display: block; color: var(--text-dim); font-weight: 400; font-size: 14px; margin-top: 6px; }
.hero p { color: var(--text-dim); font-size: 15px; max-width: 600px; margin: 0 auto; }

/* Stats bar */
.stats-bar {
  display: flex; justify-content: center; gap: 32px;
  padding: 20px 0; margin: 24px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.stat { text-align: center; font-size: 13px; color: var(--text-dim); }
.stat strong { display: block; font-size: 24px; color: var(--accent); margin-bottom: 2px; }

/* Opinion Form */
.opinion-form {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin: 24px 0;
}
.opinion-form h3 { margin-bottom: 16px; font-size: 18px; }
.opinion-form textarea {
  width: 100%;
  padding: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  resize: vertical;
  font-family: inherit;
}
.opinion-form textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.form-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  align-items: center;
}
.form-actions select {
  flex: 1;
  padding: 8px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 13px;
}
.form-actions button {
  padding: 8px 20px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.form-actions button:hover {
  opacity: 0.9;
}

/* Opinions List */
.opinions-list {
  margin: 24px 0;
}
.opinion-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 12px;
  transition: border-color 0.2s;
}
.opinion-card:hover {
  border-color: var(--accent);
}
.opinion-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.opinion-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: #fff;
}
.opinion-meta {
  flex: 1;
}
.opinion-author {
  font-weight: 600;
  font-size: 14px;
}
.opinion-time {
  font-size: 12px;
  color: var(--text-dim);
}
.opinion-category {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--bg);
  color: var(--text-dim);
}
.opinion-content {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-dim);
  margin-bottom: 12px;
}
.opinion-actions {
  display: flex;
  gap: 16px;
  font-size: 12px;
}
.opinion-actions button {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}
.opinion-actions button:hover {
  color: var(--accent);
}
.opinion-actions .liked {
  color: var(--accent4);
}
.delete-btn {
  color: var(--accent4) !important;
}
.delete-btn:hover {
  color: #ff6b7a !important;
}
.delete-comment-btn {
  font-size: 11px;
  padding: 2px 8px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-dim);
  cursor: pointer;
  margin-left: auto;
}
.delete-comment-btn:hover {
  border-color: var(--accent4);
  color: var(--accent4);
}

/* Comments Section */
.comments-section {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.comment {
  padding: 10px 12px;
  background: var(--bg);
  border-radius: 6px;
  margin-bottom: 8px;
  font-size: 13px;
}
.comment:last-child {
  margin-bottom: 0;
}
.comment-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.comment strong {
  color: var(--text);
  font-size: 12px;
}
.comment span {
  color: var(--text-dim);
  font-size: 11px;
}
.comment p {
  color: var(--text-dim);
  margin: 0;
  line-height: 1.5;
}
.comment-form {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.comment-form input {
  flex: 1;
  padding: 8px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 13px;
}
.comment-form input:focus {
  outline: none;
  border-color: var(--accent);
}
.comment-form button {
  padding: 8px 16px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.comment-form button:hover {
  opacity: 0.9;
}

/* Loading */
.loading {
  text-align: center;
  padding: 40px;
  color: var(--text-dim);
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 200;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.7);
}
.modal-content {
  background: var(--bg-card);
  margin: 15% auto;
  padding: 32px;
  border: 1px solid var(--border);
  border-radius: 12px;
  width: 90%;
  max-width: 400px;
  position: relative;
}
.modal-content h2 {
  margin-bottom: 20px;
  font-size: 20px;
}
.modal-content input {
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 14px;
}
.modal-content input:focus {
  outline: none;
  border-color: var(--accent);
}
.modal-content button[type="submit"] {
  width: 100%;
  padding: 10px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 8px;
}
.modal-content button[type="submit"]:hover {
  opacity: 0.9;
}
.close {
  position: absolute;
  right: 16px;
  top: 16px;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-dim);
}
.close:hover {
  color: var(--text);
}

/* GitHub Login */
.github-login-btn {
  display: block;
  width: 100%;
  padding: 12px;
  background: #24292e;
  color: #fff;
  text-align: center;
  border-radius: 6px;
  font-weight: 600;
  text-decoration: none;
  margin-bottom: 16px;
}
.github-login-btn:hover {
  background: #2f363d;
  text-decoration: none;
}
.divider {
  text-align: center;
  margin: 16px 0;
  position: relative;
}
.divider:before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--border);
}
.divider span {
  background: var(--bg-card);
  padding: 0 12px;
  position: relative;
  color: var(--text-dim);
  font-size: 13px;
}
.github-btn {
  background: #24292e;
  color: #fff !important;
  padding: 4px 12px !important;
  border-radius: 4px !important;
}
.github-btn:hover {
  background: #2f363d;
}
#userDisplay {
  font-size: 12px;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 6px;
}
#userDisplay img {
  width: 20px;
  height: 20px;
  border-radius: 50%;
}

/* Category Filter */
.category-filter {
  margin: 16px 0;
  display: flex;
  gap: 8px;
}
.category-filter select {
  flex: 1;
  padding: 10px 12px;
  font-size: 14px;
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%238892a4' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
}
.category-filter select:focus {
  outline: none;
  border-color: var(--accent);
}

/* Footer */
.footer {
  border-top: 1px solid var(--border);
  padding: 24px 0;
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
}

/* Responsive */
@media (max-width: 800px) {
  .header .container { flex-direction: column; align-items: flex-start; }
  .header .nav-links { margin-left: 0; }
  .stats-bar { gap: 16px; }
  .hero { padding: 24px 0 16px; }
  .hero h2 { font-size: 22px; }
  .hero h2 small { font-size: 12px; }
  .hero p { font-size: 13px; }
  .container { padding: 0 16px; }
  .form-actions { flex-wrap: wrap; }
  .category-filter { flex-wrap: wrap; }
}
@media (max-width: 500px) {
  .stats-bar { 
    flex-wrap: wrap; 
    gap: 12px;
    padding: 16px 0;
  }
  .stat { flex: 1; min-width: 45%; }
  .stat strong { font-size: 20px; }
  .opinion-header { flex-wrap: wrap; }
}