* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #0a0a0a;
  color: #e0e0e0;
  min-height: 100vh;
  -webkit-tap-highlight-color: transparent;
}

a { color: #e0e0e0; text-decoration: none; }

/* === Auth Overlay === */
.overlay {
  position: fixed;
  inset: 0;
  background: #0a0a0a;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.auth-box {
  text-align: center;
  padding: 2rem;
  width: 80%;
  max-width: 320px;
}

.auth-box h2 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  color: #fff;
}

.auth-box input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid #333;
  border-radius: 8px;
  background: #1a1a1a;
  color: #fff;
  font-size: 1rem;
  outline: none;
  margin-bottom: 1rem;
}

.auth-box input:focus {
  border-color: #666;
}

.auth-box button {
  width: 100%;
  padding: 0.75rem;
  border: none;
  border-radius: 8px;
  background: #2a2a2a;
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s;
}

.auth-box button:active {
  background: #444;
}

.error-text {
  color: #ff4444;
  font-size: 0.85rem;
  margin-top: 0.75rem;
  min-height: 1.2em;
}

/* === Header === */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 10, 10, 0.95);
  backdrop-filter: blur(10px);
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #1a1a1a;
}

header h1 {
  font-size: 1.1rem;
  font-weight: 600;
}

header h1 a { color: #fff; }

/* === Main Content === */
main {
  padding-bottom: 80px; /* space for floating button */
}

.hidden { display: none !important; }

/* === Album Header (on detail page) === */
.album-header {
  padding: 1rem;
  border-bottom: 1px solid #1a1a1a;
}

.album-header h2 {
  font-size: 1.1rem;
  color: #fff;
  margin-bottom: 0.3rem;
}

.album-header .meta {
  font-size: 0.8rem;
  color: #888;
}

/* === Image Grid (纵向列表) === */
.image-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: #111;
}

.image-list .img-wrap {
  width: 100%;
  position: relative;
  background: #111;
  min-height: 200px;
  cursor: pointer;
}

.image-list .img-wrap img {
  display: block;
  width: 100%;
  height: auto;
}

.image-list .img-wrap .loading-placeholder {
  width: 100%;
  height: 300px;
  background: #1a1a1a;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #333;
  font-size: 0.8rem;
}

/* === Floating "换一个" Button === */
.float-btn {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.75rem 2rem;
  border: none;
  border-radius: 24px;
  background: #fff;
  color: #000;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  z-index: 50;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
  transition: transform 0.15s, opacity 0.15s;
}

.float-btn:active {
  transform: translateX(-50%) scale(0.95);
}

.float-btn.loading {
  opacity: 0.6;
  pointer-events: none;
}

/* === Loading Spinner === */
.spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  color: #666;
}

.spinner::after {
  content: '';
  width: 24px;
  height: 24px;
  border: 2px solid #333;
  border-top-color: #888;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-left: 0.5rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* === Back Button === */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.5rem 0;
  color: #888;
  font-size: 0.9rem;
}

/* === Scrollbar === */
::-webkit-scrollbar { width: 0; }
