:root {
  --bg: #f4f6f9;
  --card-bg: #ffffff;
  --primary: #0f62fe;
  --primary-hover: #0043ce;
  --success: #198038;
  --success-bg: #defbe6;
  --warning: #8a3800;
  --warning-bg: #fff1e5;
  --danger: #da1e28;
  --danger-bg: #fff1f1;
  --info: #0043ce;
  --info-bg: #edf5ff;
  --text: #161616;
  --text-muted: #525252;
  --border: #dce1e7;
  --radius: 10px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Navbar */
.navbar {
  background: #161616;
  color: #fff;
  padding: 14px 0;
  margin-bottom: 24px;
}

.nav-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  font-weight: 700;
  font-size: 1.15rem;
}

.nav-links a {
  color: #e0e0e0;
  text-decoration: none;
  margin-left: 20px;
  font-size: 0.92rem;
}

.nav-links a:hover {
  color: #ffffff;
  text-decoration: underline;
}

/* Cards */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

h1 {
  font-size: 1.65rem;
  margin-bottom: 8px;
}

.subtitle {
  color: var(--text-muted);
  margin-bottom: 14px;
}

.privacy-badge {
  display: inline-block;
  background: var(--info-bg);
  color: var(--info);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 22px;
}

/* Forms */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 16px;
}

@media (max-width: 768px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group label {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 6px;
  margin-top: 8px;
}

select,
input[type="text"] {
  padding: 10px 12px;
  border: 1px solid #c6c6c6;
  border-radius: 6px;
  font-size: 0.95rem;
  background: #fff;
}

select:focus,
input[type="text"]:focus {
  outline: 2px solid var(--primary);
  border-color: transparent;
}

.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 14px 0;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 0.95rem;
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.rename-panel {
  background: #f8fafc;
  border: 1px dashed #94a3b8;
  border-radius: 8px;
  padding: 18px;
  margin-top: 12px;
}

.rename-panel h3 {
  font-size: 1.05rem;
  margin-bottom: 4px;
}

.hint {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.divider {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 22px 0;
}

/* Upload Box */
.upload-box {
  position: relative;
  border: 2px dashed #8d99ae;
  border-radius: 8px;
  padding: 32px 20px;
  text-align: center;
  background: #fafbfc;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 18px;
}

.upload-box:hover,
.upload-box.dragover {
  border-color: var(--primary);
  background: var(--info-bg);
}

.upload-box input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

/* Buttons */
.btn-primary,
.btn-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 22px;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-primary {
  width: 100%;
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
}

.btn-primary:disabled {
  background: #a8b5c8;
  cursor: not-allowed;
}

.btn-download {
  background: var(--success);
  color: #fff;
}

.btn-download:hover {
  background: #0e6027;
}

/* Alerts */
.alert {
  padding: 14px 16px;
  border-radius: 8px;
  margin-top: 16px;
  font-size: 0.94rem;
}

.alert.info {
  background: var(--info-bg);
  color: var(--info);
  border: 1px solid #a6c8ff;
}

.alert.success {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid #6fdc8c;
}

.alert.warning {
  background: var(--warning-bg);
  color: var(--warning);
  border: 1px solid #ffb784;
}

.alert.danger {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid #ffb3b8;
}

/* Result & Table */
.result-section {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 2px solid var(--border);
}

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}

.xray-section h3 {
  margin-bottom: 8px;
}

.table-wrapper {
  overflow-x: auto;
  margin-top: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

th,
td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  background: #f1f5f9;
  font-weight: 600;
  white-space: nowrap;
}

tr:hover td {
  background: #f8fafc;
}

/* Article Section */
.article-section h2 {
  margin-bottom: 12px;
  font-size: 1.35rem;
}

.article-section h3 {
  margin-top: 18px;
  margin-bottom: 8px;
  font-size: 1.08rem;
}

.article-section p,
.article-section ul {
  color: #333;
  margin-bottom: 12px;
}

.article-section ul {
  padding-left: 22px;
}

.article-section li {
  margin-bottom: 6px;
}

code {
  background: #eef2f6;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.9em;
}

/* Ad Slot Placeholder */
.ad-slot {
  background: #ebeff5;
  border: 1px dashed #cbd5e1;
  color: #64748b;
  text-align: center;
  padding: 14px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 0.82rem;
}

/* Footer */
.footer {
  background: #161616;
  color: #a8a8a8;
  padding: 24px 0;
  margin-top: 40px;
  font-size: 0.88rem;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-links a {
  color: #e0e0e0;
  text-decoration: none;
  margin-left: 16px;
}

.hidden {
  display: none !important;
}