/* ============ common.css - 所有H5页面共享样式 ============ */

/* ============ CSS变量 ============ */
:root {
    --primary:      #2563eb;
    --primary-dark: #1e40af;
    --primary-light: #60a5fa;
    --bg:           #ffffff;
    --card-bg:      #ffffff;
    --text:         #1e293b;
    --text-sub:     #64748b;
    --border:       #e2e8f0;
    --tab-bar-h:    60px;
    --header-h:     56px;
}

/* ============ Reset ============ */
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Helvetica Neue', sans-serif; background: var(--bg); color: var(--text); }

/* ============ Header ============ */
.header {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    height: var(--header-h);
    background: var(--primary);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 16px;
    box-shadow: 0 2px 12px rgba(37,99,235,0.4);
}
.header-title { color: #fff; font-size: 18px; font-weight: 700; letter-spacing: 0.05em; }
.header-actions { display: flex; gap: 10px; }
.header-btn {
    width: 32px; height: 32px; border-radius: 50%;
    background: rgba(255,255,255,0.2);
    border: none; color: #fff; font-size: 14px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.header-avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: rgba(255,255,255,0.2);
    border: 2px solid rgba(255,255,255,0.5);
    color: #fff; font-size: 18px; cursor: pointer;
    display: none; align-items: center; justify-content: center;
    overflow: hidden; flex-shrink: 0;
}
.header-avatar img {
    width: 100%; height: 100%; object-fit: cover;
}

/* ============ Tabs（发射场筛选） ============ */
.tab-header {
    position: fixed; top: var(--header-h); left: 0; right: 0; z-index: 99;
    background: #ffffff;
    display: flex;
    border-bottom: 1px solid #e2e8f0;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.tab-header::-webkit-scrollbar { display: none; }
.tab-btn {
    flex-shrink: 0; height: 44px;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; color: var(--text-sub); cursor: pointer;
    border-bottom: 3px solid transparent; transition: all 0.2s;
    font-weight: 500;
    padding: 0 16px;
}
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ============ 主内容区 ============ */
.main {
    padding-top: calc(var(--header-h) + 44px);
    padding-bottom: calc(var(--tab-bar-h) + 16px);
    min-height: 100vh;
}

/* ============ Tab Bar ============ */
.tab-bar {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
    height: var(--tab-bar-h);
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    display: flex; align-items: stretch;
}
.tab-bar-item {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px; cursor: pointer; border: none; background: transparent;
    color: var(--text-sub); transition: color 0.2s;
    text-decoration: none;
}
.tab-bar-item.active { color: var(--primary); }
.tab-bar-item .ti-icon { font-size: 22px; }
.tab-bar-item .ti-label { font-size: 10px; font-weight: 500; }

/* ============ 加载中 / 空数据 / 加载更多 ============ */
.loading { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 60px 0; }
.spinner { width: 36px; height: 36px; border: 3px solid #e2e8f0; border-top-color: var(--primary); border-radius: 50%; animation: spin 0.8s linear infinite; margin-bottom: 12px; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { color: #64748b; font-size: 14px; }
.empty { display: flex; flex-direction: column; align-items: center; padding: 60px 0; color: #64748b; }
.empty .icon { font-size: 48px; margin-bottom: 12px; opacity: 0.5; }
.empty p { font-size: 14px; }
.load-more { text-align: center; padding: 16px; }
.load-more-btn { background: transparent; border: 1px solid #e2e8f0; color: #64748b; padding: 10px 32px; border-radius: 99px; font-size: 13px; cursor: pointer; }
.load-more-btn:active { background: #f1f5f9; }

/* 状态徽章 */
.badge { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 11px; font-weight: 600; }
.badge-plan    { background: #dbeafe; color: #1d4ed8; }
.badge-success { background: #d1fae5; color: #065f46; }
.badge-fail    { background: #fee2e2; color: #991b1b; }
.badge-delay   { background: #fef3c7; color: #92400e; }

/* 登录提示 */
.login-tip {
  background: #fff3cd; border: 1px solid #ffeaa7;
  border-radius: 14px; padding: 20px; margin-bottom: 20px;
  text-align: center; color: #856404; font-size: 14px;
}
.login-tip a { color: var(--primary); font-weight: 600; text-decoration: none; }

/* 用户表单 */
.user-form { background: #ffffff; border-radius: 14px; padding: 20px; margin-bottom: 20px; border: 1px solid #e2e8f0; }
.form-title { font-size: 16px; font-weight: 600; margin-bottom: 18px; padding-bottom: 12px; border-bottom: 1px solid #f1f5f9; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 500; color: #475569; margin-bottom: 6px; }
.form-group input,
.form-group textarea {
  width: 100%; padding: 12px 14px;
  background: #f8fafc; border: 1px solid #e2e8f0;
  border-radius: 10px; font-size: 15px; color: #1e293b;
  outline: none; transition: border-color 0.2s;
}
.form-group input:focus,
.form-group textarea:focus { border-color: var(--primary); }
.form-group textarea { resize: vertical; min-height: 100px; font-family: inherit; }
.form-submit, .save-btn {
  width: 100%; padding: 14px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff; border: none; border-radius: 10px;
  font-size: 16px; font-weight: 600; cursor: pointer;
  margin-top: 8px;
}
.form-submit:active, .save-btn:active { opacity: 0.85; }
.save-btn:disabled { opacity: 0.6; cursor: not-allowed; }
