:root {
  --bg-primary: #0d1117;
  --bg-secondary: #161b22;
  --bg-tertiary: #21262d;
  --text-primary: #f0f6fc;
  --text-secondary: #8b949e;
  --text-muted: #6e7681;
  --accent: #58a6ff;
  --accent-hover: #79b8ff;
  --success: #238636;
  --success-hover: #2ea043;
  --danger: #da3633;
  --danger-hover: #f85149;
  --warning: #d29922;
  --border: #30363d;
  --border-focus: #58a6ff;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font);
  min-height: 100vh;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
}

/* Center layouts for secret page / burned page / 403 */
body.center-layout {
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.container {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 16px;
  flex: 1;
}

/* Cards */
.card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
  box-shadow: var(--shadow);
  width: 100%;
}

.card-center {
  max-width: 540px;
  text-align: center;
}

/* Header */
header.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  font-size: 32px;
}

h1 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
}

.subtitle {
  font-size: 14px;
  color: var(--text-secondary);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
}

.badge.lan {
  background: rgba(35, 134, 54, 0.15);
  border: 1px solid rgba(35, 134, 54, 0.4);
  color: #3fb950;
}

.badge.burned {
  background: rgba(218, 54, 51, 0.15);
  border: 1px solid rgba(218, 54, 51, 0.4);
  color: #f85149;
}

.badge.warning {
  background: rgba(210, 153, 34, 0.15);
  border: 1px solid rgba(210, 153, 34, 0.4);
  color: #e3b341;
}

/* Form Elements */
.form-group {
  margin-bottom: 20px;
  text-align: left;
}

label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.label-hint {
  font-weight: normal;
  color: var(--text-secondary);
  font-size: 12px;
}

input[type="text"],
input[type="url"],
textarea,
select {
  width: 100%;
  padding: 12px 14px;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 15px;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.2);
}

textarea {
  resize: vertical;
  min-height: 100px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 600px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

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

.btn-primary:hover {
  background-color: var(--success-hover);
  transform: translateY(-1px);
}

.btn-accent {
  background-color: var(--accent);
  color: #0d1117;
}

.btn-accent:hover {
  background-color: var(--accent-hover);
}

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

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

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

.btn-secondary:hover {
  background-color: #30363d;
}

.btn-block {
  width: 100%;
}

/* Mega Big Button for Secret View Page */
.btn-mega-copy {
  width: 100%;
  padding: 20px 24px;
  font-size: 20px;
  font-weight: 700;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #238636 0%, #2ea043 100%);
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(35, 134, 54, 0.4);
  transition: all 0.25s ease;
  margin: 24px 0 16px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.btn-mega-copy:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(35, 134, 54, 0.6);
  background: linear-gradient(135deg, #2ea043 0%, #3fb950 100%);
}

.btn-mega-copy:active {
  transform: translateY(0);
}

.btn-mega-copy.copied {
  background: linear-gradient(135deg, #1f6feb 0%, #388bfd 100%);
  box-shadow: 0 4px 16px rgba(56, 139, 253, 0.4);
}

/* Success Result Box in Admin */
.result-box {
  background: rgba(35, 134, 54, 0.1);
  border: 1px solid rgba(35, 134, 54, 0.4);
  border-radius: var(--radius);
  padding: 24px;
  margin-top: 24px;
  animation: fadeIn 0.3s ease;
}

.result-link-group {
  display: flex;
  gap: 10px;
  margin: 12px 0;
}

.result-link-group input {
  font-family: monospace;
  font-size: 16px;
  font-weight: 600;
  color: #58a6ff;
  background-color: var(--bg-primary);
}

.qr-container {
  display: flex;
  justify-content: center;
  margin: 16px 0;
}

.qr-container img {
  border-radius: 8px;
  background: #fff;
  padding: 8px;
  max-width: 160px;
  max-height: 160px;
}

/* Tables */
.table-container {
  margin-top: 32px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
}

.table-header-title {
  padding: 16px 20px;
  font-size: 16px;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 14px;
}

th, td {
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
}

th {
  background-color: var(--bg-tertiary);
  color: var(--text-secondary);
  font-weight: 600;
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background-color: rgba(255, 255, 255, 0.02);
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background-color: #238636;
  color: #fff;
  padding: 12px 24px;
  border-radius: 30px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
  z-index: 9999;
  pointer-events: none;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Notice and Alerts */
.burn-alert {
  background: rgba(218, 54, 51, 0.12);
  border: 1px solid rgba(218, 54, 51, 0.4);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 13px;
  color: #ff7b72;
  margin: 16px 0;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
}

.peek-box {
  margin-top: 16px;
  text-align: left;
}

.peek-toggle {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
  text-decoration: underline;
  padding: 4px 0;
}

.peek-toggle:hover {
  color: var(--text-secondary);
}

.peek-content {
  display: none;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  font-family: monospace;
  font-size: 13px;
  color: var(--text-primary);
  word-break: break-all;
  white-space: pre-wrap;
  margin-top: 8px;
  max-height: 200px;
  overflow-y: auto;
}

.peek-content.visible {
  display: block;
}

/* Icons */
.icon-badge {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  margin: 0 auto 16px auto;
}

.icon-badge.red {
  background: rgba(218, 54, 51, 0.15);
  border: 1px solid rgba(218, 54, 51, 0.4);
}

.icon-badge.green {
  background: rgba(35, 134, 54, 0.15);
  border: 1px solid rgba(35, 134, 54, 0.4);
}

.icon-badge.orange {
  background: rgba(210, 153, 34, 0.15);
  border: 1px solid rgba(210, 153, 34, 0.4);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

footer {
  text-align: center;
  padding: 20px;
  font-size: 13px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}
