/* 全局样式 */
:root {
    --primary: #07C160;
    --primary-dark: #06AD56;
    --danger: #FA5151;
    --warning: #FFC300;
    --text: #333333;
    --text-secondary: #999999;
    --bg: #F5F5F5;
    --white: #FFFFFF;
    --border: #E5E5E5;
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    --radius: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.6;
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
}

/* 顶部导航 */
.navbar {
    background: var(--white);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border);
}

.navbar .back-btn {
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
}

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

.navbar .right-btn {
    font-size: 14px;
    color: var(--primary);
    cursor: pointer;
}

/* 页面容器 */
.page {
    display: none;
    padding: 16px;
    padding-bottom: 80px;
}

.page.active {
    display: block;
}

/* 卡片 */
.card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: var(--shadow);
}

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

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

/* 统计网格 */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.stat-item {
    text-align: center;
    padding: 16px 8px;
    background: linear-gradient(135deg, #f6f8fc 0%, #eef2f7 100%);
    border-radius: 10px;
}

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

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* 表单 */
.form-group {
    margin-bottom: 16px;
}

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

.form-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.form-input:focus {
    border-color: var(--primary);
}

textarea.form-input {
    min-height: 100px;
    resize: vertical;
}

/* 按钮 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    gap: 6px;
}

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

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

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

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* 标签 */
.tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}

.tag-success {
    background: #E8F5E9;
    color: #2E7D32;
}

.tag-danger {
    background: #FFEBEE;
    color: #C62828;
}

.tag-warning {
    background: #FFF8E1;
    color: #F57F17;
}

/* 列表项 */
.list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    border-bottom: 1px solid #F0F0F0;
}

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

.list-item-left {
    flex: 1;
}

.list-item-title {
    font-size: 14px;
    font-weight: 500;
}

.list-item-desc {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* 复选框 */
.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
}

.checkbox-item.selected {
    border-color: var(--primary);
    background: #E8F5E9;
    color: var(--primary);
}

.checkbox-item input {
    display: none;
}

/* 标签栏 */
.tab-bar {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    background: var(--white);
    display: flex;
    border-top: 1px solid var(--border);
    z-index: 100;
}

.tab-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 0;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 10px;
    transition: color 0.2s;
}

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

.tab-item .icon {
    font-size: 20px;
    margin-bottom: 2px;
}

/* 模板卡片 */
.template-card {
    background: var(--white);
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 10px;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: border-color 0.2s;
}

.template-card:active {
    border-color: var(--primary);
}

.template-card .category {
    font-size: 11px;
    color: var(--primary);
    background: #E8F5E9;
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
    margin-bottom: 6px;
}

.template-card .name {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
}

.template-card .preview {
    font-size: 12px;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 发送记录 */
.log-item {
    padding: 12px 0;
    border-bottom: 1px solid #F0F0F0;
}

.log-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.log-item-content {
    font-size: 13px;
    color: var(--text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.log-item-time {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* FAQ 卡片 */
.faq-card {
    background: var(--white);
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 10px;
    border: 1px solid var(--border);
}

.faq-question {
    font-size: 14px;
    font-weight: 500;
    color: var(--primary);
    margin-bottom: 6px;
}

.faq-answer {
    font-size: 13px;
    color: var(--text);
    line-height: 1.5;
}

.faq-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    font-size: 11px;
    color: var(--text-secondary);
}

/* 登录页 */
.login-page {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 100vh;
    padding: 32px 24px;
}

.login-logo {
    text-align: center;
    margin-bottom: 40px;
}

.login-logo .icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.login-logo h1 {
    font-size: 22px;
    font-weight: 700;
}

.login-logo p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* 预览卡片 */
.preview-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    margin-top: 12px;
}

.preview-card .preview-image {
    width: 100%;
    height: 120px;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 12px;
}

.preview-card .preview-body {
    padding: 10px;
}

.preview-card .preview-title {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
}

.preview-card .preview-desc {
    font-size: 12px;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 弹窗 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 200;
    display: none;
    align-items: flex-end;
    justify-content: center;
}

.modal-overlay.show {
    display: flex;
}

.modal-content {
    background: var(--white);
    width: 100%;
    max-width: 480px;
    border-radius: 16px 16px 0 0;
    padding: 20px;
    max-height: 80vh;
    overflow-y: auto;
}

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

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

.modal-close {
    font-size: 20px;
    cursor: pointer;
    color: var(--text-secondary);
}

/* 图表容器 */
.chart-container {
    width: 100%;
    height: 200px;
    margin: 12px 0;
}

/* Toast 提示 */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 300;
    display: none;
}

.toast.show {
    display: block;
    animation: fadeInOut 2s ease;
}

@keyframes fadeInOut {
    0% { opacity: 0; }
    15% { opacity: 1; }
    85% { opacity: 1; }
    100% { opacity: 0; }
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.empty-state .icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.empty-state p {
    font-size: 13px;
}

/* 加载状态 */
.loading {
    text-align: center;
    padding: 20px;
    color: var(--text-secondary);
}

/* 敏感词警告 */
.warning-box {
    background: #FFF8E1;
    border: 1px solid #FFE082;
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 12px;
    font-size: 12px;
    color: #F57F17;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

/* 管理员专用样式 */
.admin-badge {
    background: #E3F2FD;
    color: #1565C0;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 6px;
}

/* 2026 企业级 SaaS 视觉系统 */
:root {
    --primary: #165DFF;
    --primary-dark: #0E42D2;
    --primary-soft: #EAF1FF;
    --primary-lighter: #F5F8FF;
    --danger: #F53F3F;
    --danger-soft: #FFF1F0;
    --warning: #FF7D00;
    --warning-soft: #FFF7E8;
    --success: #00B578;
    --success-soft: #E8FFF7;
    --text: #1D2129;
    --text-secondary: #667085;
    --text-tertiary: #98A2B3;
    --bg: #F3F6FA;
    --white: #FFFFFF;
    --border: #E7EBF0;
    --border-strong: #D0D7E2;
    --shadow: 0 4px 18px rgba(31, 35, 48, 0.055);
    --shadow-raised: 0 14px 40px rgba(31, 35, 48, 0.14);
    --radius: 14px;
    --radius-sm: 10px;
}

html {
    min-height: 100%;
    background: #E9EEF5;
    -webkit-text-size-adjust: 100%;
}

body {
    position: relative;
    max-width: 520px;
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    background:
        radial-gradient(circle at 90% 0%, rgba(22, 93, 255, 0.08), transparent 260px),
        var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI",
        "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    font-size: 14px;
    line-height: 1.55;
    letter-spacing: 0.01em;
    box-shadow: 0 0 0 1px rgba(29, 33, 41, 0.025);
    -webkit-font-smoothing: antialiased;
}

button,
input,
textarea,
select {
    font: inherit;
}

button,
.btn,
.navbar .back-btn,
.navbar .right-btn,
.list-item,
.checkbox-item,
.tab-item {
    -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[onclick]:focus-visible {
    outline: 3px solid rgba(22, 93, 255, 0.18);
    outline-offset: 2px;
}

::selection {
    color: var(--primary-dark);
    background: rgba(22, 93, 255, 0.15);
}

#mainApp {
    min-height: 100vh;
    min-height: 100dvh;
}

.page {
    padding: 18px;
    padding-bottom: calc(96px + env(safe-area-inset-bottom));
    animation: page-enter 180ms ease-out;
}

.page > .navbar {
    margin: -18px -18px 18px;
}

.page.active {
    display: block;
}

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

/* 顶部导航 */
.navbar {
    min-height: 60px;
    padding: calc(12px + env(safe-area-inset-top)) 18px 12px;
    background: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid rgba(231, 235, 240, 0.9);
    box-shadow: 0 1px 0 rgba(29, 33, 41, 0.02);
    backdrop-filter: saturate(150%) blur(18px);
    -webkit-backdrop-filter: saturate(150%) blur(18px);
}

.navbar .title {
    min-width: 0;
    font-size: 17px;
    font-weight: 680;
    color: #101828;
    letter-spacing: -0.01em;
}

.navbar .back-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin-left: -8px;
    padding: 0;
    border-radius: 10px;
    color: #344054;
    font-size: 23px;
    transition: background 160ms ease, transform 160ms ease;
}

.navbar .back-btn:active {
    background: #F2F4F7;
    transform: scale(0.96);
}

.navbar .right-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 10px;
    border-radius: 9px;
    color: var(--primary);
    font-size: 13px;
    font-weight: 600;
    transition: background 160ms ease;
}

.navbar .right-btn:active {
    background: var(--primary-soft);
}

.brand-title {
    display: inline-flex;
    align-items: center;
    gap: 9px;
}

.brand-title i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background: linear-gradient(135deg, #3578FF 0%, #165DFF 55%, #0D47D9 100%);
    box-shadow: 0 5px 14px rgba(22, 93, 255, 0.25);
    color: #FFFFFF;
    font-size: 11px;
    font-style: normal;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.profile-entry::before {
    content: "";
    width: 7px;
    height: 7px;
    margin-right: 6px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 0 3px var(--success-soft);
}

/* 登录页 */
.login-page {
    position: relative;
    justify-content: center;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 44px 30px;
    background:
        radial-gradient(circle at 15% 12%, rgba(22, 93, 255, 0.13), transparent 210px),
        radial-gradient(circle at 95% 84%, rgba(0, 181, 120, 0.08), transparent 240px),
        linear-gradient(180deg, #F8FAFF 0%, #F3F6FA 100%);
}

.login-page::before {
    content: "LINGQI · ENTERPRISE SERVICE";
    position: absolute;
    top: max(24px, env(safe-area-inset-top));
    left: 30px;
    color: #98A2B3;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.12em;
}

.login-logo {
    margin-bottom: 38px;
    text-align: left;
}

.brand-mark {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    margin-bottom: 22px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 17px;
    background: linear-gradient(135deg, #4A85FF 0%, #165DFF 55%, #0B3BB8 100%);
    box-shadow: 0 16px 32px rgba(22, 93, 255, 0.24);
    color: #FFFFFF;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.06em;
}

.login-logo h1 {
    color: #101828;
    font-size: 26px;
    font-weight: 720;
    letter-spacing: -0.025em;
}

.login-logo p {
    margin-top: 7px;
    color: var(--text-secondary);
    font-size: 14px;
}

.login-page > .form-group {
    margin-bottom: 18px;
}

.login-page > .btn-primary {
    margin-top: 8px !important;
    height: 50px;
    box-shadow: 0 12px 24px rgba(22, 93, 255, 0.2);
}

/* 卡片和数据概览 */
.card {
    position: relative;
    margin-bottom: 14px;
    padding: 18px;
    overflow: hidden;
    border: 1px solid rgba(231, 235, 240, 0.95);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.97);
    box-shadow: var(--shadow);
}

.card-header {
    min-height: 28px;
    margin-bottom: 15px;
}

.card-title {
    color: #1D2939;
    font-size: 15px;
    font-weight: 680;
    letter-spacing: -0.006em;
}

.stats-grid {
    gap: 10px;
}

.stat-item {
    min-height: 104px;
    padding: 18px 10px 14px;
    border: 1px solid rgba(22, 93, 255, 0.08);
    border-radius: 12px;
    background: linear-gradient(145deg, #F8FAFF 0%, #F1F5FF 100%);
    text-align: left;
}

.stat-value {
    color: #0F3FB6;
    font-size: 27px;
    font-weight: 730;
    line-height: 1.15;
    letter-spacing: -0.035em;
}

.stat-label {
    margin-top: 9px;
    color: #667085;
    font-size: 12px;
    font-weight: 500;
}

/* 表单 */
.form-group {
    margin-bottom: 18px;
}

.form-label {
    margin-bottom: 7px;
    color: #475467;
    font-size: 13px;
    font-weight: 600;
}

.form-input {
    min-height: 44px;
    padding: 10px 13px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: #FFFFFF;
    color: var(--text);
    font-size: 14px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.02);
    transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.form-input:hover {
    border-color: #B8C2D0;
}

.form-input:focus {
    border-color: var(--primary);
    background: #FFFFFF;
    box-shadow: 0 0 0 3px rgba(22, 93, 255, 0.11);
}

.form-input::placeholder {
    color: #A3ACB9;
}

textarea.form-input {
    min-height: 112px;
    line-height: 1.65;
}

select.form-input {
    padding-right: 36px;
    background-color: #FFFFFF;
}

input[type="date"],
input[type="time"],
input[type="file"] {
    cursor: pointer;
}

input[type="file"] {
    padding: 7px;
    color: var(--text-secondary);
    background: #FAFBFC;
}

input[type="file"]::file-selector-button {
    height: 30px;
    margin-right: 10px;
    padding: 0 12px;
    border: 0;
    border-radius: 8px;
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 600;
    cursor: pointer;
}

input[type="checkbox"] {
    width: 17px;
    height: 17px;
    accent-color: var(--primary);
}

/* 按钮 */
.btn {
    min-height: 42px;
    padding: 10px 17px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 620;
    line-height: 1;
    box-shadow: none;
    transition: background 160ms ease, border-color 160ms ease,
        color 160ms ease, box-shadow 160ms ease, transform 120ms ease;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    border: 1px solid var(--primary);
    background: linear-gradient(180deg, #2B6CFF 0%, #165DFF 100%);
    box-shadow: 0 5px 12px rgba(22, 93, 255, 0.17);
    color: #FFFFFF;
}

.btn-primary:hover {
    background: linear-gradient(180deg, #1F62F0 0%, #0E4DDB 100%);
    box-shadow: 0 7px 16px rgba(22, 93, 255, 0.22);
}

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

.btn-outline {
    border: 1px solid var(--border-strong);
    background: #FFFFFF;
    color: #344054;
}

.btn-outline:hover {
    border-color: #9EB7F6;
    background: var(--primary-lighter);
    color: var(--primary);
}

.btn-danger {
    border: 1px solid #FFD7D5;
    background: var(--danger-soft);
    color: var(--danger);
    box-shadow: none;
}

.btn-sm {
    min-height: 34px;
    padding: 7px 12px;
    border-radius: 9px;
    font-size: 12px;
}

.btn-block {
    min-height: 46px;
}

.msg-type-btn.selected {
    border: 1px solid rgba(22, 93, 255, 0.2);
    background: var(--primary-soft);
    color: var(--primary);
    box-shadow: inset 0 0 0 1px rgba(22, 93, 255, 0.03);
}

/* 列表和可选项 */
.list-item {
    min-height: 54px;
    padding: 14px 2px;
    border-bottom: 1px solid #EEF1F5;
    border-radius: 0;
    transition: background 140ms ease, padding 140ms ease;
}

.list-item[onclick] {
    cursor: pointer;
}

.list-item[onclick]:active {
    margin: 0 -8px;
    padding-right: 10px;
    padding-left: 10px;
    background: #F7F9FC;
}

.list-item-title {
    color: #344054;
    font-size: 14px;
    font-weight: 590;
}

.list-item-desc {
    margin-top: 4px;
    color: var(--text-tertiary);
    line-height: 1.45;
}

.checkbox-group {
    gap: 9px;
}

.checkbox-item {
    min-height: 40px;
    padding: 9px 13px;
    border-color: var(--border-strong);
    border-radius: 10px;
    background: #FFFFFF;
    color: #475467;
    font-weight: 550;
    transition: background 150ms ease, border-color 150ms ease, color 150ms ease,
        transform 120ms ease;
}

.checkbox-item:active {
    transform: scale(0.98);
}

.checkbox-item.selected {
    border-color: rgba(22, 93, 255, 0.45);
    background: var(--primary-soft);
    color: var(--primary);
}

/* 状态、内容卡片 */
.tag {
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 650;
}

.tag-success {
    background: var(--success-soft);
    color: #008A5A;
}

.tag-danger {
    background: var(--danger-soft);
    color: #D92D20;
}

.tag-warning {
    background: var(--warning-soft);
    color: #C95E00;
}

.admin-badge {
    padding: 3px 7px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 700;
}

.faq-card,
.template-card,
.preview-card {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #FAFBFC;
    box-shadow: none;
}

.faq-card,
.template-card {
    padding: 15px;
}

.faq-question {
    color: #1D2939;
    font-weight: 650;
}

.faq-answer {
    color: #475467;
    line-height: 1.65;
}

.log-item {
    padding: 15px 2px;
    border-bottom-color: #EEF1F5;
}

.log-item-content {
    color: #344054;
    line-height: 1.55;
}

.log-item-time,
.faq-meta {
    color: var(--text-tertiary);
}

.warning-box {
    padding: 12px 14px;
    border-color: #FFE1B3;
    border-radius: 11px;
    background: var(--warning-soft);
    color: #A94A00;
    line-height: 1.5;
}

/* 空状态与反馈 */
.empty-state {
    padding: 34px 18px;
    color: var(--text-tertiary);
}

.empty-state .icon {
    margin-bottom: 10px;
    font-size: 38px;
    opacity: 0.72;
    filter: saturate(0.7);
}

.empty-state p {
    font-size: 13px;
    line-height: 1.6;
}

.loading {
    padding: 28px;
    color: var(--text-tertiary);
}

.toast {
    top: auto;
    bottom: calc(96px + env(safe-area-inset-bottom));
    width: max-content;
    max-width: calc(100% - 44px);
    padding: 11px 17px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 11px;
    background: rgba(16, 24, 40, 0.92);
    box-shadow: 0 12px 30px rgba(16, 24, 40, 0.24);
    font-size: 13px;
    line-height: 1.5;
    text-align: center;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* 弹窗 */
.modal-overlay {
    padding-top: 40px;
    background: rgba(16, 24, 40, 0.48);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.modal-overlay.show .modal-content {
    animation: modal-up 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.modal-content {
    max-width: 520px;
    max-height: min(86vh, 820px);
    padding: 22px 20px calc(24px + env(safe-area-inset-bottom));
    border: 1px solid rgba(255, 255, 255, 0.65);
    border-radius: 22px 22px 0 0;
    box-shadow: var(--shadow-raised);
}

.modal-content::before {
    content: "";
    display: block;
    width: 36px;
    height: 4px;
    margin: -10px auto 16px;
    border-radius: 999px;
    background: #D0D5DD;
}

.modal-header {
    min-height: 34px;
    margin-bottom: 19px;
}

.modal-title {
    color: #101828;
    font-size: 18px;
    font-weight: 700;
}

.modal-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #F2F4F7;
    color: #667085;
    font-size: 20px;
    line-height: 1;
}

@keyframes modal-up {
    from { transform: translateY(28px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* 底部导航 */
.tab-bar {
    width: calc(100% - 20px);
    max-width: 500px;
    bottom: 10px;
    padding: 5px 7px calc(5px + env(safe-area-inset-bottom));
    border: 1px solid rgba(224, 229, 237, 0.92);
    border-radius: 17px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 12px 34px rgba(16, 24, 40, 0.14);
    backdrop-filter: saturate(160%) blur(18px);
    -webkit-backdrop-filter: saturate(160%) blur(18px);
}

.tab-item {
    position: relative;
    min-height: 53px;
    padding: 6px 0 5px;
    border-radius: 12px;
    color: #98A2B3;
    font-size: 10px;
    font-weight: 570;
}

.tab-item .icon {
    margin-bottom: 1px;
    font-size: 19px;
    filter: grayscale(0.7);
    transform: scale(0.94);
}

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

.tab-item.active .icon {
    filter: none;
    transform: scale(1);
}

.chart-container {
    height: 220px;
}

@media (min-width: 560px) {
    body {
        margin-top: 18px;
        margin-bottom: 18px;
        min-height: calc(100vh - 36px);
        border-radius: 20px;
        box-shadow: 0 18px 60px rgba(31, 35, 48, 0.14);
    }

    .login-page {
        min-height: calc(100vh - 36px);
        border-radius: 20px;
    }

    .tab-bar {
        bottom: 22px;
    }

    .modal-overlay {
        align-items: center;
        padding: 24px;
    }

    .modal-content {
        border-radius: 22px;
    }
}

@media (max-width: 360px) {
    .page {
        padding-right: 14px;
        padding-left: 14px;
    }

    .page > .navbar {
        margin-right: -14px;
        margin-left: -14px;
    }

    .card {
        padding: 15px;
    }

    .btn {
        padding-right: 13px;
        padding-left: 13px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* 2026 企业工作台视觉体系 */
:root {
    --primary: #165DFF;
    --primary-dark: #0E42D2;
    --primary-lighter: #EDF3FF;
    --danger: #E5484D;
    --warning: #F59E0B;
    --text: #182230;
    --text-secondary: #667085;
    --text-tertiary: #98A2B3;
    --bg: #F4F6FA;
    --white: #FFFFFF;
    --border: #E4E7EC;
    --shadow: 0 1px 3px rgba(16, 24, 40, .04);
    --shadow-raised: 0 20px 50px rgba(16, 24, 40, .12);
    --radius: 16px;
}

body {
    max-width: none;
    margin: 0;
    min-height: 100vh;
    border-radius: 0;
    color: var(--text);
    background: var(--bg);
    box-shadow: none;
    font-size: 14px;
}

.login-page {
    position: relative;
    overflow: hidden;
    align-items: flex-start;
    justify-content: center;
    min-height: 100vh;
    padding: max(11vh, 72px) max(7vw, 32px) 48px 58%;
    border-radius: 0;
    background: #fff;
}

.login-page::before {
    content: "让企业社群运营，更清晰、更稳定";
    position: absolute;
    inset: 20px 50% 20px 20px;
    display: flex;
    align-items: flex-end;
    padding: 58px;
    border-radius: 24px;
    color: white;
    background:
        radial-gradient(circle at 70% 25%, rgba(72, 201, 255, .35), transparent 25%),
        linear-gradient(145deg, #071A45 0%, #103B91 62%, #165DFF 100%);
    font-size: clamp(30px, 3.4vw, 52px);
    font-weight: 720;
    line-height: 1.16;
    letter-spacing: -.035em;
}

.login-page::after {
    content: "LINGQI COMMUNITY OPERATIONS";
    position: absolute;
    left: 78px;
    top: 76px;
    color: #73D3FF;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .18em;
}

.login-page > * {
    width: min(100%, 420px);
}

.login-logo {
    margin-bottom: 38px;
    text-align: left;
}

.login-logo .brand-mark {
    width: 48px;
    height: 48px;
    margin: 0 0 24px;
    border-radius: 14px;
    background: #165DFF;
    box-shadow: 0 12px 25px rgba(22, 93, 255, .22);
    font-size: 16px;
}

.login-logo h1 {
    color: #101828;
    font-size: 28px;
    letter-spacing: -.02em;
}

.login-logo p {
    margin-top: 8px;
    color: var(--text-secondary);
    font-size: 14px;
}

.form-label {
    margin-bottom: 8px;
    color: #344054;
    font-size: 13px;
    font-weight: 600;
}

.form-input {
    min-height: 44px;
    padding: 10px 13px;
    border-color: #D0D5DD;
    border-radius: 10px;
    color: #182230;
    background: white;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
}

.form-input:hover { border-color: #98A2B3; }
.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(22, 93, 255, .10);
}

.btn {
    min-height: 40px;
    border-radius: 9px;
    font-weight: 600;
}

.btn-primary {
    background: var(--primary);
    box-shadow: 0 4px 12px rgba(22, 93, 255, .18);
}

.btn-primary:hover { background: var(--primary-dark); }
.btn-outline {
    border-color: #D0D5DD;
    color: #344054;
    background: white;
}
.btn-outline:hover { border-color: #98A2B3; background: #F9FAFB; }
.btn-danger { background: var(--danger); }

#mainApp {
    min-height: 100vh;
    padding-left: 244px;
}

.page {
    width: min(1180px, calc(100% - 64px));
    margin: 0 auto;
    padding: 32px 0 64px;
}

.page > .navbar {
    position: relative;
    top: auto;
    min-height: 68px;
    margin: 0 0 24px;
    padding: 0;
    border: 0;
    background: transparent;
}

.navbar .title {
    color: #101828;
    font-size: 25px;
    font-weight: 720;
    letter-spacing: -.025em;
}

.navbar .back-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 10px;
    color: #475467;
    background: white;
    font-size: 18px;
}

.brand-title i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin-right: 9px;
    border-radius: 10px;
    color: white;
    background: var(--primary);
    font-size: 12px;
    font-style: normal;
    vertical-align: 3px;
}

.navbar .right-btn {
    padding: 8px 12px;
    border: 1px solid #D6E2FF;
    border-radius: 9px;
    color: var(--primary);
    background: #F5F8FF;
    font-size: 13px;
    font-weight: 600;
}

.card {
    margin-bottom: 16px;
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: white;
    box-shadow: var(--shadow);
}

.card-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #EEF0F3;
}

.card-title {
    color: #182230;
    font-size: 15px;
    font-weight: 670;
}

.stats-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

.stat-item {
    padding: 22px 18px;
    border: 1px solid #E6EAF0;
    border-radius: 13px;
    background: #FAFBFC;
    text-align: left;
}

.stat-value {
    color: #101828;
    font-size: 30px;
    letter-spacing: -.03em;
}

.stat-label { margin-top: 8px; color: #667085; font-size: 12px; }

.list-item {
    min-height: 54px;
    padding: 14px 4px;
    border-color: #EEF0F3;
}

.list-item:hover { background: #F8FAFC; }
.list-item-title { color: #344054; font-weight: 560; }
.empty-state {
    min-height: 140px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 28px;
    border: 1px dashed #D0D5DD;
    border-radius: 12px;
    background: #FAFBFC;
}

.empty-state .icon {
    filter: grayscale(1);
    opacity: .42;
    font-size: 30px;
}

.checkbox-item {
    min-height: 38px;
    padding: 8px 12px;
    border-color: #D0D5DD;
    border-radius: 9px;
    background: white;
}
.checkbox-item.selected {
    border-color: #9DB9FF;
    color: var(--primary);
    background: var(--primary-lighter);
}

.msg-type-btn.selected {
    color: white;
    border-color: var(--primary);
    background: var(--primary);
}

.tab-bar {
    position: fixed;
    z-index: 120;
    inset: 0 auto 0 0;
    transform: none;
    width: 244px;
    max-width: none;
    height: 100vh;
    padding: 112px 18px 24px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 6px;
    border: 0;
    border-right: 1px solid #E4E7EC;
    border-radius: 0;
    background: #0B1739;
    box-shadow: none;
}

.tab-bar::before {
    content: "LQ  灵启社群运营";
    position: absolute;
    left: 24px;
    top: 32px;
    color: white;
    font-size: 17px;
    font-weight: 680;
    letter-spacing: .01em;
}

.tab-bar::after {
    content: "企业社群运营工作台";
    position: absolute;
    left: 24px;
    top: 61px;
    color: #7787A9;
    font-size: 11px;
}

.tab-item {
    flex: none;
    width: 100%;
    min-height: 45px;
    padding: 0 13px;
    flex-direction: row;
    gap: 12px;
    justify-content: flex-start;
    border-radius: 9px;
    color: #98A7C4;
    font-size: 13px;
    font-weight: 580;
}

.tab-item .icon {
    width: 22px;
    margin: 0;
    font-size: 17px;
    filter: grayscale(1);
}

.tab-item.active {
    color: white;
    background: #1A3268;
}
.tab-item.active .icon { filter: none; }

.modal-overlay {
    align-items: center;
    padding: 28px;
    background: rgba(11, 23, 57, .52);
}
.modal-content {
    width: min(560px, 100%);
    max-width: 560px;
    max-height: calc(100vh - 56px);
    padding: 26px;
    border: 1px solid var(--border);
    border-radius: 18px;
}
.modal-content::before { display: none; }

.warning-box {
    border-color: #FDDCAB;
    color: #9A4A00;
    background: #FFF8ED;
}

.tag { padding: 3px 8px; border-radius: 999px; }
.toast { bottom: 28px; }

@media (min-width: 900px) {
    #homePage.active {
        display: grid;
        grid-template-columns: 1.15fr .85fr;
        gap: 16px;
        align-items: start;
    }
    #homePage > .navbar,
    #homePage > .card:first-of-type {
        grid-column: 1 / -1;
    }
    #homePage > .card { margin-bottom: 0; }
}

@media (max-width: 899px) {
    .login-page {
        align-items: center;
        padding: 52px 24px;
        background: linear-gradient(180deg, #F2F6FF 0%, #fff 42%);
    }
    .login-page::before,
    .login-page::after { display: none; }
    .login-logo { text-align: center; }
    .login-logo .brand-mark { margin: 0 auto 22px; }
    #mainApp { padding-left: 0; }
    .page {
        width: 100%;
        padding: 16px 16px 94px;
    }
    .page > .navbar {
        min-height: 54px;
        margin: -16px -16px 15px;
        padding: 0 16px;
        border-bottom: 1px solid var(--border);
        background: rgba(255,255,255,.94);
        backdrop-filter: blur(14px);
    }
    .navbar .title { font-size: 17px; letter-spacing: 0; }
    .brand-title i { width: 30px; height: 30px; }
    .card { padding: 17px; border-radius: 14px; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .stat-item { padding: 17px 14px; text-align: center; }
    .stat-value { font-size: 25px; }
    .tab-bar {
        inset: auto 10px 10px;
        transform: none;
        width: calc(100% - 20px);
        height: auto;
        padding: 5px 7px calc(5px + env(safe-area-inset-bottom));
        flex-direction: row;
        justify-content: space-around;
        gap: 0;
        border: 1px solid rgba(224, 229, 237, .92);
        border-radius: 17px;
        background: rgba(255,255,255,.95);
        box-shadow: 0 12px 34px rgba(16,24,40,.14);
    }
    .tab-bar::before,
    .tab-bar::after { display: none; }
    .tab-item {
        flex: 1;
        width: auto;
        min-height: 53px;
        padding: 6px 0 5px;
        flex-direction: column;
        justify-content: center;
        gap: 1px;
        color: #98A2B3;
        font-size: 10px;
    }
    .tab-item .icon { width: auto; font-size: 18px; }
    .tab-item.active { color: var(--primary); background: var(--primary-lighter); }
    .modal-overlay { align-items: flex-end; padding: 0; }
    .modal-content {
        width: 100%;
        max-height: 88vh;
        padding: 22px 18px calc(24px + env(safe-area-inset-bottom));
        border-radius: 22px 22px 0 0;
    }
}
