﻿:root {
  --bg-top: #0f1f2d;
  --bg-bottom: #1f3a56;
  --card: #ffffff;
  --text: #1d2935;
  --muted: #5f7182;
  --accent: #ff7a00;
  --accent-2: #17a2b8;
  --line: #d8e1ea;
}

html, body {
  font-family: "Segoe UI", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  background: radial-gradient(circle at 10% 10%, #2f537a 0, var(--bg-top) 30%, var(--bg-bottom) 100%);
  color: var(--text);
  min-height: 100%;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(12px);
  background: rgba(9, 20, 31, 0.82);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.brand {
  color: #fff;
  text-decoration: none;
  font-size: 1.2rem;
  font-weight: 700;
}

.nav-pill {
  display: inline-block;
  text-decoration: none;
  color: #dce7f3;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  padding: 0.35rem 0.8rem;
  background: rgba(255, 255, 255, 0.03);
}

.nav-pill.danger {
  color: #ffd2d2;
}

.lang-btn {
  color: #fff;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 0.5rem;
  padding: 0.25rem 0.55rem;
}

.lang-btn.active {
  background: #fff;
  color: #1a2c3f;
}

.hero {
  background: rgba(255, 255, 255, 0.9);
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.2);
}

.hero h1 {
  margin-bottom: 0.4rem;
}

.phone-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1rem;
}

.phone-card, .details-card, .form-card, .auth-card, .panel-table {
  background: var(--card);
  border-radius: 1rem;
  border: 1px solid var(--line);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.15);
}

.phone-card {
  overflow: hidden;
}

.phone-card img {
  width: 100%;
  height: 170px;
  object-fit: contain;
  background: #f2f6fb;
}

.phone-card-body {
  padding: 0.9rem;
}

.meta {
  color: var(--muted);
  font-size: 0.9rem;
}

.price {
  font-size: 1.35rem;
  font-weight: 700;
  color: #ea5a00;
}

.btn-modern {
  display: inline-block;
  border: none;
  text-decoration: none;
  color: #fff;
  background: linear-gradient(120deg, var(--accent), #ff9850);
  border-radius: 0.65rem;
  padding: 0.55rem 1rem;
  font-weight: 600;
}

.empty-state {
  padding: 2rem;
  text-align: center;
  background: rgba(255, 255, 255, 0.88);
  border-radius: 1rem;
}

.details-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.details-gallery-modern {
  background: var(--card);
  border-radius: 1rem;
  border: 1px solid var(--line);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.15);
  padding: 0.8rem;
}

.details-main-image-wrap {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 0.8rem;
  overflow: hidden;
  background: #eef4fb;
}

.details-main-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #f2f6fb;
  cursor: zoom-in;
}

.details-thumbs {
  display: flex;
  gap: 0.45rem;
  margin-top: 0.65rem;
  flex-wrap: wrap;
}

.thumb-btn {
  width: 74px;
  height: 56px;
  border: 2px solid transparent;
  border-radius: 0.45rem;
  overflow: hidden;
  padding: 0;
  background: transparent;
}

.thumb-btn img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #f2f6fb;
}

.thumb-btn.active {
  border-color: #3b82f6;
}

.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 12, 18, 0.92);
  z-index: 1040;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.lightbox-overlay.open {
  display: flex;
}

.lightbox-figure {
  margin: 0;
  width: min(94vw, 1300px);
  height: min(88vh, 900px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-figure img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 0.8rem;
  background: #0f1723;
}

.lightbox-close {
  position: absolute;
  top: 14px;
  right: 18px;
  border: 0;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  font-size: 1.7rem;
  line-height: 1;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 2rem;
  line-height: 1;
}

.lightbox-nav.prev {
  left: 14px;
}

.lightbox-nav.next {
  right: 14px;
}

.details-card {
  padding: 1.2rem;
}

.spec-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem 1rem;
}

.auth-card {
  max-width: 430px;
  margin: 2rem auto;
  padding: 1.4rem;
}

.form-card {
  padding: 1.2rem;
}

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

.upload-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 0.7rem;
}

.preview-item {
  border-radius: 0.6rem;
  overflow: hidden;
  border: 1px solid var(--line);
}

.preview-item img {
  width: 100%;
  height: 100px;
  object-fit: cover;
}

.condition-block {
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  background: #f8fbff;
}

.picker-input {
  cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, #6b7787 50%), linear-gradient(135deg, #6b7787 50%, transparent 50%);
  background-position: calc(100% - 20px) calc(50% - 3px), calc(100% - 14px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.picker-options-list {
  max-height: 54vh;
  overflow: auto;
  display: grid;
  gap: 0.45rem;
}

.picker-option-btn {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 0.6rem;
  padding: 0.65rem 0.75rem;
  text-align: left;
}

.picker-empty {
  border: 1px dashed var(--line);
  color: var(--muted);
  border-radius: 0.6rem;
  padding: 0.7rem;
}

.action-group {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.btn-action-icon {
  width: 34px;
  height: 34px;
  border-radius: 0.55rem;
  border: 1px solid var(--line);
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 1rem;
  line-height: 1;
}

.btn-action-icon.edit {
  color: #2563eb;
  border-color: #93c5fd;
}

.btn-action-icon.delete {
  color: #b91c1c;
  border-color: #fca5a5;
}

.admin-mobile-list {
  display: none;
}

.admin-mobile-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  padding: 0.9rem;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
  margin-bottom: 0.75rem;
}

.admin-mobile-card h4 {
  font-size: 1.05rem;
  margin-bottom: 0.55rem;
}

.admin-mobile-card p {
  margin-bottom: 0.45rem;
}

@media (max-width: 900px) {
  .details-wrap, .form-grid, .upload-row {
    grid-template-columns: 1fr;
  }

  .topbar .container {
    justify-content: center;
  }

  .thumb-btn {
    width: 64px;
    height: 48px;
  }

  .admin-header {
    align-items: stretch !important;
  }

  .admin-header-actions {
    width: 100%;
    display: grid !important;
    grid-template-columns: 1fr 1fr;
  }

  .admin-header-actions a {
    text-align: center;
    white-space: nowrap;
  }

  .admin-table-desktop {
    display: none;
  }

  .admin-mobile-list {
    display: block;
  }
}
