* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Segoe UI", Arial, sans-serif;
  color: #1c1c1e;
  background: #f4f4f6;
  font-size: 14px;
}

/* === 登录 === */
.login-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1c1c1e, #3c2a14);
}
.login-card {
  width: 420px;
  background: #fff;
  border-radius: 18px;
  padding: 40px 36px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}
.brand {
  font-size: 28px; font-weight: 700;
  background: linear-gradient(135deg, #d6a14d, #5b3a14);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.brand-en { font-size: 12px; letter-spacing: 4px; color: #8a6526; margin-top: 4px; }
.form { margin-top: 28px; }
.form input { width: 100%; padding: 12px 14px; border: 1px solid #e5e5ea; border-radius: 10px; margin-bottom: 14px; font-size: 14px; }
.form button { width: 100%; padding: 14px; background: linear-gradient(135deg, #d6a14d, #8a6526); color: #fff; border: 0; border-radius: 10px; font-size: 15px; font-weight: 600; cursor: pointer; }
.form button:disabled { opacity: 0.6; cursor: not-allowed; }
.form .err { color: #d92525; margin-top: 12px; font-size: 13px; }
.tip { margin-top: 18px; font-size: 12px; color: #8e8e93; text-align: center; }

/* === 主布局 === */
.layout { display: flex; min-height: 100vh; }
.side {
  width: 220px;
  background: #1c1c1e;
  color: #fff;
  display: flex; flex-direction: column;
  padding: 24px 0;
}
.logo {
  padding: 0 24px 28px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 2px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.menu-item {
  padding: 14px 24px;
  cursor: pointer;
  font-size: 14px;
  color: #d1d1d6;
  border-left: 3px solid transparent;
}
.menu-item:hover { background: rgba(255,255,255,0.05); }
.menu-item.active {
  background: rgba(214, 161, 77, 0.12);
  color: #f5d589;
  border-left-color: #d6a14d;
}
.side-bottom { margin-top: auto; padding: 16px 24px; border-top: 1px solid rgba(255,255,255,0.08); }
.side-bottom .user { font-size: 13px; color: #d1d1d6; }
.logout {
  margin-top: 10px; background: transparent; color: #d1d1d6;
  border: 1px solid rgba(255,255,255,0.18); border-radius: 6px;
  padding: 6px 14px; font-size: 12px; cursor: pointer;
}

.main { flex: 1; padding: 28px 32px; overflow-x: hidden; }
.page-head {
  display: flex; align-items: center; margin-bottom: 20px;
}
.page-head h2 { margin: 0; font-size: 22px; flex: 1; }
.filters { display: flex; gap: 8px; }
.filters input, .filters select {
  padding: 8px 12px; border: 1px solid #e5e5ea; border-radius: 8px; font-size: 13px;
  min-width: 160px;
}
.filters button, .page-head button {
  padding: 8px 16px; border: 0; border-radius: 8px; cursor: pointer;
  font-size: 13px;
  background: #fff; color: #1c1c1e; border: 1px solid #e5e5ea;
}
.page-head button.primary, .filters button.primary { background: #1c1c1e; color: #fff; border-color: #1c1c1e; }

/* === 表格 === */
.table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.table th, .table td { padding: 14px 16px; text-align: left; border-bottom: 1px solid #f0f0f3; vertical-align: middle; }
.table th { background: #fafafb; color: #5b5b60; font-weight: 600; font-size: 13px; }
.table td .small { font-size: 12px; }
.table .empty { text-align: center; color: #8e8e93; padding: 40px; }
.thumb { width: 60px; height: 60px; object-fit: cover; border-radius: 6px; background: #eee; }
.mono { font-family: 'Courier New', monospace; }
.gold { color: #b8893d; font-weight: 600; }
.muted { color: #8e8e93; }
.small { font-size: 12px; }

.badge { padding: 3px 10px; border-radius: 999px; font-size: 12px; display: inline-block; margin-right: 4px; }
.b-pending { background: #fef3c7; color: #b45309; }
.b-paid { background: #dbeafe; color: #1d4ed8; }
.b-confirmed { background: #d1fae5; color: #047857; }
.b-cancelled { background: #f3f4f6; color: #6b7280; }
.b-sold { background: #1f2937; color: #fef3c7; }

button.primary { background: #1c1c1e; color: #fff; border: 0; border-radius: 6px; padding: 6px 12px; cursor: pointer; font-size: 12px; margin-right: 6px; }
button.ghost { background: #fff; border: 1px solid #d1d1d6; border-radius: 6px; padding: 6px 12px; cursor: pointer; font-size: 12px; margin-right: 6px; color: #1c1c1e; }
button.danger { background: #fff; border: 1px solid #fca5a5; color: #dc2626; border-radius: 6px; padding: 6px 12px; cursor: pointer; font-size: 12px; }
button.danger:disabled { background: #f3f4f6; border-color: #e5e7eb; color: #9ca3af; cursor: not-allowed; }
button.danger:not(:disabled):hover { background: #fef2f2; }

/* === 档案删除二次确认 === */
.danger-banner {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 13px;
  line-height: 1.7;
  margin-bottom: 18px;
}
.archive-detail {
  background: #fafafb;
  border-radius: 10px;
  padding: 14px 18px;
  font-size: 13px;
  line-height: 2;
  margin-bottom: 18px;
}
.confirm-input { margin-bottom: 8px; }
.confirm-input .lbl { font-size: 13px; color: #4b5563; margin-bottom: 8px; }
.confirm-serial-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-family: 'Courier New', monospace;
  font-size: 14px;
  letter-spacing: 1px;
}
.confirm-serial-input:focus { outline: none; border-color: #1c1c1e; }
.err.small { color: #dc2626; margin-top: 6px; }
.ok.small { color: #047857; margin-top: 6px; }

/* === 弹窗 === */
.modal-mask {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: 60px;
  z-index: 999;
}
.modal {
  background: #fff;
  border-radius: 12px;
  width: 720px;
  max-width: 90%;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.modal-head {
  padding: 16px 22px;
  border-bottom: 1px solid #f0f0f3;
  display: flex; align-items: center;
  font-size: 16px; font-weight: 600;
}
.modal-head .close { margin-left: auto; font-size: 24px; cursor: pointer; color: #8e8e93; line-height: 1; }
.modal-head .close:hover { color: #1c1c1e; }
.dialog-body { padding: 22px; overflow-y: auto; }
.modal-foot {
  display: flex; gap: 12px; justify-content: flex-end;
  padding-top: 18px; margin-top: 12px;
  border-top: 1px solid #f0f0f3;
}
.modal-foot button {
  padding: 10px 20px; border-radius: 8px; font-size: 13px;
  border: 1px solid #d1d1d6; background: #fff; cursor: pointer;
}
.modal-foot button.primary {
  background: linear-gradient(135deg, #d6a14d, #8a6526);
  color: #fff; border: 0;
}
.modal-foot button.primary:disabled { opacity: 0.6; cursor: not-allowed; }

.hint { background: #faf6ee; border-left: 3px solid #d6a14d; padding: 10px 14px; border-radius: 6px; font-size: 13px; margin-bottom: 16px; line-height: 1.6; }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid label { display: flex; flex-direction: column; font-size: 12px; color: #5b5b60; }
.grid label.full { grid-column: 1 / -1; }
.grid input, .grid select, .grid textarea {
  margin-top: 6px;
  padding: 9px 12px;
  border: 1px solid #e5e5ea;
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
}
.grid textarea { resize: vertical; }

.result { text-align: center; padding: 20px 0; }
.result-tip { color: #5b5b60; }
.result-serial {
  margin: 16px 0;
  font-size: 32px; font-weight: 700;
  letter-spacing: 4px; color: #5b3a14;
  font-family: 'Courier New', monospace;
}

/* === 上传组件 === */
.lbl {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  color: #5b5b60;
}
.up-single { }
.up-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.up-thumb {
  position: relative;
  width: 110px;
  height: 110px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e5e5ea;
  background: #fafafa;
}
.up-thumb.single {
  width: 160px;
  height: 120px;
}
.up-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.up-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  border: 0;
  cursor: pointer;
  font-size: 16px;
  line-height: 22px;
  text-align: center;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.up-remove:hover {
  background: #dc2626;
}
.up-actions {
  position: absolute;
  left: 4px;
  bottom: 4px;
  display: flex;
  gap: 3px;
}
.up-actions button {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  border: 0;
  cursor: pointer;
  font-size: 14px;
  line-height: 22px;
  padding: 0;
}
.up-actions button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}
.up-idx {
  position: absolute;
  left: 4px;
  top: 4px;
  background: rgba(214, 161, 77, 0.95);
  color: #fff;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 999px;
  font-weight: 600;
}
.up-add {
  width: 110px;
  height: 110px;
  border-radius: 8px;
  border: 2px dashed #d1d1d6;
  background: #fafafa;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  font-size: 12px;
  color: #8e8e93;
  transition: all 0.15s;
  text-align: center;
}
.up-add.single {
  width: 160px;
  height: 120px;
}
.up-add:hover:not(:disabled) {
  border-color: #d6a14d;
  color: #d6a14d;
  background: #fff;
}
.up-add:disabled {
  cursor: wait;
  opacity: 0.6;
}
.up-plus {
  font-size: 28px;
  font-weight: 300;
  line-height: 1;
}
.up-add-text {
  font-size: 12px;
}
.up-hint {
  margin-top: 8px;
  font-size: 11px;
  color: #8e8e93;
}

/* === 公司简介编辑 === */
.about-form { max-width: 900px; }
.form-section {
  background: #fff;
  border-radius: 12px;
  padding: 22px 24px;
  margin-bottom: 18px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.form-section h3 {
  margin: 0 0 14px;
  font-size: 16px;
  font-weight: 600;
}
.form-section .hint {
  margin: 0 0 12px;
  background: #f7f3e9;
  border-left: 3px solid #d6a14d;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 12px;
  color: #5b5b60;
  line-height: 1.7;
}
.form-section .hint code {
  background: rgba(0,0,0,0.05);
  padding: 1px 6px;
  border-radius: 3px;
  font-family: 'Courier New', monospace;
  color: #b8893d;
}
.form-section > textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #e5e5ea;
  border-radius: 8px;
  font-size: 13px;
  font-family: 'Courier New', monospace;
  resize: vertical;
}

/* === toast === */
.toast {
  position: fixed; top: 20px; left: 50%;
  transform: translateX(-50%);
  padding: 10px 20px; border-radius: 8px;
  background: #1c1c1e; color: #fff;
  font-size: 13px; z-index: 9999;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}
.toast.error { background: #dc2626; }
.toast.success { background: #047857; }
.fade-enter-from, .fade-leave-to { opacity: 0; transform: translateX(-50%) translateY(-10px); }
.fade-enter-active, .fade-leave-active { transition: all 0.2s; }
