/* 锦鲤生活 - 全局基础样式 */
@import './variables.css';

*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; -webkit-tap-highlight-color:transparent; }

html, body {
  width: 100%; height: 100%;
  background: var(--bg);
  font-family: -apple-system, "PingFang SC", "Noto Sans SC", sans-serif;
  overflow: hidden;
}

#app {
  width: 100%; height: 100%;
  position: relative; overflow: hidden;
  background: var(--bg);
  display: flex; flex-direction: column;
}

/* Screen 管理 */
.screen {
  position: absolute; inset: 0;
  display: none; flex-direction: column;
  background: var(--bg); overflow: hidden;
}
.screen.active { display: flex; }

/* Nav */
.nav {
  flex-shrink: 0; height: 52px;
  display: flex; align-items: center; justify-content: center;
  position: relative; padding: 0 20px;
  background: linear-gradient(160deg, var(--red) 0%, var(--red2) 100%);
}
#s-fortune .nav, #s-agency .nav { display: none; }

.nav-left {
  position: absolute; left: 0; top: 0; bottom: 0; width: 50px;
  display: flex; align-items: center; justify-content: center;
  color: var(--gold); font-size: 24px; cursor: pointer;
}
.nav-title {
  color: var(--gold); font-size: 16px; font-weight: 700; letter-spacing: 1px;
}

/* Scroll body */
.body {
  flex: 1; overflow-y: auto; overflow-x: hidden;
}
.body::-webkit-scrollbar { display: none; }
.pad-bottom { height: 80px; }

/* Tab Bar */
.tabs {
  flex-shrink: 0; height: 72px; background: #fff;
  border-top: 1px solid var(--line);
  display: flex; padding-bottom: env(safe-area-inset-bottom);
}
.tab {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 3px;
  cursor: pointer; transition: all .2s; position: relative;
}
.tab.on .ti { font-size: 22px; transform: translateY(-1px); }
.tab .ti { font-size: 20px; transition: transform .2s; color: #bbb; }
.tab.on .ti { color: var(--red); }
.tab .tl { font-size: 10px; color: #bbb; font-weight: 500; transition: color .2s; }
.tab.on .tl { color: var(--red); font-weight: 700; }
.tab-indicator {
  position: absolute; bottom: 0; width: 24px; height: 3px;
  background: linear-gradient(90deg, var(--red), var(--gold2));
  border-radius: 2px; opacity: 0; transition: opacity .2s;
}
.tab.on .tab-indicator { opacity: 1; }

/* Toast */
.toast {
  position: absolute; bottom: 100px; left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: rgba(20,20,20,0.85); color: #fff;
  font-size: 13px; padding: 10px 20px; border-radius: 25px;
  opacity: 0; transition: all .2s; z-index: 999; backdrop-filter: blur(8px);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Loading overlay */
.loading-overlay {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(245,239,230,0.85);
  z-index: 1000;
}
.loading-spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--line);
  border-top-color: var(--red);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Login modal */
.modal-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 1001; padding: 20px;
}
.modal-box {
  background: #fff; border-radius: 20px;
  padding: 28px 24px; width: 100%; max-width: 340px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}
.modal-title {
  font-size: 18px; font-weight: 700; color: var(--text);
  text-align: center; margin-bottom: 6px;
}
.modal-sub {
  font-size: 12px; color: var(--sub); text-align: center; margin-bottom: 20px;
}
.modal-input {
  width: 100%; border: 1.5px solid var(--line);
  background: #F9F9F9; border-radius: 12px;
  padding: 12px 16px; font-size: 14px; font-family: inherit;
  margin-bottom: 12px; outline: none;
}
.modal-input:focus { border-color: var(--red); }
.modal-btn {
  width: 100%; height: 48px;
  background: linear-gradient(135deg, var(--red), var(--red2));
  color: var(--gold); border: none; border-radius: 24px;
  font-size: 15px; font-weight: 700;
  box-shadow: 0 4px 12px rgba(196,30,58,0.3); cursor: pointer;
}
.modal-link {
  display: block; text-align: center; margin-top: 12px;
  font-size: 12px; color: var(--sub); cursor: pointer;
}
.modal-link span { color: var(--red); font-weight: 600; }