*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --border: #e2e5e9;
  --text: #1a1d21;
  --muted: #6b7280;
  --accent: #2563eb;
  --accent-soft: #eff6ff;
  --accent-hover: #1d4ed8;
  --danger: #dc2626;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  font-size: 15px;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.75rem 1.25rem 2.5rem;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.site-header h1 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.01em;
}

.site-header .subtitle {
  font-size: 0.8125rem;
  color: var(--muted);
  font-weight: 400;
  margin-top: 0.15rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.75rem 0.35rem 0.4rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: var(--shadow);
}

.user-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 600;
  flex-shrink: 0;
}

.user-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
}

h2 {
  font-size: 0.9375rem;
  font-weight: 600;
  margin: 0 0 1rem;
  color: var(--text);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
}

.card-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.card-title h2 {
  margin: 0;
}

.card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.875rem;
}

.breadcrumbs {
  display: none;
}

.location-nav {
  margin-bottom: 1.25rem;
  padding: 1rem 1.15rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.location-now {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border);
}

.location-now-icon {
  font-size: 1.75rem;
  line-height: 1;
  flex-shrink: 0;
}

.location-now-text {
  flex: 1;
  min-width: 0;
}

.location-now-label {
  margin: 0;
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.location-now-name {
  margin: 0.1rem 0 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text);
  word-break: break-word;
}

.location-up {
  flex-shrink: 0;
  white-space: nowrap;
}

.breadcrumb-trail {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.15rem;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.875rem;
}

.breadcrumb-trail li {
  display: inline-flex;
  align-items: center;
}

.crumb-link {
  color: var(--accent);
  text-decoration: none;
  padding: 0.2rem 0.45rem;
  border-radius: 5px;
}

.crumb-link:hover {
  background: var(--accent-soft);
}

.crumb-current {
  color: var(--text);
  font-weight: 500;
  padding: 0.2rem 0.45rem;
}

.crumb-sep {
  color: var(--muted);
  padding: 0 0.15rem;
  user-select: none;
}

.field-hint {
  margin: -0.35rem 0 1rem;
  font-size: 0.875rem;
  color: var(--muted);
}

.field-hint strong {
  color: var(--text);
  font-weight: 600;
}

.empty-state {
  text-align: center;
  padding: 2.5rem 1.25rem;
}

.empty-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
}

.empty-state p {
  margin: 0.25rem 0;
}

.breadcrumbs-label {
  display: none;
}

table {
  width: 100%;
  border-collapse: collapse;
}

.file-table th,
.file-table td {
  text-align: left;
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.file-table {
  table-layout: fixed;
}

.file-table .col-name {
  width: 55%;
  overflow: hidden;
}

.file-table .col-access {
  width: 7.5rem;
}

.file-table .col-size {
  width: 5.5rem;
}

.file-table .col-actions,
.file-table th.col-actions {
  width: 8.5rem;
  text-align: right;
}

.file-table th {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-weight: 600;
}

th {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-weight: 600;
}

tbody tr:hover {
  background: #fafbfc;
}

tr:last-child td {
  border-bottom: none;
}

.entry-name {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.3rem 0.65rem 0.3rem 0.45rem;
  border-radius: 6px;
  font-weight: 500;
  font-size: 0.9375rem;
  max-width: 100%;
  min-width: 0;
  vertical-align: middle;
}

.entry-name .entry-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.entry-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.col-access,
.col-size,
.col-actions {
  white-space: nowrap;
}

.action-menu {
  position: relative;
  display: inline-block;
}

.action-menu summary {
  list-style: none;
  cursor: pointer;
}

.action-menu summary::-webkit-details-marker {
  display: none;
}

.action-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 0.35rem);
  z-index: 20;
  min-width: 11rem;
  padding: 0.35rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.action-menu-item {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 0.5rem 0.65rem;
  font-size: 0.875rem;
  font-family: inherit;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  background: none;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  text-align: left;
}

.action-menu-item:hover {
  background: var(--bg);
}

.action-menu-danger {
  color: var(--danger);
}

.action-menu-danger:hover {
  background: #fef2f2;
}

.action-menu form {
  margin: 0;
}

.entry-name.dir {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
  text-decoration: none;
  transition: background 0.15s;
}

.entry-name.dir:hover {
  background: #fef3c7;
}

.entry-name.file {
  background: var(--accent-soft);
  border: 1px solid #bfdbfe;
  color: #1e40af;
}

.entry-icon {
  font-size: 1rem;
  line-height: 1;
  flex-shrink: 0;
}

.muted {
  color: var(--muted);
  font-size: 0.875rem;
}

label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  margin-bottom: 0.35rem;
  color: var(--text);
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="date"] {
  width: 100%;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.9375rem;
  background: var(--surface);
  margin-bottom: 0.75rem;
  transition: border-color 0.15s;
}

input[type="file"] {
  width: 100%;
  padding: 0.5rem;
  border: 1px dashed var(--border);
  border-radius: 8px;
  font-size: 0.875rem;
  background: var(--bg);
  margin-bottom: 0.75rem;
}

input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

@media (max-width: 540px) {
  .form-row {
    grid-template-columns: 1fr;
  }

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

  .header-actions {
    width: 100%;
    justify-content: space-between;
  }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  padding: 0.5rem 1rem;
  min-height: 2.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.2;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
  font-family: inherit;
  white-space: nowrap;
}

button.btn {
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
}

.btn:hover {
  background: var(--bg);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
}

.btn-ghost:hover {
  color: var(--text);
  background: var(--bg);
}

.btn-danger {
  color: var(--danger);
  border-color: #fecaca;
  background: #fff;
}

.btn-danger:hover {
  background: #fef2f2;
  border-color: var(--danger);
}

.btn-sm {
  min-height: 2rem;
  padding: 0 0.65rem;
  font-size: 0.8125rem;
  border-radius: 6px;
}

.actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.inline-form {
  display: inline-flex;
  align-items: center;
}

.error {
  color: var(--danger);
  font-size: 0.875rem;
  margin-bottom: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: #fef2f2;
  border-radius: 6px;
  border: 1px solid #fecaca;
}

.share-result {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem;
  margin-bottom: 1rem;
  background: var(--bg);
}

.share-result .path-label {
  display: inline-block;
  padding: 0.25rem 0.55rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.8125rem;
  font-family: ui-monospace, monospace;
  margin-bottom: 0.75rem;
  word-break: break-all;
}

.share-result .link-box {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin: 0.5rem 0;
}

.share-result input.link {
  flex: 1;
  font-family: ui-monospace, monospace;
  font-size: 0.8125rem;
  margin-bottom: 0;
}

.qr-wrap {
  text-align: center;
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
}

.qr-wrap img {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem;
  background: #fff;
}

.download-box {
  text-align: center;
  padding: 2rem 1.25rem;
}

.download-box .filename {
  display: inline-block;
  font-size: 1rem;
  font-weight: 600;
  margin: 0.75rem 0 1.25rem;
  word-break: break-all;
  padding: 0.5rem 1rem;
  background: var(--accent-soft);
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  color: #1e40af;
}

.public-folder-card {
  padding: 1.35rem;
}

.public-folder-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.public-folder-label {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.public-folder-title {
  margin: 0.25rem 0 0.35rem;
  font-size: 1.35rem;
  font-weight: 600;
}

.public-breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.2rem;
  margin-bottom: 1rem;
  padding: 0.65rem 0.85rem;
  background: var(--bg);
  border-radius: 8px;
  font-size: 0.875rem;
}

.public-file-table {
  width: 100%;
  border-collapse: collapse;
}

.public-file-table th,
.public-file-table td {
  padding: 0.65rem 0.5rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.public-file-table th {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.public-file-action {
  text-align: right;
  white-space: nowrap;
}

@media (max-width: 540px) {
  .public-folder-header {
    flex-direction: column;
  }

  .public-folder-header .btn-primary {
    width: 100%;
    text-align: center;
  }
}

.download-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.empty {
  display: none;
}

details.share-panel summary {
  list-style: none;
}

details.share-panel summary::-webkit-details-marker {
  display: none;
}

.share-form {
  margin-top: 0.5rem;
  padding: 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.share-none {
  font-size: 0.8125rem;
  color: var(--muted);
}

.btn-accent {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: #bfdbfe;
}

.btn-accent:hover {
  background: #dbeafe;
}

.success {
  color: #166534;
  font-size: 0.875rem;
  margin-bottom: 1rem;
  padding: 0.5rem 0.75rem;
  background: #f0fdf4;
  border-radius: 6px;
  border: 1px solid #bbf7d0;
}

.edit-link-card .link-box {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.edit-link-card .link-box input.link {
  flex: 1;
  min-width: 200px;
  font-family: ui-monospace, monospace;
  font-size: 0.8125rem;
  margin-bottom: 0;
}

.share-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.meta-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.65rem;
  font-size: 0.8125rem;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--muted);
}

.meta-badge.meta-on {
  background: #fef3c7;
  border-color: #fde68a;
  color: #92400e;
}

.meta-badge.meta-off {
  background: var(--accent-soft);
  border-color: #bfdbfe;
  color: #1e40af;
}

.edit-empty {
  text-align: center;
  padding: 1.5rem;
  color: var(--muted);
}

.edit-empty p {
  margin: 0.25rem 0;
}

.form-section {
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}

.form-section:last-of-type {
  border-bottom: none;
}

.form-section-title {
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin: 0 0 0.75rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--muted);
  margin-top: 0.25rem;
  margin-bottom: 0;
  cursor: pointer;
}

.checkbox-label input {
  width: auto;
  margin: 0;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.revoke-form {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--border);
}

input[type="date"]:disabled {
  background: var(--bg);
  color: var(--muted);
  cursor: not-allowed;
}

@media (max-width: 640px) {
  th:nth-child(3),
  td:nth-child(3) {
    display: none;
  }
}

.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.flex-between input {
  margin-bottom: 0;
}

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.login-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 1.25rem;
  margin-bottom: 1rem;
}

.login-card {
  width: 100%;
  max-width: 380px;
  text-align: center;
}

.login-card h1 {
  font-size: 1.35rem;
  font-weight: 600;
  margin: 0 0 0.35rem;
}

.login-card .login-desc {
  color: var(--muted);
  font-size: 0.875rem;
  margin-bottom: 1.25rem;
}

.brand-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.02em;
  color: var(--text);
}

.brand-footer {
  text-align: center;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--muted);
  margin: 0 0 1rem;
  letter-spacing: 0.02em;
}

.brand-mark {
  font-size: 1.1rem !important;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.login-card .brand-title {
  text-align: center;
  margin-bottom: 0.25rem;
}

.site-header .brand-title {
  font-size: 1.25rem;
}

.home-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 2rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.home-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
}

.home-main-centered {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.home-brand-center {
  flex-direction: column;
  margin-bottom: 1.5rem;
}

.home-brand-center .brand-title {
  font-size: 1.75rem;
  margin-top: 0.75rem;
}

.home-brand-center .login-logo {
  width: 3rem;
  height: 3rem;
  font-size: 1.25rem;
}

.home-hint {
  margin: 0.75rem 0 0;
  font-size: 0.9375rem;
  max-width: 22rem;
  margin-inline: auto;
}

.home-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.home-brand .login-logo {
  margin: 0;
  width: 2.25rem;
  height: 2.25rem;
  font-size: 1rem;
}

.home-brand .brand-title {
  font-size: 1.15rem;
}

.home-main {
  flex: 1;
}

.home-hero {
  text-align: center;
  padding: 1.75rem 1.5rem;
  margin-bottom: 1rem;
  width: 100%;
  max-width: 28rem;
}

.home-hero h1 {
  margin: 0 0 0.75rem;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.home-lead {
  margin: 0;
  color: var(--text);
  font-size: 1rem;
  font-weight: 500;
}

.home-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

@media (min-width: 600px) {
  .home-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.home-feature {
  padding: 1.15rem;
  text-align: center;
}

.home-feature-icon {
  font-size: 1.5rem;
  display: block;
  margin-bottom: 0.5rem;
}

.home-feature h2 {
  font-size: 0.9375rem;
  margin: 0 0 0.35rem;
}

.home-feature p {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--muted);
  line-height: 1.45;
}

.home-note {
  text-align: center;
  padding: 1.25rem;
}

.home-note p {
  margin: 0.25rem 0;
}

.home-footer {
  text-align: center;
  font-size: 0.8125rem;
  margin-top: 2rem;
  padding-top: 1rem;
}

.login-back {
  margin: 1rem 0 0;
  font-size: 0.875rem;
  text-align: center;
}

.login-back a {
  color: var(--muted);
  text-decoration: none;
}

.login-back a:hover {
  color: var(--accent);
}
