:root {
  --ink: #15231f;
  --muted: #65736e;
  --line: #dfe7e2;
  --paper: #f4f7f5;
  --white: #fff;
  --green: #166b4f;
  --green-2: #0d513b;
  --mint: #dff1e8;
  --amber: #b46c13;
  --red: #ad3b35;
  --shadow: 0 16px 40px rgba(22, 46, 37, 0.09);
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-height: 100vh;
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
}
button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  cursor: wait;
  opacity: 0.62;
}
.hidden {
  display: none !important;
}
.eyebrow {
  margin: 0 0 7px;
  font-size: 11px;
  letter-spacing: 0.16em;
  font-weight: 700;
  color: #4b7766;
}
.login-layout {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  background: #eef4f0;
}
.login-brand {
  padding: 10vh 8vw;
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: white;
  background:
    radial-gradient(
      circle at 12% 16%,
      rgba(104, 188, 149, 0.28),
      transparent 34%
    ),
    linear-gradient(145deg, #163f33, #0d241e);
}
.login-brand .eyebrow {
  color: #83c5a7;
}
.login-brand h1 {
  font-size: clamp(38px, 5vw, 68px);
  line-height: 1.14;
  margin: 16px 0 28px;
  letter-spacing: -0.04em;
}
.login-brand > p:not(.eyebrow) {
  max-width: 600px;
  color: #c5d7d0;
  font-size: 17px;
  line-height: 1.8;
}
.brand-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 60px;
  max-width: 620px;
}
.brand-grid span {
  border-top: 1px solid rgba(255, 255, 255, 0.24);
  padding-top: 18px;
  display: flex;
  flex-direction: column;
}
.brand-grid b {
  font-size: 22px;
}
.brand-grid small {
  color: #8fb2a5;
  margin-top: 5px;
}
.login-panel {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-card {
  width: min(430px, 100%);
  background: white;
  border: 1px solid var(--line);
  padding: 44px;
  border-radius: 24px;
  box-shadow: var(--shadow);
}
.logo-mark {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: var(--green);
  color: white;
  display: grid;
  place-items: center;
  font-size: 26px;
  font-weight: 800;
  box-shadow: 0 10px 25px rgba(22, 107, 79, 0.22);
}
.logo-mark.small {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  font-size: 18px;
  box-shadow: none;
}
.login-card h2 {
  font-size: 26px;
  margin: 26px 0 30px;
}
.login-card > p {
  color: var(--muted);
  margin: 0 0 28px;
}
.login-card label,
.form-grid label,
dialog > form > label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 16px 0;
  font-size: 13px;
  font-weight: 650;
  color: #394c45;
}
input,
select,
textarea {
  width: 100%;
  border: 1px solid #ccd8d2;
  border-radius: 10px;
  padding: 11px 13px;
  background: white;
  color: var(--ink);
  outline: none;
  transition: 0.18s;
}
input:focus,
select:focus,
textarea:focus {
  border-color: #3d8b6e;
  box-shadow: 0 0 0 3px rgba(61, 139, 110, 0.12);
}
button {
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
  border-radius: 10px;
  padding: 9px 14px;
  font-weight: 650;
}
.primary {
  background: var(--green);
  border-color: var(--green);
  color: white;
}
.primary:hover {
  background: var(--green-2);
}
.wide {
  width: 100%;
  padding: 12px;
  margin-top: 8px;
}
.form-error {
  color: var(--red) !important;
  min-height: 20px;
  margin: 14px 0 0 !important;
  font-size: 13px;
}
.app-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px 1fr;
}
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 248px;
  background: #123229;
  color: white;
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  z-index: 5;
}
.side-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 4px 8px 28px;
}
.side-brand div {
  display: flex;
  flex-direction: column;
}
.side-brand b {
  font-size: 16px;
}
.side-brand small {
  color: #8eaaa0;
  font-size: 11px;
  margin-top: 2px;
}
.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.sidebar nav button {
  border: 0;
  background: transparent;
  color: #aac0b7;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px;
  border-radius: 11px;
  text-align: left;
}
.sidebar nav button span {
  width: 30px;
  height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: #d2e0db;
}
.sidebar nav button:hover,
.sidebar nav button.active {
  background: rgba(255, 255, 255, 0.09);
  color: white;
}
.side-foot {
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding: 18px 5px 2px;
  display: grid;
  grid-template-columns: 34px 1fr auto;
  gap: 9px;
  align-items: center;
}
.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #d7efe5;
  color: #174d3b;
  font-weight: 800;
}
.side-foot div:nth-child(2) {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.side-foot b {
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.side-foot small {
  font-size: 11px;
  color: #91aaa0;
}
.side-foot button {
  border: 0;
  background: none;
  color: #91aaa0;
  padding: 4px;
  font-size: 11px;
}
.content {
  grid-column: 2;
  padding: 28px 34px 60px;
  min-width: 0;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}
.topbar h1 {
  font-size: 29px;
  margin: 0;
}
.network-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #477064;
  background: white;
  border: 1px solid var(--line);
  padding: 8px 12px;
  border-radius: 99px;
  font-size: 12px;
}
.network-badge i {
  width: 8px;
  height: 8px;
  background: #25a36f;
  border-radius: 50%;
  box-shadow: 0 0 0 4px #dff4ea;
}
.page {
  display: none;
}
.active-page {
  display: block;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 18px;
}
.stat-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 8px 24px rgba(20, 49, 39, 0.04);
}
.stat-card small {
  color: var(--muted);
}
.stat-card b {
  display: block;
  font-size: 34px;
  margin: 9px 0 2px;
  letter-spacing: -0.04em;
}
.stat-card span {
  font-size: 12px;
  color: #668378;
}
.two-column {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  gap: 18px;
}
.panel {
  background: white;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(20, 49, 39, 0.035);
  overflow: hidden;
}
.panel-head {
  padding: 20px 22px 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.panel h2 {
  margin: 0;
  font-size: 19px;
}
.text-button {
  border: 0;
  color: var(--green);
  padding: 4px;
}
.recent-row {
  padding: 13px 22px;
  border-top: 1px solid #edf1ef;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: center;
}
.recent-row b {
  display: block;
  font-size: 14px;
}
.recent-row small {
  color: var(--muted);
}
.responsibility ul {
  list-style: none;
  margin: 0;
  padding: 0 22px 15px;
}
.responsibility li {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid #edf1ef;
  padding: 14px 0;
  font-size: 13px;
}
.responsibility span {
  color: var(--muted);
}
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 15px;
}
.search {
  display: flex;
  gap: 8px;
  min-width: min(670px, 75%);
}
.search input {
  min-width: 220px;
}
.search select {
  width: 150px;
}
.table-panel {
  min-height: 260px;
}
.table-wrap {
  overflow: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
th {
  text-align: left;
  color: #6f7d78;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: #fafcfb;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
td {
  padding: 14px 16px;
  border-bottom: 1px solid #edf1ef;
  vertical-align: middle;
}
tbody tr:hover {
  background: #fbfdfc;
}
.cell-main b {
  display: block;
  max-width: 330px;
}
.cell-main small,
.subtle {
  color: var(--muted);
  font-size: 11px;
}

.cell-main small {
  display: block;
  max-width: 330px;
  overflow-wrap: anywhere;
}
.audit-target b,
.audit-target small {
  display: block;
}
.audit-target b {
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.audit-target small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}
.audit-detail {
  min-width: 260px;
  color: #3e514a;
  font-size: 12px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  background: #e9eeec;
  color: #56635e;
}
.badge.current,
.badge.ok {
  background: #ddf1e7;
  color: #176947;
}
.badge.review,
.badge.low {
  background: #fff0d9;
  color: #9a5a0d;
}
.badge.obsolete,
.badge.archived {
  background: #f3e8e7;
  color: #99413b;
}
.table-actions {
  display: flex;
  gap: 5px;
  white-space: nowrap;
}
.table-actions button,
.table-actions a {
  border: 0;
  background: #edf5f1;
  color: #215d48;
  padding: 6px 8px;
  border-radius: 7px;
  text-decoration: none;
  font-size: 11px;
  font-weight: 650;
}
.empty {
  text-align: center;
  color: var(--muted);
  padding: 60px;
}
.notice {
  border: 1px solid #d9e7df;
  background: #eaf5ef;
  padding: 15px 18px;
  border-radius: 13px;
  margin-bottom: 15px;
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 13px;
}
.notice span {
  color: #567166;
}
.toast {
  position: fixed;
  right: 24px;
  top: 20px;
  z-index: 100;
  background: #152e26;
  color: white;
  padding: 12px 17px;
  border-radius: 10px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
  transition: 0.22s;
}
.toast.show {
  opacity: 1;
  transform: none;
}
.toast.error {
  background: #8b302b;
}
dialog {
  border: 0;
  border-radius: 18px;
  padding: 0;
  width: min(680px, calc(100vw - 30px));
  box-shadow: 0 24px 70px rgba(12, 34, 26, 0.25);
  color: var(--ink);
}
dialog::backdrop {
  background: rgba(11, 28, 22, 0.62);
  backdrop-filter: blur(3px);
}
dialog form {
  padding: 0 24px 22px;
}
.dialog-head {
  padding: 20px 24px 15px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
dialog form .dialog-head {
  margin: 0 -24px 18px;
}
.dialog-head h2 {
  margin: 0;
  font-size: 20px;
}
.dialog-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}
.icon-button {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  background: #eef2f0;
  font-size: 22px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 14px;
}
.form-grid label {
  margin: 7px 0;
}
.span-2 {
  grid-column: 1/-1;
}
.file-drop {
  border: 1px dashed #aabdb4;
  border-radius: 12px;
  padding: 14px;
  background: #f8fbf9;
}
.file-drop.drag-over {
  border-color: var(--green);
  background: #eaf5ef;
  box-shadow: 0 0 0 3px rgba(22, 107, 79, 0.1);
}
.file-drop input[type="file"] {
  display: block;
  width: 100%;
  min-height: 40px;
  border: 0;
  padding: 0;
  box-shadow: none;
  color: var(--ink);
  line-height: 40px;
  overflow: hidden;
}
.file-drop input[type="file"]::file-selector-button,
.file-drop input[type="file"]::-webkit-file-upload-button {
  min-height: 38px;
  margin: 0 14px 0 0;
  padding: 8px 14px;
  border: 1px solid #aebbb5;
  border-radius: 8px;
  background: white;
  color: var(--ink);
  font: inherit;
  line-height: 20px;
  cursor: pointer;
}
.file-drop span,
.hint {
  color: var(--muted);
  font-size: 11px;
  margin: 2px 0;
}
.import-guidance {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #f1f6f3;
  color: var(--ink-soft);
}
.import-guidance p {
  margin: 5px 0 0;
  color: var(--muted);
  line-height: 1.6;
}
.upload-status {
  min-height: 20px;
  margin: -7px 0 8px;
  color: #42675a;
  font-size: 12px;
  line-height: 1.6;
}
.upload-status.error {
  color: var(--red);
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
  margin-top: 20px;
}
.viewer-dialog {
  width: min(1200px, calc(100vw - 30px));
  height: min(86vh, 900px);
  overflow: hidden;
  transition: width 0.18s ease, height 0.18s ease, border-radius 0.18s ease;
}
.viewer-fullscreen-button {
  min-width: 64px;
  height: 34px;
  padding: 0 12px;
  background: #eef2f0;
  border: 0;
  color: var(--green-2);
}
.viewer-dialog.viewer-fullscreen {
  inset: 0;
  width: 100vw;
  height: 100vh;
  max-width: 100vw;
  max-height: 100vh;
  margin: 0;
  border-radius: 0;
}
.viewer-dialog iframe {
  width: 100%;
  height: calc(100% - 76px);
  border: 0;
  background: #e9eeec;
}
.preview-status {
  height: calc(100% - 76px);
  display: grid;
  place-items: center;
  padding: 28px;
  color: var(--muted);
  text-align: center;
  background: #f7faf8;
}
.preview-status.error {
  color: var(--red);
  background: #fff8f7;
}
.history-dialog {
  width: min(820px, calc(100vw - 30px));
  max-height: 86vh;
}
.history-dialog #history-content {
  max-height: calc(86vh - 80px);
  overflow: auto;
  padding: 0 24px 24px;
}
.history-row {
  display: grid;
  grid-template-columns: 92px 1fr auto;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  padding: 15px 0;
  align-items: center;
}
.history-row b {
  font-size: 13px;
}
.history-row small {
  display: block;
  color: var(--muted);
  margin-top: 3px;
}
.history-row a {
  color: var(--green);
  font-size: 12px;
}
.role-select {
  min-width: 135px;
  padding: 7px 9px;
}
.danger-text {
  color: var(--red);
}
.folder-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 2px 0 15px;
}
.folder-header button {
  background: #e9f2ed;
  color: var(--green);
  border: 0;
}
.folder-header h2 {
  font-size: 21px;
  margin: 0;
}
.folder-header .eyebrow {
  margin-bottom: 3px;
}
.folder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 14px;
}
.folder-card {
  min-height: 94px;
  padding: 18px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 15px;
  box-shadow: 0 8px 24px rgba(20, 49, 39, 0.035);
  display: grid;
  grid-template-columns: 46px 1fr auto;
  gap: 14px;
  align-items: center;
  text-align: left;
}
.folder-card:hover {
  border-color: #8fb7a7;
  transform: translateY(-1px);
}
.folder-card .folder-icon {
  width: 46px;
  height: 38px;
  border-radius: 8px;
  background: var(--mint);
  color: var(--green);
  display: grid;
  place-items: center;
  font-size: 21px;
}
.folder-card b {
  display: block;
  font-size: 15px;
}
.folder-card small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 6px;
}
.folder-card i {
  font-style: normal;
  color: #88a096;
}
.folder-empty {
  grid-column: 1/-1;
}
.table-actions .danger-action {
  background: #f7e9e8;
  color: var(--red);
}
.toolbar-actions {
  display: flex;
  gap: 8px;
}
.toolbar-actions button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.toolbar-actions img {
  width: 16px;
  height: 16px;
  filter: invert(34%) sepia(20%) saturate(1174%) hue-rotate(108deg) brightness(88%);
}
.file-manager {
  position: relative;
  min-height: 430px;
  border-radius: 6px;
  box-shadow: none;
}
.manager-drop-overlay {
  position: absolute;
  z-index: 8;
  inset: 10px;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 7px;
  border: 2px dashed var(--green);
  border-radius: 10px;
  color: var(--green-2);
  background: rgba(242, 249, 245, 0.96);
  pointer-events: none;
}
.manager-drop-overlay b {
  font-size: 20px;
}
.manager-drop-overlay span {
  color: var(--muted);
  font-size: 13px;
}
.file-manager.drag-over .manager-drop-overlay {
  display: flex;
}
.path-breadcrumb {
  min-height: 39px;
  padding: 6px 12px;
  border-bottom: 1px solid #cfd8d3;
  display: flex;
  align-items: center;
  color: #1d4f91;
  font-family: Consolas, "Segoe UI", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  overflow-x: auto;
  white-space: nowrap;
}
.path-breadcrumb button {
  border: 0;
  border-radius: 3px;
  padding: 2px 3px;
  color: #075bb5;
  background: transparent;
  font-weight: 500;
}
.path-breadcrumb button:hover,
.path-breadcrumb button:last-of-type {
  color: white;
  background: #1677d2;
}
.file-table {
  min-width: 880px;
  table-layout: fixed;
}
.file-table th {
  position: relative;
  padding: 10px 12px;
  color: #26342f;
  background: #fbfcfb;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  border-right: 1px solid #e1e7e4;
}
.column-sort {
  width: 100%;
  padding: 0 12px 0 0;
  border: 0;
  border-radius: 0;
  justify-content: flex-start;
  color: inherit;
  background: transparent;
  font: inherit;
}
.column-sort:hover,
.column-sort:focus-visible {
  color: #075bb5;
  background: transparent;
}
.sort-indicator {
  min-width: 12px;
  margin-left: 5px;
  color: #1677d2;
  font-size: 9px;
}
.mobile-file-sort {
  display: none;
}
.column-resizer {
  position: absolute;
  z-index: 2;
  top: 0;
  right: 0;
  width: 8px;
  height: 100%;
  cursor: col-resize;
  touch-action: none;
  user-select: none;
}
.column-resizer::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 7px;
  width: 1px;
  background: transparent;
}
.column-resizer:hover::after,
.column-resizer:focus-visible::after,
body.resizing-columns .column-resizer.active::after {
  background: #1677d2;
}
body.resizing-columns {
  cursor: col-resize;
  user-select: none;
}
.file-table td {
  height: 42px;
  padding: 6px 12px;
  color: #1c2925;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.file-table tbody tr:hover {
  background: #eef6ff;
}
.inventory-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  font-size: 12px;
}
.inventory-table th,
.inventory-table td {
  padding: 11px 6px;
  line-height: 1.35;
  overflow-wrap: anywhere;
  white-space: normal;
}
.inventory-table th {
  font-size: 10px;
  letter-spacing: 0;
}
.inventory-table .inventory-col-name { width: 15%; }
.inventory-table .inventory-col-cas { width: 10%; }
.inventory-table .inventory-col-spec { width: 8%; }
.inventory-table .inventory-col-unit { width: 7%; }
.inventory-table .inventory-col-purity { width: 11%; }
.inventory-table .inventory-col-brand { width: 11%; }
.inventory-table .inventory-col-stock { width: 7%; }
.inventory-table .inventory-col-location { width: 10%; }
.inventory-table .inventory-col-purchaser { width: 7%; }
.inventory-table .inventory-col-status { width: 6%; }
.inventory-table .inventory-col-actions { width: 8%; }
.inventory-table .table-actions {
  flex-wrap: wrap;
  gap: 3px 2px;
  white-space: normal;
}
.inventory-table .table-actions button,
.inventory-table .table-actions a {
  padding: 5px 4px;
  font-size: 10px;
}
.inventory-table .inventory-remark {
  white-space: normal;
  overflow-wrap: anywhere;
}
.entry-name {
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 7px;
  color: #111c18;
  font-weight: 500;
  text-align: left;
}
.entry-name:hover span {
  color: #075bb5;
  text-decoration: underline;
}
.entry-name span {
  overflow: hidden;
  text-overflow: ellipsis;
}
.static-entry:hover span {
  color: inherit;
  text-decoration: none;
}
.entry-icon {
  width: 25px;
  height: 25px;
  flex: 0 0 25px;
}
.folder-icon-img {
  filter: invert(78%) sepia(81%) saturate(838%) hue-rotate(344deg) brightness(104%) contrast(97%);
}
.file-icon-img {
  filter: invert(86%) sepia(8%) saturate(421%) hue-rotate(168deg) brightness(102%) contrast(91%);
}
.up-icon {
  filter: invert(42%) sepia(27%) saturate(1562%) hue-rotate(96deg) brightness(91%);
}
.entry-subtitle {
  display: block;
  margin: 1px 0 0 32px;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
}
.entry-mobile-meta {
  display: none;
}
.dialog-path {
  margin: 0 0 12px;
  padding: 9px 11px;
  border: 1px solid #dbe5e0;
  border-radius: 8px;
  color: #42675a;
  background: #f4f8f6;
  font-family: Consolas, "Microsoft YaHei", sans-serif;
  font-size: 12px;
}
@media (max-width: 980px) {
  .login-layout {
    grid-template-columns: 1fr;
  }
  .login-brand {
    display: none;
  }
  .app-layout {
    grid-template-columns: 76px 1fr;
  }
  .sidebar {
    width: 76px;
    padding: 18px 10px;
  }
  .side-brand > div,
  .sidebar nav button:not(.active)::after,
  .sidebar nav button {
    font-size: 0;
  }
  .side-brand {
    padding: 4px 9px 26px;
  }
  .sidebar nav button {
    justify-content: center;
    padding: 8px;
  }
  .sidebar nav button span {
    font-size: 13px;
  }
  .side-foot {
    grid-template-columns: 1fr;
  }
  .side-foot > div:nth-child(2),
  .side-foot button {
    display: none;
  }
  .content {
    grid-column: 2;
    padding: 24px 18px;
  }
  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }
  .two-column {
    grid-template-columns: 1fr;
  }
  .search {
    min-width: 0;
    flex: 1;
  }
}
@media (max-width: 620px) {
  body {
    padding-bottom: env(safe-area-inset-bottom, 0);
  }
  .app-layout {
    display: block;
    min-height: 100vh;
    padding-bottom: calc(70px + env(safe-area-inset-bottom, 0px));
  }
  .sidebar {
    inset: auto 0 0 0;
    width: 100%;
    height: calc(64px + env(safe-area-inset-bottom, 0px));
    padding: 5px 8px env(safe-area-inset-bottom, 0px);
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
  }
  .side-brand {
    display: none;
  }
  .sidebar nav {
    min-width: 0;
    flex: 1;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(68px, 1fr);
    gap: 3px;
  }
  .sidebar nav button,
  .sidebar nav button:not(.active)::after {
    font-size: 11px;
  }
  .sidebar nav button {
    min-width: 0;
    min-height: 52px;
    padding: 4px 6px;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    text-align: center;
  }
  .sidebar nav button span {
    width: 24px;
    height: 24px;
    font-size: 11px;
    border-radius: 7px;
  }
  .side-foot {
    width: 48px;
    margin: 0;
    padding: 0;
    border: 0;
    display: flex;
    align-items: stretch;
  }
  .side-foot .avatar,
  .side-foot > div:nth-child(2) {
    display: none;
  }
  .side-foot button {
    width: 100%;
    display: block;
    padding: 4px;
    color: #c6d8d1;
    font-size: 11px;
  }
  .content {
    grid-column: auto;
    padding: 16px 12px 24px;
  }
  .stats-grid {
    grid-template-columns: 1fr;
  }
  .topbar {
    align-items: center;
    margin-bottom: 16px;
  }
  .topbar .eyebrow {
    display: none;
  }
  .topbar h1 {
    font-size: 24px;
  }
  .network-badge {
    display: none;
  }
  .toolbar,
  .search {
    align-items: stretch;
    flex-direction: column;
  }
  .toolbar {
    gap: 10px;
    margin-bottom: 12px;
  }
  .mobile-file-sort {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 13px;
  }
  .mobile-file-sort select {
    width: 100%;
    min-height: 42px;
  }
  .search {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
  }
  .search input,
  .search select {
    width: 100%;
  }
  .search button,
  .toolbar-actions button,
  #new-inventory-button {
    min-height: 42px;
  }
  .toolbar-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .toolbar-actions button {
    justify-content: center;
  }
  #page-inventory .toolbar-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .panel,
  .file-manager {
    border-radius: 12px;
  }
  .file-manager {
    min-height: 320px;
  }
  .path-breadcrumb {
    min-height: 42px;
    padding: 7px 10px;
    font-size: 13px;
  }
  .file-manager .table-wrap {
    overflow: visible;
  }
  .file-table {
    min-width: 0 !important;
    width: 100% !important;
    table-layout: auto;
  }
  .file-table colgroup,
  .file-table thead {
    display: none;
  }
  .file-table tbody,
  .file-table tr,
  .file-table td {
    display: block;
    width: 100% !important;
  }
  .file-table tr {
    padding: 12px;
    border-bottom: 1px solid #e6ece8;
  }
  .file-table td {
    height: auto;
    padding: 0;
    border: 0;
    white-space: normal;
    overflow: visible;
  }
  .file-table td:nth-child(2),
  .file-table td:nth-child(3),
  .file-table td:nth-child(4) {
    display: none;
  }
  .file-table td:nth-child(5) {
    margin-top: 10px;
  }
  .entry-name {
    min-height: 34px;
    font-size: 14px;
  }
  .entry-name span {
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .entry-subtitle,
  .entry-mobile-meta {
    display: block;
    margin: 3px 0 0 32px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.5;
    white-space: normal;
  }
  .table-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }
  .table-actions button,
  .table-actions a {
    min-height: 36px;
    padding: 8px 11px;
    display: inline-flex;
    align-items: center;
  }
  #page-inventory .table-wrap,
  #page-audit .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  #page-inventory table,
  #page-audit table {
    min-width: 760px;
  }
  #page-inventory .inventory-table {
    min-width: 1180px;
  }
  dialog:not(.viewer-dialog) {
    width: calc(100vw - 24px);
    max-height: calc(100dvh - 24px);
  }
  .dialog-head {
    padding: 15px 16px 12px;
    gap: 12px;
  }
  .dialog-head h2 {
    font-size: 17px;
  }
  dialog form {
    padding: 0 16px 18px;
  }
  dialog form .dialog-head {
    margin: 0 -16px 16px;
  }
  .viewer-dialog,
  .viewer-dialog.viewer-fullscreen {
    inset: 0;
    width: 100vw;
    height: 100dvh;
    max-width: 100vw;
    max-height: 100dvh;
    margin: 0;
    border-radius: 0;
  }
  .viewer-dialog .dialog-head > div:first-child {
    min-width: 0;
  }
  .viewer-dialog .dialog-head h2 {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .viewer-fullscreen-button {
    display: none;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .span-2 {
    grid-column: auto;
  }
  .content {
    padding: 20px 12px;
  }
  .login-panel {
    padding: 18px;
  }
  .login-card {
    padding: 30px 24px;
  }
  .notice {
    align-items: flex-start;
    flex-direction: column;
  }
}
