/* ========== 全局基础 ========== */
:root {
  --brand: #d7263d;
  --brand-dark: #a61b2f;
  --brand-soft: #fff1f3;
  --text: #111827;
  --text-muted: #6b7280;
  --line: #d9dee7;
  --bg: #f7f7f8;
  --danger: #d93025;
  --warning: #f59e0b;
  --success: #16a34a;
  --radius: 16px;
  --shadow: 0 18px 40px rgba(17, 24, 39, 0.04);
  --el-color-primary: var(--brand);
  --el-color-primary-dark-2: var(--brand-dark);
  --el-color-primary-light-3: #e35c6d;
  --el-color-primary-light-5: #ea8390;
  --el-color-primary-light-7: #f2b0b8;
  --el-color-primary-light-8: #f7cace;
  --el-color-primary-light-9: #fdf0f2;
}

* { box-sizing: border-box; }
[v-cloak] { display: none; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.5;
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); }

/* ========== 顶部导航 ========== */
.app-header {
  min-height: 68px;
  background: #fff;
  color: var(--text);
  display: flex;
  align-items: center;
  padding: 0 32px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 100;
}
.app-header .logo {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.app-header .nav {
  margin-left: 44px;
  display: flex;
  gap: 10px;
}
.app-header .nav a {
  color: var(--text-muted);
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 14px;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.app-header .nav a:hover {
  background: #fff;
  color: var(--text);
  border-color: var(--line);
}
.app-header .nav a.active {
  background: #fff;
  color: var(--text);
  border-color: var(--brand);
}
.app-header .right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
}
.app-header .right .user {
  display: flex;
  align-items: center;
  gap: 8px;
}
.app-header .right .role-tag {
  background: var(--brand-soft);
  color: var(--brand-dark);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid rgba(215, 38, 61, 0.12);
}
.app-header .right .logout {
  cursor: pointer;
  color: var(--text-muted);
}
.app-header .right .logout:hover { color: var(--text); }

/* ========== 主体容器 ========== */
.app-main {
  padding: 32px 40px 64px;
  max-width: 1560px;
  margin: 0 auto;
}
.page-title {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 22px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.page-title::before {
  content: "";
  width: 18px;
  height: 4px;
  background: var(--brand);
  border-radius: 2px;
}
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 32px 32px;
  margin-bottom: 24px;
}
.card-title {
  font-weight: 600;
  font-size: 17px;
  margin: 0 0 24px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 8px;
}
/* ========== 工具样式 ========== */
.todo-tag {
  display: inline-block;
  background: #fff7e6;
  color: #ad6800;
  border: 1px dashed #ffc53d;
  padding: 1px 8px;
  font-size: 11px;
  border-radius: 4px;
  margin-left: 6px;
  vertical-align: middle;
  font-weight: normal;
}

.toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.toolbar .grow { flex: 1 1 auto; }

.form-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px 28px;
}
.form-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px 28px;
}
.form-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px 28px;
}
@media (max-width: 1100px) {
  .form-grid-3, .form-grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 700px) {
  .form-grid-2, .form-grid-3, .form-grid-4 { grid-template-columns: 1fr; }
}

.full-row { grid-column: 1 / -1; }

.action-bar {
  position: sticky;
  bottom: 16px;
  background: #fff;
  margin: 0;
  padding: 20px 24px;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  flex-wrap: wrap;
  border-radius: 0 0 var(--radius) var(--radius);
}

/* ========== 三张前/中/后图片 ========== */
.photo-triple {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
@media (max-width: 900px) {
  .photo-triple { grid-template-columns: 1fr; }
}
.photo-cell {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color 0.2s, transform 0.2s;
}
.photo-cell:hover {
  border-color: var(--brand);
  transform: translateY(-1px);
}
.photo-cell .seq-tag {
  display: inline-block;
  align-self: flex-start;
  background: var(--brand-soft);
  color: var(--brand-dark);
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}
.photo-cell .uploader {
  height: 220px;
  border: 1px dashed #d0d4dc;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  background: #fafbfd;
  position: relative;
  overflow: hidden;
}
.photo-cell .uploader:hover { background: #f1f5fb; color: var(--brand); }
.photo-cell .uploader img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.photo-cell .uploader .placeholder {
  text-align: center;
  font-size: 13px;
  line-height: 1.6;
}
.photo-cell .uploader .placeholder .el-icon {
  font-size: 28px;
  margin-bottom: 6px;
  display: block;
}
.photo-cell .caption-input {
  width: 100%;
}

/* ========== 表格优化 ========== */
.el-table .cell { line-height: 1.6; }
.el-table {
  --el-table-border-color: var(--line);
  --el-table-header-bg-color: #fafafa;
  border-radius: 14px;
  overflow: hidden;
}
.el-table th.el-table__cell {
  color: var(--text);
  font-weight: 600;
}
.el-tabs--border-card {
  box-shadow: none;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}
.el-tabs--border-card > .el-tabs__header {
  background: #fafafa;
  border-bottom: 1px solid var(--line);
}
.el-tabs--border-card > .el-tabs__content {
  padding: 24px;
}
.el-tabs__item {
  height: 48px;
  font-weight: 500;
}

.el-form-item {
  margin-bottom: 22px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
.form-grid-2 > .el-form-item,
.form-grid-3 > .el-form-item,
.form-grid-4 > .el-form-item {
  margin-bottom: 0;
}
.el-form-item__label {
  width: auto !important;
  padding: 0 0 8px !important;
  margin: 0 !important;
  justify-content: flex-start !important;
  line-height: 1.5 !important;
  font-size: 13px;
  font-weight: 600;
  color: var(--text) !important;
}
.el-form-item__content {
  margin-left: 0 !important;
  min-height: auto;
  line-height: 1.5;
}
.el-input,
.el-select,
.el-textarea,
.el-date-editor.el-input,
.el-date-editor.el-input__wrapper {
  width: 100%;
}
.el-input__wrapper,
.el-select__wrapper,
.el-date-editor.el-input__wrapper,
.el-textarea__inner,
.el-input-number .el-input__wrapper {
  min-height: 44px;
  border-radius: 10px;
}
.el-textarea__inner {
  padding-top: 10px;
  padding-bottom: 10px;
  line-height: 1.6;
}
.el-button {
  min-height: 42px;
  padding: 0 18px;
  border-radius: 10px;
  font-weight: 600;
}
.el-dialog {
  border-radius: 18px;
}
.el-drawer {
  border-radius: 18px 0 0 18px;
}
.el-dialog__header,
.el-drawer__header {
  margin-bottom: 0;
  padding: 22px 24px 14px;
  border-bottom: 1px solid var(--line);
}
.el-dialog__body,
.el-drawer__body {
  padding: 24px;
}
.el-dialog__footer {
  padding: 0 24px 24px;
}

@media (max-width: 960px) {
  .app-header {
    padding: 16px 20px;
    gap: 14px;
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .app-header .nav {
    width: 100%;
    margin-left: 0;
    overflow-x: auto;
    padding-bottom: 2px;
  }
  .app-header .right {
    margin-left: 0;
  }
  .app-main {
    padding: 24px 18px 48px;
  }
  .card {
    padding: 22px 18px 24px;
  }
  .toolbar {
    align-items: stretch;
  }
  .toolbar .grow {
    display: none;
  }
  .action-bar {
    bottom: 12px;
    padding: 18px;
  }
  .el-tabs--border-card > .el-tabs__content {
    padding: 18px;
  }
}
