/* ===== CSS Variables ===== */
:root {
  --primary: #5b9ce6;
  --primary-dark: #3a82d4;
  --secondary: #7b9fd4;
  --secondary-dark: #5f84bc;
  --bg-overlay: rgba(230, 245, 255, 0.85);
  --card-bg: #ffffff;
  --text: #333333;
  --text-muted: #6b7f94;
  --border: #d4e3f2;
  --shadow: 0 4px 20px rgba(91, 156, 230, 0.12);
  --radius: 16px;
  --radius-sm: 10px;
  --header-height: 60px;
  --green-notice: #e8f6f1;
  --green-notice-border: #9dcec4;
  --green-notice-text: #2d7568;
  --pink-notice: #f3f0ff;
  --pink-notice-border: #c8bfe8;
}

[data-theme="dark"] {
  --bg-overlay: rgba(18, 28, 42, 0.92);
  --card-bg: #1e2a38;
  --text: #e8f0f8;
  --text-muted: #8fa3b8;
  --border: #3a4f63;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  --green-notice: #1a2e2a;
  --green-notice-border: #2d6b5a;
  --green-notice-text: #7ec9b0;
  --pink-notice: #242838;
  --pink-notice-border: #4a5a80;
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  background: linear-gradient(160deg, #d6ecff 0%, #c5e3ff 40%, #e0f4ff 70%, #b8daf5 100%) center/cover fixed no-repeat;
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  backdrop-filter: blur(8px);
  z-index: 0;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, rgba(147, 197, 253, 0.35) 0%, rgba(186, 230, 253, 0.25) 50%, rgba(191, 219, 254, 0.3) 100%);
  z-index: 0;
  pointer-events: none;
}

[data-theme="dark"] body::after {
  background: linear-gradient(135deg, rgba(30, 60, 90, 0.45) 0%, rgba(25, 45, 70, 0.35) 100%);
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ===== Layout ===== */
.page-wrapper {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ===== Header ===== */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  max-width: 900px;
  margin: 0 auto;
  padding: 0 16px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

[data-theme="dark"] .header-inner {
  background: rgba(24, 34, 48, 0.95);
}

.logo {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}

.logo span {
  color: var(--primary);
}

.nav-bar-wrap {
  width: 100%;
  padding: 10px 16px;
  background: linear-gradient(90deg, #e3f0fc 0%, #d8e8f8 50%, #e8eef8 100%);
}

[data-theme="dark"] .nav-bar-wrap {
  background: linear-gradient(90deg, #243040 0%, #1e2a38 50%, #283448 100%);
}

.nav-bar.tabs {
  max-width: 680px;
  margin: 0 auto;
  margin-bottom: 0;
}

.nav-item.tab {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 4px 8px;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: color 0.2s;
}

.btn-text:hover {
  color: var(--primary);
}

.btn-gashapon {
  background: linear-gradient(135deg, #ff5252, #ff1744);
  color: #fff;
  border: none;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(255, 23, 68, 0.4);
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn-gashapon:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 23, 68, 0.5);
}

.btn-theme {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--card-bg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: all 0.2s;
}

.btn-theme:hover {
  border-color: var(--primary);
}

/* ===== Main Content ===== */
.main {
  flex: 1;
  padding: 20px 0 80px;
}

/* ===== Notices ===== */
.notice {
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 12px;
  font-size: 0.85rem;
  line-height: 1.7;
}

.notice-green {
  background: var(--green-notice);
  border: 1px solid var(--green-notice-border);
  color: var(--green-notice-text);
}

.notice-pink {
  background: var(--pink-notice);
  border: 1px solid var(--pink-notice-border);
  color: var(--text);
}

.notice-pink h3 {
  font-size: 0.9rem;
  color: var(--primary);
  margin-bottom: 8px;
}

.notice-pink ol {
  padding-left: 20px;
}

.notice-pink li {
  margin-bottom: 4px;
}

.notice-pink a {
  color: var(--primary);
  font-weight: 600;
}

.notice-pink a.qq-group-link {
  color: #2563eb;
}

.qq-group-link:hover {
  text-decoration: underline;
}

/* ===== Search Cards ===== */
.search-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
}

/* Tabs */
.tabs {
  display: flex;
  gap: 0;
  margin-bottom: 16px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
}

.tab {
  flex: 1;
  padding: 10px 8px;
  text-align: center;
  font-size: 0.85rem;
  border: none;
  background: var(--card-bg);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
}

.tab:not(:last-child):not(.tab-last-visible) {
  border-right: 1px solid var(--border);
}

.tab.tab-last-visible {
  border-right: none;
}

.tabs.tabs-single .tab {
  flex: 1 1 100%;
  width: 100%;
  border-right: none;
}

.tab.active {
  background: var(--primary);
  color: #fff;
}

.tab:hover:not(.active) {
  background: var(--pink-notice);
  color: var(--primary);
}

/* Search Input */
.search-input-wrap {
  margin-bottom: 12px;
}

.search-input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  background: var(--card-bg);
  color: var(--text);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(91, 156, 230, 0.2);
}

.search-input::placeholder {
  color: var(--text-muted);
}

/* Search Buttons */
.btn-search {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  color: #fff;
  transition: all 0.2s;
  letter-spacing: 2px;
}

.btn-search-pink {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  box-shadow: 0 4px 15px rgba(91, 156, 230, 0.35);
}

.btn-search-pink:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(91, 156, 230, 0.45);
}

.btn-search-purple {
  background: linear-gradient(135deg, var(--secondary), var(--secondary-dark));
  box-shadow: 0 4px 15px rgba(123, 159, 212, 0.35);
}

.btn-search-purple:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(123, 159, 212, 0.45);
}

/* Media Categories Label */
.media-label {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  padding: 8px;
  background: var(--pink-notice);
  border-radius: var(--radius-sm);
  letter-spacing: 1px;
}

/* ===== Footer ===== */
.footer {
  text-align: center;
  padding: 16px;
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.8;
}

/* ===== Floating Buttons ===== */
.fab {
  position: fixed;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.2s;
}

.fab:hover {
  transform: scale(1.05);
  text-decoration: none;
}

.fab-circle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.fab-left {
  bottom: 24px;
  left: 24px;
}

.fab-left .fab-circle {
  background: linear-gradient(135deg, #42a5f5, #1e88e5);
  color: #fff;
}

.fab-right {
  bottom: 24px;
  right: 24px;
}

.fab-right .fab-circle {
  background: linear-gradient(135deg, var(--secondary), var(--secondary-dark));
  color: #fff;
}

.fab-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 500;
}

.fab-tip {
  position: absolute;
  bottom: 70px;
  left: 0;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 0.75rem;
  white-space: nowrap;
  box-shadow: var(--shadow);
  animation: fadeInUp 0.5s ease;
}

.fab-tip::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 20px;
  width: 10px;
  height: 10px;
  background: var(--card-bg);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  transform: rotate(45deg);
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== Search Results Page ===== */
.page-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  cursor: pointer;
  border: none;
  background: none;
}

.back-link:hover {
  color: var(--primary);
}

.result-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.result-item {
  background: var(--card-bg);
  border-radius: var(--radius-sm);
  padding: 16px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: transform 0.2s;
}

.result-item:hover {
  transform: translateY(-2px);
}

.result-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.result-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.result-meta span {
  margin-right: 12px;
}

.result-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.result-actions {
  display: flex;
  gap: 8px;
}

.download-link-box {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  align-items: center;
}

.download-link-input {
  flex: 1;
  min-width: 0;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  background: var(--pink-notice);
  color: var(--text);
  outline: none;
}

.download-link-input:focus {
  border-color: var(--primary);
}

.download-link-box .btn-sm {
  flex-shrink: 0;
  white-space: nowrap;
}

.btn-sm {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary-sm {
  background: var(--primary);
  color: #fff;
}

.btn-primary-sm:hover {
  background: var(--primary-dark);
}

.btn-outline-sm {
  background: transparent;
  border: 1px solid var(--primary);
  color: var(--primary);
}

.btn-outline-sm:hover {
  background: var(--pink-notice);
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

.empty-state svg {
  width: 64px;
  height: 64px;
  margin-bottom: 16px;
  opacity: 0.4;
}

.loading {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
}

.loading-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 12px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== Rankings ===== */
.rank-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.rank-tab {
  padding: 6px 16px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}

.rank-tab.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.rank-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--card-bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  margin-bottom: 8px;
  transition: transform 0.2s;
}

.rank-item:hover {
  transform: translateX(4px);
}

.rank-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  flex-shrink: 0;
}

.rank-num.top1 { background: #ffd700; color: #fff; }
.rank-num.top2 { background: #c0c0c0; color: #fff; }
.rank-num.top3 { background: #cd7f32; color: #fff; }
.rank-num.normal { background: var(--pink-notice); color: var(--text-muted); }

.rank-info { flex: 1; min-width: 0; }
.rank-name { font-weight: 600; font-size: 0.95rem; }
.rank-author { font-size: 0.8rem; color: var(--text-muted); }

/* ===== Bookshelf ===== */
.shelf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.shelf-item {
  background: var(--card-bg);
  border-radius: var(--radius-sm);
  padding: 12px;
  border: 1px solid var(--border);
  text-align: center;
  cursor: pointer;
  transition: transform 0.2s;
}

.shelf-item:hover {
  transform: translateY(-3px);
}

.shelf-cover {
  width: 80px;
  height: 110px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 6px;
  margin: 0 auto 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 2rem;
}

.shelf-name {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shelf-author {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ===== Profile ===== */
.profile-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 24px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  text-align: center;
  margin-bottom: 16px;
}

.profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  color: #fff;
}

.profile-name {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.profile-status {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.profile-auth {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 8px;
}

.auth-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 96px;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.auth-btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 14px rgba(255, 120, 158, 0.3);
}

.auth-btn-secondary {
  background: var(--card-bg);
  color: var(--primary);
  border: 1px solid var(--primary);
}

.auth-btn-logout {
  margin-top: 8px;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.auth-btn:hover {
  transform: translateY(-1px);
  text-decoration: none;
}

/* ===== Auth Pages ===== */
.auth-container {
  max-width: 420px;
}

.auth-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 28px 24px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.auth-title {
  font-size: 1.4rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 6px;
}

.auth-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 24px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.auth-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.auth-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  color: var(--text);
  background: var(--card-bg);
  outline: none;
  transition: border-color 0.2s;
}

.auth-input:focus {
  border-color: var(--primary);
}

.auth-submit {
  width: 100%;
  margin-top: 12px;
  padding: 14px 16px;
  border: none;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(255, 120, 158, 0.35);
  transition: background 0.2s, transform 0.15s;
}

.auth-submit:hover:not(:disabled) {
  transform: translateY(-1px);
}

.auth-submit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.auth-footer {
  margin-top: 18px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.auth-footer a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}

.auth-footer a:hover {
  text-decoration: underline;
}

/* ===== Standalone Auth Pages (login / register) ===== */
.auth-standalone-page {
  background: #f5f5f5;
}

.auth-standalone-page::before,
.auth-standalone-page::after {
  display: none;
}

.auth-standalone-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.auth-standalone-card {
  width: 100%;
  max-width: 400px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.08);
  padding: 36px 32px 28px;
}

.auth-standalone-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  text-align: center;
  margin-bottom: 8px;
  line-height: 1.4;
}

.auth-standalone-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 28px;
}

.auth-standalone-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-standalone-label {
  font-size: 0.82rem;
  color: var(--primary);
  margin-top: 8px;
}

.auth-standalone-label:first-of-type {
  margin-top: 0;
}

.auth-standalone-input {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid #ffc8d8;
  border-radius: 8px;
  font-size: 0.95rem;
  color: var(--text);
  background: #fff;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.auth-standalone-input::placeholder {
  color: #c0b0b8;
}

.auth-standalone-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(255, 120, 158, 0.15);
}

.auth-standalone-agree {
  margin-top: 14px;
  padding: 12px 14px;
  background: #fff5f8;
  border: 1px solid #ffd6e4;
  border-radius: 8px;
}

.auth-standalone-agree-text {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 10px;
}

.auth-standalone-agree-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--primary);
  cursor: pointer;
  user-select: none;
}

.auth-standalone-agree-check input {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
}

[data-theme="dark"] .auth-standalone-agree {
  background: var(--pink-notice);
  border-color: var(--pink-notice-border);
}

.auth-standalone-submit {
  width: 100%;
  margin-top: 20px;
  padding: 13px 16px;
  border: none;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}

.auth-standalone-submit:hover:not(:disabled) {
  background: var(--primary-dark);
}

.auth-standalone-submit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.auth-standalone-footer {
  margin-top: 20px;
  text-align: center;
  font-size: 0.82rem;
  color: var(--primary);
}

.auth-standalone-footer a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}

.auth-standalone-footer a:hover {
  text-decoration: underline;
}

.auth-standalone-link-sep {
  margin-left: 12px;
}

.auth-standalone-inline {
  display: flex;
  gap: 8px;
  align-items: center;
}

.auth-standalone-inline .auth-standalone-input {
  flex: 1;
  min-width: 0;
}

.auth-standalone-inline-btn {
  flex-shrink: 0;
  padding: 11px 14px;
  border: 1px solid var(--primary);
  border-radius: 8px;
  background: #fff;
  color: var(--primary);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.auth-standalone-inline-btn:hover:not(:disabled) {
  background: var(--primary);
  color: #fff;
}

.auth-standalone-inline-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

[data-theme="dark"] .auth-standalone-inline-btn {
  background: var(--card-bg);
}

[data-theme="dark"] .auth-standalone-page {
  background: #1a1520;
}

[data-theme="dark"] .auth-standalone-card {
  background: var(--card-bg);
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .auth-standalone-input {
  background: var(--card-bg);
  border-color: var(--border);
}

.menu-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--card-bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text);
  text-decoration: none;
}

.menu-item:hover {
  border-color: var(--primary);
  background: var(--pink-notice);
  text-decoration: none;
}

.menu-item-icon {
  font-size: 1.2rem;
}

.menu-item-text {
  flex: 1;
  font-size: 0.9rem;
}

.menu-item-arrow {
  color: var(--text-muted);
}

/* ===== Circle (Community) ===== */
.post-form {
  background: var(--card-bg);
  border-radius: var(--radius-sm);
  padding: 16px;
  border: 1px solid var(--border);
  margin-bottom: 16px;
}

.post-form textarea {
  width: 100%;
  min-height: 80px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  font-size: 0.9rem;
  resize: vertical;
  background: var(--card-bg);
  color: var(--text);
  outline: none;
  margin-bottom: 10px;
  font-family: inherit;
}

.post-form textarea:focus {
  border-color: var(--primary);
}

.post-item {
  background: var(--card-bg);
  border-radius: var(--radius-sm);
  padding: 16px;
  border: 1px solid var(--border);
  margin-bottom: 12px;
}

.post-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.post-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.9rem;
}

.post-user {
  font-weight: 600;
  font-size: 0.9rem;
}

.post-time {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.post-content {
  font-size: 0.9rem;
  line-height: 1.7;
  margin-bottom: 10px;
}

.post-actions-bar {
  display: flex;
  gap: 16px;
}

.post-action {
  font-size: 0.8rem;
  color: var(--text-muted);
  cursor: pointer;
  border: none;
  background: none;
  display: flex;
  align-items: center;
  gap: 4px;
}

.post-action:hover {
  color: var(--primary);
}

/* ===== Gashapon ===== */
.gashapon-machine {
  text-align: center;
  padding: 30px 20px;
}

.gashapon-ball {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff5252, #ff1744);
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  box-shadow: 0 8px 30px rgba(255, 23, 68, 0.4);
  cursor: pointer;
  transition: transform 0.3s;
  user-select: none;
}

.gashapon-ball.spinning {
  animation: gashaponSpin 1s ease-in-out;
}

@keyframes gashaponSpin {
  0% { transform: rotate(0deg) scale(1); }
  25% { transform: rotate(90deg) scale(1.1); }
  50% { transform: rotate(180deg) scale(1); }
  75% { transform: rotate(270deg) scale(1.1); }
  100% { transform: rotate(360deg) scale(1); }
}

.gashapon-result {
  background: var(--pink-notice);
  border: 1px solid var(--pink-notice-border);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-top: 16px;
  font-size: 0.95rem;
  display: none;
}

.gashapon-result.show {
  display: block;
  animation: fadeInUp 0.4s ease;
}

/* ===== Points ===== */
.points-card {
  text-align: center;
  padding: 30px 20px;
}

.points-balance-wrap {
  margin-bottom: 20px;
}

.points-label {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.points-balance {
  font-size: 3rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.2;
}

.points-login-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.points-login-hint a {
  color: var(--primary);
}

.points-modal {
  text-align: center;
}

.points-modal .member-card-login-hint {
  text-align: center;
}

/* ===== Membership / Card Key ===== */
.card-key-panel {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 24px 20px;
  border: 1px solid var(--border);
  max-width: 420px;
  margin: 0 auto 20px;
}

.card-key-form .card-key-input {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.06em;
  text-transform: lowercase;
}

.card-key-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 8px 0 16px;
  line-height: 1.5;
}

.card-key-hint a {
  color: var(--primary);
  font-weight: 600;
}

.member-status-box {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--green-notice);
  border: 1px solid var(--green-notice-border);
  font-size: 0.9rem;
  text-align: center;
}

.card-key-features {
  list-style: none;
  max-width: 280px;
  margin: 0 auto;
  padding: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.card-key-features li {
  padding: 6px 0 6px 22px;
  position: relative;
}

.card-key-features li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--primary);
  font-weight: 700;
}

.member-plans {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.member-plan {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 20px;
  border: 2px solid var(--border);
  transition: all 0.2s;
  cursor: pointer;
}

.member-plan.recommended {
  border-color: var(--primary);
  position: relative;
}

.member-plan.recommended::before {
  content: '推荐';
  position: absolute;
  top: -10px;
  right: 16px;
  background: var(--primary);
  color: #fff;
  font-size: 0.7rem;
  padding: 2px 10px;
  border-radius: 10px;
}

.member-plan:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.plan-name {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.plan-price {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 8px;
}

.plan-price small {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 400;
}

.plan-features {
  list-style: none;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.plan-features li {
  padding: 4px 0;
}

.plan-features li::before {
  content: '✓ ';
  color: var(--primary);
  font-weight: 700;
}

/* ===== Toast ===== */
.toast {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  padding: 10px 24px;
  border-radius: 20px;
  font-size: 0.85rem;
  z-index: 9999;
  opacity: 0;
  transition: all 0.3s;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ===== Modal ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-overlay.show {
  display: flex;
}

.modal {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 24px;
  max-width: 400px;
  width: 100%;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.3);
  animation: fadeInUp 0.3s ease;
}

.modal h3 {
  margin-bottom: 12px;
  font-size: 1.1rem;
}

.modal p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  line-height: 1.7;
}

.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.btn-modal {
  padding: 8px 20px;
  border-radius: 20px;
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
}

.btn-modal-cancel {
  background: var(--border);
  color: var(--text);
}

.btn-modal-confirm {
  background: var(--primary);
  color: #fff;
}

/* ===== Member Card Modal ===== */
.member-card-modal {
  text-align: left;
  padding: 24px 22px 20px;
}

.member-card-modal-title {
  text-align: left;
  color: var(--primary);
  margin-bottom: 16px;
}

.member-card-login-hint {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: -8px 0 12px;
}

.member-card-login-hint a {
  color: var(--primary);
  font-weight: 600;
}

/* ===== Search Key Modal ===== */
.key-modal {
  max-width: 420px;
  padding: 28px 24px 20px;
  text-align: center;
}

.key-modal-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
}

.key-modal-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  line-height: 1.6;
}

.key-modal-promo {
  font-size: 0.82rem;
  color: var(--primary);
  margin-bottom: 14px;
  line-height: 1.6;
}

.key-modal-captcha-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 12px;
}

.key-modal-captcha-code {
  display: inline-block;
  min-width: 100px;
  padding: 10px 16px;
  letter-spacing: 6px;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--primary-dark);
  background: linear-gradient(135deg, #fff5f8, #ffe8f0);
  border: 1px dashed var(--primary);
  border-radius: var(--radius-sm);
  user-select: none;
}

[data-theme="dark"] .key-modal-captcha-code {
  background: linear-gradient(135deg, #3a2030, #2a1828);
}

.key-modal-captcha-refresh {
  padding: 8px 12px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--border);
  color: var(--text-muted);
  font-size: 0.8rem;
  cursor: pointer;
}

.key-modal-captcha-refresh:hover {
  color: var(--primary);
}

.key-modal-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  color: var(--text);
  background: var(--card-bg);
  margin-bottom: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.key-modal-input:focus {
  border-color: var(--primary);
}

.key-modal-input[readonly] {
  background: #fff8fb;
  cursor: default;
}

[data-theme="dark"] .key-modal-input[readonly] {
  background: #352030;
}

.key-modal-get-btn {
  width: 100%;
  padding: 14px 16px;
  border: none;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(255, 120, 158, 0.35);
  margin-bottom: 20px;
  transition: background 0.2s, transform 0.15s;
}

.key-modal-get-btn:hover {
  background: var(--primary-dark);
}

.key-modal-get-btn:active {
  transform: scale(0.98);
}

.key-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.btn-key-cancel,
.btn-key-verify {
  padding: 8px 22px;
  border: none;
  border-radius: 999px;
  font-size: 0.88rem;
  cursor: pointer;
  transition: opacity 0.2s;
}

.btn-key-cancel {
  background: #f9c4d4;
  color: var(--text);
}

[data-theme="dark"] .btn-key-cancel {
  background: #5a3848;
  color: var(--text);
}

.btn-key-verify {
  background: var(--primary);
  color: #fff;
}

.btn-key-cancel:hover,
.btn-key-verify:hover {
  opacity: 0.9;
}

/* ===== Responsive ===== */
@media (max-width: 600px) {
  .header-inner {
    flex-wrap: wrap;
    height: auto;
    padding: 8px 12px;
    gap: 4px;
  }

  .nav-bar-wrap {
    padding: 8px 12px;
  }

  .fab-left { left: 12px; bottom: 16px; }
  .fab-right { right: 12px; bottom: 16px; }
  .fab-circle { width: 44px; height: 44px; font-size: 1.2rem; }
}
