/* WaiLian admin theme */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f2f4f9; color: #1f2430; min-height: 100vh;
}

/* ---------- topbar ---------- */
.topbar {
  background: #14161d; color: #fff;
  padding: 18px 28px; display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 10;
}
.brand { display: flex; align-items: center; gap: 10px; }
.logo {
  background: linear-gradient(135deg, #38d996, #1fb977); color: #04281a;
  font-weight: 800; font-size: 15px; padding: 6px 10px; border-radius: 8px;
}
.brand-name { font-size: 17px; font-weight: 700; }
.brand-sub { font-size: 12px; color: #8a92a8; }
.stats { display: flex; gap: 26px; }
.stat { text-align: right; }
.stat .num { font-size: 22px; font-weight: 800; color: #38d996; line-height: 1.1; }
.stat .label { font-size: 12px; color: #8a92a8; }

/* ---------- layout ---------- */
.main { max-width: 1060px; margin: 24px auto 60px; padding: 0 20px; display: flex; flex-direction: column; gap: 20px; }
.panel { background: #fff; border-radius: 14px; padding: 22px 24px; box-shadow: 0 2px 10px rgba(20,22,29,.06); }
.panel-title { font-size: 16px; font-weight: 700; margin-bottom: 16px; color: #1f2430; }

/* ---------- form ---------- */
.create-form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; color: #4a5162; font-weight: 600; }
.field label b { color: #e5484d; }
.field input, .field select {
  height: 40px; border: 1.5px solid #dfe3ec; border-radius: 8px; padding: 0 12px;
  font-size: 14px; color: #1f2430; background: #fff; outline: none; transition: border-color .15s;
}
.field input:focus, .field select:focus { border-color: #1fb977; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.btn {
  height: 42px; padding: 0 18px; border-radius: 8px; border: none;
  font-size: 14px; font-weight: 600; cursor: pointer; transition: opacity .15s;
}
.btn:active { opacity: .8; }
.btn.primary { background: linear-gradient(135deg, #38d996, #1fb977); color: #04281a; font-size: 15px; }
.btn.ghost { background: #eef1f6; color: #3a4256; border: 1px solid #dfe3ec; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* ---------- result ---------- */
.result { margin-top: 18px; border-top: 1px dashed #dfe3ec; padding-top: 16px; }
.result-title { font-size: 14px; color: #17a362; margin-bottom: 12px; }

.douyin-card {
  display: flex; align-items: center; gap: 12px;
  background: #f8f9fc; border: 1px solid #e5e8f0; border-radius: 12px; padding: 10px;
  max-width: 420px;
}
.dc-cover { width: 128px; height: 72px; border-radius: 8px; overflow: hidden; background: #e8eaf2; flex-shrink: 0; }
.dc-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dc-body { overflow: hidden; }
.dc-title { font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dc-desc { margin-top: 4px; font-size: 12px; color: #6b7280; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.short-link-box { margin-top: 12px; }
.sl-label { font-size: 12px; color: #6b7280; margin-bottom: 6px; }
.sl-row { display: flex; gap: 8px; max-width: 560px; }
.sl-row input { flex: 1; height: 40px; border: 1.5px solid #dfe3ec; border-radius: 8px; padding: 0 12px; font-size: 13px; color: #17a362; background: #f4fbf7; }

/* ---------- list ---------- */
.table-wrap { overflow-x: auto; }
.links-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.links-table th {
  text-align: left; padding: 10px 12px; background: #f7f8fb; color: #6b7280;
  font-weight: 600; font-size: 12px; white-space: nowrap; border-bottom: 1px solid #eef0f5;
}
.links-table td { padding: 11px 12px; border-bottom: 1px solid #f0f2f7; vertical-align: middle; }
.links-table tr:hover td { background: #fafbfe; }
.td-title { font-weight: 600; max-width: 170px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.td-target { max-width: 200px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #6b7280; }
.td-code { font-family: Consolas, Menlo, monospace; color: #17a362; }
.td-clicks { font-weight: 700; }

.tag { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 12px; }
.tag-wechat { background: #e6f7ee; color: #17a362; }
.tag-wecom { background: #e8efff; color: #3460e8; }
.tag-group  { background: #fff3e6; color: #e8830c; }
.tag-qrcode { background: #f3ecff; color: #7c3aed; }
.tag-url    { background: #eef1f6; color: #4a5162; }

.ops { white-space: nowrap; }
.link-btn {
  border: none; background: transparent; color: #3a7bd5; cursor: pointer;
  font-size: 13px; padding: 4px 6px; margin-right: 2px;
}
.link-btn:hover { text-decoration: underline; }
.link-btn.danger { color: #e5484d; }

.empty { text-align: center; color: #9aa1b5; padding: 26px 0; font-size: 13px; }

.toast {
  position: fixed; left: 50%; bottom: 46px; transform: translateX(-50%) translateY(10px);
  background: rgba(17,19,26,.92); color: #fff; font-size: 13px;
  padding: 10px 18px; border-radius: 20px; opacity: 0; pointer-events: none; transition: all .25s ease; z-index: 99;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 720px) {
  .grid-2 { grid-template-columns: 1fr; }
  .stats { gap: 16px; }
  .brand-sub { display: none; }
}