* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: #f0f2f7;
  color: #333;
  font-size: 14px;
}

button {
  font-family: inherit;
  cursor: pointer;
}

input {
  font-family: inherit;
}

/* ---------- 登录 ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-card {
  width: 340px;
  background: #fff;
  border-radius: 12px;
  padding: 32px 28px;
  box-shadow: 0 8px 30px rgba(30, 30, 60, 0.08);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.login-card h1 {
  font-size: 18px;
  text-align: center;
  margin-bottom: 8px;
}
.login-card input {
  height: 40px;
  border: 1px solid #dfe3ec;
  border-radius: 8px;
  padding: 0 12px;
  font-size: 14px;
}
.login-card input:focus {
  outline: none;
  border-color: #663aff;
}
.login-card button {
  height: 40px;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(301deg, #c0aeff, #663aff);
  color: #fff;
  font-size: 15px;
}
.login-err {
  color: #e05a5a;
  font-size: 13px;
  text-align: center;
}

/* ---------- 顶栏与导航 ---------- */
.topbar {
  height: 52px;
  background: #fff;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 20px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand {
  font-weight: 600;
  font-size: 16px;
}
.who {
  color: #888;
  flex: 1;
}
.link {
  border: 0;
  background: none;
  color: #663aff;
}

.menu {
  display: flex;
  gap: 8px;
  padding: 12px 20px 0;
  max-width: 1080px;
  margin: 0 auto;
}
.menu button {
  border: 0;
  background: #e6e4f5;
  color: #555;
  height: 34px;
  padding: 0 18px;
  border-radius: 17px;
  font-size: 14px;
}
.menu button.on {
  background: linear-gradient(301deg, #c0aeff, #663aff);
  color: #fff;
}

/* ---------- 面板 ---------- */
.main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 12px 20px 60px;
}
.panel {
  background: #fff;
  border-radius: 12px;
  padding: 16px 18px;
  margin-top: 12px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}
.panel.narrow {
  max-width: 620px;
}
.panel-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 12px;
}
.panel-head h2 {
  font-size: 15px;
}
.sub {
  color: #999;
  font-size: 12px;
}

/* 页面（标签）列表 */
.page-list {
  list-style: none;
}
.page-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  cursor: pointer;
}
.page-list li:hover {
  background: #f6f5fb;
}
.page-list li.on {
  background: #efeaff;
}
.page-type {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  color: #fff;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.page-type.price {
  background: #663aff;
}
.page-type.rich {
  background: #3aa875;
}
.page-name {
  flex: 1;
  font-weight: 500;
}
.ops button {
  border: 1px solid #dfe3ec;
  background: #fff;
  border-radius: 6px;
  height: 26px;
  padding: 0 8px;
  font-size: 12px;
  color: #555;
}
.ops button:disabled {
  opacity: 0.4;
  cursor: default;
}
.ops button.danger {
  color: #e05a5a;
  border-color: #f0c4c4;
}

.row-btns {
  margin-top: 12px;
  display: flex;
  gap: 10px;
}
.row-btns button {
  border: 1px dashed #c9bdf5;
  background: #faf8ff;
  color: #663aff;
  border-radius: 8px;
  height: 34px;
  padding: 0 14px;
}

/* 价格表行编辑 */
.rows-table {
  width: 100%;
  border-collapse: collapse;
}
.rows-table th {
  text-align: left;
  color: #999;
  font-weight: 500;
  font-size: 12px;
  padding: 4px 6px;
}
.rows-table td {
  padding: 3px 6px;
}
.rows-table input {
  width: 100%;
  height: 32px;
  border: 1px solid #dfe3ec;
  border-radius: 6px;
  padding: 0 8px;
  font-size: 13px;
}
.rows-table input:focus {
  outline: none;
  border-color: #663aff;
}
.ops-cell {
  white-space: nowrap;
}
.ops-cell button {
  border: 1px solid #dfe3ec;
  background: #fff;
  border-radius: 6px;
  height: 28px;
  padding: 0 8px;
  font-size: 12px;
  margin-right: 4px;
}
.ops-cell button.danger {
  color: #e05a5a;
  border-color: #f0c4c4;
}

/* 外观设置 */
.field {
  margin-bottom: 14px;
}
.field label {
  display: block;
  color: #666;
  margin-bottom: 6px;
  font-size: 13px;
}
.field input[type='color'] {
  width: 64px;
  height: 34px;
  border: 1px solid #dfe3ec;
  border-radius: 6px;
  padding: 2px;
  background: #fff;
}
.bg-upload {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.bg-preview {
  width: 160px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #eee;
}
.bg-upload button {
  border: 1px solid #dfe3ec;
  background: #fff;
  border-radius: 6px;
  height: 30px;
  padding: 0 10px;
}
.tip {
  margin-top: 10px;
  color: #a0a4b0;
  font-size: 12px;
  line-height: 1.7;
}

/* 账号与链接 */
.link-line {
  background: #f6f5fb;
  border: 1px solid #e6e4f5;
  border-radius: 8px;
  padding: 10px 12px;
  word-break: break-all;
  font-size: 13px;
  margin-bottom: 10px;
}
.panel.narrow > button,
.panel.narrow > input {
  display: block;
  margin-bottom: 10px;
}
.panel.narrow > input {
  width: 100%;
  height: 38px;
  border: 1px solid #dfe3ec;
  border-radius: 8px;
  padding: 0 12px;
}
.panel.narrow > button {
  border: 1px solid #dfe3ec;
  background: #fff;
  border-radius: 8px;
  height: 34px;
  padding: 0 16px;
}
.panel.narrow > button.primary {
  border: 0;
  background: linear-gradient(301deg, #c0aeff, #663aff);
  color: #fff;
}

/* 底部操作条 */
.actions {
  position: sticky;
  bottom: 0;
  background: #fff;
  margin-top: 14px;
  padding: 12px 16px;
  border-radius: 12px;
  box-shadow: 0 -1px 8px rgba(0, 0, 0, 0.06);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.actions button {
  height: 36px;
  border: 1px solid #dfe3ec;
  background: #fff;
  border-radius: 8px;
  padding: 0 18px;
}
.actions .primary {
  border: 0;
  background: linear-gradient(301deg, #c0aeff, #663aff);
  color: #fff;
}
.actions .publish {
  border: 0;
  background: #2fb264;
  color: #fff;
}
.pub-state {
  color: #999;
  font-size: 12px;
}

/* 商家管理 */
.create-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.create-row input {
  flex: 1;
  min-width: 160px;
  height: 36px;
  border: 1px solid #dfe3ec;
  border-radius: 8px;
  padding: 0 12px;
}
.create-row button {
  height: 36px;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(301deg, #c0aeff, #663aff);
  color: #fff;
  padding: 0 18px;
}
.g-table {
  width: 100%;
  border-collapse: collapse;
}
.g-table th {
  text-align: left;
  color: #999;
  font-weight: 500;
  font-size: 12px;
  padding: 8px 8px;
  border-bottom: 1px solid #eef0f5;
}
.g-table td {
  padding: 10px 8px;
  border-bottom: 1px solid #f2f3f7;
}
.g-table a {
  color: #663aff;
  text-decoration: none;
}
.state {
  color: #b58a00;
  background: #fff7e0;
  border-radius: 10px;
  padding: 2px 10px;
  font-size: 12px;
}
.state.ok {
  color: #2fa15c;
  background: #e5f8ec;
}

/* Quill 编辑器 */
.rich-editor {
  border: 1px solid #dfe3ec;
  border-radius: 8px;
  overflow: hidden;
}
.rich-editor .ql-toolbar {
  border: 0;
  border-bottom: 1px solid #eef0f5;
}
.rich-editor .ql-container {
  border: 0;
  font-size: 14px;
  min-height: 300px;
}
