/* 绝区零角色培养攻略生成器 - 样式 */

:root {
  color-scheme: dark;
  --bg-deep: #0a0a0c;
  --bg-panel: #141418;
  --bg-card: #1c1c22;
  --border: #2a2a32;
  --text: #e8e8ec;
  --text-muted: #888894;
  --accent: #f5a623;
  --accent-glow: rgba(245, 166, 35, 0.35);
  --primary: #ff6b2b;
  --primary-hover: #ff8347;
  --success: #4ade80;
  --error: #f87171;
  --radius: 10px;
  --radius-lg: 16px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}

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

body {
  font-family: 'Noto Sans SC', system-ui, sans-serif;
  background: var(--bg-deep);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(245, 166, 35, 0.08), transparent),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(255, 107, 43, 0.06), transparent);
}

input,
textarea,
select {
  color-scheme: dark;
  font-family: inherit;
}

.app {
  width: 100%;
  max-width: 1520px;
  margin: 0 auto;
  padding: 12px 20px 20px;
}

/* Header */
.header {
  margin-bottom: 10px;
}

/* Team bar */
.team-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  padding: 12px 16px;
}

.team-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.team-tab {
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.team-tab:hover {
  border-color: var(--primary);
  color: var(--text);
}

.team-tab.active {
  border-color: var(--primary);
  background: rgba(255, 107, 43, 0.12);
  color: var(--primary);
}

.guide-title-field {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.guide-title-field span {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.guide-title-field input {
  width: 200px;
  padding: 6px 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.85rem;
  outline: none;
}

.guide-title-field input:focus {
  border-color: var(--accent);
}

.guide-remark-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  height: 100%;
  min-height: 0;
}

.guide-remark-field span {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
  flex-shrink: 0;
}

.guide-remark-field textarea {
  flex: 1;
  width: 100%;
  min-height: 100px;
  padding: 10px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.85rem;
  font-family: inherit;
  line-height: 1.5;
  resize: none;
  outline: none;
}

.guide-remark-field textarea:focus {
  border-color: var(--accent);
}

.team-name-field {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 160px;
}

.team-name-field span {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.team-name-field input {
  flex: 1;
  padding: 6px 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.85rem;
  outline: none;
}

.team-name-field input:focus {
  border-color: var(--accent);
}

.team-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.btn-danger {
  color: #f87171;
  border-color: rgba(248, 113, 113, 0.35);
}

.btn-danger:hover:not(:disabled) {
  border-color: #f87171;
  color: #f87171;
  background: rgba(248, 113, 113, 0.08);
}

.btn-danger:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

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

.brand-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--accent), var(--primary));
  border-radius: 10px;
  font-weight: 900;
  font-size: 1.25rem;
  color: #111;
  flex-shrink: 0;
}

.header h1 {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.header p {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 1px;
}

/* Layout */
.main-layout {
  display: grid;
  grid-template-columns: minmax(300px, 360px) minmax(340px, 1fr) minmax(400px, 520px);
  gap: 14px;
  align-items: stretch;
}

.panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow);
  min-height: 0;
}

.section-title {
  font-size: 0.88rem;
  font-weight: 700;
  margin-bottom: 0;
  color: var(--text-muted);
  letter-spacing: 0.06em;
}

.config-panel,
.preview-section,
.skills-panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow);
}

/* Gear layout: pickers row + drive row */
.gear-layout {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.gear-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

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

.gear-row-pickers .picker-slot-compact {
  width: auto;
}

.picker-slot-compact {
  flex-shrink: 0;
  width: 88px;
  padding: 10px 8px;
}

.picker-slot-compact .picker-img {
  width: 64px;
  height: 64px;
}

.picker-slot-compact .picker-label {
  font-size: 0.75rem;
}

.picker-slot-compact .picker-hint {
  display: none;
}

/* Picker slots */
.config-panel .section-title {
  margin-bottom: 0;
}

.config-panel-top {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  margin-bottom: 12px;
}

.character-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.character-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.character-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
}

.char-tab {
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.char-tab:hover {
  border-color: #555;
  color: var(--text);
}

.char-tab.active {
  border-color: var(--accent);
  background: rgba(245, 166, 35, 0.1);
  color: var(--accent);
}

.picker-slot-avatar {
  flex-shrink: 0;
  width: 110px;
}

.drive-panel {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.drive-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.drive-panel-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
}

.drive-actions {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.drive-layout {
  display: flex;
  gap: 16px;
  align-items: stretch;
  justify-content: center;
  flex: 1;
}

.drive-remark-field {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.drive-remark-field span {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
  flex-shrink: 0;
  white-space: nowrap;
}

.drive-remark-field input {
  flex: 1;
  min-width: 0;
  padding: 7px 10px;
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.8rem;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.drive-remark-field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

.drive-remark-field input::placeholder {
  color: var(--text-muted);
  opacity: 0.7;
}

.drive-zone {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.drive-zone-four {
  flex: 0 0 auto;
}

.drive-zone-two {
  flex-shrink: 0;
  width: auto;
  min-width: 56px;
  padding-left: 12px;
  border-left: 1px solid var(--border);
}

.drive-zone-label {
  font-size: 0.62rem;
  color: var(--accent);
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.06em;
}

.drive-zone-grid-four {
  display: grid;
  grid-template-columns: repeat(2, 52px);
  gap: 8px;
}

.drive-zone-grid-two {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.drive-slot {
  position: relative;
  aspect-ratio: 1;
  padding: 0;
  background: var(--bg-panel);
  border: 2px dashed var(--border);
  border-radius: 8px;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.2s, transform 0.15s;
}

.drive-slot:hover {
  border-color: var(--accent);
  transform: scale(1.04);
}

.drive-slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.drive-slot-index {
  position: absolute;
  bottom: 2px;
  right: 3px;
  font-size: 0.6rem;
  color: rgba(255, 255, 255, 0.55);
  background: rgba(0, 0, 0, 0.6);
  padding: 0 4px;
  border-radius: 3px;
}

.picker-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.picker-row-single {
  grid-template-columns: 1fr;
}

.picker-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 12px;
  background: var(--bg-card);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  font-family: inherit;
  color: var(--text);
}

.picker-slot:hover {
  border-color: var(--accent);
  background: rgba(245, 166, 35, 0.05);
}

.picker-img {
  width: 72px;
  height: 72px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid var(--border);
}

.picker-label {
  font-size: 0.85rem;
  font-weight: 600;
}

.picker-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Skill panel */
.skills-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
}

.skill-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  flex-shrink: 0;
}

.skill-header .section-title {
  margin-bottom: 0;
}

.skill-header h3 {
  font-size: 0.9rem;
  font-weight: 600;
}

.skill-panel {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  flex-shrink: 0;
  align-content: start;
}

.remark-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 140px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.skill-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.skill-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
  object-fit: cover;
}

.skill-name {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.skill-info {
  flex: 1;
  min-width: 0;
}

.skill-dots {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
}

.skill-dot {
  width: 12px;
  height: 5px;
  border-radius: 2px;
  background: #333;
  transition: background 0.15s;
}

.skill-dot.filled {
  background: linear-gradient(90deg, var(--accent), var(--primary));
}

.skill-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.skill-level {
  font-size: 0.95rem;
  font-weight: 700;
  min-width: 20px;
  text-align: center;
  color: var(--accent);
}

.btn-icon {
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-panel);
  color: var(--text);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, border-color 0.15s;
}

.btn-icon:hover {
  background: #2a2a32;
  border-color: var(--accent);
}

.search-input {
  padding: 8px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.875rem;
  width: 180px;
  outline: none;
  transition: border-color 0.2s;
}

.search-input:focus {
  border-color: var(--accent);
}

/* Modal */
body.modal-open {
  overflow: hidden;
}

.modal[hidden] {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
}

.modal-dialog {
  position: relative;
  width: 100%;
  max-width: 640px;
  max-height: 85vh;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modal-in 0.2s ease;
}

/* 角色 / 音擎选择弹窗：加宽并固定列数，完整展示 */
#avatar-modal .modal-dialog,
#weapon-modal .modal-dialog {
  max-width: min(860px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
}

#avatar-modal .modal-grid,
#weapon-modal .modal-grid {
  overflow-y: visible;
  max-height: none;
  flex: 0 1 auto;
}

#avatar-modal .asset-grid {
  grid-template-columns: repeat(11, 64px);
  justify-content: center;
  gap: 8px;
}

#weapon-modal .asset-grid {
  grid-template-columns: repeat(10, 64px);
  justify-content: center;
  gap: 8px;
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.modal-header h3 {
  font-size: 1.05rem;
  font-weight: 700;
}

.modal-close {
  width: 32px;
  height: 32px;
  border: none;
  background: var(--bg-card);
  color: var(--text-muted);
  border-radius: 8px;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.modal-close:hover {
  color: var(--text);
  background: #2a2a32;
}

.modal-toolbar {
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.modal-toolbar .search-input {
  width: 100%;
}

.modal-grid {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px 20px;
  max-height: none;
  margin-bottom: 0;
}

/* Asset grid */
.asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 10px;
  padding: 4px;
}

.asset-item {
  position: relative;
  aspect-ratio: 1;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  overflow: hidden;
  padding: 0;
  transition: border-color 0.2s, transform 0.15s;
}

.asset-item:hover {
  border-color: #555;
  transform: scale(1.04);
}

.asset-item.selected {
  border-color: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}

.asset-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.asset-index {
  position: absolute;
  bottom: 2px;
  right: 4px;
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.6);
  background: rgba(0, 0, 0, 0.55);
  padding: 1px 5px;
  border-radius: 4px;
}

.empty-hint {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-muted);
  padding: 40px;
}

/* Form */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 0;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-field span {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.form-field input {
  padding: 8px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.2s;
}

.form-field input:focus {
  border-color: var(--accent);
}

/* Buttons */
.btn {
  padding: 10px 22px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background 0.2s, opacity 0.2s;
  font-family: inherit;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

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

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
}

.btn-accent {
  background: linear-gradient(135deg, var(--accent), var(--primary));
  color: #111;
}

.btn-accent:hover:not(:disabled) {
  filter: brightness(1.08);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.btn-ghost:hover:not(:disabled) {
  border-color: #555;
  color: var(--text);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.8rem;
}

.btn-xs {
  padding: 3px 8px;
  font-size: 0.68rem;
  border-radius: 6px;
}

/* Preview */
.preview-section {
  display: flex;
  flex-direction: column;
}

.preview-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.preview-header-bar .section-title {
  margin-bottom: 0;
}

.preview-export-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.preview-wrap {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 10px;
  background: #08080a;
  border-radius: var(--radius);
  border: 1px dashed var(--border);
}

.preview-stack {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
  max-width: 480px;
  padding: 8px;
  background: #0a0a0c;
  border-radius: 8px;
}

.preview-guide-title {
  font-size: 1.15rem;
  font-weight: 900;
  color: var(--text);
  text-align: center;
  letter-spacing: 0.12em;
  padding: 12px 8px 4px;
  border-bottom: 2px solid rgba(245, 166, 35, 0.35);
  margin-bottom: 4px;
}

.preview-remark {
  margin-top: 8px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.preview-remark-label {
  font-size: 0.72rem;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.1em;
  margin-bottom: 8px;
}

.preview-remark-text {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.preview-team-block {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.preview-team-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: 0.1em;
  text-align: center;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(245, 166, 35, 0.25);
}

.preview-team-block + .preview-team-block {
  padding-top: 18px;
  border-top: 1px dashed #2a2a32;
}

.preview-stack .preview-card {
  width: 100%;
  flex-shrink: 0;
}

.preview-card {
  width: 100%;
  max-width: 480px;
  background: linear-gradient(160deg, #1a1a22 0%, #12121a 100%);
  border: 2px solid #333;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
}

.preview-header {
  display: grid;
  grid-template-columns: 108px 1fr auto;
  gap: 16px;
  padding: 18px 18px 14px;
  background: linear-gradient(180deg, rgba(245, 166, 35, 0.06) 0%, transparent 100%);
  align-items: end;
}

.preview-gear-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.preview-gear-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.preview-avatar-col {
  align-self: end;
}

.preview-avatar-wrap {
  width: 108px;
  height: 108px;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid var(--accent);
  flex-shrink: 0;
  box-shadow: 0 4px 16px var(--accent-glow);
}

.preview-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preview-weapon-col {
  justify-self: center;
  padding-bottom: 2px;
}

.preview-weapon-icon {
  width: 92px;
  height: 92px;
  border-radius: 10px;
  border: 2px solid var(--border);
  object-fit: cover;
  background: var(--bg-card);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.preview-drives-col {
  align-self: end;
}

.preview-drives-wrap {
  position: relative;
}

.preview-drives-layout {
  display: flex;
  gap: 6px;
  align-items: flex-end;
}

.preview-drive-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.preview-zone-grid-four {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}

.preview-zone-grid-two {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-left: 6px;
  border-left: 1px solid var(--border);
}

.preview-drive-icon {
  width: 42px;
  height: 42px;
  border-radius: 6px;
  border: 1px solid var(--border);
  object-fit: cover;
  background: var(--bg-card);
}

.preview-drive-remark {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 6px;
  width: max-content;
  max-width: 130px;
  font-size: 0.6rem;
  line-height: 1.25;
  color: var(--text-muted);
  text-align: center;
  word-break: break-all;
  white-space: normal;
}

.preview-skills {
  padding: 12px 16px 14px;
}

.preview-section-title {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.preview-skill-row {
  display: grid;
  grid-template-columns: 28px 64px 1fr 22px;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.preview-skill-icon {
  width: 26px;
  height: 26px;
  border-radius: 50%;
}

.preview-skill-name {
  font-size: 0.72rem;
  font-weight: 600;
}

.preview-skill-bar {
  display: flex;
  gap: 3px;
}

.preview-segment {
  flex: 1;
  height: 8px;
  border-radius: 2px;
  background: #2a2a32;
}

.preview-segment.active {
  background: linear-gradient(90deg, var(--accent), var(--primary));
}

.preview-skill-level {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent);
  text-align: right;
}

.preview-footer {
  padding: 10px 24px;
  text-align: center;
  font-size: 0.7rem;
  color: #555;
  background: rgba(0, 0, 0, 0.3);
  letter-spacing: 0.08em;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  padding: 12px 24px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  opacity: 0;
  transition: transform 0.3s, opacity 0.3s;
  z-index: 1000;
  pointer-events: none;
}

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

.toast.success {
  background: #166534;
  color: var(--success);
  border: 1px solid var(--success);
}

.toast.error {
  background: #7f1d1d;
  color: var(--error);
  border: 1px solid var(--error);
}

/* Responsive */
@media (max-width: 1200px) {
  .main-layout {
    grid-template-columns: 1fr 1fr;
  }

  .preview-section {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  .main-layout {
    grid-template-columns: 1fr;
  }

  .team-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .guide-title-field input {
    width: 100%;
  }

  .team-actions {
    margin-left: 0;
    width: 100%;
  }

  .team-actions .btn {
    flex: 1;
  }

  .gear-row-pickers {
    grid-template-columns: 1fr 1fr;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .preview-header {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 14px;
  }

  .preview-weapon-col {
    justify-self: center;
  }

  .preview-drives-layout {
    justify-content: center;
  }

  .drive-panel-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .modal {
    padding: 12px;
    align-items: flex-end;
  }

  .modal-dialog {
    max-height: 90vh;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
  }

  #avatar-modal .modal-dialog,
  #weapon-modal .modal-dialog {
    max-width: calc(100vw - 16px);
  }

  #avatar-modal .modal-grid,
  #weapon-modal .modal-grid {
    overflow-y: auto;
    max-height: calc(90vh - 120px);
  }

  #avatar-modal .asset-grid,
  #weapon-modal .asset-grid {
    grid-template-columns: repeat(auto-fill, minmax(56px, 1fr));
  }
}
