* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
  background: #0f172a; color: #e2e8f0; min-height: 100vh;
}
.screen { max-width: 1000px; margin: 0 auto; padding: 16px; }
.hidden { display: none !important; }

/* 登录 */
#login-screen { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-box {
  background: #1e293b; border: 1px solid #334155; border-radius: 16px;
  padding: 36px 32px; width: 320px;
}
.login-box h2 { text-align: center; margin-bottom: 24px; }
.login-box input {
  width: 100%; padding: 12px; margin-bottom: 12px;
  background: #0f172a; color: #e2e8f0; border: 1px solid #475569; border-radius: 8px;
}
.login-box button {
  width: 100%; padding: 12px; background: #0ea5e9; color: #fff;
  border: none; border-radius: 8px; font-size: 16px; cursor: pointer;
}
.error { color: #fca5a5; text-align: center; margin-top: 10px; font-size: 13px; }

/* 顶栏 */
header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
header h1 { font-size: 20px; }
.btn-ghost {
  background: #334155; color: #e2e8f0; border: none; border-radius: 8px;
  padding: 8px 14px; cursor: pointer;
}

/* 网格 */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.grid-item {
  background: #1e293b; border: 1px solid #334155; border-radius: 12px;
  overflow: hidden; cursor: pointer; transition: transform .15s;
}
.grid-item:hover { transform: translateY(-3px); }
.grid-item img { width: 100%; height: 150px; object-fit: cover; display: block; }
.grid-item .name {
  padding: 8px; font-size: 12px; color: #94a3b8; text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* 分类卡片 */
.cat-card {
  background: #1e293b; border: 1px solid #334155; border-radius: 12px;
  padding: 24px; text-align: center; cursor: pointer; transition: transform .15s;
}
.cat-card:hover { transform: translateY(-3px); border-color: #0ea5e9; }
.cat-card .icon { font-size: 32px; margin-bottom: 8px; }
.cat-card .name { font-size: 14px; }

/* 单张查看 */
.viewer {
  position: fixed; inset: 0; background: rgba(0,0,0,.95); z-index: 100;
  display: flex; align-items: center; justify-content: center;
}
.viewer img { max-width: 95vw; max-height: 90vh; object-fit: contain; }
.viewer-close {
  position: absolute; top: 16px; right: 16px; background: none; color: #fff;
  border: none; font-size: 28px; cursor: pointer; z-index: 10;
}
.viewer-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(255,255,255,.15); color: #fff; border: none;
  font-size: 40px; width: 50px; height: 70px; cursor: pointer; border-radius: 8px;
}
.viewer-nav.prev { left: 10px; }
.viewer-nav.next { right: 10px; }
.viewer-name {
  position: absolute; bottom: 16px; left: 0; right: 0; text-align: center;
  color: #94a3b8; font-size: 13px;
}
