/* ============================================
   一步智创 yibu.cc — 核心样式
   ============================================ */

/* ── Reset & Base ─────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Design Tokens ────────────────────────── */
:root {
  --primary: #00D4AA;
  --primary-hover: #33E8C0;
  --bg: #0A0E17;
  --surface: #111827;
  --surface-2: #1a2235;
  --border: #1E293B;
  --text: #F1F5F9;
  --text-sub: #64748B;
  --success: #10B981;
  --warning: #F59E0B;
  --danger: #EF4444;
  --sidebar-w: 260px;
  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.5);
  --shadow-md: 0 4px 20px rgba(0,0,0,.6);
  --shadow-lg: 0 8px 40px rgba(0,0,0,.7);
  --transition: 200ms ease;
}

/* ── Background Texture ───────────────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 10%, rgba(0,212,170,.06) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 90%, rgba(59,130,246,.04) 0%, transparent 60%);
}
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background-image: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(255,255,255,.008) 2px,
    rgba(255,255,255,.008) 4px
  );
}

/* ── App Layout ───────────────────────────── */
.app-nav {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 32px 0;
  z-index: 50;
}
.app-content {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  position: relative;
  z-index: 2;
}

/* ── Logo ─────────────────────────────────── */
.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 24px;
  margin-bottom: 40px;
}
.logo-mark {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
}
.logo-text {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: .02em;
}

/* ── Nav Links ────────────────────────────── */
.app-nav nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 12px;
  flex: 1;
}
.app-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  color: var(--text-sub);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition);
  position: relative;
}
.app-nav a:hover {
  color: var(--text);
  background: rgba(255,255,255,.04);
}
.app-nav a.active {
  color: var(--primary);
  background: rgba(0,212,170,.08);
}
.app-nav a.active::before {
  content: '';
  position: absolute;
  left: -12px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 24px;
  background: var(--primary);
  border-radius: 0 2px 2px 0;
}
.app-nav a svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.nav-footer {
  padding: 24px;
  border-top: 1px solid var(--border);
}
.footer-domain {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-sub);
  opacity: .5;
}

/* ── Page Container ───────────────────────── */
.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 40px;
}

/* ── Typography ───────────────────────────── */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -.02em;
}
h1 { font-size: 56px; }
h2 { font-size: 40px; }
h3 { font-size: 28px; }
h4 { font-size: 20px; }
p { color: var(--text-sub); }

/* ── Buttons ──────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary {
  background: var(--primary);
  color: #0A0E17;
}
.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(0,212,170,.3);
}
.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.btn-ghost {
  background: transparent;
  color: var(--text-sub);
  padding: 8px 12px;
}
.btn-ghost:hover {
  color: var(--text);
  background: rgba(255,255,255,.04);
}
.btn-danger {
  background: rgba(239,68,68,.1);
  color: var(--danger);
  border: 1px solid rgba(239,68,68,.2);
}
.btn-danger:hover {
  background: rgba(239,68,68,.2);
}
.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-icon {
  padding: 8px;
  border-radius: var(--radius-sm);
}

/* ── Cards ────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition);
}
.card:hover {
  border-color: rgba(0,212,170,.3);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.card-img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  background: var(--surface-2);
}
.card-body {
  padding: 24px;
}
.card-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}
.card-desc {
  font-size: 14px;
  color: var(--text-sub);
  line-height: 1.6;
}

/* ── Tags ─────────────────────────────────── */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  background: rgba(0,212,170,.1);
  color: var(--primary);
  border: 1px solid rgba(0,212,170,.15);
}
.tag-blue {
  background: rgba(59,130,246,.1);
  color: #60A5FA;
  border-color: rgba(59,130,246,.15);
}
.tag-purple {
  background: rgba(139,92,246,.1);
  color: #A78BFA;
  border-color: rgba(139,92,246,.15);
}
.tag-orange {
  background: rgba(245,158,11,.1);
  color: #FBBF24;
  border-color: rgba(245,158,11,.15);
}

/* ── Section Header ───────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
}
.section-label {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: .15em;
  margin-bottom: 8px;
}
.section-title {
  font-size: 32px;
}

/* ── Hero Section ─────────────────────────── */
.hero {
  padding: 80px 0 64px;
  position: relative;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: 100px;
  background: rgba(0,212,170,.08);
  border: 1px solid rgba(0,212,170,.15);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--primary);
  margin-bottom: 24px;
}
.hero-badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .3; }
}
.hero h1 {
  margin-bottom: 20px;
  background: linear-gradient(135deg, var(--text) 0%, var(--text-sub) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero p {
  font-size: 18px;
  max-width: 520px;
  margin-bottom: 32px;
  color: var(--text-sub);
}
.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* ── Grid Layouts ─────────────────────────── */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

/* ── Stats Bar ────────────────────────────── */
.stats-bar {
  display: flex;
  gap: 48px;
  padding: 32px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin: 48px 0;
}
.stat-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stat-value {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  color: var(--primary);
}
.stat-label {
  font-size: 13px;
  color: var(--text-sub);
}

/* ── Tables ───────────────────────────────── */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.table {
  width: 100%;
  border-collapse: collapse;
}
.table th {
  text-align: left;
  padding: 14px 20px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-sub);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.table td {
  padding: 16px 20px;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.table tbody tr:hover {
  background: rgba(255,255,255,.02);
}
.table tbody tr:last-child td {
  border-bottom: none;
}

/* ── Forms ────────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 20px;
}
.form-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-sub);
}
.form-input, .form-textarea, .form-select {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 14px;
  color: var(--text);
  font-family: inherit;
  transition: all var(--transition);
  outline: none;
  width: 100%;
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0,212,170,.1);
}
.form-textarea {
  resize: vertical;
  min-height: 120px;
}
.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

/* ── Modal ────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px 0;
}
.modal-title {
  font-size: 20px;
  font-weight: 600;
}
.modal-body {
  padding: 24px 28px;
}
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 0 28px 24px;
}

/* ── Empty State ──────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px 24px;
  text-align: center;
  gap: 16px;
}
.empty-state svg {
  width: 48px;
  height: 48px;
  color: var(--text-sub);
  opacity: .4;
}
.empty-state h3 {
  font-size: 18px;
  color: var(--text);
}
.empty-state p {
  font-size: 14px;
  max-width: 300px;
}

/* ── Animations ───────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.animate-in {
  animation: fadeUp .5s ease forwards;
  opacity: 0;
}
.animate-in:nth-child(1) { animation-delay: 0ms; }
.animate-in:nth-child(2) { animation-delay: 60ms; }
.animate-in:nth-child(3) { animation-delay: 120ms; }
.animate-in:nth-child(4) { animation-delay: 180ms; }
.animate-in:nth-child(5) { animation-delay: 240ms; }
.animate-in:nth-child(6) { animation-delay: 300ms; }

/* ── Drag Handle ──────────────────────────── */
.drag-handle {
  cursor: grab;
  color: var(--text-sub);
  opacity: .4;
  transition: opacity var(--transition);
}
.drag-handle:hover { opacity: 1; color: var(--primary); }
.dragging { opacity: .5; }
.drop-indicator {
  height: 2px;
  background: var(--primary);
  border-radius: 1px;
  margin: 2px 0;
}

/* ── Toast ────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 20px;
  font-size: 14px;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideInRight .3s ease;
}
.toast.success { border-left: 3px solid var(--success); }
.toast.error   { border-left: 3px solid var(--danger); }
.toast.info    { border-left: 3px solid var(--primary); }
@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

/* ── Responsive ───────────────────────────── */
@media (max-width: 1024px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .app-nav {
    width: 100%;
    position: relative;
    flex-direction: row;
    padding: 16px;
    gap: 8px;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .nav-logo { margin-bottom: 0; padding: 0; }
  .app-nav nav {
    flex-direction: row;
    padding: 0;
    gap: 4px;
  }
  .app-nav a span { display: none; }
  .app-nav a { justify-content: center; padding: 8px; }
  .nav-footer { display: none; }
  .app-content { margin-left: 0; }
  .page { padding: 24px 16px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  h1 { font-size: 36px; }
  h2 { font-size: 28px; }
  .stats-bar { gap: 24px; flex-wrap: wrap; }
}
