:root {
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  color: #273444;
  background: #edf1f7;
  --blue: #2f80ed;
  --blue-strong: #1f64e0;
  --blue-soft: #e8eefb;
  --line: #e4e9f2;
  --line-strong: #d8dee9;
  --text: #273444;
  --muted: #7b8794;
  --panel: #ffffff;
  --head: #f6f8fb;
  --danger: #d93025;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(135deg, rgba(47, 128, 237, 0.12), transparent 32%),
    linear-gradient(315deg, rgba(41, 196, 169, 0.1), transparent 30%),
    #edf1f7;
  color: var(--text);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

.hidden {
  display: none !important;
}

.shell {
  min-height: 100vh;
}

.auth-panel {
  width: min(440px, calc(100vw - 32px));
  margin: 7vh auto;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 24px 70px rgba(32, 54, 84, 0.14);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid rgba(47, 128, 237, 0.35);
  border-radius: 8px;
  background: linear-gradient(135deg, #edf6ff, #ffffff);
  color: var(--blue);
  font-weight: 800;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 26px 0 18px;
}

.tab,
.primary,
.outline,
.icon-btn,
.square-btn,
.page-btn,
.text-btn,
.copy-btn,
.op-btn,
.trash-btn {
  min-height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: #fff;
  color: var(--text);
}

.tab.is-active {
  border-color: rgba(47, 128, 237, 0.7);
  background: var(--blue-soft);
  color: var(--blue-strong);
}

.form {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

input,
select {
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  outline: none;
  background: #fff;
  color: var(--text);
}

input:focus,
select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(47, 128, 237, 0.12);
}

.primary {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
  font-weight: 700;
}

.primary:hover {
  background: var(--blue-strong);
}

.outline {
  padding: 0 24px;
  background: #fff;
  color: #303d4f;
}

.text-btn {
  min-height: 28px;
  border: 0;
  background: transparent;
  color: var(--blue);
}

.dashboard {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 238px 1fr;
  border-top: 1px solid #1f2937;
}

.group-sidebar {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  border-right: 1px solid var(--line-strong);
  background: #fff;
}

.group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
}

.group-head strong {
  font-size: 18px;
}

.group-head span {
  margin-left: 6px;
  color: #303d4f;
  font-size: 13px;
}

.square-btn {
  display: grid;
  width: 24px;
  min-height: 24px;
  place-items: center;
  border-color: var(--blue-strong);
  color: var(--blue-strong);
  font-size: 20px;
  font-weight: 600;
  line-height: 1;
}

.group-list {
  display: grid;
  gap: 0;
  padding: 0;
}

.group-item {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 36px;
  align-items: center;
  width: 100%;
  min-height: 54px;
  border: 0;
  border-bottom: 1px solid #f0f3f7;
  background: #fff;
  color: #222f3f;
  text-align: left;
}

.group-item.is-active {
  background: var(--blue-soft);
  color: var(--blue-strong);
  font-weight: 700;
}

.group-main {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  width: 100%;
  min-height: 54px;
  padding: 0 6px 0 14px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.group-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.group-more {
  display: grid;
  width: 28px;
  min-height: 28px;
  place-items: center;
  justify-self: center;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--blue-strong);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0;
  opacity: 0;
  transition: background 0.15s ease, opacity 0.15s ease;
}

.group-item:hover .group-more,
.group-more:focus-visible {
  opacity: 1;
}

.group-more:hover {
  background: rgba(47, 128, 237, 0.12);
}

.drag-dots {
  color: #c0c7d2;
}

.group-count {
  color: inherit;
  font-weight: 700;
}

.sidebar-footer {
  margin-top: auto;
  border-top: 1px solid var(--line);
}

.trash-btn {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 58px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
  font-size: 16px;
}

.trash-btn.is-active {
  background: var(--blue-soft);
  color: var(--blue-strong);
  font-weight: 700;
}

.sidebar-icon {
  display: block;
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.signed-user {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
  padding: 0 14px;
  color: var(--muted);
}

.link-workspace {
  min-width: 0;
  min-height: 100vh;
  padding: 20px;
  background: #edf1f7;

  display: flex;
  flex-direction: column;
}

.stats-placeholder {
  flex: 1;
  display: grid;
  place-items: center;
  background: #fff;
}

.placeholder-panel {
  width: min(520px, calc(100vw - 48px));
  padding: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(135deg, #f8fbff, #ffffff);
  text-align: center;
}

.placeholder-panel h2 {
  margin-bottom: 14px;
  font-size: 28px;
}

.placeholder-panel p:not(.eyebrow) {
  margin: 0 0 28px;
  color: var(--muted);
  line-height: 1.7;
}

.action-bar {
  display: flex;
  align-items: center;
  gap: 28px;
  min-height: 82px;
  padding: 18px 20px;
  background: #fff;
}

.list-actions {
  display: flex;
  align-items: center;
  gap: 28px;
}

.action-primary,
.action-secondary {
  width: 162px;
}

.recycle-title {
  color: #273444;
  font-size: 20px;
  font-weight: 700;
}

.table-card {
  overflow: auto;
  background: #fff;

  flex: 1;
  display: flex;
  flex-direction: column;
}

.link-table {
  width: 100%;
  min-width: 1120px;
  border-collapse: collapse;
}

.link-table th,
.link-table td {
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.link-table th {
  height: 50px;
  padding: 0 24px;
  background: var(--head);
  color: #2e3c4f;
  font-size: 17px;
  font-weight: 700;
}

.link-table td {
  height: 78px;
  padding: 10px 24px;
  color: #303d4f;
}

.info-col {
  width: 28%;
}

.url-col {
  width: 36%;
}

.ops-col {
  width: 160px;
}

.link-info {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.favicon {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 4px;
  background: #f4f7fb;
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
}

.favicon img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.title-line,
.origin-url,
.short-url {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.title-line {
  max-width: 330px;
  color: #303d4f;
  font-size: 16px;
}

.time-line {
  margin-top: 8px;
  color: #303d4f;
  font-size: 14px;
}

.short-url-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px;
  align-items: center;
}

.short-url {
  color: #0876ff;
  font-size: 16px;
  text-decoration: none;
}

.origin-url {
  max-width: 420px;
  margin-top: 8px;
  color: #7f8b98;
  font-size: 16px;
}

.copy-btn {
  min-height: 30px;
  padding: 0 10px;
  border-color: transparent;
  color: var(--blue);
  font-size: 16px;
}

.metric-box {
  display: grid;
  gap: 6px;
  color: #7f8b98;
  font-size: 15px;
}

.metric-box strong {
  margin-left: 10px;
  color: #303d4f;
}

.op-list {
  display: flex;
  gap: 18px;
  align-items: center;
}

.recycle-actions {
  gap: 12px;
}

.text-op {
  min-height: 32px;
  border: 0;
  background: transparent;
  color: var(--blue);
  font-weight: 700;
}

.text-op.danger {
  color: var(--danger);
}

.op-btn {
  display: grid;
  width: 24px;
  min-height: 24px;
  place-items: center;
  border: 0;
  background: transparent;
  color: #2e73c8;
}

.op-icon {
  display: block;
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.empty {
  padding: 42px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  text-align: center;
}

.fake-scroll {
  height: 68px;
  padding: 36px 76px 0;
  background: #fff;
}

.fake-scroll span {
  display: block;
  height: 7px;
  border-radius: 999px;
  background: #d6d8dc;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  min-height: 96px;
  color: #303d4f;

  margin-top: auto;
}

.pager select {
  width: 160px;
}

.page-btn {
  width: 34px;
  min-height: 34px;
  border: 0;
  background: transparent;
  color: #9aa4b2;
  font-size: 24px;
}

.jump-label {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #303d4f;
  font-size: 16px;
}

.jump-label input {
  width: 70px;
  text-align: center;
}

.modal {
  width: min(520px, calc(100vw - 32px));
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
}

.group-modal {
  width: min(420px, calc(100vw - 32px));
}

.group-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.danger-outline {
  min-height: 40px;
  border: 1px solid rgba(217, 48, 37, 0.42);
  border-radius: 4px;
  background: #fff;
  color: var(--danger);
  font-weight: 700;
}

.edit-modal {
  width: min(1075px, calc(100vw - 36px));
  padding: 0;
}

.edit-form {
  display: grid;
  gap: 26px;
  padding: 34px 28px 28px;
}

.edit-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 34px;
}

.edit-head h2 {
  font-size: 28px;
  font-weight: 500;
}

.edit-row {
  display: grid;
  grid-template-columns: 100px 1fr;
  align-items: start;
  gap: 20px;
  color: #606975;
  font-size: 22px;
}

.edit-row.required > span::before {
  margin-right: 4px;
  color: #f56c6c;
  content: "*";
}

.edit-row input,
.edit-row select,
.edit-row textarea {
  min-height: 48px;
  border-radius: 5px;
  font-size: 22px;
}

.edit-row textarea {
  min-height: 142px;
  padding: 12px;
  resize: vertical;
}

.edit-row small {
  grid-column: 2;
  margin-top: -18px;
  color: #606975;
  font-size: 20px;
}

.valid-row {
  grid-template-columns: 100px auto auto 1fr;
  align-items: center;
}

.radio-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #606975;
  font-size: 22px;
}

.radio-line input {
  width: 20px;
  min-height: 20px;
  accent-color: var(--blue);
}

.valid-row input[type="datetime-local"] {
  width: 240px;
}

.edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 18px;
  padding-top: 10px;
}

.edit-actions button {
  width: 88px;
  min-height: 48px;
  font-size: 22px;
}

.modal::backdrop {
  background: rgba(15, 23, 42, 0.42);
}

.modal-form {
  padding: 8px;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.icon-btn {
  width: 40px;
  min-height: 40px;
  color: var(--muted);
  font-size: 24px;
  line-height: 1;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  max-width: min(420px, calc(100vw - 48px));
  padding: 14px 16px;
  border: 1px solid rgba(47, 128, 237, 0.35);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  box-shadow: 0 18px 48px rgba(31, 48, 78, 0.18);
}

@media (max-width: 980px) {
  .dashboard {
    grid-template-columns: 1fr;
  }

  .group-sidebar {
    min-height: auto;
    border-right: 0;
  }

  .group-list {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }

  .sidebar-footer {
    display: none;
  }

  .link-workspace {
    padding: 12px;
  }
}
