/* ============================================
   智慧人力 - Smart HR Management System
   Shared Styles
   ============================================ */

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #a5b4fc;
    --secondary: #f97316;
    --accent: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --bg-elevated: #334155;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --gradient-1: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --gradient-2: linear-gradient(135deg, #f97316 0%, #fb923c 100%);
    --gradient-3: linear-gradient(135deg, #10b981 0%, #34d399 100%);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

.app-container {
    max-width: 430px;
    margin: 0 auto;
    min-height: 100vh;
    position: relative;
    background: var(--bg-dark);
}

/* ============================================
   Animations
   ============================================ */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.fade-in { animation: fadeInUp 0.5s ease-out; }

/* ============================================
   Mode Selector (Index Page)
   ============================================ */
.mode-selector {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
}

.logo {
    font-size: 48px;
    margin-bottom: 16px;
}

.app-title {
    font-size: 32px;
    font-weight: 700;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.app-subtitle {
    color: var(--text-secondary);
    margin-bottom: 48px;
}

.mode-card {
    width: 100%;
    max-width: 320px;
    background: var(--bg-card);
    border-radius: 20px;
    padding: 24px;
    margin-bottom: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    text-decoration: none;
    display: block;
}

.mode-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
    box-shadow: 0 12px 40px rgba(99, 102, 241, 0.3);
}

.mode-card.tob { border-left: 4px solid var(--primary); }
.mode-card.toc { border-left: 4px solid var(--secondary); }

.mode-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin-bottom: 16px;
}

.mode-card.tob .mode-icon { background: var(--gradient-1); }
.mode-card.toc .mode-icon { background: var(--gradient-2); }

.mode-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.mode-desc {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.5;
}

/* ============================================
   Header
   ============================================ */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--bg-card);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-title {
    font-size: 18px;
    font-weight: 600;
}

.header-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--bg-elevated);
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    text-decoration: none;
}

.header-btn:hover {
    background: var(--primary);
}

/* ============================================
   Bottom Navigation
   ============================================ */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 430px;
    background: var(--bg-card);
    display: flex;
    justify-content: space-around;
    padding: 12px 0 24px;
    border-top: 1px solid var(--bg-elevated);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s;
    background: none;
    border: none;
    font-size: 11px;
}

.nav-item.active { color: var(--primary); }
.nav-item:hover { color: var(--primary-light); }

.nav-icon {
    font-size: 22px;
}

/* ============================================
   Content Area
   ============================================ */
.content {
    padding: 20px;
    padding-bottom: 100px;
}

/* ============================================
   Cards
   ============================================ */
.card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 16px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
}

/* ============================================
   Shop Card
   ============================================ */
.shop-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.shop-card:hover {
    background: var(--bg-elevated);
}

.shop-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.shop-logo {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--gradient-1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.shop-name {
    font-weight: 600;
    margin-bottom: 4px;
}

.shop-address {
    font-size: 12px;
    color: var(--text-secondary);
}

.shop-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.stat-item {
    text-align: center;
    padding: 8px;
    background: var(--bg-elevated);
    border-radius: 10px;
}

.stat-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-light);
}

.stat-label {
    font-size: 11px;
    color: var(--text-muted);
}

/* ============================================
   Employee Card
   ============================================ */
.employee-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-elevated);
    border-radius: 12px;
    margin-bottom: 8px;
}

.avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--gradient-2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.employee-info {
    flex: 1;
}

.employee-name {
    font-weight: 500;
    margin-bottom: 2px;
}

.employee-position {
    font-size: 12px;
    color: var(--text-secondary);
}

.employee-salary {
    font-weight: 600;
    color: var(--accent);
}

/* ============================================
   Applicant Card
   ============================================ */
.applicant-card {
    background: var(--bg-elevated);
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 12px;
}

.applicant-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.match-score {
    margin-left: auto;
    background: var(--gradient-3);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.applicant-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tag {
    padding: 4px 10px;
    background: var(--bg-card);
    border-radius: 8px;
    font-size: 12px;
    color: var(--text-secondary);
}

/* ============================================
   Voice Publish
   ============================================ */
.voice-section {
    text-align: center;
    padding: 40px 20px;
}

.voice-btn {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: var(--gradient-1);
    border: none;
    color: white;
    font-size: 48px;
    cursor: pointer;
    box-shadow: 0 8px 32px rgba(99, 102, 241, 0.4);
    transition: all 0.3s;
    margin-bottom: 20px;
}

.voice-btn:hover {
    transform: scale(1.05);
}

.voice-btn.recording {
    animation: pulse 1s infinite;
    background: var(--danger);
}

.voice-text {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.voice-result {
    background: var(--bg-elevated);
    border-radius: 12px;
    padding: 16px;
    text-align: left;
    margin-top: 20px;
}

.voice-transcription {
    background: var(--bg-card);
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 12px;
    font-style: italic;
    color: var(--text-secondary);
}

.parsed-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--bg-card);
}

.parsed-label {
    color: var(--text-muted);
}

.parsed-value {
    font-weight: 500;
}

/* ============================================
   Earnings Card (ToC)
   ============================================ */
.earnings-card {
    background: var(--gradient-1);
    border-radius: 20px;
    padding: 24px;
    margin-bottom: 20px;
}

.earnings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.earnings-label {
    color: rgba(255,255,255,0.8);
}

.earnings-toggle {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    cursor: pointer;
}

.earnings-amount {
    font-size: 36px;
    font-weight: 700;
}

.earnings-detail {
    font-size: 14px;
    color: rgba(255,255,255,0.7);
    margin-top: 8px;
}

/* ============================================
   Map Section
   ============================================ */
.map-section {
    background: var(--bg-card);
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 20px;
}

.map-placeholder {
    height: 180px;
    background: linear-gradient(135deg, #1e3a5f 0%, #0f172a 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    position: relative;
}

.map-markers {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.map-marker {
    position: absolute;
    background: var(--secondary);
    color: white;
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
}

/* ============================================
   Job Card
   ============================================ */
.job-card {
    background: var(--bg-elevated);
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 12px;
}

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

.job-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.job-company {
    font-size: 13px;
    color: var(--text-secondary);
}

.job-salary {
    color: var(--secondary);
    font-weight: 700;
}

.job-tags {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.job-distance {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--text-muted);
}

/* ============================================
   Care System
   ============================================ */
.care-header {
    text-align: center;
    padding: 20px;
}

.care-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
}

.care-subtitle {
    color: var(--text-secondary);
}

.happiness-rating {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin: 24px 0;
}

.star-btn {
    font-size: 36px;
    background: none;
    border: none;
    cursor: pointer;
    transition: transform 0.2s;
    opacity: 0.3;
}

.star-btn.active {
    opacity: 1;
}

.star-btn:hover {
    transform: scale(1.2);
}

/* ============================================
   Chat
   ============================================ */
.chat-container {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 16px;
    margin-top: 20px;
}

.chat-messages {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 16px;
}

.chat-message {
    margin-bottom: 12px;
    display: flex;
}

.chat-message.ai {
    justify-content: flex-start;
}

.chat-message.user {
    justify-content: flex-end;
}

.message-bubble {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
}

.chat-message.ai .message-bubble {
    background: var(--bg-elevated);
    border-bottom-left-radius: 4px;
}

.chat-message.user .message-bubble {
    background: var(--primary);
    border-bottom-right-radius: 4px;
}

.chat-input-container {
    display: flex;
    gap: 8px;
}

.chat-input {
    flex: 1;
    background: var(--bg-elevated);
    border: none;
    border-radius: 24px;
    padding: 12px 20px;
    color: var(--text-primary);
    font-size: 14px;
}

.chat-input:focus {
    outline: 2px solid var(--primary);
}

.chat-send {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--primary);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============================================
   Certificate
   ============================================ */
.cert-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--bg-elevated);
    border-radius: 12px;
    margin-bottom: 12px;
}

.cert-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.cert-icon.obtained {
    background: var(--gradient-3);
}

.cert-icon.recommended {
    background: var(--gradient-2);
}

.cert-name {
    font-weight: 500;
    margin-bottom: 4px;
}

.cert-desc {
    font-size: 12px;
    color: var(--text-secondary);
}

/* ============================================
   Profile
   ============================================ */
.profile-header {
    text-align: center;
    padding: 24px;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--gradient-2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    margin: 0 auto 16px;
}

.profile-name {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 4px;
}

.profile-phone {
    color: var(--text-secondary);
}

/* ============================================
   Forms
   ============================================ */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    background: var(--bg-elevated);
    border: none;
    border-radius: 12px;
    padding: 14px 16px;
    color: var(--text-primary);
    font-size: 15px;
}

.form-input:focus {
    outline: 2px solid var(--primary);
}

/* ============================================
   Buttons
   ============================================ */
.btn {
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    border: none;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--gradient-1);
    color: white;
}

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--bg-elevated);
    color: var(--text-primary);
}

.btn-accent {
    background: var(--accent);
    color: white;
}

/* ============================================
   Job Preferences
   ============================================ */
.preference-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.pref-tag {
    padding: 10px 16px;
    background: var(--bg-elevated);
    border: 2px solid transparent;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
}

.pref-tag:hover {
    background: var(--bg-card);
}

.pref-tag.selected {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.2);
    color: var(--primary-light);
}

/* ============================================
   Crisis Resources
   ============================================ */
.crisis-card {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    border-radius: 16px;
    padding: 20px;
    margin-top: 20px;
}

.crisis-title {
    font-weight: 600;
    margin-bottom: 12px;
}

.crisis-resource {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,0.2);
}

.crisis-resource:last-child {
    border-bottom: none;
}

.resource-name {
    font-size: 14px;
}

.resource-phone {
    font-weight: 600;
}

/* ============================================
   Filter Tabs
   ============================================ */
.filter-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    overflow-x: auto;
    padding-bottom: 8px;
}

.filter-tab {
    padding: 8px 16px;
    background: var(--bg-elevated);
    border: none;
    border-radius: 20px;
    color: var(--text-secondary);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

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

/* ============================================
   Search Box
   ============================================ */
.search-box {
    display: flex;
    align-items: center;
    background: var(--bg-elevated);
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 16px;
    gap: 10px;
}

.search-box input {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 15px;
}

.search-box input:focus {
    outline: none;
}

.search-box input::placeholder {
    color: var(--text-muted);
}

/* ============================================
   Summary Stats
   ============================================ */
.summary-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.summary-stat {
    background: var(--bg-card);
    border-radius: 14px;
    padding: 16px;
    text-align: center;
}

.summary-value {
    font-size: 28px;
    font-weight: 700;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.summary-label {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ============================================
   Detail Tabs
   ============================================ */
.detail-tabs {
    display: flex;
    margin-bottom: 16px;
    background: var(--bg-elevated);
    border-radius: 12px;
    padding: 4px;
}

.detail-tab {
    flex: 1;
    padding: 10px;
    text-align: center;
    background: none;
    border: none;
    color: var(--text-secondary);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.detail-tab.active {
    background: var(--primary);
    color: white;
}

/* ============================================
   Utility Classes
   ============================================ */
.hidden {
    display: none !important;
}

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

.text-muted {
    color: var(--text-muted);
}

.mt-16 {
    margin-top: 16px;
}

.mb-16 {
    margin-bottom: 16px;
}
