* { margin: 0; padding: 0; box-sizing: border-box; }
    html, body, #app { height: 100%; width: 100%; overflow: hidden; }
    body { font-family: 'Helvetica Neue', Helvetica, 'PingFang SC', 'Microsoft YaHei', Arial, sans-serif; background: #f0f2f5; }

    /* 登录页 - 绿色主题 */
    .login-container { display: flex; justify-content: center; align-items: center; height: 100vh; background: linear-gradient(135deg, #1a6b3c 0%, #0d4a28 100%); }
    .login-card { width: 440px; padding: 40px; border-radius: 12px; background: #fff; box-shadow: 0 8px 32px rgba(0,0,0,0.15); position:relative; }
    .login-card h2 { text-align: center; margin-bottom: 24px; color: #1a6b3c; font-size: 24px; }
    .login-card .el-form-item { margin-bottom: 20px; }
    .login-card .el-checkbox { font-size: 13px; }
    .login-feedback { font-size: 12px; padding: 8px 12px; border-radius: 6px; margin-top: 8px; line-height: 1.5; text-align:center; }
    .login-feedback.fb-orange { background: #fdf6ec; color: #e6a23c; border: 1px solid #faecd8; }
    .login-feedback.fb-red { background: #fef0f0; color: #ff1a1a; border: 1px solid #fde2e2; }
    .login-feedback.fb-green { background: #f0f9eb; color: #67c23a; border: 1px solid #e1f3d8; }
    .login-btn { width: 100%; }

    /* 布局 */
    .app-layout { height: 100vh; display: flex; flex-direction: column; }
    .app-header { display: flex; align-items: center; justify-content: space-between; padding: 0 20px; height: 56px; background: #fff; border-bottom: 1px solid #e4e7ed; box-shadow: 0 1px 4px rgba(0,0,0,0.04); }
    .app-header .logo-area { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 600; color: #00BFA5; }
    .app-header .logo-area .collapse-btn { font-size: 20px; cursor: pointer; color: #606266; }
    .app-header .user-area { display: flex; align-items: center; gap: 12px; }
    .app-sidebar { background: #001529; overflow-y: auto; transition: width 0.28s; }
    .app-sidebar .el-menu { border-right: none; }
    .app-main { padding: 16px; overflow-y: auto; background: #f0f2f5; flex: 1; }

    /* 通用 */
    .page-card { background: #fff; border-radius: 8px; padding: 20px; box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
    .page-title { font-size: 18px; font-weight: 600; margin-bottom: 16px; color: #303133; display: flex; align-items: center; gap: 8px; }
    .search-bar { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; align-items: flex-end; }
    .search-bar .el-form-item { margin-bottom: 0; }
    .table-actions { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
    .el-table th.el-table__cell { background-color: #f5f7fa; font-weight: 600; }

    /* 看板 */
    .dashboard-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; margin-bottom: 20px; }
    .stat-card { background: #fff; border-radius: 8px; padding: 20px; box-shadow: 0 1px 4px rgba(0,0,0,0.06); display: flex; align-items: center; gap: 16px; }
    .stat-card .icon-box { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0; }
    .stat-card .num { font-size: 28px; font-weight: 700; color: #303133; }
    .stat-card .label { font-size: 13px; color: #909399; margin-top: 2px; }
    .chart-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
    .chart-box { background: #fff; border-radius: 8px; padding: 16px; box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
    .chart-box .chart-title { font-size: 15px; font-weight: 600; margin-bottom: 12px; color: #303133; }

    /* 菜单 */
    .sider-menu .el-sub-menu__title { color: #ffffffb3 !important; }
    .sider-menu .el-menu-item { color: #ffffffb3 !important; }
    .sider-menu .el-menu-item.is-active { color: #fff !important; background: #00BFA5 !important; }
    .sider-menu .el-sub-menu__title:hover, .sider-menu .el-menu-item:hover { background: #00BFA540 !important; }
    .el-dialog { border-radius: 8px; }
    .upload-box { margin-top: 10px; padding: 10px; border: 1px dashed #d9d9d9; border-radius: 6px; }
    .preview-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
    .preview-item { position: relative; width: 120px; height: 90px; border: 1px solid #eee; border-radius: 6px; overflow: hidden; cursor: pointer; transition: box-shadow .2s; }
    .preview-item:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.12); }
    .preview-item img, .preview-item video { width: 100%; height: 100%; object-fit: contain; background: #f5f5f5; }
    .remove-btn { position: absolute; top: 2px; right: 2px; width: 18px; height: 18px; line-height: 16px; text-align: center; background: rgba(0,0,0,0.5); color: #fff; border-radius: 50%; font-size: 14px; cursor: pointer; }
    .text-green { color: #67c23a; }
    .text-red { color: #ff1a1a; }
    .text-orange { color: #e6a23c; }
    .alert-row-unconfirmed { background: #fef0f0 !important; }
    .alert-row-confirmed { background: #fdf6ec !important; }
    @media (max-width: 1200px) { .chart-row { grid-template-columns: 1fr; } }
    @media (max-width: 768px) { .wq-cards-row { grid-template-columns: repeat(3,1fr); } }

    /* Dashboard - 大棚选择 */
    .gh-select-area { margin-bottom: 16px; }
    .gh-cards-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
    .gh-card { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border: 2px solid #e8e8e8; border-radius: 10px; cursor: pointer; background:#fafafa; transition: all 0.2s; min-width:160px; }
    .gh-card:hover { border-color: #00BFA5; background: #f0fdfa; }
    .gh-card.gh-active { border-color: #00BFA5; background: #e6faf5; }
    .gh-card-icon { font-size: 24px; flex-shrink:0; }
    .gh-card-info { flex:1; min-width:0; }
    .gh-card-name { font-size: 14px; font-weight: 600; color: #303133; }
    .gh-card-meta { font-size: 11px; color: #909399; }
    .gh-card-status { font-size: 11px; padding: 2px 8px; border-radius: 10px; flex-shrink:0; }
    .gh-tag-green { background: #e8faf0; color: #67c23a; }
    .gh-tag-gray { background: #f4f4f5; color: #909399; }
    .gh-toolbar { display: flex; align-items: center; gap: 12px; }
    .gh-selected-info { font-size: 13px; color: #606266; }
    .gh-last-update { font-size: 12px; color: #c0c4cc; }

    /* Dashboard - 水质卡片 */
    .section-title { font-size: 15px; font-weight: 600; color: #303133; margin-bottom: 12px; }
    .wq-section { margin-bottom: 16px; }
    .wq-cards-row { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
    .wq-card { background:#fff; border-radius:10px; padding:12px 10px; box-shadow:0 1px 4px rgba(0,0,0,0.06); text-align:center; }
    .wq-card-header { font-size:12px; color:#909399; margin-bottom:4px; }
    .wq-card-value { font-size:20px; font-weight:700; line-height:1.2; }
    .wq-card-unit { font-size:11px; color:#c0c4cc; margin-bottom:6px; }
    .wq-ring-canvas { width:90px; height:90px; display:block; margin:0 auto; }
    .wq-card-range { font-size:10px; color:#909399; margin-top:4px; }
    .wq-group-pill { background:#f0f2f5; color:#606266; }
    .wq-group-pill-active { background:#00BFA5; color:#fff !important; }
    
    
    /* Strong blinking animations for stale WQ data */
    @keyframes wq-border-pulse {
      0%, 100% { border-color: rgba(255, 26, 26, 0.3); box-shadow: 0 0 4px rgba(255, 26, 26, 0.2); }
      50% { border-color: #ff1a1a; box-shadow: 0 0 14px rgba(255, 26, 26, 0.8); }
    }
    @keyframes wq-bg-breathe {
      0%, 100% { background-color: rgba(253, 246, 236, 0.2); }
      50% { background-color: rgba(253, 246, 236, 0.9); }
    }
    @keyframes wq-badge-blink {
      0%, 100% { opacity: 1; transform: scale(1); background-color: rgba(253, 246, 236, 0.5); }
      50% { opacity: 1; transform: scale(1.12); background-color: rgba(255, 26, 26, 0.15); }
    }
    @keyframes wq-text-blink {
      0%, 100% { color: #e6a23c; }
      50% { color: #ff1a1a; font-weight: 700; }
    }
.wq-card-stale { opacity:0.55; filter:grayscale(0.6); border: 2px solid rgba(255, 26, 26, 0.25); animation: wq-border-pulse 0.8s ease-in-out infinite, wq-bg-breathe 1s ease-in-out infinite; border-radius: 10px; }
    .wq-stale-badge { font-size:11px; padding:2px 8px; border-radius:10px; display:inline-block; }
    .wq-stale-badge.warn { background:#fdf6ec; color:#e6a23c; animation: wq-badge-blink 0.6s ease-in-out infinite, wq-text-blink 0.6s ease-in-out infinite; }
    .wq-stale-badge.ok { background:#f0f9eb; color:#67c23a; }
  
    /* Mobile responsive */
    @media (max-width: 768px) {
      .app-sidebar { width: 200px !important; }
      .app-main { padding: 8px !important; }
      .search-bar { flex-direction: column; align-items: stretch; }
      .search-bar .el-select, .search-bar .el-date-picker { width: 100% !important; }
      .el-table { font-size: 12px; }
      .dashboard-grid { grid-template-columns: 1fr 1fr; }
      .chart-row { grid-template-columns: 1fr; }
      .wq-cards-row { grid-template-columns: repeat(2,1fr); }
      .gh-cards-row { flex-direction: row; gap: 6px; }
      .gh-card { min-width: calc(50% - 6px); padding: 8px 10px; gap: 6px; }
      .page-card { padding: 12px; }
      .el-dialog { width: 95% !important; max-width: 95% !important; }
    }
    @media (max-width: 480px) {
      .dashboard-grid { grid-template-columns: 1fr; }
      .wq-cards-row { grid-template-columns: 1fr 1fr; }
    }
    /* Threshold highlight */
    .td-danger { background-color: #fde2e2 !important; color: #ff1a1a !important; font-weight: 700; }
    .td-warning { background-color: #fdf6ec !important; color: #e6a23c !important; }
    .td-green { background-color: #f0f9eb !important; color: #67c23a !important; }
    .threshold-legend { display: flex; gap: 16px; margin: 8px 0 12px; font-size: 12px; align-items: center; }
    .threshold-legend .dot { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 4px; vertical-align: middle; }
    .alert-voice-btn { position: fixed; bottom: 20px; right: 20px; z-index: 9999; }
    /* Inspection plan */
    .inspection-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
    .inspect-card { background: #fff; border-radius: 10px; border: 1px solid #ebeef5; padding: 16px; transition: all 0.2s; }
    .inspect-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.08); }
    .inspect-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
    .inspect-card-title { font-size: 15px; font-weight: 600; color: #303133; }

  .sop-viewer { height: calc(100vh - 120px); display: flex; flex-direction: column; }
.sop-browse-header { padding: 16px 20px; border-bottom: 1px solid #e8e8e8; background: #fff; }
.sop-browse-title { font-size: 20px; font-weight: 600; color: #1a6b3c; margin-bottom: 12px; }
.sop-search-bar { display: flex; gap: 8px; max-width: 400px; }
.sop-search-bar input { flex: 1; padding: 8px 12px; border: 1px solid #dcdfe6; border-radius: 6px; font-size: 14px; outline: none; }
.sop-search-bar input:focus { border-color: #00BFA5; }
.sop-search-bar button { padding: 8px 16px; background: #00BFA5; color: #fff; border: none; border-radius: 6px; cursor: pointer; }
.sop-browse-body { display: flex; flex: 1; overflow: hidden; }
.sop-sidebar { width: 220px; border-right: 1px solid #e8e8e8; background: #fafafa; overflow-y: auto; flex-shrink: 0; }
.sop-sidebar-title { padding: 12px 16px; font-weight: 600; font-size: 14px; color: #333; border-bottom: 1px solid #e8e8e8; }
.sop-cat-tree { padding: 4px 0; }
.sop-cat-item { cursor: pointer; }
.sop-cat-row { display: flex; align-items: center; gap: 4px; padding: 6px 8px; border-radius: 4px; margin: 1px 6px; font-size: 13px; }
.sop-cat-row:hover { background: #e8f5e9; }
.sop-cat-active { background: #e0f2f1 !important; color: #00BFA5; font-weight: 600; }
.sop-cat-toggle { font-size: 10px; width: 14px; text-align: center; color: #999; flex-shrink: 0; }
.sop-cat-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sop-cat-count { font-size: 11px; color: #999; background: #eee; padding: 0 6px; border-radius: 8px; }
.sop-doc-list { flex: 1; overflow-y: auto; padding: 16px; }
.sop-doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.sop-doc-card { background: #fff; border: 1px solid #e8e8e8; border-radius: 8px; padding: 16px; cursor: pointer; transition: all 0.2s; }
.sop-doc-card:hover { border-color: #00BFA5; box-shadow: 0 2px 8px rgba(0,191,165,0.15); transform: translateY(-1px); }
.sop-doc-card-code { font-size: 11px; color: #00BFA5; font-weight: 600; margin-bottom: 4px; }
.sop-doc-card-name { font-size: 15px; font-weight: 500; color: #333; margin-bottom: 8px; line-height: 1.4; }
.sop-doc-card-meta { font-size: 12px; color: #999; display: flex; justify-content: space-between; }

/* Read mode */
.sop-read-header { padding: 12px 20px; border-bottom: 1px solid #e8e8e8; background: #fff; display: flex; align-items: center; gap: 16px; }
.sop-back-btn { background: none; border: 1px solid #dcdfe6; padding: 6px 14px; border-radius: 6px; cursor: pointer; font-size: 13px; color: #666; }
.sop-back-btn:hover { border-color: #00BFA5; color: #00BFA5; }
.sop-read-title { font-size: 16px; color: #333; }
.sop-read-title .sop-read-version { font-size: 12px; color: #999; margin-left: 8px; font-weight: normal; }
.sop-read-body { display: flex; flex: 1; overflow: hidden; }
.sop-toc-panel { width: 200px; border-right: 1px solid #e8e8e8; background: #fafafa; overflow-y: auto; flex-shrink: 0; }
.sop-toc-title { padding: 12px 16px; font-weight: 600; font-size: 13px; color: #333; border-bottom: 1px solid #e8e8e8; }
.sop-toc-item { padding: 8px 12px; font-size: 13px; cursor: pointer; color: #666; border-left: 2px solid transparent; }
.sop-toc-item:hover { color: #00BFA5; background: #e8f5e9; border-left-color: #00BFA5; }
.sop-toc-text { line-height: 1.4; }
.sop-content-area { flex: 1; overflow-y: auto; padding: 24px 32px; line-height: 1.8; color: #333; }
.sop-content-area h1 { font-size: 22px; border-bottom: 2px solid #00BFA5; padding-bottom: 8px; margin-top: 24px; margin-bottom: 16px; }
.sop-content-area h2 { font-size: 18px; color: #1a6b3c; margin-top: 20px; margin-bottom: 12px; }
.sop-content-area h3 { font-size: 16px; margin-top: 16px; margin-bottom: 8px; }
.sop-content-area p { margin-bottom: 12px; }
.sop-content-area img { max-width: 100%; height: auto; border-radius: 6px; margin: 8px 0; cursor: pointer; border: 1px solid #eee; }
.sop-content-area video { max-width: 100%; border-radius: 6px; margin: 8px 0; }
.sop-content-area table { border-collapse: collapse; width: 100%; margin: 12px 0; }
.sop-content-area th, .sop-content-area td { border: 1px solid #dcdfe6; padding: 8px 12px; text-align: left; }
.sop-content-area th { background: #f5f7fa; font-weight: 600; }
.sop-content-area ul, .sop-content-area ol { padding-left: 24px; margin-bottom: 12px; }
.sop-content-area blockquote { border-left: 3px solid #00BFA5; padding: 8px 16px; margin: 12px 0; background: #f5f7fa; color: #666; }
.sop-content-area code { background: #f5f7fa; padding: 2px 6px; border-radius: 3px; font-size: 13px; }

/* Lightbox */
.sop-lightbox { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.85); z-index: 10000; display: flex; align-items: center; justify-content: center; cursor: zoom-out; }
.sop-lightbox-close { position: absolute; top: 20px; right: 30px; font-size: 36px; color: #fff; cursor: pointer; }
.sop-lightbox-img { max-width: 90%; max-height: 90%; object-fit: contain; border-radius: 4px; cursor: default; }

/* Mobile responsive */
@media (max-width: 768px) {
  .sop-sidebar { display: none; }
  .sop-toc-panel { display: none; }
  .sop-content-area { padding: 16px; }
  .sop-doc-grid { grid-template-columns: 1fr; }
  .sop-browse-body { flex-direction: column; }
}
@keyframes loadPulse { 0%,100%{opacity:0.4} 50%{opacity:1}}

/* 媒体预览覆盖层 */
.media-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.92); z-index: 9999;
  display: flex; justify-content: center; align-items: center;
  cursor: pointer;
}
.media-overlay img,
.media-overlay video {
  max-width: 90%; max-height: 90%;
  object-fit: contain; cursor: default;
  border-radius: 4px;
}

/* 报表汇总行 */
.total-row td { font-weight: 700; background: #f0fdfa !important; color: #00BFA5; border-top: 2px solid #00BFA5; }
.total-row:hover td { background: #e6faf5 !important; }

/* ====== 手机端响应式 ====== */
@media (max-width: 768px) {
    position: fixed !important;
    top: 0;
    left: -100%;
    width: 260px !important;
    height: 100vh;
    z-index: 1000;
    transition: left 0.3s ease;
    overflow-y: auto;
    display: block;
  }
  .app-sidebar.mobile-open {
    left: 0;
  }
  .sidebar-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
  }
  .el-aside { width: 0 !important; overflow: visible; }
  .app-sidebar.mobile-open { left: 0; width: 260px !important; }
  .app-sidebar .el-menu { max-height: calc(100vh - 56px); overflow-y: auto; }
  .collapse-btn { display: none; }
  .mobile-hamburger { display: inline-block !important; font-size: 22px; cursor: pointer; padding: 6px 10px; color: #333; background: #f0f2f5; border-radius: 4px; }
  .app-header .logo-area { font-size: 15px; }
  .dashboard-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 8px; }
  .stat-card { padding: 12px; gap: 8px; }
  .stat-card .icon-box { width: 36px; height: 36px; font-size: 16px; }
  .stat-card .num { font-size: 20px; }
  .chart-row { grid-template-columns: 1fr !important; }
  .wq-cards-row { grid-template-columns: repeat(3, 1fr) !important; gap: 6px; }
  .el-table { width: 100% !important; }
  .el-table .el-table__cell { max-width: 45px !important; white-space: normal !important; word-break: break-all !important; font-size: 11px !important; }
  .el-table__cell.is-right { max-width: 100px !important; }
  .el-table colgroup col, .el-table col { width: auto !important; }
  .el-table .el-table__cell .cell { white-space: normal !important; word-break: break-all !important; padding: 2px 4px !important; display: flex !important; flex-wrap: wrap !important; gap: 2px !important; }
  .el-table .el-table__cell .cell .el-button { margin-left: 0 !important; white-space: nowrap !important; }
}
@media (min-width: 769px) {
  .mobile-hamburger { display: none; }
}
