/*!
 * h5.css —— 手机版（/h5/）样式：大按钮、单列、底部操作条
 * 依赖 Bootstrap 5.3 + style.css
 */

.h5-body {
  padding-bottom: calc(74px + env(safe-area-inset-bottom));
  background: var(--bs-tertiary-bg);
}

.h5-header {
  position: sticky;
  top: 0;
  z-index: 1030;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  background: color-mix(in srgb, var(--bs-body-bg) 92%, transparent);
  border-bottom: 1px solid var(--bs-border-color-translucent);
  backdrop-filter: saturate(160%) blur(10px);
}

.h5-header .brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: inherit;
  text-decoration: none;
}

.h5-main {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px 12px 0;
}

.h5-card {
  padding: 14px;
  border: 1px solid var(--bs-border-color-translucent);
  border-radius: 14px;
  background: var(--bs-body-bg);
  box-shadow: var(--pd-shadow-sm);
}

.h5-card-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.h5-hero {
  padding: 22px 16px;
  text-align: center;
  border: 1px solid var(--bs-border-color-translucent);
  border-radius: 16px;
  background-image:
    radial-gradient(circle at 12% 0%, rgba(79, 70, 229, 0.14), transparent 55%),
    radial-gradient(circle at 88% 10%, rgba(236, 72, 153, 0.13), transparent 50%);
}

.h5-hero h1 {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.h5-hero p {
  color: var(--bs-secondary-color);
  margin-bottom: 16px;
}

.h5-btns {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.h5-btns .btn {
  min-height: 48px;
  font-size: 1rem;
}

.h5-points {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.h5-points li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 0.95rem;
}

.h5-points .dot {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 0.72rem;
  background: linear-gradient(135deg, var(--pd-brand), var(--pd-brand-2));
}

.h5-preview {
  position: relative;
  overflow: auto;
  max-height: 58vh;
  padding: 10px;
  border-radius: 12px;
  background-color: var(--bs-tertiary-bg);
  background-image:
    linear-gradient(45deg, rgba(125, 135, 150, 0.09) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(125, 135, 150, 0.09) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(125, 135, 150, 0.09) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(125, 135, 150, 0.09) 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
}

.h5-preview #previewStage {
  display: inline-block;
  border-radius: 4px;
  background: #fff;
  line-height: 0;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.16);
}

.h5-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.h5-toolbar .btn {
  min-height: 40px;
  min-width: 40px;
}

.h5-toolbar .tool-btn {
  width: 40px;
  height: 40px;
}

.h5-toolbar .tool-btn.active {
  background: var(--pd-brand);
  border-color: var(--pd-brand);
  color: #fff;
}

.h5-colorbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-size: 0.85rem;
}

.h5-colorbar .color-chips {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  flex-wrap: nowrap;
  padding-bottom: 2px;
}

.h5-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.h5-stats .stat-card {
  padding: 8px 10px;
}

.h5-stats .stat-card .value {
  font-size: 0.98rem;
}

/* 用量清单：手机上只留色块、色号、颜色名称、数量、操作 */
@media (max-width: 575.98px) {
  .h5-table {
    font-size: 0.85rem;
  }

  .h5-table th,
  .h5-table td {
    white-space: nowrap;
    padding: 0.35rem 0.3rem;
  }

  .h5-table th:nth-child(1),
  .h5-table td:nth-child(1),
  .h5-table th:nth-child(5),
  .h5-table td:nth-child(5),
  .h5-table th:nth-child(7),
  .h5-table td:nth-child(7) {
    display: none;
  }

  .h5-table .swatch {
    width: 18px;
    height: 18px;
  }
}

.h5-samples {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.h5-samples .btn,
.h5-actions-secondary .btn {
  min-height: 38px;
}

.h5-actions-secondary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.h5-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.9rem;
}

.h5-tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1035;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--bs-body-bg) 94%, transparent);
  border-top: 1px solid var(--bs-border-color-translucent);
  backdrop-filter: saturate(160%) blur(10px);
}

.h5-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 0 4px;
  border-radius: 10px;
  font-size: 0.72rem;
  line-height: 1.2;
  color: var(--bs-secondary-color);
  text-decoration: none;
}

.h5-tab svg {
  width: 22px;
  height: 22px;
}

.h5-tab.active {
  color: var(--pd-brand);
  font-weight: 600;
  background: color-mix(in srgb, var(--pd-brand) 10%, transparent);
}

.h5-tab:active {
  transform: scale(0.96);
}

.h5-actionrow {
  display: flex;
  gap: 8px;
}

.h5-actionrow .btn {
  flex: 1;
  min-height: 46px;
}

.h5-empty {
  padding: 28px 16px;
  text-align: center;
  color: var(--bs-secondary-color);
}

.h5-kv {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  font-size: 0.9rem;
  border-bottom: 1px dashed var(--bs-border-color-translucent);
}

.h5-kv:last-child {
  border-bottom: 0;
}

.h5-kv .k {
  color: var(--bs-secondary-color);
}

.h5-kv .v {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.h5-colorlist {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 6px;
  max-height: 300px;
  overflow: auto;
}

.h5-form .form-label {
  font-size: 0.92rem;
  font-weight: 600;
  margin-top: 10px;
}

.h5-form .form-select,
.h5-form .form-control {
  min-height: 44px;
}

.h5-form .form-range {
  height: 2rem;
}

.h5-form .form-check {
  min-height: 32px;
}

/* 根目录版本选择页 */
.router-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background-image:
    radial-gradient(circle at 12% 8%, rgba(79, 70, 229, 0.14), transparent 45%),
    radial-gradient(circle at 88% 12%, rgba(236, 72, 153, 0.13), transparent 42%),
    radial-gradient(rgba(120, 130, 150, 0.2) 1px, transparent 1px);
  background-size: auto, auto, 20px 20px;
}

.router-card {
  width: 100%;
  max-width: 520px;
  padding: 28px 24px;
  text-align: center;
  border: 1px solid var(--bs-border-color-translucent);
  border-radius: 18px;
  background: var(--bs-body-bg);
  box-shadow: var(--pd-shadow);
}

.router-card h1 {
  font-size: 1.45rem;
  font-weight: 800;
  margin: 12px 0 8px;
}

.router-card p {
  color: var(--bs-secondary-color);
}

.router-choices {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 18px;
}

@media (min-width: 576px) {
  .router-choices {
    flex-direction: row;
  }
}

.router-choice {
  flex: 1;
  padding: 16px 14px;
  border: 1px solid var(--bs-border-color-translucent);
  border-radius: 14px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.router-choice:hover {
  border-color: var(--pd-brand);
  color: inherit;
  transform: translateY(-2px);
}

.router-choice .title {
  display: block;
  font-weight: 700;
  margin-bottom: 2px;
}

.router-choice .desc {
  display: block;
  font-size: 0.82rem;
  color: var(--bs-secondary-color);
}
