:root {
  --blue: #1668dc;
  --blue-dark: #123d7c;
  --cyan: #20c7d8;
  --green: #22a06b;
  --ink: #182334;
  --muted: #66758a;
  --line: #dbe5f1;
  --paper: #f4f8fc;
  --white: #ffffff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  color: var(--ink);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea {
  font: inherit;
}

.mobile-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 12px;
  background:
    radial-gradient(circle at 20% 10%, rgba(32, 199, 216, .16), transparent 28%),
    linear-gradient(145deg, #e8f2fb 0%, #f8fbff 48%, #e9f6ef 100%);
}

.phone-shell {
  width: min(430px, 100%);
  min-height: 820px;
  overflow: hidden;
  border: 1px solid rgba(18, 61, 124, .12);
  border-radius: 32px;
  background: var(--paper);
  box-shadow: 0 24px 80px rgba(22, 42, 72, .18);
}

.home-screen {
  padding: 18px;
}

.home-hero {
  min-height: 350px;
  padding: 20px;
  border-radius: 24px;
  color: var(--white);
  background:
    linear-gradient(180deg, rgba(12, 44, 91, .66), rgba(9, 31, 65, .88)),
    url("./logo.jpg") center 42% / 220px auto no-repeat,
    linear-gradient(135deg, #0f5fc5, #0d8a9a);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 58px;
}

.brand-logo {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  object-fit: cover;
  background: var(--white);
}

.brand-name {
  width: 245px;
  max-width: calc(100% - 64px);
  height: auto;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .9);
}

.hero-copy .eyebrow {
  width: fit-content;
  margin: 0 0 12px;
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, .34);
  border-radius: 999px;
  color: #d7f5ff;
  font-size: 12px;
}

.hero-copy h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1.22;
  letter-spacing: 0;
}

.hero-copy p:last-child {
  margin: 12px 0 0;
  color: rgba(255, 255, 255, .84);
  line-height: 1.7;
  font-size: 14px;
}

.quick-panel,
.category-section,
.chat-window,
.suggestion-panel,
.answer-card,
.source-list,
.result-question {
  margin-top: 14px;
  padding: 16px;
  border: 1px solid rgba(167, 188, 210, .58);
  border-radius: 18px;
  background: rgba(255, 255, 255, .9);
}

.panel-title,
.section-heading,
.answer-head,
.mobile-topbar,
.admin-header,
.admin-user {
  display: flex;
  align-items: center;
}

.panel-title,
.section-heading,
.mobile-topbar,
.admin-header {
  justify-content: space-between;
}

.panel-title span,
.section-heading h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}

.panel-title small,
.section-heading small {
  color: var(--muted);
  font-size: 12px;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 14px;
}

.quick-card {
  min-height: 126px;
  padding: 14px;
  border: 1px solid #dde8f5;
  border-radius: 14px;
  background: #fbfdff;
}

.quick-icon {
  display: block;
  width: 34px;
  height: 34px;
  margin-bottom: 14px;
  border-radius: 10px;
}

.quick-icon.endangered { background: linear-gradient(135deg, #e34f60, #ffba69); }
.quick-icon.cultivate { background: linear-gradient(135deg, #22a06b, #80d37a); }
.quick-icon.identify { background: linear-gradient(135deg, #1668dc, #20c7d8); }
.quick-icon.document { background: linear-gradient(135deg, #5664d2, #9a78f0); }

.quick-card strong,
.quick-card em {
  display: block;
}

.quick-card strong {
  font-size: 15px;
}

.quick-card em {
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.45;
}

.notice-strip {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #eaf5ff;
  color: #315a8d;
  font-size: 12px;
}

.notice-strip span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--cyan);
}

.notice-strip p {
  margin: 0;
  line-height: 1.5;
}

.primary-action,
.ghost-action {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 52px;
  margin-top: 16px;
  border-radius: 16px;
  font-weight: 700;
}

.primary-action {
  color: var(--white);
  background: linear-gradient(135deg, var(--blue), #0a8d99);
  box-shadow: 0 12px 24px rgba(22, 104, 220, .24);
}

.primary-action.compact,
.ghost-action {
  margin-top: 0;
  flex: 1;
}

.ghost-action {
  border: 1px solid var(--line);
  background: var(--white);
}

.chat-screen,
.result-screen {
  padding: 14px;
}

.mobile-topbar {
  min-height: 64px;
  padding: 8px 4px 12px;
}

.mobile-topbar .icon-button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: var(--white);
  color: var(--blue-dark);
  font-size: 30px;
  line-height: 1;
}

.mobile-topbar div {
  text-align: center;
}

.mobile-topbar strong,
.mobile-topbar span {
  display: block;
}

.mobile-topbar strong {
  font-size: 17px;
}

.mobile-topbar span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.mobile-topbar img {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  object-fit: cover;
}

.category-tabs {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-top: 14px;
}

.category-tabs button,
.suggestion-panel button {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f9fbfe;
  color: #38516f;
  cursor: pointer;
}

.category-tabs button {
  height: 42px;
  font-size: 13px;
}

.category-tabs button.active {
  border-color: rgba(22, 104, 220, .2);
  color: var(--white);
  background: var(--blue);
}

.chat-window {
  min-height: 420px;
  background:
    linear-gradient(180deg, rgba(235, 245, 255, .85), rgba(255, 255, 255, .95)),
    radial-gradient(circle at top right, rgba(32, 199, 216, .2), transparent 32%);
}

.message {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.message img {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  object-fit: cover;
}

.message div {
  max-width: 82%;
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--white);
  box-shadow: 0 8px 22px rgba(33, 64, 98, .08);
}

.message strong {
  display: block;
  margin-bottom: 6px;
  color: var(--blue-dark);
  font-size: 13px;
}

.message p {
  margin: 0;
  color: #34465d;
  font-size: 14px;
  line-height: 1.7;
}

.message.user {
  justify-content: flex-end;
}

.message.user div {
  background: #e7f0ff;
}

.suggestion-panel {
  display: grid;
  gap: 8px;
}

.suggestion-panel button {
  min-height: 42px;
  padding: 8px 10px;
  text-align: left;
  line-height: 1.45;
}

.chat-composer {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  padding: 10px;
  border-radius: 18px;
  background: var(--white);
}

.chat-composer input {
  min-width: 0;
  flex: 1;
  height: 42px;
  border: 0;
  outline: 0;
  color: var(--ink);
}

.chat-composer button {
  width: 76px;
  border: 0;
  border-radius: 13px;
  color: var(--white);
  background: var(--blue);
  cursor: pointer;
}

.result-question small,
.answer-head span {
  color: var(--muted);
  font-size: 12px;
}

.result-question p {
  margin: 8px 0 0;
  line-height: 1.65;
  font-weight: 700;
}

.answer-head {
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.answer-head img {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  object-fit: cover;
}

.answer-head strong,
.answer-head span {
  display: block;
}

.answer-content {
  padding-top: 12px;
}

.answer-content p,
.answer-content li,
.source-item p {
  color: #34465d;
  line-height: 1.75;
  font-size: 14px;
}

.answer-content p {
  margin: 0 0 10px;
}

.answer-content ul {
  margin: 0;
  padding-left: 18px;
}

.source-item {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  padding: 12px;
  border-radius: 12px;
  background: #f7fbff;
}

.source-item span {
  color: var(--blue);
  font-weight: 700;
}

.source-item p {
  margin: 0;
}

.result-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.admin-body {
  min-height: 100vh;
  display: flex;
  background: #eef3f8;
}

.admin-sidebar {
  width: 260px;
  min-height: 100vh;
  padding: 22px 16px;
  background: #102b52;
  color: var(--white);
}

.admin-brand {
  padding: 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .08);
}

.admin-brand img {
  display: block;
  width: 100%;
  padding: 8px;
  border-radius: 8px;
  background: var(--white);
}

.admin-sidebar nav {
  display: grid;
  gap: 8px;
  margin-top: 22px;
}

.admin-sidebar nav a {
  padding: 13px 14px;
  border-radius: 10px;
  color: rgba(255, 255, 255, .78);
}

.admin-sidebar nav a.active,
.admin-sidebar nav a:hover {
  color: var(--white);
  background: rgba(32, 199, 216, .18);
}

.admin-main {
  flex: 1;
  min-width: 0;
  padding: 24px;
}

.admin-header {
  min-height: 76px;
  padding: 0 0 18px;
}

.admin-header small {
  color: var(--blue);
  font-weight: 700;
}

.admin-header h1 {
  margin: 6px 0 0;
  font-size: 26px;
  letter-spacing: 0;
}

.admin-user {
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
}

.admin-user img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
}

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

.kpi-grid article,
.admin-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: 0 10px 28px rgba(37, 64, 92, .06);
}

.kpi-grid article {
  padding: 18px;
}

.kpi-grid span,
.kpi-grid em {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
}

.kpi-grid strong {
  display: block;
  margin: 10px 0;
  font-size: 30px;
  color: var(--blue-dark);
}

.admin-grid {
  display: grid;
  grid-template-columns: 1.3fr .9fr;
  gap: 14px;
  margin-top: 14px;
}

.admin-grid.lower {
  grid-template-columns: 1fr 1fr;
}

.admin-panel {
  min-width: 0;
  padding: 18px;
}

.admin-panel .panel-title {
  margin-bottom: 14px;
}

.admin-panel .panel-title button,
.admin-form button {
  border: 0;
  border-radius: 8px;
  background: var(--blue);
  color: var(--white);
  cursor: pointer;
}

.admin-panel .panel-title button {
  height: 34px;
  padding: 0 12px;
}

.chart-box {
  height: 300px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.admin-table th,
.admin-table td {
  padding: 13px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.admin-table th {
  color: var(--muted);
  font-weight: 700;
  background: #f7fbff;
}

.status {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
}

.status.ok {
  color: #13724f;
  background: #e5f7ef;
}

.status.warn {
  color: #9a6200;
  background: #fff3d7;
}

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

.admin-form label {
  display: grid;
  gap: 7px;
}

.admin-form label span {
  color: var(--muted);
  font-size: 13px;
}

.admin-form input[type="text"],
.admin-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: 0;
  padding: 10px 12px;
  color: var(--ink);
  background: #fbfdff;
}

.admin-form textarea {
  min-height: 96px;
  resize: vertical;
}

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

.admin-form button {
  height: 42px;
}

@media (max-width: 900px) {
  .admin-body {
    display: block;
  }

  .admin-sidebar {
    width: 100%;
    min-height: auto;
  }

  .admin-sidebar nav {
    grid-template-columns: repeat(5, minmax(88px, 1fr));
    overflow-x: auto;
  }

  .kpi-grid,
  .admin-grid,
  .admin-grid.lower {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 460px) {
  .mobile-body {
    padding: 0;
    display: block;
    background: var(--paper);
  }

  .phone-shell {
    width: 100%;
    min-height: 100vh;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
}

/* [小程序对话页修改区] 当前入口页为 index.html / chat.html */
.chat-app-screen {
  display: flex;
  flex-direction: column;
  min-height: 860px;
  padding: 14px;
  background: linear-gradient(180deg, #eef7ff 0%, #f7fbff 46%, #edf8f3 100%);
}

.app-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 58px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  min-width: 0;
}


.top-name {
  width: 292px;
  max-width: calc(100vw - 82px);
  padding: 7px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .92);
}

.round-tool,
.upload-button {
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--blue-dark);
  background: #fff;
  cursor: pointer;
}

.round-tool {
  width: 42px;
  height: 42px;
  font-weight: 700;
}

.assistant-title {
  margin-top: 12px;
  padding: 16px;
  border-radius: 18px;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(18, 61, 124, .94), rgba(17, 128, 142, .86)),
    url("./银杏/银杏3.jpg") center 34% / cover no-repeat;
}

.assistant-title p,
.assistant-title h1 {
  margin: 0;
}

.assistant-title p {
  color: rgba(255, 255, 255, .78);
  font-size: 12px;
}

.assistant-title h1 {
  margin-top: 7px;
  font-size: 22px;
  line-height: 1.28;
  letter-spacing: 0;
}

.compact-section {
  margin-top: 10px;
  padding: 12px;
}

.smart-tabs {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.smart-tabs button {
  height: 40px;
  border-radius: 10px;
  font-size: 13px;
}

.history-panel {
  display: none;
  margin-top: 10px;
  padding: 12px;
  border: 1px solid rgba(167, 188, 210, .58);
  border-radius: 16px;
  background: rgba(255, 255, 255, .94);
}

.history-panel.show {
  display: block;
}

.history-panel button {
  width: 100%;
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px solid #e0e9f4;
  border-radius: 10px;
  color: #34465d;
  text-align: left;
  background: #f8fbff;
  cursor: pointer;
}

.smart-window {
  flex: 1;
  min-height: 360px;
  max-height: 470px;
  overflow-y: auto;
  padding: 14px;
}

.smart-window .message div {
  max-width: 86%;
}

.plant-image,
.message-photo {
  width: 100%;
  border-radius: 14px;
  object-fit: cover;
  background: #edf3f8;
}

.plant-image {
  max-height: 220px;
  margin: 8px 0 10px;
}

.message-photo {
  max-height: 180px;
  margin-bottom: 8px;
}

.plant-meta {
  display: grid;
  gap: 6px;
  margin: 10px 0;
  padding: 10px;
  border-radius: 12px;
  background: #f2f8ff;
}

.plant-meta span {
  color: #35506d;
  font-size: 12px;
  line-height: 1.45;
}

.plant-meta.compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.answer-block {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #e3edf7;
}

.answer-block h3 {
  margin: 0 0 6px;
  font-size: 14px;
  color: var(--blue-dark);
}

.answer-block p {
  margin: 0 0 6px;
}

.scenario-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.scenario-actions button {
  min-height: 72px;
  padding: 10px;
  border: 1px solid #dce8f4;
  border-radius: 14px;
  text-align: left;
  background: #fff;
  cursor: pointer;
}

.scenario-actions strong,
.scenario-actions span {
  display: block;
}

.scenario-actions strong {
  color: var(--blue-dark);
  font-size: 14px;
}

.scenario-actions span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.smart-composer {
  margin-top: 10px;
  border: 1px solid #dce8f4;
}

.upload-button {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  font-size: 22px;
}

.video-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.video-list article {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid #dfeaf5;
  border-radius: 12px;
  background: linear-gradient(135deg, #f7fbff, #edf8f3);
}

.video-list article span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 50%;
  color: #fff;
  background: var(--blue);
  font-size: 13px;
}

.video-list strong,
.video-list small {
  display: block;
}

.video-list strong {
  color: var(--blue-dark);
  font-size: 13px;
}

.video-list small {
  margin-top: 3px;
  color: var(--muted);
  line-height: 1.4;
}

@media (max-width: 460px) {
  .chat-app-screen {
    min-height: 100vh;
  }

  .smart-window {
    max-height: none;
  }
}


/* intro page: index.html */
.intro-body {
  background: linear-gradient(180deg, #edf7ff 0%, #f8fbff 48%, #eef8f2 100%);
}

.intro-screen.intro-minimal {
  position: relative;
  min-height: 860px;
  padding: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .9), rgba(242, 249, 255, .96)),
    url("./银杏/银杏3.jpg") center / cover no-repeat;
}

.intro-topbar.compact {
  display: flex;
  align-items: center;
  min-height: 48px;
}

.intro-topbar.compact img {
  width: 292px;
  max-width: calc(100vw - 70px);
  padding: 7px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .94);
}

.intro-focus {
  margin-top: 60px;
  text-align: center;
}

.intro-avatar {
  width: 122px;
  height: 122px;
  margin: 0 auto 22px;
  padding: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(22, 104, 220, .14), rgba(34, 160, 107, .18));
  box-shadow: 0 20px 46px rgba(22, 61, 124, .18);
}

.intro-avatar img {
  width: 100%;
  height: 100%;
  border: 5px solid #fff;
  border-radius: 50%;
  object-fit: cover;
}

.intro-focus p {
  margin: 0 0 10px;
  color: #12606b;
  font-size: 13px;
  font-weight: 700;
}

.intro-focus h1 {
  margin: 0 auto;
  max-width: 330px;
  color: var(--blue-dark);
  font-size: 27px;
  line-height: 1.28;
  text-align: center;
  letter-spacing: 0;
}

.intro-tags {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}

.intro-tags span {
  padding: 8px 10px;
  border: 1px solid rgba(22, 104, 220, .14);
  border-radius: 999px;
  color: #35506d;
  background: rgba(255, 255, 255, .82);
  font-size: 12px;
}

.intro-solve {
  display: grid;
  gap: 10px;
  margin-top: 28px;
}

.intro-solve article {
  padding: 14px;
  border: 1px solid rgba(167, 188, 210, .62);
  border-radius: 16px;
  background: rgba(255, 255, 255, .9);
}

.intro-solve strong {
  display: block;
  color: var(--blue-dark);
  font-size: 15px;
}

.intro-solve p {
  margin: 7px 0 0;
  color: #485b73;
  font-size: 13px;
  line-height: 1.65;
}


.intro-primary.fixed {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 52px;
  border-radius: 16px;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), #0a8d99);
  box-shadow: 0 12px 24px rgba(22, 104, 220, .24);
  font-weight: 700;
}

@media (max-width: 460px) {
  .intro-screen.intro-minimal {
    min-height: 100vh;
    border-radius: 0;
  }
}


/* admin knowledge overview */
.knowledge-overview {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.kb-card {
  min-height: 150px;
  padding: 18px;
  overflow: hidden;
  position: relative;
}

.kb-card span,
.kb-card p {
  color: var(--muted);
}

.kb-card span {
  font-size: 13px;
  font-weight: 700;
}

.kb-card strong {
  display: block;
  margin-top: 10px;
  color: var(--blue-dark);
  font-size: 34px;
}

.kb-card p {
  margin: 10px 0 0;
  font-size: 13px;
  line-height: 1.6;
}

.kb-card::after {
  content: "";
  position: absolute;
  right: -28px;
  top: -28px;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  opacity: .16;
}

.kb-card.danger::after { background: #e34f60; }
.kb-card.common::after { background: #22a06b; }
.kb-card.storage::after { background: #1668dc; }

@media (max-width: 900px) {
  .knowledge-overview {
    grid-template-columns: 1fr;
  }
}


/* mobile admin entrance */
.top-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.top-actions .round-tool {
  text-decoration: none;
  font-size: 14px;
}

.intro-actions.fixed {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 18px;
  display: grid;
  grid-template-columns: .92fr 1.28fr;
  gap: 10px;
}

.intro-actions .intro-primary,
.intro-actions .intro-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 52px;
  border-radius: 16px;
  font-weight: 700;
}

.intro-actions .intro-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--blue), #0a8d99);
  box-shadow: 0 12px 24px rgba(22, 104, 220, .24);
}

.intro-actions .intro-secondary {
  border: 1px solid rgba(22, 104, 220, .22);
  color: var(--blue-dark);
  background: rgba(255, 255, 255, .9);
}

/* knowledge management page */
.kb-main {
  background: #eef3f8;
}

.kb-header {
  align-items: flex-start;
}

.admin-sidebar nav {
  gap: 6px;
}

.admin-sidebar nav a {
  font-size: 14px;
}

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

.kb-summary-grid article {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(37, 64, 92, .06);
}

.kb-summary-grid span,
.kb-summary-grid em {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
}

.kb-summary-grid strong {
  display: block;
  margin: 10px 0;
  color: var(--blue-dark);
  font-size: 30px;
}

.kb-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-top: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.kb-toolbar strong {
  color: var(--blue-dark);
  font-size: 18px;
}

.kb-toolbar p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.kb-toolbar-actions {
  display: flex;
  gap: 10px;
  flex: 0 0 auto;
}

.kb-toolbar-actions button {
  height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--blue-dark);
  background: #f8fbff;
  cursor: pointer;
}

.kb-toolbar-actions button:first-child {
  border-color: transparent;
  color: #fff;
  background: var(--blue);
}

.kb-folder-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.kb-folder {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(37, 64, 92, .06);
}

.folder-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.folder-icon {
  position: relative;
  width: 64px;
  height: 48px;
  border-radius: 8px;
  background: linear-gradient(180deg, #ffd46b, #f2a93b);
  box-shadow: inset 0 -8px 14px rgba(133, 83, 14, .16);
}

.folder-icon::before {
  content: "";
  position: absolute;
  left: 7px;
  top: -8px;
  width: 30px;
  height: 14px;
  border-radius: 6px 6px 0 0;
  background: #ffe08a;
}

.folder-icon span {
  position: absolute;
  inset: 10px 8px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, .22);
}

.common-folder .folder-icon {
  background: linear-gradient(180deg, #8bdcae, #22a06b);
}

.common-folder .folder-icon::before {
  background: #b9edce;
}

.folder-head strong,
.folder-head em {
  display: block;
}

.folder-head strong {
  color: var(--blue-dark);
  font-size: 18px;
}

.folder-head em {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
}

.folder-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.folder-stats div {
  padding: 12px;
  border-radius: 8px;
  background: #f7fbff;
}

.folder-stats span,
.folder-stats strong {
  display: block;
}

.folder-stats span {
  color: var(--muted);
  font-size: 12px;
}

.folder-stats strong {
  margin-top: 5px;
  color: var(--blue-dark);
  font-size: 18px;
}

.folder-desc {
  margin-top: 14px;
  color: #485b73;
  font-size: 14px;
  line-height: 1.65;
}

.folder-types {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.folder-types span {
  padding: 7px 9px;
  border: 1px solid #dce8f4;
  border-radius: 999px;
  color: #35506d;
  background: #f8fbff;
  font-size: 12px;
}

.folder-types.single span {
  border-color: #dcefe4;
  background: #f5fcf8;
}

.folder-progress {
  height: 8px;
  margin-top: 16px;
  border-radius: 999px;
  overflow: hidden;
  background: #e8eef6;
}

.folder-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--cyan));
}

.common-folder .folder-progress i {
  background: linear-gradient(90deg, #22a06b, #84d66f);
}

.kb-detail-grid {
  display: grid;
  grid-template-columns: 1.35fr .75fr;
  gap: 14px;
  margin-top: 14px;
}

.kb-detail-panel,
.kb-ingest-panel {
  min-height: 240px;
}

.ingest-list {
  display: grid;
  gap: 10px;
}

.ingest-list div {
  padding: 12px;
  border: 1px solid #e0e9f4;
  border-radius: 8px;
  background: #f8fbff;
}

.ingest-list strong,
.ingest-list span {
  display: block;
}

.ingest-list strong {
  color: var(--blue-dark);
  font-size: 14px;
}

.ingest-list span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 1100px) {
  .kb-summary-grid,
  .kb-folder-grid,
  .kb-detail-grid {
    grid-template-columns: 1fr;
  }

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


/* simplified knowledge-base home */
.kb-home-only .kb-header h1 {
  margin-bottom: 6px;
}

.kb-home-only .kb-header p {
  margin: 0;
  max-width: 620px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.kb-total-strip {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 4px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(37, 64, 92, .06);
}

.kb-total-strip span,
.kb-total-strip em {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
}

.kb-total-strip strong {
  color: var(--blue-dark);
  font-size: 28px;
}

.kb-folder-grid.only-folders {
  grid-template-columns: repeat(2, minmax(360px, 1fr));
  align-items: stretch;
  margin-top: 16px;
}

.kb-folder-grid.only-folders .kb-folder {
  min-height: 430px;
  display: flex;
  flex-direction: column;
}

.folder-actions {
  display: grid;
  grid-template-columns: 1.1fr 1fr .8fr .8fr;
  gap: 8px;
  margin-top: auto;
  padding-top: 18px;
}

.folder-actions button {
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--blue-dark);
  background: #f8fbff;
  cursor: pointer;
}

.folder-actions button:first-child {
  border-color: transparent;
  color: #fff;
  background: var(--blue);
}

.folder-actions .danger-action {
  color: #b4233a;
  background: #fff6f7;
  border-color: #f2c9cf;
}


@media (max-width: 1100px) {
  .kb-folder-grid.only-folders {
    grid-template-columns: 1fr;
  }

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


/* plus input menu and knowledge drilldown */
.smart-composer {
  position: relative;
}

.upload-menu {
  display: none;
  position: absolute;
  left: 8px;
  bottom: 64px;
  z-index: 8;
  width: 138px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(37, 64, 92, .16);
}

.upload-menu.show {
  display: grid;
  gap: 6px;
}

.upload-menu button {
  height: 36px;
  border: 0;
  border-radius: 8px;
  color: #35506d;
  text-align: left;
  padding: 0 10px;
  background: #f7fbff;
  cursor: pointer;
}

.type-folders {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.type-folder {
  min-height: 220px;
}

.type-icon {
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
  border-radius: 14px;
}

.doc-icon { background: linear-gradient(135deg, #1668dc, #20c7d8); }
.image-icon { background: linear-gradient(135deg, #22a06b, #84d66f); }
.video-icon { background: linear-gradient(135deg, #e6a23c, #ffcf69); }
.table-icon { background: linear-gradient(135deg, #5664d2, #9a78f0); }

.kb-breadcrumb {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
}

.kb-breadcrumb a {
  color: var(--blue);
}

.data-toolbar {
  display: flex;
  gap: 10px;
  margin-top: 4px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.data-toolbar input {
  min-width: 220px;
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  outline: 0;
}

.data-toolbar button,
.asset-grid button {
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--blue-dark);
  background: #f8fbff;
  cursor: pointer;
}

.data-toolbar button:nth-child(3) {
  border-color: transparent;
  color: #fff;
  background: var(--blue);
}

.asset-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.asset-grid article {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(37, 64, 92, .06);
}

.asset-grid img,
.video-thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 8px;
  object-fit: cover;
  background: #edf3f8;
}

.video-thumb {
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 34px;
  background: linear-gradient(135deg, #123d7c, #0a8d99);
}

.asset-grid strong,
.asset-grid span {
  display: block;
}

.asset-grid strong {
  margin-top: 12px;
  color: var(--blue-dark);
  font-size: 15px;
}

.asset-grid span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.asset-grid article div:last-child {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

@media (max-width: 1100px) {
  .type-folders,
  .asset-grid {
    grid-template-columns: 1fr;
  }

  .data-toolbar {
    flex-wrap: wrap;
  }
}


/* final polish: compact menus, folders, modal */
.upload-menu {
  width: 168px;
}

.upload-menu button {
  white-space: nowrap;
  text-align: center;
  font-size: 13px;
}

.kb-total-strip em {
  display: none;
}

.kb-folder-grid.only-folders .kb-folder {
  min-height: 300px;
}

.kb-folder {
  padding: 16px;
}

.folder-stats {
  margin-top: 12px;
}

.folder-desc {
  margin-top: 12px;
}

.folder-types {
  margin-top: 12px;
}

.type-folders {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.type-folder {
  min-height: 156px;
  padding: 16px;
}

.type-folder .folder-head {
  gap: 12px;
}

.type-folder .folder-desc {
  font-size: 13px;
  line-height: 1.55;
}

.type-icon {
  position: relative;
  width: 54px;
  height: 40px;
  border-radius: 8px;
  background: linear-gradient(180deg, #f9d97a, #e8ad3d) !important;
  box-shadow: inset 0 -8px 14px rgba(133, 83, 14, .12);
}

.type-icon::before {
  content: "";
  position: absolute;
  left: 7px;
  top: -7px;
  width: 25px;
  height: 12px;
  border-radius: 6px 6px 0 0;
  background: #ffe49a;
}

.data-toolbar {
  align-items: center;
  width: fit-content;
  max-width: 100%;
}

.data-toolbar input {
  flex: 0 0 260px;
  min-width: 0;
  height: 36px;
}

.admin-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 50;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 35, 61, .38);
}

.admin-modal.show {
  display: flex;
}

.admin-modal-box {
  position: relative;
  width: min(420px, 100%);
  padding: 22px;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(15, 35, 61, .28);
}

.admin-modal-close {
  position: absolute;
  right: 12px;
  top: 10px;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 8px;
  background: #f3f6fa;
  cursor: pointer;
}

.admin-modal-box strong {
  display: block;
  color: var(--blue-dark);
  font-size: 18px;
}

.admin-modal-box p {
  margin: 12px 0 0;
  color: #485b73;
  font-size: 14px;
  line-height: 1.7;
}

.admin-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.admin-modal-actions button {
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--blue-dark);
  background: #f8fbff;
  cursor: pointer;
}

.admin-modal-actions button:last-child {
  border-color: transparent;
  color: #fff;
  background: var(--blue);
}

@media (max-width: 1100px) {
  .type-folders {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .type-folders {
    grid-template-columns: 1fr;
  }

  .data-toolbar {
    width: 100%;
  }

  .data-toolbar input {
    flex-basis: 100%;
  }
}

/* [本轮修正] 一级知识库文件夹与现代上传弹窗 */
.kb-folder-grid.only-folders {
  grid-template-columns: repeat(4, minmax(210px, 1fr));
  align-items: start;
  gap: 12px;
}

.kb-folder-grid.only-folders .kb-folder {
  min-height: 0;
  padding: 15px;
}

.kb-folder-grid.only-folders .folder-head {
  gap: 12px;
}

.kb-folder-grid.only-folders .folder-icon {
  width: 50px;
  height: 38px;
  border-radius: 8px;
}

.kb-folder-grid.only-folders .folder-icon::before {
  top: -7px;
  width: 25px;
  height: 12px;
}

.kb-folder-grid.only-folders .folder-head strong {
  font-size: 15px;
  line-height: 1.35;
}

.kb-folder-grid.only-folders .folder-head em {
  font-size: 12px;
}

.kb-folder-grid.only-folders .folder-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 12px;
}

.kb-folder-grid.only-folders .folder-stats div {
  padding: 8px 7px;
}

.kb-folder-grid.only-folders .folder-stats span {
  font-size: 11px;
}

.kb-folder-grid.only-folders .folder-stats strong {
  font-size: 15px;
}

.kb-folder-grid.only-folders .folder-desc {
  display: -webkit-box;
  min-height: 42px;
  margin-top: 10px;
  overflow: hidden;
  color: #4c5f76;
  font-size: 13px;
  line-height: 1.6;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.kb-folder-grid.only-folders .folder-types {
  display: none;
}

.admin-modal {
  background: rgba(12, 27, 48, .48);
  backdrop-filter: blur(6px);
}

.admin-modal-box {
  width: min(560px, 100%);
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(219, 229, 241, .92);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(11, 31, 56, .28);
}

.admin-modal-box > strong {
  padding: 22px 26px 8px;
  color: #102b52;
  font-size: 20px;
}

.admin-modal-close {
  right: 18px;
  top: 18px;
  width: 34px;
  height: 34px;
  border: 1px solid #e3edf7;
  border-radius: 50%;
  color: #52677f;
  background: #fff;
}

.admin-modal-close:hover {
  color: var(--blue-dark);
  background: #f3f8ff;
}

.admin-modal-content {
  margin: 0;
  padding: 0 26px 4px;
}

.modal-subtitle {
  margin-bottom: 18px;
  color: #66758a;
  font-size: 14px;
  line-height: 1.65;
}

.modal-field {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.modal-field span {
  color: #34465d;
  font-size: 13px;
  font-weight: 700;
}

.modal-field input[type="text"] {
  height: 44px;
  border: 1px solid #d8e4f0;
  border-radius: 10px;
  padding: 0 13px;
  outline: 0;
  color: #182334;
  background: #fbfdff;
}

.modal-field input[type="text"]:focus {
  border-color: rgba(22, 104, 220, .55);
  box-shadow: 0 0 0 3px rgba(22, 104, 220, .1);
}

.upload-drop {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 150px;
  margin-top: 16px;
  border: 1px dashed rgba(22, 104, 220, .42);
  border-radius: 14px;
  background: linear-gradient(180deg, #f8fbff, #eef7ff);
  cursor: pointer;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.upload-drop:hover {
  border-color: var(--blue);
  box-shadow: 0 14px 30px rgba(22, 104, 220, .12);
  transform: translateY(-1px);
}

.upload-drop input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.upload-drop-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-bottom: 10px;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), #0a8d99);
  font-size: 24px;
  font-weight: 700;
}

.upload-drop strong,
.upload-drop em {
  display: block;
  text-align: center;
  font-style: normal;
}

.upload-drop strong {
  color: #123d7c;
  font-size: 15px;
}

.upload-drop em {
  margin-top: 6px;
  color: #66758a;
  font-size: 12px;
}

.modal-hint,
.admin-modal-content p {
  margin: 12px 0 0;
  color: #66758a;
  font-size: 13px;
  line-height: 1.65;
}

.delete-confirm {
  padding: 18px;
  border: 1px solid #f4c7cf;
  border-radius: 12px;
  background: #fff7f8;
}

.delete-confirm strong {
  display: block;
  color: #9d2537;
  font-size: 16px;
}

.admin-modal-actions {
  margin-top: 20px;
  padding: 16px 26px 22px;
  border-top: 1px solid #edf2f7;
  background: #fbfdff;
}

.admin-modal-actions button {
  min-width: 88px;
  height: 40px;
  border-radius: 10px;
  font-weight: 700;
}

.admin-modal-actions button:first-child {
  border-color: #d8e4f0;
  color: #52677f;
  background: #fff;
}

.admin-modal-actions button:last-child {
  border-color: transparent;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), #0a8d99);
  box-shadow: 0 10px 20px rgba(22, 104, 220, .18);
}

.admin-modal-content.danger-text + .admin-modal-actions button:last-child {
  background: #c7354b;
  box-shadow: 0 10px 20px rgba(199, 53, 75, .18);
}

@media (max-width: 1280px) {
  .kb-folder-grid.only-folders {
    grid-template-columns: repeat(3, minmax(210px, 1fr));
  }
}

@media (max-width: 980px) {
  .kb-folder-grid.only-folders {
    grid-template-columns: repeat(2, minmax(210px, 1fr));
  }
}

@media (max-width: 620px) {
  .kb-folder-grid.only-folders {
    grid-template-columns: 1fr;
  }

  .admin-modal-box {
    width: min(94vw, 560px);
  }
}
/* [管理端返回入口] */
.admin-return-mini {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  margin-top: 12px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 10px;
  color: #fff;
  background: rgba(32, 199, 216, .16);
  font-size: 14px;
  font-weight: 700;
}

.admin-return-mini:hover {
  background: rgba(32, 199, 216, .28);
}
/* [初次访问页按钮调整] */
.intro-actions.fixed.single-action {
  grid-template-columns: 1fr;
}