/* ============================================
   DDK 卡密商城 - Cloudflare 风格设计系统
   Version: 1.0.0
   ============================================ */

/* ---- CSS Custom Properties ---- */
:root {
  /* Primary palette */
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #dbeafe;
  --primary-dark: #1e40af;
  --primary-gradient: linear-gradient(135deg, #2563eb, #1d4ed8);

  /* Neutral palette */
  --bg-page: #f7f8fa;
  --bg-surface: #ffffff;
  --bg-hover: #f1f5f9;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --border-color: #e2e8f0;
  --border-light: #f1f5f9;

  /* Status colors */
  --success: #10b981;
  --success-light: #d1fae5;
  --warning: #f59e0b;
  --warning-light: #fef3c7;
  --danger: #ef4444;
  --danger-light: #fee2e2;
  --info: #3b82f6;
  --info-light: #dbeafe;

  /* Typography */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Cascadia Code', 'Courier New', monospace;

  /* Spacing */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 24px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .05);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, .04), 0 2px 4px rgba(0, 0, 0, .03);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, .06), 0 4px 10px rgba(0, 0, 0, .03);
  --shadow-xl: 0 20px 50px rgba(0, 0, 0, .08);

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(.4, 0, .2, 1);
  --transition-normal: 250ms cubic-bezier(.4, 0, .2, 1);
  --transition-slow: 350ms cubic-bezier(.4, 0, .2, 1);
}

/* ---- Reset & Base ---- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-family);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-page);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--primary-hover);
}

img {
  max-width: 100%;
  height: auto;
}

/* ---- Typography ---- */
h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
}

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
}

.text-gradient {
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ---- Layout Utilities ---- */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

@media (max-width: 768px) {
  .container {
    padding: 0 1rem;
  }
}

/* ---- Navigation ---- */
.ddk-nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, .85);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border-color);
  transition: all var(--transition-normal);
}

.ddk-nav.scrolled {
  box-shadow: var(--shadow-lg);
  background: rgba(255, 255, 255, .95);
}

.ddk-nav .nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 2rem;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  transition: color var(--transition-fast);
}

.nav-brand:hover {
  color: var(--primary);
}

.nav-brand .brand-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--primary-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.1rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: .25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .5rem .875rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: .9rem;
  font-weight: 500;
  transition: all var(--transition-fast);
}

.nav-links a:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.nav-links a.active {
  color: var(--primary);
  background: var(--primary-light);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
  padding: .25rem;
}

@media (max-width: 768px) {
  .nav-links {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    flex-direction: column;
    padding: .5rem;
    display: none;
    box-shadow: var(--shadow-lg);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    width: 100%;
    padding: .75rem 1rem;
  }

  .nav-toggle {
    display: block;
  }
}

/* ---- Hero / Banner ---- */
.ddk-hero {
  position: relative;
  min-height: 360px;
  background: var(--primary-gradient);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ddk-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: 
    radial-gradient(ellipse at 20% 50%, rgba(255,255,255,.1) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 50%, rgba(255,255,255,.08) 0%, transparent 50%);
}

.ddk-hero .hero-content {
  position: relative;
  text-align: center;
  color: #fff;
  padding: 4rem 1rem;
}

.ddk-hero .hero-title {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: .75rem;
  letter-spacing: -.02em;
}

.ddk-hero .hero-subtitle {
  font-size: 1.15rem;
  opacity: .85;
  max-width: 500px;
  margin: 0 auto;
}

.ddk-hero .hero-badge {
  display: inline-block;
  background: rgba(255,255,255,.15);
  backdrop-filter: blur(10px);
  padding: .35rem 1rem;
  border-radius: 100px;
  font-size: .85rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
  .ddk-hero {
    min-height: 260px;
  }
  .ddk-hero .hero-title {
    font-size: 1.75rem;
  }
  .ddk-hero .hero-subtitle {
    font-size: 1rem;
  }
}

/* ---- Hero Carousel ---- */
.ddk-carousel {
  position: relative;
  overflow: hidden;
  border-radius: 0;
}

.ddk-carousel .carousel-track {
  display: flex;
  transition: transform var(--transition-slow);
}

.ddk-carousel .carousel-slide {
  min-width: 100%;
  height: 360px;
  background: var(--primary-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
}

.ddk-carousel .carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: .85;
}

.ddk-carousel .carousel-dots {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: .5rem;
}

.carousel-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,.4);
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  padding: 0;
}

.carousel-dot.active {
  background: #fff;
  transform: scale(1.2);
}

.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,.15);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.2);
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  z-index: 10;
}

.carousel-arrow:hover {
  background: rgba(255,255,255,.25);
}

.carousel-prev { left: 1rem; }
.carousel-next { right: 1rem; }

@media (max-width: 768px) {
  .ddk-carousel .carousel-slide {
    height: 240px;
  }
}

/* ---- Category Tabs ---- */
.category-bar {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 64px;
  z-index: 99;
}

.category-bar .container {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding-top: .75rem;
  padding-bottom: .75rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.category-bar .container::-webkit-scrollbar {
  display: none;
}

.category-tab {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .5rem 1.25rem;
  border-radius: 100px;
  font-size: .875rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  text-decoration: none;
}

.category-tab:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.category-tab.active {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
}

/* ---- Product Cards ---- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.product-card {
  background: var(--bg-surface);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  transition: all var(--transition-normal);
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
  border-color: var(--primary-light);
}

.product-card .card-image {
  height: 180px;
  background: linear-gradient(135deg, #eff6ff, #dbeafe, #bfdbfe);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.product-card .card-image::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(circle at 70% 30%, rgba(37,99,235,.1), transparent 70%);
}

.product-card .card-image-icon {
  font-size: 3.5rem;
  color: var(--primary);
  opacity: .6;
  position: relative;
  z-index: 1;
}

.product-card .card-badge {
  position: absolute;
  top: .75rem;
  left: .75rem;
  z-index: 2;
  padding: .25rem .75rem;
  border-radius: 100px;
  font-size: .75rem;
  font-weight: 600;
}

.card-badge-category {
  background: rgba(255,255,255,.9);
  color: var(--primary);
  backdrop-filter: blur(8px);
}

.card-badge-stock {
  right: .75rem;
  left: auto;
}

.card-badge-stock.in-stock {
  background: var(--success-light);
  color: var(--success);
}

.card-badge-stock.out-stock {
  background: var(--danger-light);
  color: var(--danger);
}

.product-card .card-body {
  padding: 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.product-card .card-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: .375rem;
  color: var(--text-primary);
}

.product-card .card-desc {
  font-size: .825rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-card .card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: .75rem;
}

.product-card .card-price {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--danger);
}

.product-card .card-stock {
  font-size: .8rem;
  color: var(--text-muted);
}

.product-card .btn-buy {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  width: 100%;
  padding: .75rem 1rem;
  border-radius: var(--radius-md);
  font-size: .9rem;
  font-weight: 600;
  background: var(--primary-gradient);
  color: #fff;
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.product-card .btn-buy::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0);
  transition: background var(--transition-fast);
}

.product-card .btn-buy:hover::before {
  background: rgba(255,255,255,.1);
}

.product-card .btn-buy:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37,99,235,.35);
}

.product-card .btn-buy:disabled {
  background: var(--text-muted);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.product-card .btn-buy:disabled::before {
  display: none;
}

@media (max-width: 640px) {
  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
  }
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .625rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: .9rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  line-height: 1.5;
  text-decoration: none;
}

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

.btn-primary {
  background: var(--primary-gradient);
  color: #fff;
  border: none;
  box-shadow: 0 2px 8px rgba(37,99,235,.25);
}

.btn-primary:hover:not(:disabled) {
  box-shadow: 0 4px 16px rgba(37,99,235,.35);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-color);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--border-color);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}

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

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

.btn-success:hover:not(:disabled) {
  background: #059669;
}

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

.btn-danger:hover:not(:disabled) {
  background: #dc2626;
}

.btn-sm {
  padding: .4rem .875rem;
  font-size: .8rem;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: .875rem 1.75rem;
  font-size: 1rem;
  border-radius: var(--radius-lg);
}

.btn-block {
  width: 100%;
}

/* ---- Forms ---- */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: .875rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: .375rem;
}

.form-label .required {
  color: var(--danger);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: .75rem 1rem;
  font-size: .9rem;
  font-family: var(--font-family);
  color: var(--text-primary);
  background: var(--bg-surface);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  outline: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}

.form-input::placeholder {
  color: var(--text-muted);
}

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

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23475569' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

.form-hint {
  font-size: .8rem;
  color: var(--text-muted);
  margin-top: .25rem;
}

.form-error {
  font-size: .8rem;
  color: var(--danger);
  margin-top: .25rem;
}

.input-group {
  display: flex;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.input-group .form-input {
  border-radius: 0;
  border-right: none;
}

.input-group .form-input:first-child {
  border-radius: var(--radius-md) 0 0 var(--radius-md);
}

.input-group .btn {
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  white-space: nowrap;
}

.quantity-control {
  display: inline-flex;
  align-items: center;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.quantity-control button {
  width: 40px;
  height: 40px;
  background: var(--bg-hover);
  border: none;
  font-size: 1rem;
  cursor: pointer;
  color: var(--text-primary);
  transition: background var(--transition-fast);
}

.quantity-control button:hover {
  background: var(--border-color);
}

.quantity-control input {
  width: 60px;
  text-align: center;
  border: none;
  border-left: 1px solid var(--border-color);
  border-right: 1px solid var(--border-color);
  font-weight: 600;
  font-size: 1rem;
}

/* ---- Cards & Panels ---- */
.ddk-card {
  background: var(--bg-surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-light);
  overflow: hidden;
}

.ddk-card-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ddk-card-body {
  padding: 1.5rem;
}

/* ---- Status Panels ---- */
.status-panel {
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
  margin-bottom: 1.5rem;
}

.status-panel .status-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  margin-bottom: 1rem;
}

.status-pending {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
}

.status-pending .status-icon {
  background: var(--warning);
  color: #fff;
}

.status-paid {
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
}

.status-paid .status-icon {
  background: var(--info);
  color: #fff;
}

.status-shipped {
  background: linear-gradient(135deg, #d1fae5, #a7f3d0);
}

.status-shipped .status-icon {
  background: var(--success);
  color: #fff;
}

.status-cancelled {
  background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
}

.status-cancelled .status-icon {
  background: var(--text-muted);
  color: #fff;
}

/* ---- Code Block (for card display) ---- */
.code-block {
  background: linear-gradient(135deg, #1e293b, #0f172a);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  position: relative;
  color: #e2e8f0;
  font-family: var(--font-mono);
  font-size: .95rem;
  line-height: 1.8;
  white-space: pre-wrap;
  word-break: break-all;
}

.code-block .copy-btn {
  position: absolute;
  top: .75rem;
  right: .75rem;
  padding: .4rem .875rem;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.15);
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: .8rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: .35rem;
}

.code-block .copy-btn:hover {
  background: rgba(255,255,255,.2);
}

/* ---- Alerts ---- */
.alert {
  padding: .875rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: .9rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  line-height: 1.5;
}

.alert i {
  font-size: 1rem;
  margin-top: .1rem;
}

.alert-info {
  background: var(--info-light);
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

.alert-success {
  background: var(--success-light);
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.alert-warning {
  background: var(--warning-light);
  color: #92400e;
  border: 1px solid #fde68a;
}

.alert-danger {
  background: var(--danger-light);
  color: #991b1b;
  border: 1px solid #fecaca;
}

/* ---- Order Info Table ---- */
.info-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .5rem 1.5rem;
  align-items: center;
  font-size: .9rem;
}

.info-grid .info-label {
  color: var(--text-muted);
  font-size: .825rem;
}

.info-grid .info-value {
  text-align: right;
  font-weight: 500;
}

/* ---- Payment QR Section ---- */
.qr-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.qr-card {
  text-align: center;
  padding: 1.5rem;
  background: var(--bg-hover);
  border-radius: var(--radius-lg);
  border: 1px dashed var(--border-color);
}

.qr-card img {
  max-height: 160px;
  border-radius: var(--radius-md);
  margin-bottom: .5rem;
}

.qr-card .qr-label {
  font-size: .85rem;
  font-weight: 600;
  color: var(--text-primary);
}

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

/* ---- Footer ---- */
.ddk-footer {
  background: #0f172a;
  color: #94a3b8;
  padding: 3rem 0 1.5rem;
  margin-top: 4rem;
}

.ddk-footer .footer-brand {
  color: #fff;
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: .5rem;
}

.ddk-footer .footer-desc {
  font-size: .875rem;
  margin-bottom: 1rem;
}

.ddk-footer .footer-link {
  color: #94a3b8;
  font-size: .875rem;
}

.ddk-footer .footer-link:hover {
  color: #fff;
}

.ddk-footer hr {
  border-color: #1e293b;
  margin: 1.5rem 0;
}

.ddk-footer .copyright {
  text-align: center;
  font-size: .8rem;
}

/* ---- Stats Cards ---- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.stat-card {
  background: var(--bg-surface);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  transition: all var(--transition-normal);
}

.stat-card:hover {
  box-shadow: var(--shadow-lg);
}

.stat-card .stat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  margin-bottom: .875rem;
}

.stat-card .stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: .25rem;
}

.stat-card .stat-label {
  font-size: .825rem;
  color: var(--text-muted);
  margin-bottom: .375rem;
}

.stat-card .stat-change {
  font-size: .75rem;
  font-weight: 600;
}

/* ---- Badges ---- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  padding: .2rem .625rem;
  border-radius: 100px;
  font-size: .75rem;
  font-weight: 600;
}

.badge-success {
  background: var(--success-light);
  color: #065f46;
}

.badge-warning {
  background: var(--warning-light);
  color: #92400e;
}

.badge-danger {
  background: var(--danger-light);
  color: #991b1b;
}

.badge-info {
  background: var(--info-light);
  color: #1e40af;
}

.badge-secondary {
  background: var(--bg-hover);
  color: var(--text-secondary);
}

/* ---- Modal (Vanilla CSS) ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeIn .2s ease;
}

.modal-dialog {
  background: var(--bg-surface);
  border-radius: var(--radius-2xl);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  animation: slideUp .3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---- Skeleton Loading ---- */
.skeleton {
  background: linear-gradient(90deg, var(--bg-hover) 25%, #e2e8f0 50%, var(--bg-hover) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ---- Utilities ---- */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.font-bold { font-weight: 700; }
.mt-1 { margin-top: .25rem; }
.mt-2 { margin-top: .5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: .25rem; }
.mb-2 { margin-bottom: .5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.py-4 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.py-5 { padding-top: 2rem; padding-bottom: 2rem; }
.hidden { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* ---- Toast Notifications ---- */
.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.toast {
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  padding: .875rem 1.25rem;
  box-shadow: var(--shadow-xl);
  font-size: .875rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: .5rem;
  animation: slideIn .3s ease;
  max-width: 380px;
}

.toast-success { border-left: 3px solid var(--success); }
.toast-error { border-left: 3px solid var(--danger); }
.toast-warning { border-left: 3px solid var(--warning); }
.toast-info { border-left: 3px solid var(--info); }

@keyframes slideIn {
  from { opacity: 0; transform: translateX(100%); }
  to { opacity: 1; transform: translateX(0); }
}

/* ---- Search Box ---- */
.search-box {
  position: relative;
}

.search-box input {
  padding-right: 4rem;
}

.search-box .search-btn {
  position: absolute;
  right: .375rem;
  top: .375rem;
  bottom: .375rem;
}

/* ---- Step Indicator ---- */
.steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  margin-bottom: 1.5rem;
}

.step-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .8rem;
  font-weight: 700;
  background: var(--bg-hover);
  color: var(--text-muted);
  transition: all var(--transition-fast);
}

.step-dot.active {
  background: var(--primary);
  color: #fff;
}

.step-dot.done {
  background: var(--success);
  color: #fff;
}

.step-line {
  width: 48px;
  height: 2px;
  background: var(--border-color);
  transition: background var(--transition-fast);
}

.step-line.done {
  background: var(--success);
}

/* ---- Empty State ---- */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
}

.empty-state .empty-icon {
  font-size: 3.5rem;
  color: var(--border-color);
  margin-bottom: 1rem;
}

.empty-state .empty-text {
  color: var(--text-muted);
  font-size: .95rem;
}

/* ---- Print styles ---- */
@media print {
  .ddk-nav,
  .ddk-footer,
  .category-bar,
  .carousel-arrow,
  .carousel-dots,
  .btn,
  .copy-btn { display: none !important; }
}
