/* ============================================
   热工专业H5应用 - 全局样式表
   电厂热工技术人员专用移动端Web应用
   设计风格：现代化扁平化 + 工业专业配色
   ============================================ */

/* === CSS变量与配色方案 === */
:root {
    /* 主色调 */
    --primary: #1a56db;
    --primary-light: #3b82f6;
    --primary-dark: #1e40af;
    --primary-bg: #eff6ff;

    /* 辅助色 */
    --accent: #f97316;
    --accent-light: #fb923c;
    --accent-bg: #fff7ed;

    /* 功能色 */
    --success: #10b981;
    --success-bg: #ecfdf5;
    --warning: #f59e0b;
    --warning-bg: #fffbeb;
    --danger: #ef4444;
    --danger-bg: #fef2f2;
    --info: #06b6d4;
    --info-bg: #ecfeff;

    /* 中性色 */
    --bg: #f0f2f5;
    --bg-white: #ffffff;
    --card-bg: #ffffff;
    --border: #e5e7eb;
    --border-light: #f3f4f6;

    /* 文字色 */
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --text-inverse: #ffffff;

    /* 阴影 */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);

    /* 圆角 */
    --radius-xs: 4px;
    --radius-sm: 6px;
    --radius: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 50%;

    /* 间距 */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;

    /* 字体 */
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    --font-mono: 'SF Mono', 'Cascadia Code', 'Consolas', 'Monaco', monospace;

    /* 动画 */
    --transition-fast: 0.15s ease;
    --transition: 0.25s ease;
    --transition-slow: 0.35s ease;

    /* 底部导航高度 */
    --navbar-height: 60px;
    --statusbar-height: 28px;
    --header-height: 48px;

    /* 安全区域 */
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* === 全局重置 === */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--text-primary);
    background-color: var(--bg);
    min-height: 100vh;
    min-height: -webkit-fill-available;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    padding-top: var(--statusbar-height);
    padding-bottom: calc(var(--navbar-height) + var(--safe-bottom));
    user-select: none;
    -webkit-user-select: none;
}

/* === 状态栏 === */
.statusbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--statusbar-height);
    background: var(--primary-dark);
    color: var(--text-inverse);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-4);
    font-size: 0.6875rem;
    font-weight: 500;
    z-index: 1000;
    letter-spacing: 0.025em;
}

.statusbar .status-left {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.statusbar .status-right {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.statusbar .status-signal i {
    font-size: 0.5625rem;
}

.statusbar .status-battery {
    display: flex;
    align-items: center;
    gap: 2px;
    font-size: 0.625rem;
}

/* === 页面头部 === */
.page-header {
    position: sticky;
    top: var(--statusbar-height);
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--bg-white);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-4);
    border-bottom: 1px solid var(--border);
    z-index: 999;
    box-shadow: var(--shadow-sm);
}

.page-header .header-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.page-header .header-title i {
    color: var(--primary);
    font-size: 1.125rem;
}

.page-header .header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.page-header .btn-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    border: none;
    background: var(--bg);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 1rem;
}

.page-header .btn-icon:active {
    background: var(--primary-bg);
    color: var(--primary);
    transform: scale(0.92);
}

.page-header .btn-back {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    border: none;
    background: transparent;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.25rem;
    transition: all var(--transition-fast);
}

/* === 主内容区域 === */
.main-content {
    padding: var(--space-4);
    min-height: calc(100vh - var(--statusbar-height) - var(--header-height) - var(--navbar-height));
}

.page {
    display: none;
    animation: fadeSlideIn var(--transition-slow) forwards;
}

.page.active {
    display: block;
}

@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* === 底部导航栏 === */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--navbar-height);
    background: var(--bg-white);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding-bottom: var(--safe-bottom);
    z-index: 1000;
    box-shadow: 0 -1px 3px rgba(0,0,0,0.05);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-width: 56px;
    padding: var(--space-1) var(--space-2);
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    border-radius: var(--radius);
}

.nav-item i {
    font-size: 1.25rem;
    transition: all var(--transition-fast);
}

.nav-item span {
    font-size: 0.625rem;
    font-weight: 500;
    white-space: nowrap;
}

.nav-item.active {
    color: var(--primary);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 3px;
    background: var(--primary);
    border-radius: 0 0 3px 3px;
}

.nav-item:active {
    transform: scale(0.9);
}

.nav-item.nav-center {
    position: relative;
    top: -16px;
}

.nav-item.nav-center .nav-icon-wrap {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(26, 86, 219, 0.35);
    transition: all var(--transition);
}

.nav-item.nav-center:active .nav-icon-wrap {
    transform: scale(0.9);
}

.nav-item.nav-center i {
    color: #fff;
    font-size: 1.25rem;
}

.nav-item.nav-center span {
    color: var(--text-secondary);
    margin-top: 4px;
}

/* === 卡片组件 === */
.card {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    padding: var(--space-5);
    margin-bottom: var(--space-4);
    box-shadow: var(--shadow);
    transition: all var(--transition);
    border: 1px solid var(--border-light);
}

.card:active {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--border-light);
}

.card-title {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.card-title i {
    color: var(--primary);
    font-size: 1.0625rem;
}

.card-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 400;
}

/* === 工具卡片 - 首页快捷入口 === */
.tool-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-3);
    margin-bottom: var(--space-4);
}

.tool-card {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
    cursor: pointer;
    transition: all var(--transition);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.tool-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--transition);
}

.tool-card:active::after {
    transform: scaleX(1);
}

.tool-card:active {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.tool-card .tool-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.375rem;
}

.tool-card .tool-icon.blue { background: var(--primary-bg); color: var(--primary); }
.tool-card .tool-icon.orange { background: var(--accent-bg); color: var(--accent); }
.tool-card .tool-icon.green { background: var(--success-bg); color: var(--success); }
.tool-card .tool-icon.purple { background: #f5f3ff; color: #7c3aed; }
.tool-card .tool-icon.teal { background: var(--info-bg); color: var(--info); }

.tool-card .tool-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.tool-card .tool-desc {
    font-size: 0.6875rem;
    color: var(--text-muted);
    line-height: 1.3;
}

/* === 横幅/Banner === */
.banner {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: var(--radius-md);
    padding: var(--space-5);
    margin-bottom: var(--space-4);
    color: var(--text-inverse);
    position: relative;
    overflow: hidden;
}

.banner::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 200px;
    height: 200px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.banner::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 120px;
    height: 120px;
    background: rgba(255,255,255,0.03);
    border-radius: 50%;
}

.banner h2 {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: var(--space-1);
    position: relative;
    z-index: 1;
}

.banner p {
    font-size: 0.75rem;
    opacity: 0.85;
    position: relative;
    z-index: 1;
}

/* === 表单组件 === */
.form-group {
    margin-bottom: var(--space-4);
}

.form-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: var(--space-2);
}

.form-input {
    width: 100%;
    height: 44px;
    padding: 0 var(--space-4);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.9375rem;
    font-family: var(--font-family);
    color: var(--text-primary);
    background: var(--bg-white);
    transition: all var(--transition-fast);
    outline: none;
    -webkit-appearance: none;
}

.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 86, 219, 0.1);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-input.readonly {
    background: var(--bg);
    color: var(--text-primary);
    font-weight: 600;
    cursor: default;
}

.form-textarea {
    width: 100%;
    min-height: 100px;
    padding: var(--space-3) var(--space-4);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-family: var(--font-family);
    color: var(--text-primary);
    background: var(--bg-white);
    transition: all var(--transition-fast);
    outline: none;
    resize: vertical;
    -webkit-appearance: none;
}

.form-textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 86, 219, 0.1);
}

/* === 选择器 === */
.select-group {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.form-select {
    flex: 1;
    height: 44px;
    padding: 0 var(--space-3);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-family: var(--font-family);
    color: var(--text-primary);
    background: var(--bg-white);
    cursor: pointer;
    transition: all var(--transition-fast);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 86, 219, 0.1);
}

/* === 按钮 === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    height: 44px;
    padding: 0 var(--space-5);
    border: none;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 600;
    font-family: var(--font-family);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    outline: none;
}

.btn:active {
    transform: scale(0.96);
}

.btn-primary {
    background: var(--primary);
    color: var(--text-inverse);
    box-shadow: 0 2px 6px rgba(26, 86, 219, 0.3);
}

.btn-primary:active {
    background: var(--primary-dark);
    box-shadow: 0 1px 3px rgba(26, 86, 219, 0.2);
}

.btn-secondary {
    background: var(--bg);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 1.5px solid var(--primary);
}

.btn-success {
    background: var(--success);
    color: var(--text-inverse);
}

.btn-danger {
    background: var(--danger);
    color: var(--text-inverse);
}

.btn-warning {
    background: var(--warning);
    color: #fff;
}

.btn-sm {
    height: 34px;
    padding: 0 var(--space-3);
    font-size: 0.75rem;
    border-radius: var(--radius-sm);
}

.btn-lg {
    height: 52px;
    padding: 0 var(--space-8);
    font-size: 1rem;
    border-radius: var(--radius-md);
}

.btn-block {
    width: 100%;
}

.btn-group {
    display: flex;
    gap: var(--space-2);
}

.btn-group .btn {
    flex: 1;
}

/* === 结果展示区 === */
.result-area {
    background: linear-gradient(135deg, #f8fafc, #eff6ff);
    border: 1.5px solid var(--primary-light);
    border-radius: var(--radius-md);
    padding: var(--space-5);
    margin-top: var(--space-4);
    display: none;
}

.result-area.visible {
    display: block;
    animation: fadeSlideIn var(--transition) forwards;
}

.result-area .result-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--primary);
    font-family: var(--font-mono);
    text-align: center;
    margin-bottom: var(--space-1);
}

.result-area .result-unit {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-align: center;
    font-weight: 500;
}

.result-area .result-detail {
    display: flex;
    justify-content: space-around;
    margin-top: var(--space-3);
    padding-top: var(--space-3);
    border-top: 1px dashed var(--border);
}

.result-detail-item {
    text-align: center;
}

.result-detail-item .rd-label {
    font-size: 0.6875rem;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.result-detail-item .rd-value {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-primary);
    font-family: var(--font-mono);
}

/* === 历史记录 === */
.history-list {
    max-height: 240px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-3) var(--space-2);
    border-bottom: 1px solid var(--border-light);
    font-size: 0.8125rem;
    transition: background var(--transition-fast);
    cursor: pointer;
    border-radius: var(--radius-sm);
}

.history-item:active {
    background: var(--bg);
}

.history-item .history-formula {
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 0.75rem;
}

.history-item .history-result {
    color: var(--primary);
    font-weight: 600;
}

.history-item .history-time {
    color: var(--text-muted);
    font-size: 0.6875rem;
}

.history-item .btn-del {
    color: var(--text-muted);
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--space-1);
    border-radius: var(--radius-xs);
    transition: all var(--transition-fast);
}

.history-item .btn-del:active {
    color: var(--danger);
    background: var(--danger-bg);
}

/* === 计算模式标签切换 === */
.mode-tabs {
    display: flex;
    background: var(--bg);
    border-radius: var(--radius);
    padding: 3px;
    margin-bottom: var(--space-4);
}

.mode-tab {
    flex: 1;
    height: 36px;
    border: none;
    background: transparent;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    font-family: var(--font-family);
}

.mode-tab.active {
    background: var(--bg-white);
    color: var(--primary);
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}

/* === 精度指示器 === */
.precision-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.025em;
}

.precision-badge.excellent {
    background: #ecfdf5;
    color: #059669;
}

.precision-badge.excellent i {
    color: var(--success);
}

/* === 已解决标记 === */
.resolved-stamp {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    color: #059669;
    border: 1px solid #6ee7b7;
    border-radius: 20px;
    font-size: 0.6875rem;
    font-weight: 700;
    transform: rotate(-5deg);
    letter-spacing: 0.05em;
    box-shadow: 0 1px 3px rgba(16,185,129,0.15);
}

.resolved-stamp i {
    font-size: 0.6875rem;
}

/* === 文档列表 === */
.doc-filter-bar {
    display: flex;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: var(--space-1);
}

.doc-filter-bar::-webkit-scrollbar { display: none; }

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-white);
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--transition-fast);
}

.filter-chip.active {
    background: var(--primary-bg);
    color: var(--primary);
    border-color: var(--primary-light);
}

.filter-chip:active {
    transform: scale(0.95);
}

.doc-search-bar {
    position: relative;
    margin-bottom: var(--space-4);
}

.doc-search-bar i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.875rem;
}

.doc-search-bar .form-input {
    padding-left: 38px;
}

.doc-card {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4);
    background: var(--card-bg);
    border-radius: var(--radius);
    margin-bottom: var(--space-2);
    border: 1px solid var(--border-light);
    transition: all var(--transition-fast);
    cursor: pointer;
}

.doc-card:active {
    background: var(--bg);
    transform: scale(0.98);
}

.doc-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.doc-icon.pdf { background: #fef2f2; color: #ef4444; }
.doc-icon.docx { background: #eff6ff; color: #2563eb; }
.doc-icon.xlsx { background: #f0fdf4; color: #16a34a; }
.doc-icon.ppt { background: #fff7ed; color: #ea580c; }
.doc-icon.txt { background: #f8fafc; color: #64748b; }

.doc-info {
    flex: 1;
    min-width: 0;
}

.doc-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.doc-meta {
    font-size: 0.6875rem;
    color: var(--text-muted);
    margin-top: 2px;
    display: flex;
    gap: var(--space-2);
}

.doc-tags {
    display: flex;
    gap: 4px;
    margin-top: 4px;
    flex-wrap: wrap;
}

.doc-tag {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 10px;
    font-size: 0.625rem;
    background: var(--bg);
    color: var(--text-secondary);
}

/* === 社区帖子 === */
.post-card {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    margin-bottom: var(--space-3);
    border: 1px solid var(--border-light);
    transition: all var(--transition-fast);
    cursor: pointer;
}

.post-card:active {
    box-shadow: var(--shadow-md);
}

.post-header {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-3);
}

.post-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.post-user {
    flex: 1;
}

.post-username {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.post-time {
    font-size: 0.6875rem;
    color: var(--text-muted);
}

.post-category {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.625rem;
    font-weight: 600;
    background: var(--primary-bg);
    color: var(--primary);
}

.post-category.paid {
    background: #fef3c7;
    color: #b45309;
}

.post-title {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-2);
    line-height: 1.4;
}

.post-content {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-footer {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    margin-top: var(--space-3);
    padding-top: var(--space-3);
    border-top: 1px solid var(--border-light);
}

.post-stat {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.post-stat i {
    font-size: 0.8125rem;
}

.post-stat.active {
    color: var(--primary);
}

/* === 付费标签 === */
.price-tag {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 10px;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #fff;
    border-radius: 20px;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.025em;
}

/* === 回复列表 === */
.reply-list {
    margin-top: var(--space-4);
}

.reply-item {
    display: flex;
    gap: var(--space-3);
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--border-light);
}

.reply-item:last-child {
    border-bottom: none;
}

.reply-avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.reply-body {
    flex: 1;
}

.reply-username {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.reply-username.anonymous {
    color: var(--text-muted);
    font-style: italic;
}

.reply-text {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-top: 2px;
    line-height: 1.5;
}

.reply-time {
    font-size: 0.6875rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* === 上传区域 === */
.upload-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-8) var(--space-4);
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
    background: var(--bg);
}

.upload-zone:hover, .upload-zone.drag-over {
    border-color: var(--primary);
    background: var(--primary-bg);
}

.upload-zone i {
    font-size: 2.5rem;
    color: var(--primary-light);
    margin-bottom: var(--space-3);
}

.upload-zone p {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.upload-zone .upload-hint {
    font-size: 0.6875rem;
    color: var(--text-muted);
    margin-top: var(--space-1);
}

/* === 模态框 === */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    display: none;
    align-items: flex-end;
    justify-content: center;
    backdrop-filter: blur(2px);
}

.modal-overlay.visible {
    display: flex;
    animation: fadeIn var(--transition) forwards;
}

.modal-sheet {
    width: 100%;
    max-width: 500px;
    background: var(--bg-white);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    padding: var(--space-6);
    animation: slideUp var(--transition-slow) forwards;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-handle {
    width: 36px;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    margin: 0 auto var(--space-4);
}

/* === Toast提示 === */
.toast {
    position: fixed;
    top: calc(var(--statusbar-height) + var(--space-4));
    left: 50%;
    transform: translateX(-50%);
    padding: var(--space-3) var(--space-5);
    background: var(--text-primary);
    color: var(--text-inverse);
    border-radius: var(--radius-lg);
    font-size: 0.8125rem;
    font-weight: 500;
    z-index: 3000;
    box-shadow: var(--shadow-lg);
    animation: fadeSlideIn var(--transition) forwards;
    max-width: 90%;
    text-align: center;
}

.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.warning { background: var(--warning); color: var(--text-primary); }

/* === 空状态 === */
.empty-state {
    text-align: center;
    padding: var(--space-10) var(--space-4);
    color: var(--text-muted);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: var(--space-4);
    opacity: 0.4;
}

.empty-state p {
    font-size: 0.875rem;
}

/* === 加载动画 === */
.loading-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-8);
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: var(--radius-full);
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-dots {
    display: flex;
    gap: 6px;
    justify-content: center;
    padding: var(--space-4);
}

.loading-dots span {
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full);
    background: var(--primary);
    animation: dotPulse 1.2s infinite ease-in-out;
}

.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotPulse {
    0%, 100% { transform: scale(0.5); opacity: 0.4; }
    50% { transform: scale(1); opacity: 1; }
}

/* === 单位选择器行 === */
.unit-row {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-3);
}

.unit-row .unit-arrow {
    color: var(--text-muted);
    font-size: 1.25rem;
    flex-shrink: 0;
    padding-top: 18px;
}

/* === 精度信息条 === */
.precision-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-2) var(--space-3);
    background: var(--success-bg);
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-3);
}

.precision-bar .precision-info {
    font-size: 0.6875rem;
    color: #059669;
    font-weight: 500;
}

.precision-bar .precision-info i {
    margin-right: 4px;
}

/* === 分段标题 === */
.section-title {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: var(--space-2);
    padding-left: var(--space-1);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.section-title::before {
    content: '';
    width: 3px;
    height: 14px;
    background: var(--primary);
    border-radius: 2px;
}

/* === 标签输入 === */
.tag-input-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: var(--space-2);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    min-height: 44px;
    align-items: center;
    transition: all var(--transition-fast);
    cursor: text;
}

.tag-input-wrap:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26,86,219,0.1);
}

.tag-input-wrap .tag-item {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 3px 8px;
    background: var(--primary-bg);
    color: var(--primary);
    border-radius: 12px;
    font-size: 0.6875rem;
    font-weight: 500;
}

.tag-input-wrap .tag-item .tag-remove {
    cursor: pointer;
    font-size: 0.625rem;
    color: var(--primary-light);
    transition: color var(--transition-fast);
}

.tag-input-wrap .tag-item .tag-remove:active {
    color: var(--danger);
}

.tag-input-wrap input {
    border: none;
    outline: none;
    font-size: 0.8125rem;
    flex: 1;
    min-width: 60px;
    height: 28px;
    font-family: var(--font-family);
}

/* === 电源/信号快捷选择 === */
.quick-select {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
    margin-bottom: var(--space-3);
}

.quick-chip {
    padding: 4px 12px;
    border: 1px solid var(--border);
    border-radius: 16px;
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-white);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.quick-chip:active {
    background: var(--primary-bg);
    color: var(--primary);
    border-color: var(--primary-light);
}

.quick-chip.selected {
    background: var(--primary-bg);
    color: var(--primary);
    border-color: var(--primary);
    font-weight: 600;
}

/* === 响应式 === */
@media (min-width: 768px) {
    body {
        max-width: 480px;
        margin: 0 auto;
        border-left: 1px solid var(--border);
        border-right: 1px solid var(--border);
        box-shadow: var(--shadow-lg);
    }

    .bottom-nav {
        max-width: 480px;
        left: 50%;
        transform: translateX(-50%);
    }

    .statusbar {
        max-width: 480px;
        left: 50%;
        transform: translateX(-50%);
    }

    .tool-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-4);
    }
}

/* === 打印隐藏 === */
@media print {
    .bottom-nav, .statusbar, .page-header {
        display: none;
    }
    body {
        padding: 0;
    }
}

/* === 工具提示文字 === */
.tooltip-text {
    font-size: 0.6875rem;
    color: var(--text-muted);
    margin-top: var(--space-1);
}

/* === 单位符号高亮 === */
.unit-highlight {
    color: var(--primary);
    font-weight: 600;
    background: var(--primary-bg);
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
}

/* === 无障碍 === */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* === 暗色模式适配（可选） === */
@media (prefers-color-scheme: dark) {
    /* 保留亮色主题作为默认，可通过JS切换暗色 */
}

/* === 开关组件 === */
.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: all var(--transition);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    left: 2px;
    bottom: 2px;
    background: #fff;
    border-radius: 50%;
    transition: all var(--transition);
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--primary);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(20px);
}

/* === 分页器 === */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-4) 0;
}

.pagination .page-btn {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border);
    background: var(--bg-white);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.75rem;
    transition: all var(--transition-fast);
}

.pagination .page-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.pagination .page-btn:active {
    transform: scale(0.9);
}