.admin-page {
  min-height: 100vh;
  background: var(--warm-gradient-page);
  padding: 16px;
  box-sizing: border-box;
}

.admin-top {
  max-width: 960px;
  margin: 0 auto 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
}

.admin-top h1 {
  font-size: 1.25rem;
  margin: 0;
  color: #5c3d42;
}

.admin-top-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-top-actions button {
  padding: 8px 14px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 14px;
  background: #fff;
  color: #5c3d42;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.admin-top-actions button.danger {
  background: #e07a5f;
  color: #fff;
}

.admin-tabs {
  max-width: 960px;
  margin: 0 auto 16px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-tabs button {
  padding: 8px 14px;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.55);
  color: #5c3d42;
  font-size: 14px;
}

.admin-tabs button.active {
  background: var(--accent);
  color: #fff;
}

.admin-panel {
  max-width: 960px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}

.admin-msg {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--accent-link);
}

.admin-msg.err {
  color: #c0392b;
}

.admin-form-grid label {
  display: block;
  font-size: 12px;
  color: #555;
  margin-bottom: 4px;
}

.admin-form-grid input,
.admin-form-grid textarea {
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 12px;
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 14px;
}

/* 复选框/单选框不应被拉成整行宽，否则文字会「飞到」行尾 */
.admin-form-grid input[type='checkbox'],
.admin-form-grid input[type='radio'] {
  width: auto;
  min-width: 1.125rem;
  max-width: none;
  margin-bottom: 0;
  padding: 0;
  border: none;
  border-radius: 4px;
  flex-shrink: 0;
  align-self: center;
}

/* 覆盖 .admin-form-grid label { display:block }，与勾选文字同一行对齐 */
.admin-form-grid label.admin-check {
  display: flex !important;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  margin-bottom: 0;
  width: 100%;
  box-sizing: border-box;
  cursor: pointer;
}

.admin-form-grid textarea {
  min-height: 72px;
  resize: vertical;
}

.admin-form-actions {
  margin-top: 8px;
}

.admin-form-actions button {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-size: 14px;
}

/* 技术栈「已有项」：多列网格，减少纵向滚动 */
.admin-tech-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
  align-items: start;
}

.admin-tech-card {
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  padding: 8px 10px;
  background: #fafafa;
  min-width: 0;
}

.admin-tech-card .admin-row-head {
  margin-bottom: 0;
  flex-wrap: nowrap;
  justify-content: flex-start;
}

.admin-tech-card__ico {
  flex-shrink: 0;
}

.admin-tech-card__ph {
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}

.admin-tech-card__name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #5c3d42;
}

.admin-tech-card .admin-row-btns {
  flex-shrink: 0;
}

.admin-row {
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 12px;
  background: #fafafa;
}

.admin-row-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.admin-row-head strong {
  color: #5c3d42;
}

.admin-row-btns {
  display: flex;
  gap: 6px;
}

.admin-row-btns button {
  padding: 6px 12px;
  font-size: 13px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  background: #fff;
  border: 1px solid #ccc;
}

.admin-row-btns button.warn {
  background: #fde8e4;
  border-color: #e07a5f;
  color: #922b21;
}

.admin-check {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-right: 12px;
  font-size: 13px;
}

.admin-check-row {
  display: flex;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.admin-summary {
  margin-bottom: 16px;
  padding: 14px;
  background: #fff8f5;
  border-radius: 10px;
  border: 1px solid #fce0d8;
}

.admin-summary p {
  margin: 0 0 6px;
}

.admin-summary-meta {
  font-size: 13px;
  color: #555;
}

.admin-toolbar {
  margin-bottom: 16px;
}

.admin-toolbar-btn {
  padding: 10px 18px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  background: #e8e8e8;
  color: #333;
}

.admin-toolbar-btn.primary {
  background: var(--accent);
  color: #fff;
}

.admin-toolbar-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.admin-list-heading {
  margin: 0 0 12px;
  font-size: 1rem;
  color: #5c3d42;
}

.admin-row-sub {
  font-size: 13px;
  color: #555;
}

/* 管理后台 · 项目列表卡片 */
.admin-project-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.admin-project-card__icon-wrap {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #e0e0e0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.admin-project-card__icon {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.admin-project-card__main {
  flex: 1;
  min-width: 0;
}

.admin-project-card__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.admin-project-card__title {
  font-size: 1rem;
  color: #5c3d42;
  line-height: 1.3;
}

.admin-project-card__desc {
  margin: 0 0 8px;
  font-size: 13px;
  color: #555;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.admin-project-card__link {
  display: inline-block;
  max-width: 100%;
  font-size: 12px;
  color: var(--accent-link);
  word-break: break-all;
  text-decoration: none;
  margin-bottom: 8px;
}

.admin-project-card__link:hover {
  text-decoration: underline;
}

.admin-project-card__link--empty {
  color: #999;
  cursor: default;
}

.admin-project-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.admin-project-card__tag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #fff0eb;
  color: #9d4e56;
  border: 1px solid #f5cfc4;
}

.admin-project-card__tag--more {
  background: #f5f5f5;
  color: #666;
  border-color: #ddd;
}

.admin-project-card__tag--tech {
  background: #e3f2fd;
  color: #1565c0;
  border-color: #90caf9;
}

.admin-project-card__pill {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 600;
}

.admin-project-card__pill--dev {
  background: #e3f2fd;
  color: #1565c0;
  border: 1px solid #90caf9;
}

.admin-project-card__pill--deploy {
  background: #fff3e0;
  color: #e65100;
  border: 1px solid #ffcc80;
}

.admin-project-card__pill--admin {
  background: #fce4ec;
  color: #c2185b;
  border: 1px solid #f48fb1;
}

.admin-project-card__pill--hidden {
  background: #eceff1;
  color: #546e7a;
  border: 1px solid #b0bec5;
}

.admin-inline-title {
  margin-bottom: 16px;
}

.admin-title-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.admin-title-row input {
  flex: 1;
  min-width: 160px;
  box-sizing: border-box;
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 14px;
}

.admin-tech-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  max-height: 240px;
  overflow-y: auto;
  padding: 4px 0;
}

/* 项目弹窗加宽时：技术栈格子与图标放大，便于点击 */
.admin-modal-panel--wide .admin-tech-picker {
  gap: 12px;
  max-height: min(52vh, 480px);
  padding: 8px 4px;
}

.admin-modal-panel--wide .admin-tech-pick {
  width: 104px;
  min-width: 104px;
  min-height: 96px;
  padding: 12px 8px;
  gap: 8px;
  border-radius: 12px;
  font-size: 12px;
}

.admin-modal-panel--wide .admin-tech-pick__img {
  width: 44px;
  height: 44px;
}

.admin-modal-panel--wide .admin-tech-pick__ph {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  font-size: 18px;
}

.admin-modal-panel--wide .admin-tech-pick__name {
  font-size: 12px;
  line-height: 1.25;
}

.admin-tech-picker-empty {
  margin: 0;
  font-size: 13px;
  color: #888;
}

.admin-tech-pick {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 76px;
  padding: 8px 6px;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  font-size: 11px;
  color: #333;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.admin-tech-pick:hover {
  border-color: var(--accent);
}

.admin-tech-pick--on {
  border-color: var(--accent);
  background: var(--accent-alpha-14);
  box-shadow: 0 0 0 1px var(--accent-alpha-35);
}

.admin-tech-pick__img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.admin-tech-pick__ph {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #eee;
  border-radius: 6px;
  font-weight: 700;
  color: #999;
}

.admin-tech-pick__name {
  text-align: center;
  line-height: 1.2;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.admin-project-card__tech-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 3px;
  border-radius: 6px;
  box-sizing: border-box;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.admin-project-card__tech-ico img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* 技术栈项「主题色」：取色器 + 文本 + 快捷色块 */
.admin-color-row {
  display: flex;
  align-items: stretch;
  gap: 10px;
  margin-bottom: 8px;
  width: 100%;
  box-sizing: border-box;
}

.admin-form-grid .admin-color-row input {
  margin-bottom: 0;
}

/* 取色器宽度需压过 .admin-form-grid input { width:100% } */
.admin-form-grid .admin-color-row input[type='color'] {
  width: 52px;
  min-width: 52px;
  max-width: 52px;
  flex-shrink: 0;
  padding: 3px;
}

.admin-color-native {
  width: 52px;
  min-width: 52px;
  height: 42px;
  padding: 3px;
  border: 1px solid #ccc;
  border-radius: 8px;
  cursor: pointer;
  background: #fff;
  box-sizing: border-box;
}

.admin-color-native::-webkit-color-swatch-wrapper {
  padding: 2px;
}

.admin-color-native::-webkit-color-swatch {
  border-radius: 4px;
  border: none;
}

.admin-color-hex-input {
  flex: 1;
  min-width: 0;
}

.admin-color-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.admin-color-swatch {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: 2px solid rgba(0, 0, 0, 0.12);
  cursor: pointer;
  padding: 0;
  box-sizing: border-box;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.admin-color-swatch:hover {
  transform: scale(1.1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
  z-index: 1;
}

.admin-color-swatch--light {
  border-color: #bbb;
}
