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

body {
  font: 14px/1.6 -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: #f5f6fa;
  color: #333;
}

.hidden {
  display: none !important;
}

#login-view {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #ffe3c2, #ffd0a0);
}

.login-card {
  width: 360px;
  background: #fff;
  border-radius: 16px;
  padding: 40px 36px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12);
}

.login-logo {
  font-size: 22px;
  font-weight: 700;
  text-align: center;
}

.login-sub {
  text-align: center;
  color: #999;
  margin: 6px 0 28px;
}

.login-card .input {
  margin-bottom: 14px;
}

.login-err {
  color: #e54d42;
  font-size: 13px;
  text-align: center;
  margin-top: 12px;
  min-height: 18px;
}

.input {
  width: 100%;
  height: 40px;
  border: 1px solid #e3e5ea;
  border-radius: 8px;
  padding: 0 12px;
  font-size: 14px;
  outline: none;
  background: #fff;
  color: #333;
}

.input:focus {
  border-color: #ff8f1f;
}

textarea.input {
  height: auto;
  padding: 10px 12px;
  resize: vertical;
  font-family: inherit;
}

select.input {
  cursor: pointer;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 16px;
  border: 1px solid #e3e5ea;
  background: #fff;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  color: #333;
}

.btn:hover {
  border-color: #ff8f1f;
  color: #ff8f1f;
}

.btn.primary {
  background: linear-gradient(135deg, #ffb64d, #ff8f1f);
  border: none;
  color: #fff;
}

.btn.primary:hover {
  opacity: 0.9;
  color: #fff;
}

.btn.block {
  width: 100%;
  height: 42px;
}

.btn.danger {
  color: #e54d42;
}

.btn.sm {
  height: 28px;
  padding: 0 10px;
  font-size: 12px;
}

.btn.ghost {
  border-color: rgba(255, 255, 255, 0.6);
  color: #fff;
  background: transparent;
}

#app-view {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 220px;
  background: #23262d;
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
}

.side-logo {
  padding: 24px 20px;
  font-size: 17px;
  font-weight: 700;
}

.nav-item {
  display: block;
  padding: 14px 20px;
  color: #a6adb8;
  cursor: pointer;
}

.nav-item:hover {
  color: #fff;
}

.nav-item.active {
  color: #fff;
  background: rgba(255, 143, 31, 0.18);
  border-left: 3px solid #ff8f1f;
  padding-left: 17px;
}

.side-foot {
  margin-top: auto;
  padding: 20px;
}

.side-foot .btn + .btn {
  margin-top: 10px;
}

.main {
  flex: 1;
  margin-left: 220px;
  padding: 0 24px 40px;
}

.topbar {
  height: 60px;
  display: flex;
  align-items: center;
  font-size: 18px;
  font-weight: 700;
}

.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
}

.toolbar .input {
  width: 240px;
}

.spacer {
  flex: 1;
}

.table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.table th,
.table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid #f0f1f4;
  vertical-align: middle;
}

.table th {
  background: #fafbfc;
  color: #888;
  font-weight: 600;
  font-size: 13px;
}

.table tr:last-child td {
  border-bottom: none;
}

.cell-cover {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
  display: block;
}

.cell-emoji {
  font-size: 30px;
  line-height: 44px;
}

.tag {
  display: inline-block;
  font-size: 12px;
  padding: 2px 10px;
  border-radius: 999px;
  margin-right: 6px;
}

.tag.free {
  background: #e8f7ef;
  color: #2ba471;
}

.tag.hot {
  background: #fff1e8;
  color: #ff8f1f;
}

.ops {
  white-space: nowrap;
}

.ops .btn {
  margin-right: 8px;
}

.strong {
  font-weight: 600;
}

.empty {
  text-align: center;
  color: #999;
  padding: 60px 0;
}

.mask {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.modal {
  width: 640px;
  max-height: 86vh;
  overflow: auto;
  background: #fff;
  border-radius: 16px;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid #f0f1f4;
  font-size: 16px;
  font-weight: 700;
}

.icon-btn {
  border: none;
  background: none;
  font-size: 16px;
  cursor: pointer;
  color: #999;
}

.modal-body {
  padding: 20px 24px;
}

.form-row {
  display: flex;
  align-items: flex-start;
  margin-bottom: 16px;
}

.form-row > label {
  width: 80px;
  flex-shrink: 0;
  color: #666;
  padding-top: 8px;
}

.form-row > div {
  flex: 1;
  min-width: 0;
}

.check {
  margin-right: 16px;
  cursor: pointer;
  user-select: none;
}

.mt8 {
  margin-top: 8px;
}

.input-emoji {
  width: 240px;
}

.cover-preview {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 8px;
  margin-top: 8px;
  display: block;
}

.section-title {
  font-weight: 700;
  margin: 8px 0 12px;
}

.muted {
  color: #999;
  font-weight: 400;
  font-size: 12px;
  margin-left: 8px;
}

.sticker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.sticker-cell {
  position: relative;
  height: 72px;
  background: #f7f8fa;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
}

.sticker-cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
}

.sticker-del {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: none;
  background: #e54d42;
  color: #fff;
  font-size: 11px;
  cursor: pointer;
  line-height: 1;
}

.sticker-add {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.sticker-add .input {
  width: 220px;
}

.modal-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid #f0f1f4;
}

.msg {
  margin-right: auto;
  color: #2ba471;
  font-size: 13px;
}

.import-tip {
  font-size: 13px;
  color: #888;
  line-height: 1.7;
}

.import-tip b {
  color: #ff8f1f;
}

.import-pick {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 14px 0;
  flex-wrap: wrap;
}

.import-pick .check {
  margin-right: 4px;
}

.import-summary {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
}

.imp-groups {
  max-height: 240px;
  overflow: auto;
  border: 1px solid #f0f1f4;
  border-radius: 10px;
  margin-bottom: 6px;
}

.imp-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-bottom: 1px solid #f5f6fa;
  font-size: 13px;
}

.imp-row:last-child {
  border-bottom: none;
}

.imp-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}

.imp-count {
  color: #999;
  flex-shrink: 0;
}

.imp-st {
  width: 160px;
  flex-shrink: 0;
  text-align: right;
  font-size: 12px;
}

.st-wait {
  color: #bbb;
}

.st-run {
  color: #ff8f1f;
}

.st-ok {
  color: #2ba471;
}

.st-skip {
  color: #999;
}

.st-fail {
  color: #e54d42;
}

.imp-progress {
  margin-top: 12px;
}

.bar {
  height: 8px;
  background: #f0f1f4;
  border-radius: 999px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(135deg, #ffb64d, #ff8f1f);
  border-radius: 999px;
  transition: width 0.2s;
}

.imp-status {
  margin-top: 6px;
  font-size: 12px;
  color: #999;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.stat-card {
  background: #fff;
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.stat-num {
  font-size: 30px;
  font-weight: 700;
  color: #333;
  line-height: 1.2;
}

.stat-label {
  margin-top: 6px;
  font-size: 13px;
  color: #999;
}

.card {
  background: #fff;
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 12px;
}

.chart-toggle {
  display: inline-flex;
  gap: 6px;
}

.btn.active {
  background: #ff8f1f;
  color: #fff;
  border-color: #ff8f1f;
}

.chart-box svg text {
  font-family: inherit;
}

.form-card {
  max-width: 720px;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
}

.form-tip {
  margin-top: 14px;
  font-size: 12px;
  color: #999;
  line-height: 1.8;
}

.form-tip code {
  background: #f5f6fa;
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 12px;
}

.seg {
  display: inline-flex;
  gap: 6px;
}

.log-detail {
  max-width: 420px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.log-url {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.table code {
  background: #f5f6fa;
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 12px;
}

#log-page {
  font-size: 12px;
}

.inline-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.inline-controls .input-mid {
  width: 200px;
}

.input-sel {
  width: 180px;
}

.input-num {
  width: 100px;
}

.hdr-list {
  margin-bottom: 8px;
}

.hdr-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.hdr-row .hdr-k {
  width: 180px;
  flex-shrink: 0;
}

.hdr-row .hdr-v {
  flex: 1;
}

.kv-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.kv-row .kv-k {
  width: 180px;
  flex-shrink: 0;
}

.kv-row .kv-v {
  flex: 1;
}

.kv-hint {
  font-size: 12px;
}

.sp-body {
  margin-top: 8px;
  font-family: Consolas, Monaco, monospace;
  font-size: 12px;
  width: 100%;
  box-sizing: border-box;
  resize: vertical;
}

.modal-wide {
  width: 720px;
  max-width: 94vw;
}

.sp-url {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.sp-modal-tip {
  margin-top: 14px;
  font-size: 12px;
  color: #999;
  line-height: 1.8;
}

.sp-result-summary {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 10px;
}

.packet {
  background: #1e2430;
  color: #d6e2f0;
  border-radius: 10px;
  padding: 14px;
  font-family: Consolas, Monaco, monospace;
  font-size: 12px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 420px;
  overflow: auto;
  margin: 0;
}

.settings-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 20px;
  margin-bottom: 14px;
}
