:root {
  --blue: #2b6de0;
  --blue-dark: #1d54b7;
  --blue-soft: #eaf1ff;
  --ink: #1f2329;
  --muted: #767c85;
  --line: #e4e7ec;
  --panel: #ffffff;
  --bg: #f5f7fa;
  --sidebar: #fafbfc;
  --green: #22a06b;
  --orange: #ee7d3b;
  --shadow: 0 10px 30px rgba(31, 35, 41, 0.09);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: var(--bg);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
}

button {
  color: inherit;
}

.wps-topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  height: 58px;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.97);
}

.wps-brand {
  display: flex;
  align-items: center;
  gap: 9px;
}

.wps-logo {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(145deg, #2d7df0, #1953bd);
  font-family: Arial, sans-serif;
  font-size: 18px;
  font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.wps-brand-text {
  color: #2b3138;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.doc-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.doc-heading strong {
  overflow: hidden;
  font-size: 14px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.doc-icon {
  color: var(--blue);
  font-size: 18px;
}

.preview-badge {
  flex: 0 0 auto;
  padding: 3px 8px;
  border: 1px solid #f0c99b;
  border-radius: 999px;
  color: #b45d19;
  background: #fff7ea;
  font-size: 10px;
  font-weight: 700;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 13px;
}

.save-state {
  color: #989da5;
  font-size: 11px;
}

.share-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 16px;
  border: 0;
  border-radius: 7px;
  color: #fff;
  background: var(--blue);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.share-button:hover {
  background: var(--blue-dark);
}

.avatars {
  display: flex;
  padding-left: 8px;
}

.avatar {
  display: grid;
  width: 28px;
  height: 28px;
  margin-left: -7px;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 50%;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
}

.avatar-blue {
  background: #3978d9;
}

.avatar-orange {
  background: var(--orange);
}

.avatar-more {
  color: #60666f;
  background: #edf0f4;
}

.preview-note {
  padding: 8px 20px;
  border-bottom: 1px solid #e9dfcb;
  color: #7a6140;
  background: #fffaef;
  font-size: 11px;
  text-align: center;
}

.workspace {
  display: grid;
  grid-template-columns: 218px minmax(0, 1fr);
  min-height: calc(100vh - 87px);
}

.sidebar {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 16px 12px;
  border-right: 1px solid var(--line);
  background: var(--sidebar);
}

.base-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 10px;
  border: 1px solid #dce4f5;
  border-radius: 9px;
  background: #f3f7ff;
}

.base-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: var(--blue);
  font-size: 17px;
}

.base-card strong {
  display: block;
  margin-bottom: 3px;
  font-size: 12px;
}

.base-card span {
  display: block;
  color: #838b97;
  font-size: 10px;
}

.base-card b {
  color: #5e6570;
}

.sidebar-label {
  margin: 22px 9px 8px;
  color: #9a9fa8;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.sidebar-nav {
  display: grid;
  gap: 2px;
}

.nav-item {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  width: 100%;
  height: 35px;
  padding: 0 10px;
  border: 0;
  border-radius: 7px;
  text-align: left;
  background: transparent;
  font-size: 11px;
  cursor: pointer;
}

.nav-item:hover {
  background: #f0f3f7;
}

.nav-item.active {
  color: var(--blue-dark);
  background: var(--blue-soft);
  font-weight: 700;
}

.nav-icon {
  color: #8b929c;
  font-size: 13px;
  text-align: center;
}

.nav-item.active .nav-icon {
  color: var(--blue);
}

.nav-item small {
  color: #969ca6;
  font-size: 9px;
}

.field-list {
  display: grid;
  gap: 9px;
  padding: 0 11px;
  color: #5e6670;
  font-size: 10px;
}

.field-list div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.field-dot {
  width: 7px;
  height: 7px;
  border-radius: 2px;
}

.image-dot {
  background: #db6d47;
}

.text-dot {
  background: #6f96de;
}

.tag-dot {
  background: #55b28a;
}

.long-dot {
  background: #cc9c43;
}

.sidebar-tip {
  margin-top: auto;
  padding: 12px;
  border: 1px solid #e2e6ec;
  border-radius: 9px;
  background: #fff;
}

.sidebar-tip strong {
  font-size: 10px;
}

.sidebar-tip p {
  margin: 6px 0 0;
  color: #8b919a;
  font-size: 9px;
  line-height: 1.6;
}

.main-panel {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 54px;
  padding: 9px 18px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.view-tabs {
  display: flex;
  align-items: center;
  gap: 3px;
}

.view-tab,
.add-view {
  height: 32px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  font-size: 11px;
  cursor: pointer;
}

.view-tab {
  padding: 0 13px;
  color: #757c86;
}

.view-tab:hover {
  background: #f2f4f7;
}

.view-tab.active {
  color: var(--blue-dark);
  background: var(--blue-soft);
  font-weight: 700;
}

.add-view {
  width: 30px;
  color: #8b929c;
  font-size: 18px;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 250px;
  height: 34px;
  padding: 0 10px;
  border: 1px solid #dfe3e9;
  border-radius: 7px;
  background: #fafbfc;
}

.search-box span {
  color: #8f96a0;
  font-size: 17px;
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 11px;
}

.search-box input::-webkit-search-cancel-button {
  display: none;
}

.toolbar-actions select {
  height: 34px;
  max-width: 150px;
  padding: 0 28px 0 10px;
  border: 1px solid #dfe3e9;
  border-radius: 7px;
  outline: 0;
  color: #555d67;
  background: #fff;
  font-size: 11px;
}

.tool-button {
  height: 34px;
  padding: 0 11px;
  border: 1px solid #dfe3e9;
  border-radius: 7px;
  color: #666e78;
  background: #fff;
  font-size: 11px;
  cursor: pointer;
}

.tool-button:hover {
  border-color: #b9c7df;
  color: var(--blue-dark);
}

.query-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 43px;
  padding: 7px 18px;
  border-bottom: 1px solid #edf0f3;
  background: #fff;
}

.query-left,
.query-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.filter-label {
  color: #9aa0a9;
  font-size: 10px;
}

.active-query {
  padding: 4px 9px;
  border-radius: 5px;
  color: #59616b;
  background: #f1f4f8;
  font-size: 10px;
}

.query-right {
  color: #959ba4;
  font-size: 10px;
}

.sort-select {
  height: 28px;
  border: 0;
  outline: 0;
  color: #5b626c;
  background: transparent;
  font-size: 10px;
}

.gallery-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 18px;
}

.wps-gallery {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.group-heading {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 5px 0 -3px;
  color: #606871;
  font-size: 11px;
  font-weight: 700;
}

.group-heading::after {
  content: "";
  height: 1px;
  flex: 1;
  background: #e5e8ed;
}

.wps-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #e1e5ea;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 2px 5px rgba(31, 35, 41, 0.025);
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.wps-card:hover {
  border-color: #b9cbea;
  box-shadow: 0 8px 20px rgba(43, 109, 224, 0.1);
  transform: translateY(-2px);
}

.wps-card-button {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  text-align: left;
  background: transparent;
  cursor: pointer;
}

.wps-card-image {
  position: relative;
  display: grid;
  height: 142px;
  place-items: center;
  overflow: hidden;
  border-bottom: 1px solid #edf0f3;
  background: #fafbfc;
}

.wps-card-image img {
  width: 100%;
  height: 100%;
  padding: 10px;
  object-fit: contain;
}

.wps-card-type {
  position: absolute;
  top: 8px;
  left: 8px;
  max-width: calc(100% - 16px);
  overflow: hidden;
  padding: 3px 7px;
  border: 1px solid #e1e6ed;
  border-radius: 4px;
  color: #6a727c;
  background: rgba(255, 255, 255, 0.92);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wps-card-content {
  padding: 11px 12px 10px;
}

.wps-card-model {
  height: 14px;
  color: var(--blue);
  font-family: Consolas, monospace;
  font-size: 9px;
  font-weight: 700;
}

.wps-card h3 {
  min-height: 36px;
  margin: 3px 0 7px;
  overflow: hidden;
  font-size: 12px;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.wps-card-tags {
  display: flex;
  gap: 4px;
  min-height: 19px;
  margin-bottom: 8px;
  overflow: hidden;
}

.wps-card-tag {
  max-width: 100%;
  overflow: hidden;
  padding: 3px 6px;
  border-radius: 4px;
  color: #4f728b;
  background: #edf5fb;
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wps-card-tag.tag-green {
  color: #3b765e;
  background: #edf8f2;
}

.wps-card-fields {
  display: grid;
  gap: 5px;
  min-height: 51px;
  margin: 0;
}

.wps-card-field {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 8px;
  line-height: 1.4;
}

.wps-card-field dt {
  flex: 0 0 auto;
  color: #9aa0a9;
}

.wps-card-field dd {
  overflow: hidden;
  margin: 0;
  color: #5d6570;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wps-card-footer {
  display: flex;
  justify-content: space-between;
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px solid #edf0f3;
  color: #8e959e;
  font-size: 8px;
}

.load-wrap {
  display: flex;
  justify-content: center;
  padding: 22px 0 10px;
}

.load-button {
  height: 34px;
  padding: 0 18px;
  border: 1px solid #cfd7e4;
  border-radius: 7px;
  color: #4c5764;
  background: #fff;
  font-size: 10px;
  cursor: pointer;
}

.load-button:hover {
  border-color: var(--blue);
  color: var(--blue-dark);
}

.wps-empty {
  padding: 100px 20px;
  text-align: center;
}

.wps-empty div {
  color: #aab0b9;
  font-size: 50px;
}

.wps-empty h2 {
  margin: 10px 0 5px;
  font-size: 18px;
}

.wps-empty p {
  color: #8f959e;
  font-size: 11px;
}

.share-popover {
  position: fixed;
  z-index: 50;
  top: 64px;
  right: 95px;
  width: 390px;
  padding: 17px;
  border: 1px solid #dfe3e9;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 55px rgba(31, 35, 41, 0.18);
}

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

.share-head strong {
  font-size: 14px;
}

.share-head button {
  border: 0;
  color: #8d939c;
  background: transparent;
  font-size: 20px;
  cursor: pointer;
}

.share-permission {
  display: flex;
  gap: 10px;
  padding: 11px;
  border-radius: 8px;
  background: #f5f8ff;
}

.permission-icon {
  display: grid;
  flex: 0 0 auto;
  width: 25px;
  height: 25px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--blue);
  font-size: 12px;
}

.share-permission strong {
  display: block;
  margin-bottom: 4px;
  font-size: 10px;
}

.share-permission p {
  margin: 0;
  color: #858c96;
  font-size: 9px;
}

.share-link-row {
  display: flex;
  gap: 7px;
  margin-top: 13px;
}

.share-link-row input {
  min-width: 0;
  height: 34px;
  flex: 1;
  padding: 0 9px;
  border: 1px solid #dfe3e9;
  border-radius: 6px;
  outline: 0;
  color: #5c6470;
  background: #fafbfc;
  font-size: 9px;
}

.share-link-row button {
  height: 34px;
  padding: 0 13px;
  border: 0;
  border-radius: 6px;
  color: #fff;
  background: var(--blue);
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

.share-foot {
  margin-top: 10px;
  color: #9aa0a9;
  font-size: 8px;
}

.drawer-backdrop {
  position: fixed;
  z-index: 60;
  inset: 0;
  background: rgba(21, 25, 31, 0.28);
}

.record-drawer {
  position: fixed;
  z-index: 70;
  top: 0;
  right: 0;
  width: min(460px, 100%);
  height: 100vh;
  overflow-y: auto;
  border-left: 1px solid #dfe3e9;
  background: #fff;
  box-shadow: -18px 0 50px rgba(31, 35, 41, 0.13);
  transform: translateX(105%);
  transition: transform 200ms ease;
}

.record-drawer.open {
  transform: translateX(0);
}

.drawer-head {
  position: sticky;
  z-index: 2;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 51px;
  padding: 0 16px;
  border-bottom: 1px solid #e8ebef;
  background: rgba(255, 255, 255, 0.97);
  font-size: 12px;
  font-weight: 700;
  backdrop-filter: blur(8px);
}

.drawer-head button {
  border: 0;
  color: #8d939c;
  background: transparent;
  font-size: 22px;
  cursor: pointer;
}

.drawer-image {
  display: grid;
  height: 310px;
  margin: 16px;
  padding: 12px;
  place-items: center;
  border: 1px solid #e1e5ea;
  border-radius: 10px;
  background: #fafbfc;
}

.drawer-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.drawer-title-block {
  padding: 0 18px 16px;
  border-bottom: 1px solid #e8ebef;
}

.drawer-model {
  color: var(--blue);
  font-family: Consolas, monospace;
  font-size: 11px;
  font-weight: 700;
}

.drawer-title-block h2 {
  margin: 6px 0 8px;
  font-size: 21px;
  line-height: 1.35;
}

.drawer-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.drawer-tags span {
  padding: 4px 8px;
  border-radius: 4px;
  color: #4f728b;
  background: #edf5fb;
  font-size: 9px;
}

.drawer-fields {
  padding: 10px 18px 24px;
}

.drawer-field {
  display: grid;
  grid-template-columns: 105px minmax(0, 1fr);
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid #edf0f3;
  font-size: 10px;
}

.drawer-field span:first-child {
  color: #9097a0;
}

.drawer-field span:last-child {
  color: #343a42;
  white-space: pre-wrap;
}

.drawer-description {
  padding: 14px 18px 40px;
}

.drawer-description h3 {
  margin: 0 0 9px;
  font-size: 12px;
}

.drawer-description p {
  color: #626a74;
  font-size: 10px;
  line-height: 1.8;
  white-space: pre-wrap;
}

.toast {
  position: fixed;
  z-index: 100;
  right: 22px;
  bottom: 22px;
  padding: 11px 15px;
  border-radius: 8px;
  color: #fff;
  background: #1f2329;
  font-size: 10px;
  box-shadow: 0 12px 30px rgba(31, 35, 41, 0.2);
}

@media (max-width: 1180px) {
  .wps-gallery {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .search-box {
    width: 200px;
  }
}

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

  .sidebar {
    display: none;
  }

  .toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .toolbar-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .search-box {
    width: min(100%, 320px);
  }

  .wps-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .wps-topbar {
    grid-template-columns: 1fr auto;
    gap: 10px;
  }

  .wps-brand-text,
  .save-state,
  .avatars,
  .doc-icon {
    display: none;
  }

  .wps-gallery {
    grid-template-columns: 1fr;
  }

  .preview-note {
    text-align: left;
  }

  .share-popover {
    top: 62px;
    right: 10px;
    left: 10px;
    width: auto;
  }
}
