/* 主题：采用系统字体、iOS 蓝色与浅灰背景；可在此统一修改品牌配色。 */
:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --ios-blue: #007aff;
  --ios-blue-dark: #0062cc;
  --ios-label: #1c1c1e;
  --ios-secondary: #6e6e73;
  --ios-background: #f2f2f7;
  --ios-separator: rgba(60, 60, 67, 0.13);
  --panel: rgba(255, 255, 255, 0.76);
  --shadow: 0 24px 70px rgba(36, 43, 63, 0.13);
}

* { box-sizing: border-box; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ios-label);
  background: var(--ios-background);
}

button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }

/* 页面布局：限制桌面宽度，保留 iPhone 刘海屏的安全边距。 */
.app-shell {
  width: min(760px, calc(100% - 28px));
  margin: 0 auto;
  padding: max(30px, env(safe-area-inset-top)) 0 max(28px, env(safe-area-inset-bottom));
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 4px 22px;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--ios-blue);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0;
}

h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 38px; letter-spacing: 0; }
h2 { margin-bottom: 0; font-size: 22px; letter-spacing: 0; }

/* 毛玻璃卡片：圆角和半透明背景用于文件面板与登录窗口。 */
.glass-panel, .login-card {
  border: 1px solid rgba(255, 255, 255, 0.72);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(28px) saturate(150%);
  -webkit-backdrop-filter: blur(28px) saturate(150%);
}

.glass-panel { border-radius: 24px; padding: 22px; }

.icon-button {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: var(--ios-blue);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 8px 24px rgba(40, 51, 76, 0.1);
  cursor: pointer;
}

/* 目录导航与搜索栏：窄屏可横向滚动面包屑。 */
.breadcrumbs {
  display: flex;
  gap: 4px;
  align-items: center;
  overflow-x: auto;
  padding-bottom: 14px;
  white-space: nowrap;
  scrollbar-width: none;
}

.breadcrumb-button {
  border: 0;
  padding: 4px 6px;
  color: var(--ios-blue);
  background: transparent;
  font-weight: 650;
  cursor: pointer;
}

.breadcrumb-separator { color: #aeaeb2; }

.search-box {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 13px;
  border: 1px solid rgba(60, 60, 67, 0.07);
  border-radius: 13px;
  color: #8e8e93;
  background: rgba(118, 118, 128, 0.1);
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--ios-label);
  background: transparent;
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 24px 4px 10px;
}

.section-heading span { color: var(--ios-secondary); font-size: 13px; }

/* 文件列表：图标、文件名/元数据、操作提示分三列排列。 */
.file-list { border-top: 1px solid var(--ios-separator); }

.file-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 70px;
  padding: 10px 13px;
  border: 0;
  border-bottom: 1px solid var(--ios-separator);
  color: inherit;
  text-align: left;
  background: transparent;
  cursor: pointer;
}

.file-row:last-child { border-bottom: 0; }
.file-row:active { background: rgba(118, 118, 128, 0.09); }

.file-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 13px;
  font-size: 22px;
  background: #e9f3ff;
}

.file-icon.folder { color: #e6a400; background: #fff4cc; }
.file-info { min-width: 0; }
.file-name { display: block; overflow: hidden; margin-bottom: 4px; font-size: 15px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.file-meta { display: block; color: var(--ios-secondary); font-size: 12px; }
.chevron { color: #c7c7cc; font-size: 22px; }

.empty-state { padding: 44px 15px 34px; color: var(--ios-secondary); text-align: center; }
.empty-state h3 { margin-bottom: 8px; color: var(--ios-label); }
.empty-state p { margin-bottom: 0; font-size: 14px; }
.empty-icon { margin-bottom: 12px; font-size: 42px; }

footer { padding: 22px 0 0; color: #8e8e93; font-size: 12px; text-align: center; }

/* 密钥登录遮罩：未通过认证时隐藏文件面板。 */
.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(242, 242, 247, 0.72);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.login-card {
  width: min(410px, 100%);
  padding: 32px;
  border-radius: 28px;
  text-align: center;
}

.lock-icon {
  display: grid;
  width: 64px;
  height: 64px;
  margin: 0 auto 22px;
  place-items: center;
  border-radius: 20px;
  color: white;
  font-size: 30px;
  background: #0878e8;
  box-shadow: 0 14px 30px rgba(0, 122, 255, 0.3);
}

.login-copy { margin: 9px 0 24px; color: var(--ios-secondary); font-size: 14px; }
.key-field { display: block; text-align: left; }
.key-field span { display: block; margin: 0 4px 7px; color: var(--ios-secondary); font-size: 12px; font-weight: 650; }
.key-field input {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid rgba(60, 60, 67, 0.14);
  border-radius: 13px;
  outline: none;
  background: rgba(255, 255, 255, 0.85);
}
.key-field input:focus { border-color: var(--ios-blue); box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.11); }

.primary-button {
  width: 100%;
  margin-top: 14px;
  padding: 13px 18px;
  border: 0;
  border-radius: 14px;
  color: white;
  font-weight: 700;
  background: var(--ios-blue);
  cursor: pointer;
}
.primary-button:hover { background: var(--ios-blue-dark); }
.primary-button:disabled { cursor: wait; opacity: 0.6; }
.error-message { min-height: 18px; margin: 12px 0 0; color: #ff3b30; font-size: 13px; }

/* 轻提示：显示网络错误或操作反馈，不阻塞用户浏览。 */
.toast {
  position: fixed;
  z-index: 20;
  right: 18px;
  bottom: max(18px, env(safe-area-inset-bottom));
  max-width: calc(100% - 36px);
  padding: 12px 16px;
  border-radius: 14px;
  color: white;
  background: rgba(28, 28, 30, 0.9);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: 180ms ease;
}
.toast.visible { opacity: 1; transform: translateY(0); }
.hidden { display: none !important; }

/* 手机适配和减少动画偏好。 */
@media (max-width: 560px) {
  .app-shell { width: min(100% - 18px, 760px); }
  .glass-panel { padding: 15px; border-radius: 22px; }
  .login-card { padding: 28px 22px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
