:root {
  --bg: #eef2f7;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --border: #d8dee8;
  --text: #1f2937;
  --muted: #5f6b7a;
  --accent: #1254d1;
  --accent-soft: #dbe8ff;
  --accent-strong: #0f43a5;
  --sidebar-top: #16315f;
  --sidebar-bottom: #0f2344;
  --shadow: 0 18px 50px rgba(31, 41, 55, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", "Arial", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, #ffffff 0, var(--bg) 38%),
    linear-gradient(180deg, var(--bg) 0%, var(--accent-soft) 100%);
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
}

.sidebar {
  background: linear-gradient(180deg, var(--sidebar-top) 0%, var(--sidebar-bottom) 100%);
  color: #f7f9fc;
  padding: 28px 22px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.14);
  font-weight: 800;
  font-size: 22px;
}

.brand-title {
  font-size: 18px;
  font-weight: 700;
}

.brand-subtitle {
  color: rgba(247, 249, 252, 0.72);
  font-size: 13px;
}

.nav {
  display: grid;
  gap: 10px;
}

.nav-item {
  width: 100%;
  text-align: left;
  border: 0;
  border-radius: 14px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.08);
  color: inherit;
  font: inherit;
  transition: background-color 140ms ease, transform 140ms ease;
}

.nav-item:not(:disabled):hover {
  background: rgba(255, 255, 255, 0.14);
  transform: translateX(2px);
}

.nav-item.active {
  background: rgba(255, 255, 255, 0.18);
  font-weight: 700;
}

.nav-item:disabled {
  opacity: 0.55;
}

.sidebar-note {
  margin-top: auto;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(247, 249, 252, 0.82);
  line-height: 1.45;
  font-size: 14px;
}

.theme-panel {
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.08);
}

.theme-panel-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 12px;
}

.theme-reset {
  min-height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  color: inherit;
  font: inherit;
}

.theme-fields {
  display: grid;
  gap: 10px;
}

.theme-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  color: rgba(247, 249, 252, 0.9);
}

.theme-field input[type="color"] {
  width: 46px;
  height: 32px;
  border: 0;
  background: transparent;
  padding: 0;
}

.theme-reset {
  width: 100%;
  margin-top: 14px;
}

.content {
  padding: 30px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 22px;
}

.hero h1 {
  margin: 0 0 8px;
  font-size: 30px;
  line-height: 1.12;
}

.hero p {
  margin: 0;
  color: var(--muted);
  max-width: 780px;
}

.hero-chip {
  border-radius: 999px;
  padding: 10px 14px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 700;
  white-space: nowrap;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 18px;
}

.panel-header {
  margin-bottom: 18px;
}

.panel-header h2 {
  margin: 0;
  font-size: 20px;
}

.warning-box {
  margin-bottom: 18px;
  border: 1px solid #f3d28b;
  background: #fff7e6;
  border-radius: 18px;
  padding: 16px 18px;
}

.warning-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 6px;
  color: #8a5a00;
}

.warning-text {
  color: #6f5530;
  line-height: 1.55;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.field {
  display: grid;
  gap: 8px;
}

.field-span-2 {
  grid-column: span 2;
}

.field span {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}

.field input {
  width: 100%;
  height: 46px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #fff;
  padding: 0 14px;
  font: inherit;
  color: var(--text);
}

.selected-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 10px;
}

.selected-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  border: 1px solid rgba(18, 84, 209, 0.18);
  font-size: 13px;
  font-weight: 600;
}

.selected-chip button {
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  min-width: auto;
  height: auto;
  font: inherit;
  cursor: pointer;
  line-height: 1;
}

.field select {
  width: 100%;
  height: 46px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #fff;
  padding: 0 14px;
  font: inherit;
  color: var(--text);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.upload-panel {
  display: grid;
  gap: 10px;
}

.upload-info {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

.download-link {
  color: var(--accent-strong);
  font-weight: 700;
}

button {
  cursor: pointer;
  font: inherit;
}

.ghost,
.primary {
  height: 46px;
  border-radius: 14px;
  padding: 0 16px;
  border: 1px solid transparent;
  font-weight: 700;
}

.ghost {
  background: var(--panel-soft);
  border-color: var(--border);
  color: var(--text);
}

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

.ghost:hover,
.primary:hover {
  filter: brightness(0.98);
}

.primary:disabled {
  opacity: 0.6;
  cursor: default;
}

.option-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.option-card {
  background: var(--panel-soft);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
}

.option-card h3 {
  margin: 0 0 12px;
  font-size: 16px;
}

.option-text {
  margin: 0 0 10px;
  color: var(--muted);
  line-height: 1.55;
}

.advanced-settings {
  margin-top: 18px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--panel-soft);
  padding: 0 18px 18px;
}

.advanced-settings summary {
  cursor: pointer;
  font-weight: 700;
  padding: 16px 0;
}

.advanced-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0;
  color: var(--text);
}

.checkbox input {
  width: 18px;
  height: 18px;
}

.actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 22px;
  flex-wrap: wrap;
}

.status-text {
  color: var(--muted);
}

.confirm-checkbox {
  margin-right: 6px;
  padding: 10px 14px;
  border-radius: 14px;
  background: var(--panel-soft);
  border: 1px solid var(--border);
}

.summary {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.summary-card {
  background: var(--panel-soft);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
}

.summary-label {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 6px;
}

.summary-value {
  font-size: 22px;
  font-weight: 700;
}

.summary-paths {
  background: var(--panel-soft);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  line-height: 1.5;
}

.summary-empty {
  color: var(--muted);
}

.log-box {
  min-height: 260px;
  max-height: 420px;
  overflow: auto;
  border-radius: 18px;
  background: #101827;
  color: #e5edf9;
  padding: 16px;
  font-family: "Consolas", "Courier New", monospace;
  white-space: pre-wrap;
  line-height: 1.55;
}

@media (max-width: 1100px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    padding-bottom: 18px;
  }

  .content {
    padding: 20px;
  }
}

@media (max-width: 820px) {
  .hero,
  .actions {
    flex-direction: column;
    align-items: stretch;
  }

  .form-grid,
  .option-grid,
  .summary-grid,
  .advanced-grid {
    grid-template-columns: 1fr;
  }

  .field-span-2 {
    grid-column: auto;
  }
}
