:root {
  --bg: #f8fafd;
  --surface: #ffffff;
  --border: #dde3ea;
  --muted: #5f6368;
  --text: #202124;
  --blue: #1a73e8;
  --blue-soft: #e8f0fe;
  --sidebar: #f7f9fc;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  font-family: "Roboto", sans-serif;
  color: var(--text);
  background: var(--bg);
  height: 100%;
}

button,
input,
a,
table {
  font-family: inherit;
}

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: 64px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 190px;
  font-size: 20px;
  letter-spacing: 0.15px;
}

.drive-logo {
  width: 28px;
  height: 28px;
}

.search-wrap {
  flex: 1;
  max-width: 760px;
  background: #eef3fc;
  border-radius: 999px;
  height: 46px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
}

.search-wrap .material-symbols-outlined {
  color: var(--muted);
}

.search-wrap input {
  border: none;
  outline: none;
  background: transparent;
  width: 100%;
  font-size: 15px;
  color: var(--text);
}

.key-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  height: 40px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.workspace {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: calc(100vh - 64px);
}

.sidebar {
  border-right: 1px solid var(--border);
  background: var(--sidebar);
  padding: 18px 12px;
}

.new-btn {
  width: 124px;
  height: 54px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 14px;
  cursor: pointer;
  margin-bottom: 16px;
  box-shadow: 0 1px 2px rgba(25, 35, 53, 0.14);
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav-item {
  border: none;
  background: transparent;
  color: var(--text);
  height: 38px;
  border-radius: 999px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  text-align: left;
}

.nav-item.active {
  background: var(--blue-soft);
  color: #0b57d0;
  font-weight: 500;
}

.sidebar-note {
  margin-top: 20px;
  font-size: 12px;
  color: var(--muted);
  padding: 0 10px;
}

.content {
  padding: 16px 20px 24px;
}

.content-head {
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.content-head h1 {
  margin: 0;
  font-size: 23px;
  font-weight: 500;
}

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

.doc-count {
  color: var(--muted);
  font-size: 13px;
  margin-right: 6px;
}

.view-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.view-btn.active {
  color: #0b57d0;
  border-color: #c4d6fb;
  background: var(--blue-soft);
}

.status-banner {
  border: 1px solid #f6d8d8;
  background: #fff7f7;
  color: #b3261e;
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 12px;
  font-size: 13px;
}

.status-banner.info {
  border: 1px solid #d2e3fc;
  background: #f3f8ff;
  color: #174ea6;
}

.hidden {
  display: none !important;
}

.doc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(265px, 1fr));
  gap: 14px;
}

.doc-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(20, 29, 45, 0.08);
}

.doc-card-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.doc-card-link:hover {
  border-color: #b7cff8;
  box-shadow: 0 3px 9px rgba(20, 29, 45, 0.12);
}

.thumb-wrap {
  position: relative;
  border-bottom: 1px solid #edf1f6;
  background: #f4f7fb;
}

.thumb-wrap img {
  width: 100%;
  height: 182px;
  object-fit: cover;
  display: block;
}

.page-badge {
  position: absolute;
  right: 8px;
  bottom: 8px;
  background: rgba(32, 33, 36, 0.86);
  color: #fff;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
}

.doc-body {
  padding: 10px 12px 12px;
}

.doc-title {
  margin: 0 0 6px;
  font-size: 14px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.doc-meta {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
}

.doc-list {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  overflow: hidden;
}

.list-head {
  display: grid;
  grid-template-columns: 1fr 90px 120px;
  gap: 8px;
  padding: 10px 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  background: #fafcff;
}

.list-body {
  display: flex;
  flex-direction: column;
}

.list-row {
  display: grid;
  grid-template-columns: 1fr 90px 120px;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border-top: 1px solid #eef1f5;
  text-decoration: none;
  color: inherit;
  font-size: 13px;
}

.list-row:hover {
  background: #f7fbff;
}

.name-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.name-cell img {
  width: 34px;
  height: 44px;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: 4px;
}

.modal {
  border: none;
  padding: 0;
  border-radius: 16px;
  width: min(94vw, 680px);
}

.modal::backdrop {
  background: rgba(18, 23, 34, 0.45);
}

.modal-card {
  padding: 20px;
  background: var(--surface);
}

.modal-card h2 {
  margin: 0 0 8px;
  font-size: 20px;
}

.modal-card p {
  margin: 0 0 12px;
  font-size: 14px;
  color: var(--muted);
}

.modal-card input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  height: 42px;
  padding: 0 12px;
  margin-bottom: 12px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.btn-primary,
.btn-muted,
.icon-btn {
  border-radius: 10px;
  height: 36px;
  border: 1px solid var(--border);
  padding: 0 12px;
  cursor: pointer;
  background: var(--surface);
}

.btn-primary {
  border-color: #0b57d0;
  background: #0b57d0;
  color: #fff;
}

.pdf-viewer {
  position: fixed;
  inset: 64px 0 0 0;
  background: rgba(247, 250, 255, 0.98);
  border-top: 1px solid var(--border);
  z-index: 30;
  display: flex;
  flex-direction: column;
}

.pdf-viewer-head {
  height: 56px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px 0 16px;
}

.pdf-viewer-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.pdf-open-link {
  border: 1px solid var(--border);
  border-radius: 10px;
  height: 34px;
  padding: 0 11px;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: #174ea6;
  font-size: 12px;
  background: var(--surface);
}

#pdf-frame {
  border: none;
  width: 100%;
  height: calc(100vh - 120px);
  background: #f3f6fc;
}

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

  .sidebar {
    display: none;
  }

  .topbar {
    gap: 10px;
  }

  .brand span {
    font-size: 18px;
  }

  .search-wrap {
    height: 40px;
  }

  .pdf-viewer {
    inset: 64px 0 0 0;
  }

  #pdf-frame {
    height: calc(100vh - 120px);
  }
}

@media (max-width: 640px) {
  .brand {
    min-width: auto;
  }

  .brand span {
    display: none;
  }

  .key-btn span:last-child {
    display: none;
  }

  .content {
    padding: 12px;
  }

  .doc-grid {
    grid-template-columns: 1fr;
  }

  .list-head,
  .list-row {
    grid-template-columns: 1fr 72px 96px;
    font-size: 12px;
  }
}
