:root {
  color: #182327;
  background: #f5f7f8;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.45;
}

* { box-sizing: border-box; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
body { margin: 0; min-width: 320px; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .48; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid #69a7a0; outline-offset: 2px; }

.login-shell { min-height: 100svh; display: grid; place-items: center; padding: 24px; background: #e9efee; }
.login-panel { width: min(100%, 380px); padding: 42px 36px; background: #ffffff; border: 1px solid #d9e2e0; border-radius: 8px; box-shadow: 0 18px 42px rgba(24, 35, 39, .08); }
.login-panel h1 { margin: 2px 0 0; font-family: Georgia, "Songti SC", serif; font-size: 40px; font-weight: 500; letter-spacing: 0; }
.login-copy { margin: 4px 0 30px; color: #657475; }
.login-form, .dialog form { display: grid; gap: 10px; }
label { color: #435356; font-size: 13px; font-weight: 650; }
input, select { width: 100%; min-height: 40px; border: 1px solid #cbd6d3; border-radius: 4px; background: #fff; color: #182327; padding: 8px 10px; }
.form-error { min-height: 1.3em; margin: 2px 0 0; color: #a7392f; font-size: 13px; }
.eyebrow { margin: 0; color: #6b7a7a; font-size: 11px; font-weight: 750; letter-spacing: .08em; }

.app-shell { min-height: 100svh; display: grid; grid-template-columns: 240px minmax(0, 1fr) 260px; background: #f5f7f8; }
.source-nav { display: flex; flex-direction: column; min-height: 0; padding: 22px 14px 14px; border-right: 1px solid #d7e1df; background: #eef2f1; }
.brand-lockup { display: flex; align-items: center; gap: 10px; padding: 0 8px 32px; font-family: Georgia, "Songti SC", serif; font-size: 19px; }
.brand-mark { display: grid; place-items: center; width: 28px; height: 28px; background: #1f6962; color: #fff; border-radius: 4px; font: 700 11px/1 Inter, sans-serif; }
.nav-heading { display: flex; align-items: center; justify-content: space-between; padding: 0 6px 7px 8px; color: #536264; font-size: 12px; font-weight: 700; }
.source-list { display: grid; gap: 2px; overflow: auto; }
.source-button { display: grid; grid-template-columns: 28px minmax(0, 1fr); align-items: center; gap: 8px; min-height: 48px; padding: 8px; border: 0; border-radius: 5px; background: transparent; color: #283638; text-align: left; }
.source-button:hover { background: #e1e9e7; }
.source-button[aria-current="true"] { background: #d7e4e1; color: #164d47; }
.source-provider { display: grid; place-items: center; width: 28px; height: 28px; border: 1px solid #c7d5d1; border-radius: 4px; color: #51716c; font-size: 10px; font-weight: 750; }
.source-name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.source-state { display: block; color: #788687; font-size: 11px; }
.nav-footer { display: grid; gap: 2px; margin-top: auto; padding-top: 16px; border-top: 1px solid #d7e1df; }
.text-button { border: 0; background: transparent; color: #536264; padding: 8px; text-align: left; font-size: 13px; }
.text-button:hover { color: #164d47; }

.workspace { min-width: 0; display: grid; grid-template-rows: auto auto auto minmax(0, 1fr); background: #fff; }
.workspace-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 24px 30px 18px; border-bottom: 1px solid #e2e9e7; }
.workspace-header h2 { margin: 2px 0 0; font-size: 20px; font-weight: 650; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.button, .icon-button { border: 1px solid #cbd6d3; border-radius: 4px; background: #fff; color: #273638; min-height: 36px; padding: 7px 12px; font-size: 13px; font-weight: 650; }
.button:hover, .icon-button:hover { border-color: #99aea9; background: #f7faf9; }
.button-primary { border-color: #1f6962; background: #1f6962; color: #fff; }
.button-primary:hover { border-color: #185852; background: #185852; }
.button-danger { border-color: #d99d96; color: #a7392f; }
.button-danger:hover { border-color: #bf7067; background: #fff8f7; }
.icon-button { display: grid; place-items: center; width: 36px; padding: 0; font-size: 20px; line-height: 1; }
.breadcrumb-row { display: flex; align-items: center; min-height: 46px; padding: 0 30px; border-bottom: 1px solid #eef2f1; color: #617071; font-size: 13px; }
.breadcrumb-current { border: 0; padding: 0; background: transparent; color: #1f6962; font-weight: 650; }
.breadcrumb-trail::before { content: "/"; margin: 0 8px; color: #b4c0be; }
.workspace-status { min-height: 0; padding: 0 30px; color: #607071; font-size: 13px; }
.workspace-status:not(:empty) { padding-top: 12px; }
.file-list { overflow: auto; padding: 8px 18px 28px; }
.file-row { display: grid; grid-template-columns: minmax(0, 1fr) 104px 126px; align-items: center; min-height: 48px; border: 0; border-bottom: 1px solid #edf2f0; background: transparent; color: #263638; text-align: left; width: 100%; padding: 0 12px; }
.file-row:hover { background: #f5f9f8; }
.file-row[aria-selected="true"] { background: #e7f0ee; }
.file-main { display: grid; grid-template-columns: 26px minmax(0, 1fr); align-items: center; gap: 8px; }
.file-glyph { color: #477b73; font-size: 17px; text-align: center; }
.file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 550; }
.file-row small { color: #748182; font-size: 12px; }
.empty-state { align-self: center; justify-self: center; text-align: center; color: #667678; }
.empty-state h3 { margin: 0 0 4px; color: #3b4d50; font-size: 16px; }
.empty-state p { margin: 0; font-size: 13px; }

.inspector { padding: 24px 20px; border-left: 1px solid #dfe8e5; background: #f8faf9; }
.inspector-empty { padding-top: 100px; text-align: center; color: #778586; font-size: 13px; }
.inspector-empty p { margin: 0 0 4px; color: #4e6062; font-weight: 600; }
.inspector h3 { overflow-wrap: anywhere; margin: 2px 0 24px; font-size: 17px; font-weight: 650; }
.metadata { display: grid; gap: 13px; margin: 0; }
.metadata div { display: grid; gap: 2px; }
.metadata dt { color: #7a8889; font-size: 11px; font-weight: 700; letter-spacing: .06em; }
.metadata dd { margin: 0; overflow-wrap: anywhere; color: #3a4c4f; font-size: 13px; }
.inspector-actions { display: grid; gap: 8px; margin-top: 28px; }
.inspector-note { margin: 12px 0 0; color: #748182; font-size: 12px; }

.dialog { width: min(calc(100vw - 32px), 480px); border: 1px solid #cbd6d3; border-radius: 8px; box-shadow: 0 18px 50px rgba(20, 39, 39, .2); padding: 0; }
.dialog::backdrop { background: rgba(21, 38, 38, .38); }
.dialog form { padding: 24px; }
.dialog-header { display: flex; align-items: start; justify-content: space-between; margin-bottom: 8px; }
.dialog-header h2 { margin: 2px 0 0; font-size: 19px; }
.field-note { margin: 0 0 4px; color: #6d7d7e; font-size: 12px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.dialog-actions-split { justify-content: space-between; }
.dialog-actions-split > div { display: flex; gap: 8px; }

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 190px minmax(0, 1fr); }
  .inspector { grid-column: 2; border-top: 1px solid #dfe8e5; border-left: 0; padding: 16px 22px; }
  .inspector-empty { display: none; }
  .metadata, .inspector-actions { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .inspector-actions { margin-top: 16px; }
}

@media (max-width: 640px) {
  .app-shell { min-height: 100svh; grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr) auto; }
  .source-nav { display: block; min-height: auto; padding: 12px; border-right: 0; border-bottom: 1px solid #d7e1df; }
  .brand-lockup { padding: 0 4px 10px; }
  .source-list { display: flex; overflow-x: auto; }
  .source-button { flex: 0 0 155px; }
  .nav-footer { display: none; }
  .workspace-header { align-items: flex-start; padding: 16px; }
  .header-actions { flex-wrap: wrap; justify-content: flex-end; }
  .breadcrumb-row { padding: 0 16px; }
  .workspace-status:not(:empty) { padding: 10px 16px 0; }
  .file-list { padding: 8px 6px 16px; }
  .file-row { grid-template-columns: minmax(0, 1fr) 80px; padding: 0 10px; }
  .file-row > small:last-child { display: none; }
  .inspector { grid-column: 1; }
  .metadata, .inspector-actions { grid-template-columns: 1fr 1fr; }
  .metadata div:first-child { grid-column: span 2; }
}
