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

:root {
  --primary: #6c5ce7;
  --success: #00b894;
  --warning: #ffeaa7;
  --surface: #dfe6e9;
  --ink: #2d3436;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: var(--surface);
  min-height: 100vh;
  padding: 20px;
  color: var(--ink);
}

.container {
  max-width: 1080px;
  margin: 0 auto;
  background: white;
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  overflow: hidden;
}

header {
  background: var(--primary);
  color: white;
  padding: 30px;
  text-align: center;
}

header h1 { font-size: 2em; }
header p { opacity: 0.95; margin-bottom: 10px; }

.repo-link {
  color: white;
  opacity: 0.92;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}
.repo-link:hover { opacity: 1; }

.content { padding: 30px; }
.section { margin-bottom: 30px; }
.section h2 { color: var(--primary); margin-bottom: 15px; font-size: 1.3em; }

.how-to { background: #f8f9fa !important; border-color: #d0d7de !important; }
.how-to ol { padding-left: 16px; color: var(--ink); display: grid; gap: 6px; }

.code-list { list-style: none; }
.code-item {
  background: #f8f9fa;
  border: 1px solid #d0d7de;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.code-name { font-weight: bold; color: var(--ink); font-size: 1.1em; }
.meta { color: #636e72; font-size: 0.85rem; margin-top: 4px; }
.code-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.btn {
  padding: 8px 12px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85em;
  font-weight: 500;
  transition: all 0.2s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { filter: brightness(0.95); }
.btn-secondary { background: #b2bec3; color: var(--ink); }
.btn-secondary:hover { background: #95a5a6; }
.btn-success { background: var(--success); color: white; }
.btn-success:hover { filter: brightness(0.95); }
.btn-danger { background: #e17055; color: white; }
.btn-danger:hover { filter: brightness(0.95); }
.btn-warning { background: var(--warning); color: var(--ink); }
.btn-warning:hover { filter: brightness(0.97); }

.new-code-form { display: flex; gap: 10px; margin-top: 15px; }
.new-code-form input {
  flex: 1;
  padding: 12px;
  border: 2px solid #d0d7de;
  border-radius: 6px;
  font-size: 1em;
}
.new-code-form input:focus { outline: none; border-color: var(--primary); }

.empty-state { text-align: center; padding: 40px; color: #636e72; }

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
}

.modal.active { display: flex; align-items: center; justify-content: center; }

.modal-content {
  background: white;
  padding: 30px;
  border-radius: 12px;
  max-width: 400px;
  width: 90%;
}

.modal-content h3 { margin-bottom: 20px; color: var(--ink); }

.modal-content input {
  width: 100%;
  padding: 12px;
  border: 2px solid #d0d7de;
  border-radius: 6px;
  font-size: 1em;
  margin-bottom: 20px;
}

.modal-actions { display: flex; gap: 10px; justify-content: flex-end; }

.brand { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 10px; }
.brand-logo { width: 44px; height: 44px; border-radius: 10px; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25); }

/* Responsive layout */
@media (max-width: 1024px) {
  body { padding: 14px; }
  .content { padding: 22px; }
  .section h2 { font-size: 1.18em; }
}

@media (max-width: 768px) {
  body { padding: 10px; }
  .container { border-radius: 10px; }
  header { padding: 22px 16px; }
  header h1 { font-size: 1.55em; }
  .brand-logo { width: 36px; height: 36px; }
  .content { padding: 16px; }
  .section { margin-bottom: 20px; }

  .new-code-form {
    flex-direction: column;
    align-items: stretch;
  }

  .new-code-form input,
  .new-code-form .btn {
    width: 100%;
  }

  .code-item {
    flex-direction: column;
    align-items: stretch;
  }

  .code-actions {
    width: 100%;
  }

  .code-actions .btn {
    flex: 1 1 calc(50% - 8px);
    justify-content: center;
  }
}

@media (max-width: 480px) {
  header h1 { font-size: 1.35em; }
  .brand { gap: 8px; }
  .code-actions .btn {
    flex: 1 1 100%;
  }
  .repo-link { font-size: 0.9rem; }
}
