/* ===== 底部 Tab Bar ===== */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 12px;
}

.alert-warning {
  background: #FEF3E2;
  border-left: 4px solid var(--color-warning);
  color: var(--color-text);
  font-weight: 500;
}

.alert-success {
  background: #ECF9F4;
  border-left: 4px solid var(--color-success);
  color: var(--color-text);
}

.alert-error {
  background: #FDE8E8;
  border-left: 4px solid var(--color-danger);
  color: var(--color-text);
}

/* ===== 选品采购状态 ===== */
.primary-status-group {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  flex-wrap: wrap;
}

.primary-status-group .btn {
  flex: 1;
  min-width: 80px;
  font-size: 14px;
  padding: 8px 12px;
}

.eliminated-banner {
  padding: 16px;
  text-align: center;
  font-size: 15px;
  color: var(--color-danger);
  font-weight: 500;
  background: #FDE8E8;
  margin: 0 16px 12px;
  border-radius: var(--radius-sm);
}

.mobile-tab-bar {
  display: none;
}

@media (max-width: 767px) {
  .mobile-tab-bar {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--tab-height);
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    z-index: 100;
    padding-bottom: env(safe-area-inset-bottom, 0);
  }

  .tab-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: var(--color-text-secondary);
    text-decoration: none;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s;
    background: none;
    border: none;
    padding: 0;
    font-family: var(--font-body);
  }

  .tab-item .tab-icon {
    font-size: 22px;
    line-height: 1;
  }

  .tab-item.active {
    color: var(--color-primary);
  }

  .tab-item:active {
    opacity: 0.7;
  }
}

/* ===== 侧边栏 ===== */
.sidebar {
  display: none;
}

@media (min-width: 768px) {
  .sidebar {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--color-surface);
    border-right: 1px solid var(--color-border);
    padding: 24px 0;
    z-index: 50;
  }

  .sidebar-logo {
    padding: 0 20px 32px;
    font-family: var(--font-display);
    font-size: 22px;
    color: var(--color-primary);
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 16px;
  }

  .sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0 8px;
  }

  .sidebar-nav a,
  .sidebar-nav button {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    color: var(--color-text-secondary);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    background: none;
    border: none;
    font-family: var(--font-body);
    text-align: left;
    width: 100%;
  }

  .sidebar-nav a:hover,
  .sidebar-nav button:hover {
    background: var(--color-primary-light);
    color: var(--color-primary);
  }

  .sidebar-nav a.active,
  .sidebar-nav button.active {
    background: var(--color-primary-light);
    color: var(--color-primary);
    font-weight: 600;
  }

  .sidebar-nav .nav-icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
  }

  .sidebar-footer {
    padding: 16px 20px 0;
    border-top: 1px solid var(--color-border);
    margin-top: 16px;
  }
}

/* ===== Header ===== */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0 20px;
  gap: 12px;
}

.page-title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 400;
  color: var(--color-text);
  line-height: 1.2;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-actions .btn {
  flex-shrink: 0;
}

/* ===== Grid 布局 ===== */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}

/* ===== Stats Card ===== */
.stat-card {
  background: var(--color-surface);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.stat-card .stat-label {
  font-size: 13px;
  color: var(--color-text-secondary);
  margin-bottom: 4px;
}

.stat-card .stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--color-text);
}

.stat-card .stat-sub {
  font-size: 12px;
  color: var(--color-text-secondary);
  margin-top: 2px;
}

/* ===== List ===== */
.list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--color-border);
  cursor: pointer;
  transition: background 0.2s;
}

.list-item:last-child {
  border-bottom: none;
}

.list-item:active {
  background: var(--color-primary-light);
  margin: 0 -12px;
  padding-left: 12px;
  padding-right: 12px;
  border-radius: var(--radius-sm);
}

.list-item-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--color-primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.list-item-content {
  flex: 1;
  min-width: 0;
}

.list-item-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 2px;
}

.list-item-sub {
  font-size: 13px;
  color: var(--color-text-secondary);
}

.list-item-meta {
  font-size: 13px;
  color: var(--color-text-secondary);
  text-align: right;
  flex-shrink: 0;
}

/* ===== Section ===== */
.section {
  margin-bottom: 24px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.section-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--color-text);
}

.section-link {
  font-size: 14px;
  color: var(--color-primary);
  cursor: pointer;
  background: none;
  border: none;
  font-family: var(--font-body);
  font-weight: 500;
}

/* ===== Modal ===== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

@media (min-width: 768px) {
  .modal-overlay {
    align-items: center;
  }
}

.modal-box {
  background: var(--color-surface);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 28px 24px;
  width: 100%;
  max-width: 400px;
  animation: slideUp 0.3s ease;
}

@media (min-width: 768px) {
  .modal-box {
    border-radius: var(--radius);
  }
}

.modal-confirm-icon {
  font-size: 40px;
  text-align: center;
  margin-bottom: 12px;
}

.modal-confirm-title {
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 8px;
}

.modal-confirm-desc {
  font-size: 14px;
  color: var(--color-text-secondary);
  text-align: center;
  line-height: 1.5;
}

.modal-confirm-input {
  text-align: center;
  font-size: 15px;
}

.modal {
  background: var(--color-surface);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 20px;
  width: 100%;
  max-width: 480px;
  max-height: 80vh;
  overflow-y: auto;
  animation: slideUp 0.3s ease;
}

@media (min-width: 768px) {
  .modal {
    border-radius: var(--radius);
    max-height: 70vh;
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 400;
  color: var(--color-text);
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--color-text-secondary);
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}

/* ===== Avatar ===== */
.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--color-primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--color-primary);
  font-weight: 600;
  flex-shrink: 0;
  overflow: hidden;
}

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

.avatar-lg {
  width: 64px;
  height: 64px;
  font-size: 28px;
}

/* ===== Skeleton Loading ===== */
.skeleton {
  background: linear-gradient(90deg, #f0e8e0 25%, #e8ddd0 50%, #f0e8e0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 8px;
}

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

.skeleton-text {
  height: 14px;
  margin-bottom: 8px;
  width: 100%;
}

.skeleton-text:last-child {
  width: 60%;
}

.skeleton-card {
  height: 100px;
  margin-bottom: 12px;
}

/* ===== Badge ===== */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  padding: 0 5px;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  background: var(--color-primary);
}

.badge-danger {
  background: var(--color-danger);
}

/* ===== Animations ===== */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes slideDown {
  from { transform: translateY(-100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

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