/* =========================================
   车牌查询系统 - 现代化UI设计
   完全响应式，移动端优先设计
   ========================================= */

:root {
  /* 颜色方案 - 现代柔和色调 */
  --primary-color: #4361ee;
  --primary-light: #4895ef;
  --primary-dark: #3a0ca3;
  --secondary-color: #7209b7;
  --success-color: #4cc9f0;
  --danger-color: #f72585;
  --warning-color: #f8961e;
  --info-color: #43aa8b;

  /* 中性色 */
  --light-color: #f8f9fa;
  --dark-color: #212529;
  --gray-100: #f8f9fa;
  --gray-200: #e9ecef;
  --gray-300: #dee2e6;
  --gray-400: #ced4da;
  --gray-500: #adb5bd;
  --gray-600: #6c757d;
  --gray-700: #495057;
  --gray-800: #343a40;
  --gray-900: #212529;

  /* 阴影 */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.15);

  /* 圆角 */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  /* 过渡 */
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;
}

/* =========================================
   基础重置与全局样式
   ========================================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
  font-size: 16px;
  line-height: 1.6;
  color: var(--gray-800);
  background: linear-gradient(135deg, #f5f7fa 0%, #e4e8f0 100%);
  min-height: 100vh;
  padding-bottom: 2rem;
}

/* =========================================
   容器与布局
   ========================================= */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

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

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

/* =========================================
   标题与文本
   ========================================= */
h1 {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--dark-color);
  margin-bottom: 2rem;
  text-align: center;
  background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  position: relative;
  padding-bottom: 1rem;
}

h1::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
  border-radius: 2px;
}

h3 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--gray-800);
  margin-bottom: 1.5rem;
  position: relative;
  padding-bottom: 0.75rem;
}

h3::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 60px;
  height: 3px;
  background: var(--primary-color);
  border-radius: 2px;
}

/* =========================================
   主卡片设计
   ========================================= */
.main-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  margin-bottom: 2rem;
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.main-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-xl);
}

@media (max-width: 768px) {
  .main-card {
    padding: 1.75rem;
    border-radius: var(--radius-md);
  }
}

@media (max-width: 576px) {
  .main-card {
    padding: 1.25rem;
    border-radius: var(--radius-sm);
  }
}

/* =========================================
   表单元素
   ========================================= */
.form-group {
  margin-bottom: 1.75rem;
}

.form-label {
  display: block;
  font-size: 1rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 0.5rem;
}

.form-control {
  width: 100%;
  padding: 1rem 1.25rem;
  font-size: 1rem;
  font-weight: 500;
  color: var(--gray-800);
  background: var(--gray-100);
  border: 2px solid var(--gray-300);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  outline: none;
}

.form-control:focus {
  border-color: var(--primary-color);
  background: white;
  box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.15);
  transform: translateY(-1px);
}

.form-control::placeholder {
  color: var(--gray-500);
}

.form-text {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: var(--gray-600);
}

/* =========================================
   按钮设计
   ========================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
  outline: none;
  user-select: none;
}

.btn::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  background: rgba(255, 255, 255, 0.5);
  opacity: 0;
  border-radius: 100%;
  transform: scale(1, 1) translate(-50%);
  transform-origin: 50% 50%;
}

.btn:focus:not(:active)::after {
  animation: ripple 1s ease-out;
}

@keyframes ripple {
  0% {
    transform: scale(0, 0);
    opacity: 0.5;
  }
  100% {
    transform: scale(20, 20);
    opacity: 0;
  }
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
  color: white;
  box-shadow: 0 4px 14px rgba(67, 97, 238, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(67, 97, 238, 0.4);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-info {
  background: linear-gradient(135deg, var(--info-color), #4cc9f0);
  color: white;
  box-shadow: 0 4px 14px rgba(67, 170, 139, 0.3);
}

.btn-info:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(67, 170, 139, 0.4);
}

.btn-secondary {
  background: var(--gray-600);
  color: white;
}

.btn-secondary:hover {
  background: var(--gray-700);
  transform: translateY(-2px);
}

.btn-block {
  width: 100%;
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

/* =========================================
   加载状态
   ========================================= */
#loading, #imageLoading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  min-height: 200px;
}

.loading-spinner {
  width: 4rem;
  height: 4rem;
  border: 4px solid var(--gray-200);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-text {
  margin-top: 1rem;
  color: var(--gray-600);
  font-size: 1.125rem;
  font-weight: 500;
}

/* =========================================
   查询结果区域
   ========================================= */
#resultSection {
  animation: fadeIn 0.5s ease;
}

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

/* 查询信息卡片 */
#queryInfo {
  background: linear-gradient(135deg, rgba(67, 97, 238, 0.08), rgba(76, 201, 240, 0.08));
  border-left: 4px solid var(--primary-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 2rem;
  animation: slideInLeft 0.5s ease;
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.query-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.query-info-item {
  flex: 1;
  min-width: 200px;
}

.query-info-label {
  font-size: 0.875rem;
  color: var(--gray-600);
  margin-bottom: 0.25rem;
  font-weight: 500;
}

.query-info-value {
  font-size: 1.125rem;
  color: var(--gray-800);
  font-weight: 600;
}

/* 错误提示 */
#errorAlert {
  background: linear-gradient(135deg, rgba(247, 37, 133, 0.1), rgba(248, 150, 30, 0.1));
  border-left: 4px solid var(--danger-color);
  color: var(--danger-color);
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
  animation: shake 0.5s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
  20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* =========================================
   结果表格 - 桌面端设计
   ========================================= */
.table-container {
  background: white;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  margin-bottom: 2rem;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table thead {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
}

.table th {
  padding: 1.25rem 1rem;
  color: white;
  font-weight: 600;
  text-align: left;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.table tbody tr {
  transition: background-color var(--transition-fast);
}

.table tbody tr:nth-child(even) {
  background-color: rgba(67, 97, 238, 0.02);
}

.table tbody tr:hover {
  background-color: rgba(67, 97, 238, 0.05);
}

.table td {
  padding: 1rem;
  border-bottom: 1px solid var(--gray-200);
  color: var(--gray-700);
  font-size: 0.95rem;
}

.table td:last-child {
  text-align: center;
}

/* =========================================
   结果卡片 - 移动端设计
   ========================================= */
.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.result-card {
  background: white;
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--gray-200);
  transition: all var(--transition-normal);
}

.result-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-light);
}

.result-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--gray-100);
}

.result-card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--gray-800);
}

.result-card-id {
  font-size: 0.875rem;
  color: var(--gray-600);
  background: var(--gray-100);
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
}

.result-card-body {
  margin-bottom: 1.25rem;
}

.result-card-item {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.result-card-label {
  font-size: 0.875rem;
  color: var(--gray-600);
  font-weight: 500;
}

.result-card-value {
  font-size: 0.95rem;
  color: var(--gray-800);
  font-weight: 600;
  text-align: right;
  max-width: 60%;
  word-break: break-word;
}

.result-card-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

/* =========================================
   模态框设计
   ========================================= */
.modal-content {
  border-radius: var(--radius-lg);
  border: none;
  overflow: hidden;
  box-shadow: var(--shadow-xl);
}

.modal-header {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
  color: white;
  padding: 1.5rem 1.75rem;
  border-bottom: none;
}

.modal-title {
  font-weight: 600;
  font-size: 1.5rem;
}

.modal-body {
  padding: 2rem;
}

.modal-footer {
  padding: 1.5rem;
  border-top: 1px solid var(--gray-200);
  background: var(--gray-100);
}

/* 图片轮播 */
.carousel-container {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--gray-100);
  min-height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.carousel-inner {
  border-radius: var(--radius-md);
  overflow: hidden;
}

.carousel-item {
  text-align: center;
}

.carousel-item img {
  max-height: 450px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  margin: 0 auto;
}

.carousel-control-prev,
.carousel-control-next {
  width: 50px;
  height: 50px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 50%;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.8;
  transition: all var(--transition-fast);
}

.carousel-control-prev:hover,
.carousel-control-next:hover {
  background: rgba(0, 0, 0, 0.5);
  opacity: 1;
}

.carousel-control-prev {
  left: 20px;
}

.carousel-control-next {
  right: 20px;
}

/* 无图片状态 */
.no-images {
  text-align: center;
  padding: 3rem;
}

.no-images-icon {
  font-size: 4rem;
  color: var(--gray-400);
  margin-bottom: 1rem;
}

.no-images-text {
  color: var(--gray-600);
  font-size: 1.125rem;
}

/* =========================================
   响应式设计
   ========================================= */

/* 平板设备 */
@media (max-width: 992px) {
  h1 {
    font-size: 2.25rem;
  }

  h3 {
    font-size: 1.5rem;
  }

  .main-card {
    padding: 2rem;
  }
}

/* 移动设备 */
@media (max-width: 768px) {
  body {
    padding-bottom: 1.5rem;
  }

  h1 {
    font-size: 1.875rem;
    margin-bottom: 1.5rem;
  }

  h1::after {
    width: 80px;
  }

  h3 {
    font-size: 1.375rem;
    margin-bottom: 1.25rem;
  }

  .main-card {
    padding: 1.5rem;
    margin-bottom: 1.5rem;
  }

  .form-control {
    padding: 0.875rem 1rem;
  }

  .btn {
    padding: 0.875rem 1.5rem;
  }

  /* 移动端表格转换为卡片 */
  .table-container {
    display: none;
  }

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

  .result-card {
    padding: 1.25rem;
  }

  .query-info-row {
    flex-direction: column;
    gap: 0.75rem;
  }

  .query-info-item {
    min-width: 100%;
  }

  .modal-body {
    padding: 1.5rem;
  }

  .carousel-container {
    min-height: 300px;
  }

  .carousel-item img {
    max-height: 300px;
  }

  .carousel-control-prev,
  .carousel-control-next {
    width: 40px;
    height: 40px;
  }
}

/* 小屏幕移动设备 */
@media (max-width: 576px) {
  h1 {
    font-size: 1.625rem;
    margin-bottom: 1.25rem;
  }

  h3 {
    font-size: 1.25rem;
  }

  .main-card {
    padding: 1.25rem;
    border-radius: var(--radius-md);
  }

  .btn {
    padding: 0.75rem 1.25rem;
    font-size: 0.95rem;
  }

  .result-card {
    padding: 1rem;
  }

  .result-card-item {
    flex-direction: column;
    margin-bottom: 0.5rem;
  }

  .result-card-label {
    margin-bottom: 0.25rem;
  }

  .result-card-value {
    max-width: 100%;
    text-align: left;
  }

  .modal-header {
    padding: 1.25rem 1.5rem;
  }

  .modal-body {
    padding: 1.25rem;
  }

  .modal-footer {
    padding: 1.25rem;
  }

  .carousel-container {
    min-height: 250px;
  }

  .carousel-item img {
    max-height: 250px;
  }
}

/* 超小屏幕 */
@media (max-width: 380px) {
  .container {
    padding: 0 0.375rem;
  }

  h1 {
    font-size: 1.5rem;
  }

  .main-card {
    padding: 1rem;
  }

  .result-card-actions {
    flex-direction: column;
  }

  .result-card-actions .btn {
    width: 100%;
    margin-bottom: 0.5rem;
  }
}

/* =========================================
   新增UI组件样式
   ========================================= */

/* 页面头部 */
.page-header {
  text-align: center;
  margin-bottom: 3rem;
  padding-top: 2rem;
}

.page-subtitle {
  font-size: 1.125rem;
  color: var(--gray-600);
  margin-top: 0.75rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}

/* 卡片头部 */
.card-header {
  margin-bottom: 1.5rem;
}

.card-header h2 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--gray-800);
  margin-bottom: 0.5rem;
}

.card-header p {
  font-size: 1rem;
  color: var(--gray-600);
  line-height: 1.5;
}

/* 按钮图标 */
.btn-icon {
  margin-right: 0.5rem;
  font-size: 1.125rem;
}

.btn-text {
  font-weight: 600;
}

/* 加载状态 */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  margin: 2rem 0;
}

.loading-spinner {
  width: 4rem;
  height: 4rem;
  border: 4px solid var(--gray-200);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1.5rem;
}

.loading-text {
  font-size: 1.125rem;
  color: var(--gray-600);
  font-weight: 500;
}

/* 结果区域 */
.results-section {
  margin-top: 2rem;
  animation: fadeIn 0.5s ease;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--gray-200);
}

.section-actions {
  display: flex;
  gap: 0.75rem;
}

/* 错误提示样式 */
.alert-error {
  background: linear-gradient(135deg, rgba(247, 37, 133, 0.1), rgba(248, 150, 30, 0.1));
  border-left: 4px solid var(--danger-color);
  color: var(--danger-color);
  padding: 1.25rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
  font-weight: 500;
}

/* 空状态 */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  margin: 2rem 0;
}

.empty-state-icon {
  font-size: 4rem;
  color: var(--gray-400);
  margin-bottom: 1.5rem;
}

.empty-state-title {
  font-size: 1.5rem;
  color: var(--gray-700);
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.empty-state-text {
  font-size: 1.125rem;
  color: var(--gray-600);
  max-width: 400px;
  margin: 0 auto;
  line-height: 1.6;
}

/* 模态框图标 */
.modal-title-icon {
  margin-right: 0.5rem;
}

/* 响应式调整 */
@media (max-width: 768px) {
  .page-header {
    margin-bottom: 2rem;
    padding-top: 1.5rem;
  }

  .page-subtitle {
    font-size: 1rem;
    padding: 0 1rem;
  }

  .card-header h2 {
    font-size: 1.5rem;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .section-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .loading-state {
    padding: 3rem 1.5rem;
  }

  .empty-state {
    padding: 3rem 1.5rem;
  }
}

@media (max-width: 576px) {
  .page-header {
    margin-bottom: 1.5rem;
  }

  .page-subtitle {
    font-size: 0.95rem;
  }

  .card-header h2 {
    font-size: 1.375rem;
  }

  .btn-icon {
    margin-right: 0.375rem;
    font-size: 1rem;
  }

  .loading-spinner {
    width: 3rem;
    height: 3rem;
  }

  .loading-text {
    font-size: 1rem;
  }
}

/* 打印样式 */
@media print {
  .main-card,
  .result-card,
  .table-container {
    box-shadow: none;
    border: 1px solid var(--gray-300);
  }

  .btn {
    display: none;
  }

  .modal {
    display: none !important;
  }
}