/* =========================================================
   贵阳市科学技术局 APP — 自定义样式
   主色：蓝色系（blue / indigo）科技风格
   ========================================================= */

* { -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; }
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overscroll-behavior-y: none;
}

/* ---------- App-like Surfaces ---------- */
.card-shadow     { box-shadow: 0 2px 12px rgba(15, 23, 42, 0.06); }
.card-shadow-lg  { box-shadow: 0 8px 28px rgba(15, 23, 42, 0.10); }
.card-shadow-xl  { box-shadow: 0 16px 40px rgba(15, 23, 42, 0.12); }

/* ---------- Safe area ---------- */
.safe-top    { padding-top: max(0.75rem, env(safe-area-inset-top)); }
.safe-bottom { padding-bottom: env(safe-area-inset-bottom); }

/* ---------- Hero Header ---------- */
.hero-header {
    position: relative;
    overflow: hidden;
    color: #fff;
}
.hero-bg {
    position: absolute; inset: 0;
    background: linear-gradient(135deg, #1e3a8a 0%, #1d4ed8 45%, #2563eb 100%);
}
.hero-bg::before, .hero-bg::after {
    content: ''; position: absolute; border-radius: 50%;
    background: radial-gradient(circle at center, rgba(255,255,255,0.18), rgba(255,255,255,0));
}
.hero-bg::before { width: 320px; height: 320px; top: -120px; right: -100px; }
.hero-bg::after  { width: 220px; height: 220px; bottom: -90px; left: -60px; }

/* ---------- Search bar (in hero) ---------- */
.search-bar {
    display: flex; align-items: center; gap: 0.5rem;
    background: rgba(255,255,255,0.18);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.22);
    border-radius: 9999px;
    padding: 0.55rem 0.85rem;
    color: rgba(255,255,255,0.95);
}
.search-bar input {
    background: transparent; border: 0; outline: 0;
    color: white; font-size: 0.85rem;
    width: 100%;
}
.search-bar input::placeholder { color: rgba(255,255,255,0.7); }

#searchClear {
    display: none;
    flex-shrink: 0;
    padding: 0 0.25rem;
    font-size: 1.1rem;
    line-height: 1;
}
#searchClear.visible { display: inline-block; }

mark {
    background: #dbeafe;
    color: #1e40af;
    border-radius: 3px;
    padding: 0 2px;
}

/* ---------- Top Navigation Tabs ---------- */
.top-tabs {
    position: sticky; top: 0; z-index: 30;
    background: rgba(255,255,255,0.85);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 0.5px solid rgba(15,23,42,0.06);
}
.top-tab {
    position: relative;
    padding: 0.85rem 0.25rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: #64748b;
    transition: color 0.2s ease;
    flex-shrink: 0;
    cursor: pointer;
    background: transparent;
    border: 0;
}
.top-tab.active { color: #2563eb; font-weight: 600; }
.top-tab .tab-indicator {
    position: absolute; left: 50%; bottom: -0.5px;
    transform: translateX(-50%);
    height: 2.5px; width: 0;
    background: #3b82f6;
    border-radius: 9999px;
    transition: width 0.25s ease;
}
.top-tab.active .tab-indicator { width: 1.5rem; }

/* ---------- Sections ---------- */
.app-main {
    position: relative;
    overflow-x: hidden;
}
.section {
    display: none;
    animation: fadeIn 0.28s ease forwards;
}
.section.active { display: block; }
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Bottom Tab Bar ---------- */
.tabbar {
    position: fixed;
    left: 0.5rem; right: 0.5rem;
    bottom: calc(0.5rem + env(safe-area-inset-bottom));
    z-index: 40;
    background: rgba(255,255,255,0.92);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-radius: 1.25rem;
    box-shadow: 0 10px 30px rgba(15,23,42,0.10), 0 2px 8px rgba(15,23,42,0.05);
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    padding: 0.4rem 0.25rem;
}
.tabbar-item {
    display: flex; flex-direction: column; align-items: center;
    gap: 0.15rem;
    padding: 0.3rem 0;
    color: #64748b;
    font-size: 0.65rem;
    font-weight: 500;
    border-radius: 0.75rem;
    transition: color 0.2s ease, transform 0.2s ease;
    position: relative;
    cursor: pointer;
    background: transparent;
    border: 0;
}
.tabbar-item.active { color: #2563eb; }
.tabbar-item.active::before {
    content: ''; position: absolute;
    top: -0.1rem; left: 50%; transform: translateX(-50%);
    width: 1.4rem; height: 0.2rem; border-radius: 9999px;
    background: #3b82f6;
}
.tabbar-item:active { transform: scale(0.95); }
.tabbar-icon {
    width: 1.45rem; height: 1.45rem;
    display: flex; align-items: center; justify-content: center;
}

/* ---------- Stat Cards ---------- */
.stat-gradient-blue { background: linear-gradient(135deg, #3b82f6 0%, #2563eb 50%, #1e40af 100%); }
.stat-gradient-white { background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%); border: 1px solid #e2e8f0; }
.stat-gradient-slate { background: linear-gradient(135deg, #475569 0%, #334155 50%, #1e293b 100%); }

/* ---------- Avatar Ring ---------- */
.avatar-ring  { background: linear-gradient(135deg, #3b82f6, #6366f1, #8b5cf6); padding: 3px; border-radius: 50%; }
.avatar-inner { background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%); }

/* ---------- Org Badge ---------- */
.org-badge {
    min-width: 2.5rem; height: 2.5rem;
    padding: 0 0.6rem;
    border-radius: 0.75rem;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.org-badge span { white-space: nowrap; line-height: 1; }

/* ---------- Duty Number ---------- */
.duty-num {
    min-width: 1.6rem; height: 1.6rem;
    padding: 0 0.35rem;
    border-radius: 0.5rem;
    background: #eff6ff;
    color: #2563eb;
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center; justify-content: center;
    flex-shrink: 0;
    border: 1px solid #bfdbfe;
    white-space: nowrap; line-height: 1;
}

/* ---------- Duty Item ---------- */
.duty-item {
    display: flex; gap: 0.75rem;
    padding: 0.85rem 0;
    align-items: flex-start;
}
.duty-item + .duty-item { border-top: 1px solid #f1f5f9; }

/* ---------- Leader Card ---------- */
.leader-card {
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.leader-card:active { transform: scale(0.98); }

/* ---------- Org Card ---------- */
.org-card {
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.org-card:hover { border-color: #93c5fd; }
.org-card:active { transform: scale(0.98); }

/* ---------- Bottom Sheet Modal ---------- */
.modal-overlay {
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    transition: opacity 0.25s ease;
}
.bottom-sheet {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    background: #fff;
    border-radius: 1.5rem 1.5rem 0 0;
    max-height: 92vh;
    overflow: hidden;
    transform: translateY(100%);
    transition: transform 0.32s cubic-bezier(0.22, 0.61, 0.36, 1);
    will-change: transform;
}
.bottom-sheet.open { transform: translateY(0); }
.bottom-sheet .sheet-handle {
    width: 2.5rem; height: 0.3rem;
    background: #d1d5db;
    border-radius: 9999px;
    margin: 0.5rem auto 0;
}

/* ---------- Misc ---------- */
.scrollbar-hide::-webkit-scrollbar { display: none; }
.scrollbar-hide { -ms-overflow-style: none; scrollbar-width: none; }

.label-badge {
    font-size: 0.65rem;
    padding: 0.1rem 0.5rem;
    border-radius: 9999px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.section-divider {
    height: 1px;
    background: linear-gradient(to right, transparent, #e5e7eb, transparent);
}

/* ---------- Animations ---------- */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}
.animate-fadeInUp { animation: fadeInUp 0.4s ease forwards; }
.stagger-1 { animation-delay: 0.04s; }
.stagger-2 { animation-delay: 0.08s; }
.stagger-3 { animation-delay: 0.12s; }
.stagger-4 { animation-delay: 0.16s; }
.stagger-5 { animation-delay: 0.20s; }

@media (max-width: 360px) {
    .top-tab { padding: 0.7rem 0.25rem; font-size: 0.8rem; }
}
