/**
 * 智途 TalentFlow - 移动端样式
 * 移动端优先设计，适配手机屏幕
 */

/* ============================================
   CSS 变量定义
   ============================================ */
:root {
    --primary-color: #7c3aed;
    --primary-light: #ede9fe;
    --primary-dark: #6d28d9;
    --accent-color: #f59e0b;
    --accent-light: #fef3c7;
    --bg-color: #f5f7fa;
    --card-bg: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    --transition-fast: 0.15s ease;
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
}

/* ============================================
   全局样式重置
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    padding-bottom: calc(60px + var(--safe-area-bottom));
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
}

img {
    max-width: 100%;
    display: block;
}

/* ============================================
   顶部状态栏
   ============================================ */
.status-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: env(safe-area-inset-top, 0px);
    background: var(--card-bg);
    z-index: 1001;
}

/* ============================================
   顶部导航栏
   ============================================ */
.navbar {
    position: fixed;
    top: env(safe-area-inset-top, 0px);
    left: 0;
    right: 0;
    height: 56px;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.navbar-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.navbar-back {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 1.25rem;
}

.navbar-filter {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    width: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

/* ============================================
   筛选面板
   ============================================ */
.filter-panel {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.filter-panel.active {
    opacity: 1;
}

.filter-panel.active .filter-panel-content {
    transform: translateY(0);
}

.filter-panel-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--card-bg);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    max-height: 80vh;
    overflow-y: auto;
}

.filter-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
}

.filter-panel-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.filter-panel-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    background: var(--bg-color);
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.filter-panel-content-inner {
    padding: 1rem 1.25rem;
}

.filter-group {
    margin-bottom: 1.5rem;
}

.filter-group:last-child {
    margin-bottom: 0;
}

.filter-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.filter-option {
    padding: 0.5rem 1rem;
    background: var(--bg-color);
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    color: var(--text-secondary);
    border: 1px solid transparent;
    transition: all var(--transition-fast);
}

.filter-option.active {
    background: var(--primary-light);
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.filter-panel-footer {
    display: flex;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border-color);
    background: var(--card-bg);
    padding-bottom: calc(1rem + var(--safe-area-bottom));
}

.filter-reset {
    flex: 1;
    padding: 0.75rem;
    border-radius: var(--radius-md);
    background: var(--bg-color);
    color: var(--text-secondary);
    font-size: 0.9375rem;
    font-weight: 500;
}

.filter-apply {
    flex: 2;
    padding: 0.75rem;
    border-radius: var(--radius-md);
    background: var(--primary-color);
    color: white;
    font-size: 0.9375rem;
    font-weight: 500;
}

/* ============================================
   主内容区域
   ============================================ */
.main-content {
    padding-top: calc(56px + env(safe-area-inset-top, 0px));
    min-height: 100vh;
}

/* ============================================
   底部 Tab 导航
   ============================================ */
.tab-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(60px + var(--safe-area-bottom));
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
    display: flex;
    z-index: 1000;
    padding-bottom: var(--safe-area-bottom);
}

.tab-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: var(--text-muted);
    font-size: 0.625rem;
    transition: all var(--transition-fast);
}

.tab-item .tab-icon-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 28px;
    border-radius: 10px;
    transition: all var(--transition-fast);
}

.tab-item .tab-icon {
    font-size: 1.25rem;
    line-height: 1;
    opacity: 0.55;
    transition: all var(--transition-fast);
}

.tab-item.active {
    color: var(--primary-color);
    font-weight: 600;
}

.tab-item.active .tab-icon-wrap {
    background: var(--primary-color);
}

.tab-item.active .tab-icon {
    opacity: 1;
    color: #fff;
}

.tab-item:active {
    opacity: 0.7;
}

/* ============================================
   卡片通用样式
   ============================================ */
.card {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 1rem;
    margin-bottom: 0.75rem;
}

.card:active {
    background: #f8fafc;
}

/* ============================================
   岗位卡片
   ============================================ */
.job-card {
    display: block;
    padding: 1rem;
}

.job-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.job-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
    margin-right: 0.5rem;
}

.job-salary {
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent-color);
    white-space: nowrap;
}

.job-company {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.job-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.job-tag {
    padding: 0.25rem 0.5rem;
    background: var(--primary-light);
    color: var(--primary-color);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
}

.job-tag.type-campus {
    background: #dcfce7;
    color: #16a34a;
}

.job-tag.type-intern {
    background: #fef3c7;
    color: #d97706;
}

.job-tag.type-social {
    background: #f3e8ff;
    color: #9333ea;
}

.job-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.job-city {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.job-date {
    font-size: 0.75rem;
}

/* ============================================
   公司卡片
   ============================================ */
.company-card {
    display: block;
    padding: 1rem;
}

.company-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.company-logo {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.company-info {
    flex: 1;
    min-width: 0;
}

.company-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.125rem;
}

.company-position {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.company-slogan {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.company-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.company-tag {
    padding: 0.25rem 0.5rem;
    background: var(--bg-color);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
}

/* ============================================
   筛选标签
   ============================================ */
.filter-tags {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.filter-tags::-webkit-scrollbar {
    display: none;
}

.filter-tag {
    flex-shrink: 0;
    padding: 0.5rem 1rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.filter-tag.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* ============================================
   列表容器
   ============================================ */
.list-container {
    padding: 0.75rem 1rem;
}

/* ============================================
   空状态
   ============================================ */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.empty-text {
    font-size: 0.875rem;
    text-align: center;
}

/* ============================================
   加载更多
   ============================================ */
.load-more {
    display: block;
    width: calc(100% - 2rem);
    margin: 1rem auto;
    padding: 0.75rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-align: center;
    transition: all var(--transition-fast);
}

.load-more:active {
    background: var(--bg-color);
}

/* ============================================
   页面切换动画
   ============================================ */
.page {
    display: none;
    animation: fadeIn 0.2s ease;
}

.page.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   岗位详情页样式
   ============================================ */
.detail-header {
    background: var(--card-bg);
    padding: 1rem;
    margin-bottom: 0.5rem;
}

.detail-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.detail-salary {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--accent-color);
    margin-bottom: 0.75rem;
}

.detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.detail-section {
    background: var(--card-bg);
    padding: 1rem;
    margin-bottom: 0.5rem;
}

.detail-section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.detail-list {
    list-style: none;
}

.detail-list li {
    position: relative;
    padding-left: 1rem;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.detail-list li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--primary-color);
}

/* ============================================
   公司详情页样式
   ============================================ */
.company-detail-header {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    color: white;
    padding: 1.5rem 1rem;
    text-align: center;
}

.company-detail-logo {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-md);
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    color: #7c3aed;
    margin: 0 auto 1rem;
}

.company-detail-name {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.company-detail-slogan {
    font-size: 0.875rem;
    opacity: 0.9;
}

.company-attrs {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.company-attr {
    padding: 0.25rem 0.75rem;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
}

.company-description {
    background: var(--card-bg);
    padding: 1rem;
    margin-bottom: 0.5rem;
}

.company-description p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.8;
    white-space: pre-line;
}

/* ============================================
   首页样式
   ============================================ */
.hero-section {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    color: white;
    padding: 2rem 1rem 3rem;
    text-align: center;
    margin-top: 56px;
}

.hero-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.hero-subtitle {
    font-size: 0.875rem;
    opacity: 0.9;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 1.5rem;
}

.hero-stat {
    text-align: center;
}

.hero-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
}

.hero-stat-label {
    font-size: 0.75rem;
    opacity: 0.8;
}

.quick-links {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    padding: 1rem;
    margin-top: -1.5rem;
}

.quick-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.25rem 1rem;
    background: var(--card-bg);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    transition: transform var(--transition-fast);
}

.quick-link:active {
    transform: scale(0.98);
}

.quick-link-icon {
    font-size: 1.5rem;
}

.quick-link-text {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

.section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    padding: 1rem 1rem 0.5rem;
}

.section-more {
    font-size: 0.75rem;
    color: var(--text-muted);
    float: right;
    padding-right: 1rem;
}

/* ============================================
   新闻/动态样式
   ============================================ */
.news-item {
    display: block;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.news-item:last-child {
    border-bottom: none;
}

.news-title {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-meta {
    display: flex;
    gap: 0.75rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ============================================
   底部操作按钮
   ============================================ */
.bottom-action {
    position: fixed;
    bottom: calc(60px + var(--safe-area-bottom));
    left: 0;
    right: 0;
    padding: 0.75rem 1rem;
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
}

.btn-primary {
    display: block;
    width: 100%;
    padding: 0.875rem;
    background: var(--primary-color);
    color: white;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    transition: background var(--transition-fast);
}

.btn-primary:active {
    background: var(--primary-dark);
}

/* ============================================
   工具类
   ============================================ */
.text-primary { color: var(--primary-color); }
.text-accent { color: var(--accent-color); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.px-1 { padding-left: 0.25rem; padding-right: 0.25rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
