* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
    --primary: #0ea5e9;
    --primary-dark: #0284c7;
    --primary-light: #e0f2fe;
    --secondary: #6366f1;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --bg: #f8fafc;
    --card: #ffffff;
    --text: #1e293b;
    --text-light: #64748b;
    --border: #e2e8f0;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
    --shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 12px 24px rgba(15, 23, 42, 0.12);
    --radius: 14px;
    --radius-sm: 10px;
}

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    font-size: 14px;
    line-height: 1.5;
    overflow: hidden;
}

/* ====== 启动屏 ====== */
#splash {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(135deg, #0ea5e9 0%, #6366f1 100%);
    display: flex; align-items: center; justify-content: center;
    z-index: 9999;
    transition: opacity 0.4s ease;
}
.splash-inner { text-align: center; color: #fff; }
.splash-icon {
    font-size: 72px;
    margin-bottom: 16px;
    animation: bounce 2s ease infinite;
    display: inline-block;
}
.splash-title { font-size: 28px; font-weight: 700; margin-bottom: 8px; letter-spacing: 2px; }
.splash-sub { font-size: 14px; opacity: 0.9; margin-bottom: 24px; }
.splash-loader {
    width: 48px; height: 3px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 2px;
    margin: 0 auto;
    overflow: hidden;
    position: relative;
}
.splash-loader::after {
    content: ''; position: absolute; left: 0; top: 0;
    width: 40%; height: 100%;
    background: #fff;
    border-radius: 2px;
    animation: loading-slide 1.4s ease-in-out infinite;
}
@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}
@keyframes loading-slide {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(300%); }
}

/* ====== 登录页 ====== */
.view-login {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #0ea5e9 0%, #6366f1 50%, #ec4899 100%);
    overflow-y: auto;
    padding: 20px;
    position: relative;
}
.login-bg { position: absolute; inset: 0; overflow: hidden; z-index: 0; }
.bg-blob {
    position: absolute;
    width: 300px; height: 300px;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: blob-float 20s ease-in-out infinite;
}
.bg-blob.blob-1 {
    background: #fbbf24;
    top: -100px; left: -100px;
}
.bg-blob.blob-2 {
    background: #ec4899;
    bottom: -100px; right: -100px;
    animation-delay: -7s;
}
.bg-blob.blob-3 {
    background: #10b981;
    top: 40%; left: 50%;
    width: 200px; height: 200px;
    animation-delay: -14s;
}
@keyframes blob-float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -20px) scale(1.1); }
    66% { transform: translate(-20px, 30px) scale(0.95); }
}

.login-content {
    position: relative; z-index: 1;
    width: 100%; max-width: 420px;
    display: flex; flex-direction: column; align-items: center;
    gap: 20px;
}

.login-brand {
    display: flex; align-items: center; gap: 12px;
    color: #fff;
    margin-bottom: 4px;
}
.brand-icon {
    font-size: 44px;
    width: 64px; height: 64px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    display: flex; align-items: center; justify-content: center;
    backdrop-filter: blur(10px);
}
.login-title { font-size: 22px; font-weight: 700; }
.login-subtitle { font-size: 12px; opacity: 0.85; }

.login-card {
    width: 100%;
    background: rgba(255, 255, 255, 0.96);
    border-radius: 20px;
    padding: 28px 24px;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(10px);
}

.role-tabs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 24px;
}
.role-tab {
    padding: 10px 8px;
    background: #f1f5f9;
    border-radius: 10px;
    font-size: 13px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-light);
    font-weight: 500;
}
.role-tab:hover { background: #e2e8f0; }
.role-tab.active {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
}

.login-form { display: flex; flex-direction: column; gap: 12px; }

.form-field {
    display: flex; align-items: center;
    background: #f8fafc;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    padding: 12px 14px;
    transition: all 0.2s ease;
}
.form-field:focus-within {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.1);
}
.field-icon { margin-right: 10px; font-size: 16px; }
.form-field input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 14px;
    color: var(--text);
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    border: none;
    padding: 14px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.25);
    font-family: inherit;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(14, 165, 233, 0.35); }
.btn-primary:active { transform: translateY(0); }
.btn-primary.block { width: 100%; }

.btn-secondary {
    background: #f1f5f9;
    color: var(--text);
    border: 1px solid var(--border);
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}
.btn-secondary:hover { background: #e2e8f0; }

.btn-small {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    border: none;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}
.btn-small.green { background: linear-gradient(135deg, #10b981, #059669); }
.btn-small.ghost { background: #f1f5f9; color: var(--text-light); }

.login-msg {
    text-align: center;
    font-size: 13px;
    color: var(--danger);
    min-height: 18px;
    padding-top: 4px;
}

.register-link {
    margin-top: 20px;
    text-align: center;
    color: var(--text-light);
}
.register-link span { font-size: 13px; }
.reg-btns { margin-top: 10px; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.btn-reg {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.25);
}
.btn-reg:hover { background: linear-gradient(135deg, var(--primary-dark), var(--secondary)); transform: translateY(-1px); }
.btn-reg.alt {
    background: #f1f5f9;
    color: var(--text);
    border: 1px solid var(--border);
    box-shadow: none;
}
.btn-reg.alt:hover { background: #e2e8f0; }

.login-footer {
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    margin-top: 8px;
}

/* ====== 应用主体 ====== */
#app {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    position: relative;
}

.app-header {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.15);
    position: relative;
    z-index: 10;
}
.header-brand { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; }
.brand-dot {
    width: 8px; height: 8px;
    background: #fbbf24;
    border-radius: 50%;
    box-shadow: 0 0 10px #fbbf24;
}
.header-user {
    font-size: 12px;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

.app-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 16px;
    padding-bottom: 90px;
}

/* ====== 底部导航 ====== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 72px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--border);
    display: flex;
    z-index: 20;
    padding-bottom: env(safe-area-inset-bottom);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.06);
}
.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: var(--text-light);
    cursor: pointer;
    transition: color 0.2s ease;
    position: relative;
}
.nav-item .nav-icon { font-size: 20px; transition: transform 0.2s ease; }
.nav-item .nav-label { font-size: 11px; font-weight: 500; }
.nav-item.active {
    color: var(--primary);
}
.nav-item.active .nav-icon {
    transform: scale(1.15);
}
.nav-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 0 0 4px 4px;
}

/* ====== 通用：页面头部 ====== */
.page-head {
    margin-bottom: 18px;
}
.page-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}
.page-sub {
    font-size: 13px;
    color: var(--text-light);
}

.section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin: 20px 0 12px;
    display: flex;
    align-items: center;
}
.section-title::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 16px;
    background: linear-gradient(180deg, var(--primary), var(--secondary));
    border-radius: 2px;
    margin-right: 8px;
}

/* ====== 首页问候卡 ====== */
.greet-card {
    background: linear-gradient(135deg, #ffffff, #f0f9ff);
    border-radius: 18px;
    padding: 18px;
    box-shadow: var(--shadow);
    margin-bottom: 16px;
    position: relative;
    overflow: hidden;
    border: 1px solid #e0f2fe;
}
.greet-card::before {
    content: '';
    position: absolute;
    top: -40px; right: -40px;
    width: 140px; height: 140px;
    background: radial-gradient(circle, rgba(14, 165, 233, 0.15) 0%, transparent 70%);
    border-radius: 50%;
}
.greet-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
    position: relative;
}
.greet-info { flex: 1; }
.greet-hi { font-size: 18px; font-weight: 700; margin-bottom: 4px; color: var(--text); }
.greet-role { font-size: 12px; color: var(--text-light); }
.greet-date {
    font-size: 12px;
    background: #e0f2fe;
    color: var(--primary-dark);
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 500;
    white-space: nowrap;
}

.ai-banner {
    background: linear-gradient(135deg, #f0f9ff, #ede9fe);
    border-radius: 14px;
    padding: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: transform 0.2s ease;
    border: 1px solid rgba(14, 165, 233, 0.15);
}
.ai-banner:hover { transform: translateX(2px); }
.ai-banner-icon {
    font-size: 28px;
    width: 50px; height: 50px;
    background: #fff;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    animation: ai-pulse 3s ease-in-out infinite;
}
@keyframes ai-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}
.ai-banner-info { flex: 1; }
.ai-banner-title { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.ai-banner-sub { font-size: 11px; color: var(--text-light); }

/* ====== 首页统计网格 ====== */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 4px;
}
.mini-stat {
    background: var(--card);
    border-radius: 14px;
    padding: 16px 14px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease;
}
.mini-stat:hover { transform: translateY(-2px); }
.mini-stat::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 3px;
    background: var(--accent, var(--primary));
    opacity: 0.8;
}
.mini-icon { font-size: 20px; margin-bottom: 6px; }
.mini-val { font-size: 22px; font-weight: 700; color: var(--primary); margin-bottom: 4px; }
.mini-label { font-size: 11px; color: var(--text-light); font-weight: 500; }

/* ====== 快捷功能 ====== */
.quick-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}
.quick-card {
    background: var(--card);
    border-radius: 14px;
    padding: 16px 14px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}
.quick-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    border-color: var(--primary);
}
.quick-icon { font-size: 26px; margin-bottom: 8px; }
.quick-label { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.quick-desc { font-size: 11px; color: var(--text-light); }

/* ====== 老人列表 ====== */
.elder-list { display: flex; flex-direction: column; gap: 10px; }
.elder-card {
    background: var(--card);
    border-radius: 14px;
    padding: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.2s ease;
}
.elder-card:hover { transform: translateX(2px); box-shadow: var(--shadow); }
.elder-avatar {
    width: 50px; height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0ea5e9, #6366f1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #fff;
    flex-shrink: 0;
}
.elder-info { flex: 1; min-width: 0; }
.elder-name { font-size: 15px; font-weight: 600; color: var(--text); }
.elder-age { font-size: 12px; color: var(--text-light); font-weight: 500; margin-left: 4px; }
.elder-meta { font-size: 12px; color: var(--text-light); margin: 4px 0; }
.elder-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.tag {
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 8px;
    font-weight: 500;
}
.tag-blue { background: #e0f2fe; color: var(--primary-dark); }
.tag-green { background: #dcfce7; color: #15803d; }
.tag-orange { background: #fef3c7; color: #b45309; }
.tag-red { background: #fee2e2; color: #b91c1c; }
.elder-arrow { color: #cbd5e1; font-size: 24px; font-weight: 300; }

/* ====== 报警卡片 ====== */
.alert-list { display: flex; flex-direction: column; gap: 10px; }
.alert-card {
    background: var(--card);
    border-radius: 14px;
    padding: 14px;
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--warning);
}
.alert-card.sev-critical { border-left-color: var(--danger); }
.alert-card.sev-warning { border-left-color: var(--warning); }
.alert-card.sev-info { border-left-color: var(--primary); }
.alert-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.sev-badge {
    padding: 3px 10px;
    border-radius: 10px;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
}
.alert-elder { font-size: 13px; font-weight: 600; color: var(--text); }
.alert-time { font-size: 11px; color: var(--text-light); margin-left: auto; }
.alert-body { font-size: 13px; color: var(--text); line-height: 1.6; margin-bottom: 10px; }
.alert-foot {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.status-pill {
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 500;
    background: #fef3c7;
    color: #b45309;
}
.status-pill.pending { background: #fef3c7; color: #b45309; }
.status-pill.done { background: #dcfce7; color: #15803d; }
.status-pill.assigned { background: #e0f2fe; color: #0369a1; }
.status-pill.processing { background: #ede9fe; color: #6d28d9; }
.status-pill.cancel { background: #f1f5f9; color: var(--text-light); }

/* ====== 工单卡片 ====== */
.wo-list { display: flex; flex-direction: column; gap: 10px; }
.wo-card {
    background: var(--card);
    border-radius: 14px;
    padding: 14px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}
.wo-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.wo-type {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    background: linear-gradient(135deg, #f0f9ff, #ede9fe);
    padding: 4px 12px;
    border-radius: 8px;
}
.wo-body {
    font-size: 13px;
    color: var(--text);
    line-height: 1.6;
    margin-bottom: 10px;
    padding: 10px 12px;
    background: #f8fafc;
    border-radius: 10px;
}
.wo-meta {
    display: flex;
    gap: 14px;
    font-size: 11px;
    color: var(--text-light);
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.wo-actions {
    display: flex;
    gap: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
}

/* ====== AI 风险分级 ====== */
.risk-overview {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 8px;
}
.risk-over-card {
    border-radius: 14px;
    padding: 14px 10px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.risk-over-card.red { background: linear-gradient(135deg, #fee2e2, #fecaca); }
.risk-over-card.orange { background: linear-gradient(135deg, #ffedd5, #fed7aa); }
.risk-over-card.amber { background: linear-gradient(135deg, #fef3c7, #fde68a); }
.risk-over-num { font-size: 28px; font-weight: 700; margin-bottom: 4px; }
.risk-over-card.red .risk-over-num { color: #dc2626; }
.risk-over-card.orange .risk-over-num { color: #ea580c; }
.risk-over-card.amber .risk-over-num { color: #ca8a04; }
.risk-over-label { font-size: 12px; color: var(--text-light); font-weight: 500; }

.risk-list { display: flex; flex-direction: column; gap: 8px; }
.risk-item {
    border-radius: 12px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.risk-item-left { display: flex; align-items: center; gap: 12px; }
.risk-item-avatar {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}
.risk-item-name { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.risk-item-tag { font-size: 11px; font-weight: 600; }
.risk-item-score { text-align: right; }
.risk-score-val { font-size: 20px; font-weight: 700; }
.risk-score-label { font-size: 10px; color: var(--text-light); }

/* ====== 数据大屏移动版 ====== */
.bigscreen-mobile { display: flex; flex-direction: column; gap: 12px; }
.bs-panel {
    background: linear-gradient(135deg, #ffffff, #f8fafc);
    border-radius: 16px;
    padding: 16px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}
.bs-hero {
    background: linear-gradient(135deg, #0c4a6e 0%, #1e3a8a 60%, #4c1d95 100%);
    color: #fff;
    border: none;
    box-shadow: var(--shadow-lg);
}
.bs-hero-title { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.bs-hero-time { font-size: 11px; opacity: 0.7; margin-bottom: 14px; }
.bs-hero-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}
.bs-hero-cell { text-align: center; padding: 8px 4px; }
.bs-hero-cell .bs-val { font-size: 18px; font-weight: 700; color: #fff; margin-bottom: 4px; }
.bs-hero-cell .bs-lbl { font-size: 10px; opacity: 0.85; }
.bs-panel-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 10px;
}
.bs-list { display: flex; flex-direction: column; gap: 8px; }
.bs-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: #f8fafc;
    border-radius: 10px;
}
.bs-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.bs-row-text { flex: 1; min-width: 0; }
.bs-row-text > div:first-child { font-size: 12px; font-weight: 500; color: var(--text); }
.bs-row-sub { font-size: 10px; color: var(--text-light); margin-top: 2px; }

/* ====== 语音助手 ====== */
.voice-card {
    background: linear-gradient(135deg, #f0f9ff, #ede9fe);
    border-radius: 18px;
    padding: 24px 20px;
    box-shadow: var(--shadow);
    margin-bottom: 12px;
    text-align: center;
    border: 1px solid #e0f2fe;
}
.voice-wave {
    margin-bottom: 20px;
    padding: 16px;
}
.voice-ai-icon {
    font-size: 56px;
    margin-bottom: 10px;
    animation: ai-pulse 2.5s ease-in-out infinite;
}
.voice-hint {
    font-size: 13px;
    color: var(--text-light);
    font-weight: 500;
}
.btn-speak {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    border: none;
    padding: 16px 36px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(14, 165, 233, 0.35);
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: inherit;
}
.btn-speak:hover { transform: translateY(-2px) scale(1.02); }
.speak-icon { font-size: 20px; }
.voice-input-title { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 8px; text-align: left; }
.voice-textarea {
    width: 100%;
    min-height: 80px;
    padding: 12px;
    background: #fff;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    font-size: 14px;
    color: var(--text);
    resize: vertical;
    outline: none;
    font-family: inherit;
    text-align: left;
}
.voice-textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.1); }

.quick-voice-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}
.quick-voice-item {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 10px;
    font-size: 12px;
    font-weight: 500;
    text-align: center;
    color: var(--text);
    cursor: pointer;
    transition: all 0.2s ease;
}
.quick-voice-item:hover { background: var(--primary-light); border-color: var(--primary); color: var(--primary-dark); }

/* ====== 个人中心 ====== */
.profile-card {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 20px;
    padding: 24px 16px;
    text-align: center;
    color: #fff;
    margin-bottom: 16px;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}
.profile-card::before {
    content: '';
    position: absolute;
    top: -50px; right: -50px;
    width: 160px; height: 160px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}
.profile-avatar {
    font-size: 48px;
    width: 80px; height: 80px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    position: relative;
    z-index: 1;
}
.profile-name { font-size: 20px; font-weight: 700; margin-bottom: 4px; position: relative; z-index: 1; }
.profile-uname { font-size: 12px; opacity: 0.8; margin-bottom: 8px; position: relative; z-index: 1; }
.profile-role {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
    position: relative;
    z-index: 1;
}

.card-panel {
    background: var(--card);
    border-radius: 16px;
    padding: 8px 16px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    margin-bottom: 16px;
}
.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}
.info-row:last-child { border-bottom: none; }
.info-label { font-size: 13px; color: var(--text-light); font-weight: 500; }
.info-val { font-size: 13px; color: var(--text); font-weight: 600; text-align: right; max-width: 60%; word-break: break-all; }

/* ====== Toast ====== */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-120%);
    background: #1e293b;
    color: #fff;
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 500;
    z-index: 10000;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    max-width: 80%;
    text-align: center;
    pointer-events: none;
}
.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.toast.show.err { background: linear-gradient(135deg, #dc2626, #b91c1c); }
.toast.show.ok { background: linear-gradient(135deg, #10b981, #059669); }

/* ====== Loading ====== */
.loading {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9998;
    backdrop-filter: blur(4px);
}
.spinner {
    width: 48px; height: 48px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ====== AI 助手浮窗 ====== */
.fab {
    position: fixed;
    right: 16px;
    bottom: 88px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    padding: 10px 16px 10px 14px;
    border-radius: 30px;
    box-shadow: 0 8px 24px rgba(14, 165, 233, 0.4);
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    z-index: 30;
    transition: all 0.2s ease;
    animation: fab-bounce 4s ease-in-out infinite;
}
.fab:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(14, 165, 233, 0.5); }
.fab-icon { font-size: 20px; }
.fab-label { font-size: 13px; font-weight: 600; }
@keyframes fab-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

/* ====== Modal ====== */
.modal-mask {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
    padding: 20px;
}
.modal-card {
    background: #fff;
    border-radius: 18px;
    width: 100%;
    max-width: 360px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    animation: modal-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.modal-card.big { max-width: 420px; }
@keyframes modal-in {
    from { opacity: 0; transform: translateY(20px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-header {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.modal-title { font-size: 15px; font-weight: 600; }
.modal-close {
    cursor: pointer;
    font-size: 18px;
    opacity: 0.9;
    padding: 2px 6px;
    line-height: 1;
}
.modal-close:hover { opacity: 1; }
.modal-body { padding: 18px; }

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    gap: 12px;
}
.detail-row:last-child { border-bottom: none; margin-bottom: 8px; }
.detail-label { font-size: 13px; color: var(--text-light); flex-shrink: 0; }
.detail-val { font-size: 13px; color: var(--text); font-weight: 500; text-align: right; }

.ai-chat-bubble {
    background: linear-gradient(135deg, #f0f9ff, #ede9fe);
    padding: 12px 14px;
    border-radius: 14px;
    font-size: 13px;
    color: var(--text);
    line-height: 1.6;
    border-bottom-left-radius: 4px;
}

/* ====== 空状态 ====== */
.empty-tip {
    text-align: center;
    padding: 32px 16px;
    color: var(--text-light);
    font-size: 13px;
    background: var(--card);
    border-radius: 14px;
    border: 1px dashed var(--border);
}

/* ====== 响应式 ====== */
@media (min-width: 600px) {
    .stat-grid, .quick-grid { grid-template-columns: repeat(4, 1fr); }
    .quick-voice-list { grid-template-columns: repeat(3, 1fr); }
    .greet-hi { font-size: 20px; }
    .page-title { font-size: 24px; }
}

@media (min-width: 900px) {
    .app-content { padding: 24px; max-width: 960px; margin: 0 auto; width: 100%; }
    .bottom-nav { max-width: 960px; left: 50%; transform: translateX(-50%); right: auto; border-radius: 20px 20px 0 0; }
    .fab { right: calc(50% - 480px + 20px); }
}
