* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Microsoft YaHei", sans-serif;
}

:root {
    --bg-body: #edf3fa;
    --bg-header: linear-gradient(to right, #2055a0, #3b82c4);
    --border-header: transparent;
    --bg-sidebar: #f0f5fc;
    --border-sidebar: #d6e4f5;
    --menu-active-bg: #bfdaf5;
    --menu-active-color: #1a5fb4;
    --submenu-bg: #f4f8fc;
    --nav-active-bg: #ddebf8;
    --nav-active-color: #1a5fb4;
    --card-shadow: 0 1px 4px rgba(26,95,180,0.08);
    --table-head-bg: #eaf1f9;
    --btn-primary: #2a6dc9;
    --btn-primary-hover: #1f5aac;
    --filter-focus-shadow: rgba(42,109,201,0.1);
    --td-border: #e2eaf4;
    --period-tag-bg: #eef4fb;
    --period-tag-border: #b8cfe8;
    --period-tag-color: #1a5fb4;
}

body {
    background-color: #f2f5f9;
    background-image: radial-gradient(circle, #dce2ea 1px, transparent 1px);
    background-size: 20px 20px;
    color: #333;
    font-size: 13px;
}

/* 登录遮罩 —— 风电主题背景 + 暗色渐变保证文字可读 */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: linear-gradient(rgba(12,28,56,0.45), rgba(12,28,56,0.6)), url('/img/login-bg.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 玻璃拟态登录卡 */
.login-card {
    width: 380px;
    padding: 40px 36px;
    border-radius: 16px;
    background: rgba(255,255,255,0.16);
    backdrop-filter: blur(16px) saturate(150%);
    -webkit-backdrop-filter: blur(16px) saturate(150%);
    border: 1px solid rgba(255,255,255,0.35);
    box-shadow: 0 12px 48px rgba(0,0,0,0.35);
    text-align: center;
    color: #fff;
}

.login-card h2 {
    font-size: 22px;
    color: #fff;
    margin-bottom: 22px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.35);
    letter-spacing: 1px;
}

.login-card .form-group {
    margin-bottom: 18px;
    text-align: left;
}

.login-card .form-group label {
    display: block;
    margin-bottom: 6px;
    color: rgba(255,255,255,0.92);
    font-weight: 500;
    font-size: 13px;
}

.login-card .form-group input {
    width: 100%;
    height: 42px;
    border: 1px solid rgba(255,255,255,0.45);
    border-radius: 6px;
    padding: 0 12px;
    outline: none;
    font-size: 14px;
    background: rgba(255,255,255,0.18);
    color: #fff;
    box-sizing: border-box;
}

.login-card .form-group input::placeholder {
    color: rgba(255,255,255,0.7);
}

.login-card .form-group input:focus {
    border-color: #fff;
    background: rgba(255,255,255,0.26);
}

/* 密码框 + 小眼睛 */
.login-card .input-wrap {
    position: relative;
}

.login-card .input-wrap input {
    padding-right: 42px;
}

.login-card .toggle-pwd {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.9);
    cursor: pointer;
}

.login-card .toggle-pwd:hover {
    color: #fff;
}

.login-card .toggle-pwd svg {
    width: 20px;
    height: 20px;
}

/* 记住密码 */
.login-card .remember-row {
    text-align: left;
    margin-bottom: 16px;
}

.login-card .remember-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: rgba(255,255,255,0.92);
    font-size: 13px;
    cursor: pointer;
}

.login-card .remember-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #2055a0;
    cursor: pointer;
}

.login-card .btn-login {
    width: 100%;
    height: 44px;
    background: linear-gradient(135deg, #3b82c4, #2055a0);
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    margin-top: 4px;
    transition: all 0.2s;
    box-shadow: 0 4px 14px rgba(32,85,160,0.4);
}

.login-card .btn-login:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(32,85,160,0.5);
}

.login-card .btn-login:disabled {
    opacity: 0.7;
    cursor: default;
    transform: none;
}

.login-error {
    color: #ffd6d6;
    font-size: 13px;
    min-height: 20px;
    margin-top: 10px;
    text-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

/* 用户信息栏 */
.user-info-bar {
    position: absolute;
    right: 20px;
    top: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-size: 13px;
    z-index: 300;
}

.user-info-bar .btn-logout {
    padding: 4px 12px;
    border: 1px solid rgba(255,255,255,0.5);
    border-radius: 4px;
    background: transparent;
    color: #fff;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

.user-info-bar .btn-logout:hover {
    background: rgba(255,255,255,0.2);
}

.user-info-bar .role-tag {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    padding: 0;
    vertical-align: middle;
}

.user-info-bar .role-tag.admin {
    background: #ff4d4f;
}

.user-info-bar .role-tag.user {
    background: #52c41a;
}

.user-info-bar .user-menu-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 4px;
    transition: background 0.2s;
}

.user-info-bar .user-menu-trigger:hover {
    background: rgba(255,255,255,0.15);
}

.user-info-bar .user-menu-arrow {
    font-size: 10px;
    color: rgba(255,255,255,0.8);
}

.user-info-bar .user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 6px;
    min-width: 140px;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    overflow: hidden;
    z-index: 200;
}

.user-info-bar .user-dropdown-item {
    padding: 10px 16px;
    font-size: 13px;
    color: #333;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s;
}

.user-info-bar .user-dropdown-item:hover {
    background: #f0f2f5;
}

.user-info-bar .user-dropdown-item:last-child {
    color: #ff4d4f;
}

/* 页面标题 */
.header-title {
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    padding: 16px 20px 12px;
    letter-spacing: 2px;
    background: var(--bg-header);
    border-bottom: 1px solid var(--border-header);
    position: relative;
}

/* 顶部导航栏 */
.top-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: #eceff5;
    display: flex;
    align-items: center;
    /* 用 padding 提供上下间距，避免 sticky 透明 margin 在滚动时露出下层内容（原为 margin: 8px 0 16px） */
    padding: 8px 0 8px 4px;
    border-bottom: 1px solid #d0dceb;
    margin: 0;
    height: 58px;
}

.top-nav-links {
    display: flex;
    gap: 0;
    align-items: center;
}

.nav-link {
    padding: 0 16px;
    line-height: 42px;
    color: #555;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    border-top: 2px solid transparent;
}

.nav-link.active {
    background: var(--nav-active-bg);
    color: var(--nav-active-color);
    border-top: 2px solid var(--nav-active-color);
}

.nav-link .tab-close {
    display: inline-block;
    width: 18px;
    height: 18px;
    line-height: 16px;
    text-align: center;
    font-size: 14px;
    color: #999;
    border-radius: 50%;
    cursor: pointer;
}

.nav-link .tab-close:hover {
    background-color: #ff4d4f;
    color: #fff;
}

/* 主体布局 */
.layout {
    display: flex;
    height: calc(100vh - 52px);
}

/* 左侧菜单 */
.sidebar {
    width: 200px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-sidebar);
    padding: 10px 0;
}

.sidebar-search {
    padding: 0 15px 15px;
}

.sidebar-search input {
    width: 100%;
    height: 36px;
    border: 1px solid #dce4f0;
    border-radius: 4px;
    padding: 0 10px;
    outline: none;
}

.menu-group {
    margin-bottom: 5px;
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    color: #555;
    cursor: pointer;
    gap: 8px;
}

.menu-item.active {
    background-color: var(--menu-active-bg);
    color: var(--menu-active-color);
}

.menu-item .arrow {
    margin-left: auto;
    font-size: 12px;
}

.menu-disabled {
    color: #bbb !important;
    cursor: not-allowed;
    pointer-events: none;
}

.submenu {
    background-color: var(--submenu-bg);
}
.submenu.collapsed {
    display: none;
}

.submenu .menu-item {
    padding-left: 35px;
}

/* 主内容区 */
.main-content {
    flex: 1;
    padding: 0 20px 20px;
    overflow-y: auto;
}

/* 导航栏下方的间距（原为 top-bar 的透明 margin，移到内容区避免滚动露缝） */
.tab-content-area {
    margin-top: 16px;
}

.page-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #1a1a1a;
}

/* 筛选区 */
.filter-section {
    background-color: #fff;
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    align-items: center;
    box-shadow: var(--card-shadow);
    overflow: visible;
}

/* 大部件/异动/缺陷 — 搜索栏吸顶 */
#anomalyView .filter-section,
#componentView .filter-section {
    position: sticky;
    top: 50px;
    z-index: 99;
}

/* 缺陷页 — 分栏布局，吸在左侧面板顶部 */
#defectView .filter-section {
    position: sticky;
    top: 0;
    z-index: 99;
}

#defectView {
    height: calc(100vh - 110px);
}

#defectListPanel {
    max-height: 100%;
}

.filter-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.filter-item label {
    white-space: nowrap;
    color: #555;
    font-weight: 500;
    font-size: 12px;
}

.filter-item select,
.filter-item input {
    height: 34px;
    border: 1px solid #dce4f0;
    border-radius: 4px;
    padding: 0 8px;
    min-width: 90px;
    outline: none;
    font-size: 13px;
}

.filter-item select:focus,
.filter-item input:focus {
    border-color: var(--btn-primary);
    box-shadow: 0 0 0 2px var(--filter-focus-shadow);
}

.filter-btn-group {
    width: 100%;
    display: flex;
    gap: 12px;
    justify-content: center;
}

.btn {
    height: 34px;
    padding: 0 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

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

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

/* 表格区域 */
.table-wrapper {
    background-color: #fff;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
}

.table-wrapper .table-inner {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

thead {
    background: var(--table-head-bg);
}

th {
    text-align: center;
}

td {
    text-align: center;
}

th, td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--td-border);
    white-space: nowrap;
}

/* 项目明细表格列宽 */
#listContent th:nth-child(1) { width: 44px; }
#listContent th:nth-child(5) { width: 80px; }
#listContent th:nth-child(7) { width: 90px; }
#listContent th:nth-child(8) { width: 120px; }

#listContent td:nth-child(4),
#listContent td:nth-child(6) {
    white-space: normal;
    word-wrap: break-word;
    vertical-align: top;
}

#listContent td:nth-child(4) { max-width: 180px; }
#listContent td:nth-child(6) { max-width: 200px; }

.progress-content {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.5;
    max-height: 3em;
}

.empty-table {
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
}

/* 详情页样式 */
.detail-view {
    display: none;
}

.detail-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.detail-header .btn-back {
    height: 36px;
    padding: 0 16px;
    background-color: #fff;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.detail-header .btn-back:hover {
    border-color: #4096ff;
    color: #4096ff;
}

.detail-info-card {
    background-color: #fff;
    border-radius: 6px;
    padding: 20px 24px;
    margin-bottom: 16px;
    box-shadow: var(--card-shadow);
}

.detail-info-card h4 {
    font-size: 15px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--menu-active-color);
    color: var(--menu-active-color);
}

.detail-info-row {
    margin-bottom: 16px;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    flex-wrap: wrap;
}

.detail-info-row span {
    color: #666;
    font-size: 13px;
}

.detail-info-row strong {
    color: #1a1a1a;
    margin-left: 4px;
    font-weight: 600;
}

.detail-info-meta {
    margin-top: 4px;
    padding-top: 4px;
}

.detail-info-meta span {
    color: #888;
    font-size: 13px;
}

.period-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 8px;
}

.period-tag {
    background-color: var(--period-tag-bg);
    border: 1px solid var(--period-tag-border);
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 13px;
}

.period-tag .tag-name {
    font-weight: 600;
    color: var(--period-tag-color);
}

.period-tag .tag-info {
    color: #555;
    margin-left: 8px;
}

.progress-log-section {
    background-color: #fff;
    border-radius: 6px;
    padding: 20px 24px;
    margin-bottom: 16px;
    box-shadow: var(--card-shadow);
}

.progress-log-section h4 {
    font-size: 15px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--menu-active-color);
    color: var(--menu-active-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.progress-log-table {
    margin-top: 8px;
    overflow-x: auto;
}

.progress-log-table table {
    table-layout: fixed;
    width: 100%;
    min-width: 600px;
    font-size: 12px;
}

.progress-log-table th,
.progress-log-table td {
    padding: 6px 8px;
    text-align: center;
    border-bottom: 1px solid #f0f2f5;
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.progress-log-table th {
    background-color: var(--table-head-bg);
    color: #555;
    font-weight: 600;
}

.progress-log-table th:nth-child(1) { width: 40px; }
.progress-log-table th:nth-child(2) { width: 70px; }
.progress-log-table th:nth-child(3) { width: auto; }
.progress-log-table th:nth-child(4) { width: 100px; }
.progress-log-table th:nth-child(5) { width: 100px; }
.progress-log-table th:nth-child(6) { width: 60px; }

.progress-log-table td:nth-child(3) {
    text-align: left;
    white-space: pre-wrap;
    word-break: break-all;
    line-height: 1.5;
}

.prog-log-content {
    white-space: pre-wrap;
    word-break: break-all;
    line-height: 1.5;
}

.add-log-form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 12px;
    align-items: flex-end;
    padding: 12px 0;
    border-bottom: 1px solid #eee;
    margin-bottom: 8px;
}

.add-log-form .form-group {
    margin-bottom: 0;
    flex: 3;
    min-width: 280px;
}

.add-log-form .alert-options {
    display: flex;
    gap: 12px;
    flex: 1;
    min-width: 200px;
}

.add-log-form .alert-options .form-group {
    flex: 1;
    min-width: 90px;
}

.add-log-form .form-group label {
    display: block;
    margin-bottom: 4px;
    font-size: 13px;
    color: #666;
}

.add-log-form .form-group input,
.add-log-form .form-group select {
    width: 100%;
    height: 32px;
    border: 1px solid #dce4f0;
    border-radius: 4px;
    padding: 0 8px;
    outline: none;
    font-size: 12px;
}

.add-log-form .form-group input:focus,
.add-log-form .form-group select:focus {
    border-color: #4096ff;
}

.add-log-form .btn {
    height: 32px;
    flex-shrink: 0;
    font-size: 12px;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 15px 20px;
    gap: 10px;
}

.page-btn {
    width: 32px;
    height: 32px;
    border: 1px solid #dce4f0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 4px;
}

.page-btn.active {
    background-color: #4096ff;
    color: #fff;
    border-color: #4096ff;
}

.page-input {
    width: 60px;
    height: 32px;
    border: 1px solid #dce4f0;
    border-radius: 4px;
    padding: 0 8px;
    text-align: center;
}

/* 右侧悬浮按钮 */
.float-btn-group {
    position: fixed;
    right: 20px;
    bottom: 80px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.float-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #fff;
    border: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.float-btn.ai {
    background-color: #e6f4ff;
    color: #4096ff;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: #fff;
    margin: 5% auto;
    border-radius: 8px;
    width: 560px;
    max-width: 90%;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #eee;
}

.modal-header h3 {
    margin: 0;
    font-size: 16px;
    color: #333;
}

.close {
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    color: #999;
    line-height: 1;
}

.close:hover {
    color: #333;
}

.modal-body {
    padding: 24px;
    max-height: 60vh;
    overflow-y: auto;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    color: #555;
    font-weight: 500;
}

.form-group select,
.form-group input,
.form-group textarea {
    width: 100%;
    border: 1px solid #dce4f0;
    border-radius: 4px;
    padding: 8px 12px;
    outline: none;
    font-size: 14px;
    font-family: inherit;
    box-sizing: border-box;
}

.form-group select,
.form-group input {
    height: 40px;
    padding: 0 12px;
}

.form-group select:focus,
.form-group input:focus {
    border-color: #4096ff;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px 24px;
    border-top: 1px solid #eee;
}

.btn-cancel {
    background-color: #f5f5f5;
    color: #666;
    border: 1px solid #d9d9d9;
}

.btn-cancel:hover {
    background-color: #e8e8e8;
}

/* 操作按钮样式 */
.btn-small {
    padding: 3px 7px;
    font-size: 12px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    margin-right: 4px;
}

.btn-edit {
    background-color: #1890ff;
    color: white;
}

.btn-edit:hover {
    background-color: #40a9ff;
}

.btn-delete {
    background-color: #ff4d4f;
    color: white;
}

.btn-delete:hover {
    background-color: #ff7875;
}

.btn-pin {
    background-color: #f0f0f0;
    color: #999;
    font-size: 11px;
    padding: 3px 6px;
}

.btn-pin:hover {
    background-color: #e6f7ff;
    color: #1890ff;
}

.btn-pin.pinned {
    background-color: #e6f7ff;
    color: #1890ff;
}

.btn-pin.pinned:hover {
    background-color: #bae7ff;
}

/* 复选框样式 */
.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    max-width: 400px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: #555;
    margin-right: 0;
}

.checkbox-label input[type="checkbox"] {
    margin-right: 6px;
    width: 16px;
    height: 16px;
    accent-color: #4096ff;
    cursor: pointer;
}

.checkbox-label:hover {
    color: #4096ff;
}

/* 模态框中的复选框样式 */
.modal .checkbox-group {
    max-width: 100%;
    gap: 10px;
}

.modal .checkbox-label {
    font-size: 14px;
}

/* 模态框期次布局样式 */
.period-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    padding: 4px 0;
}

.period-item {
    padding: 5px 16px;
    transition: all 0.2s;
    border-bottom: 1px solid #f5f5f5;
}

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

.period-item.has-detail {
    background-color: #fafbff;
}

.period-item .checkbox-label {
    display: block;
    font-weight: 500;
    font-size: 14px;
}

.period-detail {
    display: none;
    margin-top: 4px;
    padding-left: 20px;
}

.period-detail.show {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.period-detail label {
    font-size: 12px;
    color: #999;
    white-space: nowrap;
    font-weight: normal;
}

.period-detail input[type="number"] {
    width: 60px;
    height: 28px;
    border: 1px solid #dce4f0;
    border-radius: 4px;
    padding: 0 6px;
    outline: none;
    font-size: 13px;
    text-align: center;
}

.period-detail input[type="number"]:focus {
    border-color: #4096ff;
}

.period-detail textarea.period-numbers {
    width: 100%;
    min-width: 260px;
    height: 28px;
    border: 1px solid #dce4f0;
    border-radius: 4px;
    padding: 3px 8px;
    outline: none;
    font-size: 13px;
    font-family: inherit;
    resize: vertical;
    overflow-y: hidden;
    line-height: 22px;
}

.period-detail textarea.period-numbers:focus {
    border-color: #4096ff;
    height: auto;
    min-height: 50px;
    overflow-y: auto;
}

.pending-input {
    display: none;
    margin-top: 8px;
}

.pending-input.show {
    display: inline-flex;
    align-items: center;
}

.modal-checkbox-group {
    display: block;
}

.checkbox-row {
    display: contents;
}

/* 下拉复选框样式 */
.dropdown-checkbox {
    position: relative;
    min-width: 110px;
}

.dropdown-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 34px;
    border: 1px solid #dce4f0;
    border-radius: 4px;
    padding: 0 8px;
    background-color: #fff;
    cursor: pointer;
    font-size: 13px;
    color: #555;
    min-width: 110px;
}

.dropdown-toggle:hover {
    border-color: #4096ff;
}

.dropdown-arrow {
    font-size: 12px;
    color: #999;
    transition: transform 0.2s;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #fff;
    border: 1px solid #dce4f0;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    z-index: 1000;
    max-height: 360px;
    overflow-y: auto;
    overflow-x: hidden;
    margin-top: 4px;
    min-width: 200px;
    width: max-content;
}

.dropdown-content {
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.dropdown-content .checkbox-label {
    margin: 0;
    padding: 6px 10px;
    border-radius: 3px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    white-space: nowrap;
    font-size: 14px;
}

.dropdown-content .checkbox-label:hover {
    background-color: #f5f5f5;
}

.dropdown-content input[type="checkbox"] {
    margin: 0;
    width: 14px;
    height: 14px;
    min-width: 14px;
    accent-color: #4096ff;
}

/* 预警角标 */
.alert-badge {
    display: inline-block;
    background-color: #ff4d4f;
    color: #fff;
    font-size: 11px;
    border-radius: 10px;
    min-width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    padding: 0 5px;
    margin-left: 6px;
    font-weight: 600;
}

.alert-badge:empty {
    display: none;
}

.menu-item .alert-badge {
    margin-left: auto;
    margin-right: 0;
}

/* 预警页面 */
.alert-section {
    margin-bottom: 24px;
}

.alert-section-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.alert-section-title .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.alert-section-title .dot.overdue { background-color: #ff4d4f; }
.alert-section-title .dot.today { background-color: #faad14; }

.alert-empty {
    text-align: center;
    padding: 60px 0;
    color: #999;
    font-size: 14px;
}

tr.row-overdue {
    background-color: #fff1f0;
}

tr.row-overdue:hover {
    background-color: #ffe0df !important;
}

tr.row-today {
    background-color: #fffbe6;
}

tr.row-today:hover {
    background-color: #fff7cc !important;
}

.alert-options {
    display: flex;
    gap: 16px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.alert-options .form-group {
    margin-bottom: 0;
    flex: 1;
    min-width: 160px;
}

.alert-options .form-group label {
    display: block;
    margin-bottom: 4px;
    font-size: 13px;
    color: #666;
}

.alert-options .form-group input[type="date"] {
    width: 100%;
    height: 38px;
    border: 1px solid #dce4f0;
    border-radius: 6px;
    padding: 0 10px;
    outline: none;
    font-size: 13px;
}

.alert-options .form-group input[type="date"]:focus {
    border-color: #4096ff;
}

.alert-options .form-group select {
    width: 100%;
    height: 38px;
    border: 1px solid #dce4f0;
    border-radius: 6px;
    padding: 0 10px;
    outline: none;
    font-size: 13px;
    background-color: #fff;
}

.turbine-section {
    background-color: #fff;
    border-radius: 6px;
    padding: 20px 24px;
    margin-top: 0;
    box-shadow: var(--card-shadow);
}

.turbine-section h4 {
    font-size: 15px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--menu-active-color);
    color: var(--menu-active-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.turbine-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
    font-size: 13px;
}

.turbine-summary span {
    border-radius: 4px;
    padding: 3px 12px;
    font-size: 12px;
}

.turbine-summary .done { background-color: #e6ffed; color: #389e0d; }
.turbine-summary .pending { background-color: #fffbe6; color: #d48806; }
.turbine-summary .none { background-color: #f5f5f5; color: #999; }

.turbine-table {
    font-size: 12px;
    width: 100%;
    border-collapse: collapse;
}

.turbine-table th {
    background-color: var(--table-head-bg);
    color: #555;
    font-weight: 600;
    font-size: 12px;
}

.turbine-table th,
.turbine-table td {
    padding: 5px 6px;
    text-align: center;
    border-bottom: 1px solid #f0f2f5;
    white-space: nowrap;
}

.turbine-table th:nth-child(1) { width: 75px; }
.turbine-table th:nth-child(2) { width: 75px; }
.turbine-table th:nth-child(3) { width: 120px; }
.turbine-table th:nth-child(4) { }
.turbine-table th:nth-child(5) { min-width: 170px; }
.turbine-table th:nth-child(6) { width: 133px; }

.turbine-status-done { color: #389e0d; font-weight: 600; }
.turbine-status-active { color: #d48806; font-weight: 600; }
.turbine-status-none { color: #999; }

.turbine-tabs {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.turbine-tab {
    padding: 3px 14px;
    border: 1px solid #d6e4f5;
    border-radius: 14px;
    cursor: pointer;
    font-size: 12px;
    color: #666;
    background-color: #f8fafd;
    transition: all 0.15s;
}

.turbine-tab:hover {
    border-color: var(--menu-active-color);
    color: var(--menu-active-color);
}

.turbine-tab.active {
    background-color: var(--menu-active-color);
    color: #fff;
    border-color: var(--menu-active-color);
}

#turbineDailyNote:focus { border-color: #4096ff; }

/* Toast提示 */
.toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 10px 24px;
    border-radius: 6px;
    color: #fff;
    font-size: 13px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    animation: toastIn 0.3s ease;
    white-space: nowrap;
}

.toast-success { background-color: #52c41a; }
.toast-warning { background-color: #faad14; }
.toast-error { background-color: #ff4d4f; }

@keyframes toastIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.component-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 24px;
    margin-bottom: 12px;
}

.component-detail-grid .form-group {
    margin-bottom: 0;
}

.comp-upload-row {
    display: flex;
    align-items: flex-end;
    gap: 10px;
}

.comp-upload-row input[type="text"] {
    flex: 1;
}

.comp-upload-btn {
    height: 36px;
    padding: 0 10px;
    font-size: 12px;
    border: 1px solid #dce4f0;
    border-radius: 4px;
    background-color: #fafafa;
    cursor: pointer;
    white-space: nowrap;
}

.comp-upload-btn:hover {
    border-color: #4096ff;
    color: #4096ff;
}

.comp-thumb {
    width: 60px;
    height: 60px;
    border-radius: 4px;
    border: 1px solid #eee;
    object-fit: cover;
    display: none;
    cursor: pointer;
}

.comp-thumb.show {
    display: block;
}

/* 大部件台账查看详情弹窗 */
.comp-view-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px 32px;
    margin-bottom: 20px;
}

.comp-view-field {
    display: flex;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px dashed #eee;
}

.comp-view-field:last-child {
    border-bottom: none;
}

.comp-view-label {
    color: #888;
    font-size: 13px;
    font-weight: 500;
    min-width: 90px;
    white-space: nowrap;
}

.comp-view-value {
    color: #1a1a1a;
    font-size: 14px;
    font-weight: 600;
    margin-left: 12px;
}

.comp-view-section {
    background-color: #f8fafd;
    border: 1px solid #e8ecf2;
    border-radius: 6px;
    padding: 16px 20px;
    margin-bottom: 16px;
}

.comp-view-section-title {
    font-size: 14px;
    font-weight: 600;
    color: #1a5fb4;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e0e6ed;
}

.comp-view-photo-row {
    display: flex;
    gap: 32px;
    flex-wrap: wrap;
}

.comp-view-photo-box {
    flex: 1;
    min-width: 200px;
}

.comp-view-sublabel {
    display: block;
    color: #888;
    font-size: 12px;
    margin-bottom: 4px;
}

.comp-view-photo-box .comp-view-value {
    margin-left: 0;
    margin-bottom: 8px;
}

.comp-view-photo-box .comp-thumb {
    width: 120px;
    height: 120px;
    border-radius: 6px;
    border: 1px solid #ddd;
    object-fit: cover;
    display: none;
    cursor: pointer;
    transition: transform 0.2s;
}

.comp-view-photo-box .comp-thumb:hover {
    transform: scale(1.05);
}

.comp-view-photo-box .comp-thumb.show {
    display: block;
}

/* 权限控制 - 非管理员隐藏操作元素 */
.hidden-for-user {
    display: none !important;
}

/* 项目明细表格 — 项目名称、当前进度居中 */
#listContent td:nth-child(4),
#listContent td:nth-child(6) {
    vertical-align: middle;
}

#listContent th:nth-child(5) {
    min-width: 100px;
}

/* 大部件更换台账表格居中 */
#componentView td {
    vertical-align: middle;
    text-align: center;
}

/* ===== 设备异动 — 编辑模态框 ===== */
.form-section-label {
    font-size: 14px;
    font-weight: 600;
    color: #1f1f1f;
    margin: 16px 0 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid #f0f0f0;
}
.anom-update-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}
.anom-update-fields {
    display: flex;
    gap: 8px;
    flex: 1;
}
.anom-update-fields input,
.anom-update-fields select {
    height: 34px;
    border: 1px solid #dce4f0;
    border-radius: 4px;
    padding: 0 8px;
    font-size: 13px;
    font-family: inherit;
    outline: none;
}
.anom-update-fields input:focus,
.anom-update-fields select:focus {
    border-color: #4096ff;
}
.anom-new-date { width: 130px; flex: none; }
.anom-new-operator { width: 100px; flex: none; }
.anom-new-content { flex: 1; }
.anom-new-status { width: 110px; flex: none; }
.anom-update-fields .form-group input,
.anom-update-fields .form-group select { width: auto; }
.anom-update-fields .anom-new-date { width: 130px; }
.anom-update-fields .anom-new-status { width: 110px; }
.btn-sm {
    padding: 6px 16px;
    font-size: 13px;
    height: 34px;
    white-space: nowrap;
}

/* ===== 设备异动 — 表格紧凑样式（9列防溢出） ===== */
#anomalyView > div:nth-child(2) {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
#anomalyView table {
    table-layout: fixed;
    width: 100%;
    min-width: 680px;
}
#anomalyView th,
#anomalyView td {
    padding: 6px 4px;
    font-size: 12px;
    vertical-align: middle;
    text-align: center;
}
#anomalyView th {
    white-space: normal;
}
#anomalyView td {
    white-space: nowrap;
}
/* 序号、期次、风机号、异动类型、异动状态 — 统一宽度 */
#anomalyView th:nth-child(1),
#anomalyView td:nth-child(1),
#anomalyView th:nth-child(2),
#anomalyView td:nth-child(2),
#anomalyView th:nth-child(3),
#anomalyView td:nth-child(3),
#anomalyView th:nth-child(4),
#anomalyView td:nth-child(4),
#anomalyView th:nth-child(8),
#anomalyView td:nth-child(8) { width: 60px; }
/* 异动时间 */
#anomalyView th:nth-child(7),
#anomalyView td:nth-child(7) { width: 96px; font-size: 11px; }
/* 操作 */
#anomalyView th:nth-child(9),
#anomalyView td:nth-child(9) { width: 84px; }
/* 异动内容、最近更新 — 自动伸缩，溢出截断 */
#anomalyView td:nth-child(5),
#anomalyView td:nth-child(6) {
    overflow: hidden;
    text-overflow: ellipsis;
}
#anomalyView .btn-small {
    padding: 2px 6px;
    font-size: 11px;
}

/* ===== 设备异动 — 变更记录表格（编辑弹窗内嵌） ===== */
.history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    min-width: 0;
    table-layout: auto;
}
.history-table th {
    background: #fafafa;
    padding: 10px 12px;
    text-align: center;
    font-weight: 600;
    color: #555;
    border-bottom: 2px solid #e8e8e8;
    font-size: 12px;
}
.history-table td {
    padding: 10px 12px;
    text-align: center;
    border-bottom: 1px solid #f0f0f0;
    color: #333;
    vertical-align: middle;
}
.history-table td:last-child {
    text-align: left;
}
.history-table tbody tr:hover {
    background: #fafafa;
}
.history-row-latest {
    background: #f6ffed;
}
.history-row-latest:hover {
    background: #eeffd8;
}
.history-badge {
    font-size: 10px;
    background: #52c41a;
    color: #fff;
    padding: 1px 5px;
    border-radius: 8px;
    font-weight: 600;
    vertical-align: middle;
    display: inline-block;
    line-height: 1.4;
}
.history-del {
    cursor: pointer;
    color: #ccc;
    font-size: 18px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 50%;
    transition: all 0.15s;
}
.history-del:hover {
    color: #fff;
    background: #ff4d4f;
}

/* 大部件台账 — 输入框紧凑保持一行，其余与异动管理一致 */
#compFilterSection .filter-item input,
#compFilterSection .filter-item select {
    min-width: 80px;
    width: 100px;
}
#compFilterSection .filter-item input[type="date"] {
    width: 90px;
    min-width: 90px;
}
#compFilterSection .dropdown-single {
    min-width: 80px;
}
#compFilterSection .dropdown-single .dropdown-toggle {
    min-width: 80px;
}
/* 按钮行：与异动管理 filter-btn-group 一致 */
.comp-filter-btns {
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 12px;
}

/* 统一 placeholder 颜色 */
.filter-item input::placeholder,
.form-group input::placeholder,
.dropdown-input::placeholder {
    color: #bbb;
}

/* select 下拉选择 placeholder 淡色 */
select.placeholder-light {
    color: #bbb;
}
select.placeholder-light option {
    color: #333;
}
select.placeholder-light option[value=""] {
    color: #bbb;
}

/* ===== 单选自定下拉 ===== */
.dropdown-single {
    position: relative;
}
.dropdown-single .dropdown-menu {
    min-width: 100%;
}
.dropdown-input {
    width: 100%;
    height: 34px;
    border: none !important;
    outline: none;
    padding: 0;
    font-size: 13px;
    font-family: inherit;
    background: transparent;
    color: #555;
    box-shadow: none !important;
    min-width: 0;
}
.dropdown-input:focus {
    border: none !important;
    box-shadow: none !important;
    outline: none;
}
.filter-item .dropdown-input,
.filter-item .dropdown-input:focus {
    border: none !important;
    box-shadow: none !important;
}
.dropdown-option {
    padding: 6px 10px;
    border-radius: 3px;
    cursor: pointer;
    white-space: nowrap;
    font-size: 13px;
}
.dropdown-option:hover {
    background-color: #f0f5fc;
}
.dropdown-option.selected {
    background-color: #e6f4ff;
    color: #1a5fb4;
    font-weight: 600;
}

/* ===== 遗留问题页面 ===== */
.leftover-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    min-width: 0;
}
.leftover-table th {
    background: var(--table-head-bg);
    padding: 10px 12px;
    text-align: center;
    font-weight: 600;
    color: #555;
    border-bottom: 1px solid var(--td-border);
    font-size: 13px;
}
.leftover-table td {
    padding: 10px 12px;
    text-align: center;
    border-bottom: 1px solid var(--td-border);
    vertical-align: middle;
}
.leftover-table th:nth-child(1) { width: 46px; }
.leftover-table td:nth-child(2),
.leftover-table td:nth-child(4),
.leftover-table td:nth-child(5) {
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 280px;
}
.leftover-table td:nth-child(4) { min-width: 200px; }
.leftover-progress-cell {
    text-align: center !important;
    vertical-align: middle !important;
}
.leftover-section-title:hover {
    background-color: #f8fafd;
    border-radius: 4px;
}
.leftover-arrow {
    font-size: 12px;
    color: #999;
    transition: transform 0.2s;
}

/* ===== 主页仪表盘 ===== */

#homeView {
    display: block;
    padding: 4px 0;
}

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

.home-header-title {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #334155;
    letter-spacing: 0.5px;
}

/* -- 风场总览 -- */
.home-total-card {
    background: linear-gradient(135deg, #fff 0%, #f8faff 100%);
    border-radius: 16px;
    padding: 20px 28px 20px;
    box-shadow:
        0 1px 3px rgba(0,0,0,0.03),
        0 4px 16px rgba(26,80,160,0.06);
    margin-bottom: 14px;
    border: 1px solid rgba(26,95,180,0.08);
}

.home-total-title {
    font-size: 11px;
    font-weight: 600;
    color: #8899b4;
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 16px;
}

.home-total-cols {
    display: flex;
    gap: 40px;
}

.home-total-col {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    gap: 22px;
}

.home-total-col:first-child::after {
    content: '';
    position: absolute;
    right: -20px;
    top: 5%;
    height: 90%;
    width: 1px;
    background: linear-gradient(to bottom, transparent, #e2e8f0, transparent);
}



/* 折叠面板 */
.collapse-header {
    user-select: none;
    -webkit-user-select: none;
    transition: color 0.15s;
}
.collapse-header:hover {
    color: #1a5fb4;
}
.collapse-arrow {
    font-size: 11px;
    margin-left: 6px;
    transition: transform 0.2s;
}

/* ===== 发电量录入弹窗 ===== */
.gen-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    min-width: 0;
}

.gen-table th {
    background: var(--table-head-bg);
    padding: 8px 10px;
    text-align: center;
    font-weight: 600;
    color: #555;
    border-bottom: 1px solid var(--td-border);
    font-size: 12px;
}

.gen-table td {
    padding: 8px 10px;
    text-align: center;
    border-bottom: 1px solid #f0f2f5;
    vertical-align: middle;
}

.gen-edit-table td {
    padding: 6px 8px;
}

.gen-edit-table input {
    width: 100%;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 7px 10px;
    font-size: 13px;
    text-align: center;
    outline: none;
    transition: border-color 0.15s;
    box-sizing: border-box;
}

.gen-edit-table input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59,130,246,0.1);
}

.gen-edit-table input::placeholder {
    color: #c0c8d2;
}



/* ===== 缺陷详情面板 ===== */
.defect-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 16px;
    margin-bottom: 12px;
    padding: 12px 14px;
    background: var(--color-background-secondary);
    border-radius: var(--border-radius-md);
}
.defect-info-item { font-size: 12px; }
.defect-info-item label { color: var(--color-text-secondary); display: block; margin-bottom: 2px; font-size: 11px; }
.defect-info-item span { color: var(--color-text-primary); font-weight: 500; font-size: 13px; }
.defect-info-full { font-size: 12px; margin-top: 6px; padding: 10px 14px; background: var(--color-background-secondary); border-radius: var(--border-radius-md); }
.defect-info-full label { color: var(--color-text-secondary); display: block; margin-bottom: 4px; font-size: 11px; }
.defect-info-full div { color: var(--color-text-primary); font-size: 13px; line-height: 1.5; }
.defect-section-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-primary);
    margin: 16px 0 8px;
    padding-bottom: 6px;
    border-bottom: 0.5px solid var(--color-border-tertiary);
}
.defect-photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 6px;
}
.defect-photo-grid img,
.defect-photo-grid video {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: var(--border-radius-md);
    border: 0.5px solid var(--color-border-tertiary);
    cursor: pointer;
}
.defect-photo-placeholder {
    padding: 16px;
    text-align: center;
    color: var(--color-text-tertiary);
    background: var(--color-background-secondary);
    border-radius: var(--border-radius-md);
    font-size: 12px;
}

/* ---- 全屏媒体查看器 ---- */

.media-viewer-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.92); z-index: 10000;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
}
.media-viewer-content {
    position: relative; display: flex; align-items: center;
    justify-content: center; width: 100%; height: 100%;
}
.media-viewer-content img,
.media-viewer-content video {
    user-select: none; -webkit-user-select: none; touch-action: none;
}
.media-viewer-close {
    position: absolute; top: 16px; right: 24px;
    width: 40px; height: 40px;
    background: rgba(255,255,255,0.15); border: none;
    border-radius: 50%; color: #fff; font-size: 28px;
    line-height: 38px; text-align: center; cursor: pointer;
    z-index: 10001; transition: background 0.2s;
}
.media-viewer-close:hover { background: rgba(255,255,255,0.3); }
.media-viewer-loading {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%); z-index: 10001;
    color: #fff; font-size: 14px; text-align: center;
}
.media-viewer-spinner {
    width: 40px; height: 40px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top-color: #fff; border-radius: 50%;
    animation: media-spin 0.8s linear infinite;
    margin: 0 auto 8px;
}
@keyframes media-spin { to { transform: rotate(360deg); } }
.media-viewer-nav {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 48px; height: 48px;
    background: rgba(255,255,255,0.15); border: none;
    border-radius: 50%; color: #fff; font-size: 22px;
    line-height: 46px; text-align: center; cursor: pointer;
    z-index: 10001; transition: background 0.2s;
}
.media-viewer-nav:hover { background: rgba(255,255,255,0.3); }
.media-viewer-nav:disabled { cursor: default; }
.media-viewer-prev { left: 16px; }
.media-viewer-next { right: 16px; }
.media-viewer-toolbar {
    position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%);
    display: flex; gap: 12px; z-index: 10001;
    background: rgba(0,0,0,0.5); border-radius: 24px; padding: 8px 16px;
}
.media-viewer-tool {
    width: 44px; height: 44px;
    background: rgba(255,255,255,0.15); border: none;
    border-radius: 50%; color: #fff; font-size: 20px;
    line-height: 44px; text-align: center; cursor: pointer;
    transition: background 0.2s;
}
.media-viewer-tool:hover { background: rgba(255,255,255,0.3); }

/* ============ 页内弹窗（替代原生 confirm/prompt）============ */
.dlg-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20000;
}
.dlg-box {
    width: 380px;
    max-width: 90vw;
    background: #fff;
    border-radius: 8px;
    padding: 20px 22px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}
.dlg-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}
.dlg-msg {
    font-size: 14px;
    color: #555;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}
.dlg-input {
    width: 100%;
    margin-top: 12px;
    border: 1px solid #dce4f0;
    border-radius: 6px;
    padding: 8px 10px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    outline: none;
    box-sizing: border-box;
}
.dlg-input:focus { border-color: #3b82c4; }
.dlg-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 18px;
}
.dlg-btn {
    padding: 7px 18px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    border: 1px solid transparent;
}
.dlg-cancel { background: #f5f5f5; color: #666; border-color: #e0e0e0; }
.dlg-cancel:hover { background: #ececec; }
.dlg-ok { background: #3b82c4; color: #fff; }
.dlg-ok:hover { background: #2055a0; }

/* ============ 列表分页控件 ============ */
.list-pager {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 6px;
    padding: 12px 2px 2px;
    font-size: 12px;
    color: #666;
}
.list-pager button {
    padding: 4px 10px;
    border: 1px solid #dce4f0;
    background: #fff;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    color: #555;
}
.list-pager button:hover:not(:disabled) {
    border-color: #3b82c4;
    color: #3b82c4;
}
.list-pager button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ============ 首页：渐变圆环总览 ============ */
.col-ring-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
}
.col-label {
    font-size: 12px;
    color: #8899b4;
    font-weight: 600;
    margin-top: 10px;
    margin-bottom: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}
.col-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    display: inline-block;
}
.ring-wrap {
    position: relative;
    display: inline-block;
}
.ring-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    text-align: center;
}
.ring-center .rc-pct {
    font-weight: 800;
    line-height: 1;
    letter-spacing: -1px;
    color: #1e293b;
}
.ring-center .rc-pct.over {
    color: #f59e0b;
}
.ring-center .rc-over {
    font-size: 11px;
    font-weight: 700;
    color: #f59e0b;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 999px;
    padding: 2px 9px;
    line-height: 1.2;
}
.ring-wrap.over {
    filter: drop-shadow(0 0 6px rgba(245, 158, 11, 0.35));
}
.ring-prog {
    transition: stroke-dashoffset 1.1s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.data-card {
    flex: 0 0 48%;
    max-width: 200px;
    display: flex;
    flex-direction: column;
    gap: 9px;
    min-width: 0;
}
.data-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8faff;
    border: 1px solid #eef2f8;
    border-radius: 10px;
    padding: 9px 14px;
}
.data-row .dl {
    font-size: 12px;
    color: #64748b;
}
.data-row .dv {
    font-size: 15px;
    font-weight: 700;
}

/* ============ 首页：各期总览卡片 ============ */
.home-period-section {
    background: linear-gradient(135deg, #fff 0%, #f8faff 100%);
    border-radius: 16px;
    padding: 20px 28px 20px;
    box-shadow:
        0 1px 3px rgba(0,0,0,0.03),
        0 4px 16px rgba(26,80,160,0.06);
    margin-top: 14px;
    border: 1px solid rgba(26,95,180,0.08);
}
.home-period-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.home-period-title {
    font-size: 11px;
    font-weight: 700;
    color: #8899b4;
    text-transform: uppercase;
    letter-spacing: 3px;
}
.home-metric-toggle {
    display: inline-flex;
    border: 1px solid #c7d4e6;
    border-radius: 9px;
    overflow: hidden;
}
.home-metric-toggle button {
    border: 0;
    background: #fff;
    padding: 6px 16px;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: all 0.15s;
}
.home-metric-toggle button.active {
    background: #2a6dc9;
    color: #fff;
}
.home-leaderboard {
    padding: 2px 0;
}
.lb-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 4px;
    border-bottom: 1px solid #f1f5f9;
}
.lb-row:last-child {
    border-bottom: 0;
}
.lb-rank {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #eef2f8;
    color: #64748b;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.lb-rank.top {
    background: #2a6dc9;
    color: #fff;
}
.lb-name {
    width: 88px;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    flex-shrink: 0;
}
.lb-bar {
    flex: 1;
    height: 14px;
    border-radius: 7px;
    background: #eef1f6;
    position: relative;
}
.lb-fill {
    display: block;
    height: 100%;
    border-radius: 7px;
    transition: width 1s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.lb-fill.over {
    background: repeating-linear-gradient(45deg, #f59e0b, #f59e0b 8px, #fbbf24 8px, #fbbf24 16px) !important;
}
.lb-goal-line {
    position: absolute;
    top: -2px;
    right: 0;
    width: 2px;
    height: calc(100% + 4px);
    background: #cbd5e1;
    border-radius: 1px;
}
.lb-pct {
    width: 56px;
    text-align: right;
    font-size: 13px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
    white-space: nowrap;
}
.lb-pct.over {
    color: #f59e0b;
}
.lb-tip {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(30,41,59,0.95);
    color: #fff;
    font-size: 11px;
    line-height: 1;
    padding: 5px 10px;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.12s ease;
    z-index: 20;
    box-shadow: 0 4px 12px rgba(0,0,0,0.18);
}
.lb-bar:hover .lb-tip {
    opacity: 1;
}

/* ============ 缺陷库：筛选行 + 列表卡片 ============ */
/* 搜索框并入第一行，长度收窄（原为独占一行的 flex:1 长条） */
.filter-item.search-item input {
    width: 140px;
    min-width: 0;
}

.defect-list-card {
    background: #fff;
    border-radius: 10px;
    border: 1px solid rgba(26, 95, 180, 0.06);
    box-shadow: var(--card-shadow);
    overflow: hidden;
}
.defect-list-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    border-bottom: 1px solid #f1f5f9;
}
.defect-list-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
    color: #1e293b;
}
.defect-list-title::before {
    content: "";
    width: 3px;
    height: 13px;
    border-radius: 2px;
    background: var(--btn-primary);
}
.defect-list-hint {
    font-size: 12px;
    color: #94a3b8;
}
.defect-list-body {
    overflow-x: auto;
}
.defect-list-card .defect-main-table thead th {
    padding: 9px 10px;
    font-size: 12px;
    color: #64748b;
}
.defect-list-card .defect-main-table tbody td {
    padding: 10px;
}
.defect-list-card .defect-main-table tbody tr {
    transition: background 0.12s;
}
.defect-list-card .defect-main-table tbody tr:hover {
    background: #f8fbff;
}
.defect-list-pager {
    border-top: 1px solid #f1f5f9;
}
.defect-list-pager .list-pager {
    padding: 8px 16px;
}

/* 缺陷库筛选行：各筛选项按可用宽度自动分配，保证 6 项 + 搜索在一行
   （真实下拉因内部 input 默认宽度会撑到 ~186px，这里统一改为可伸缩） */
#defectView .filter-section {
    gap: 8px 10px;
}
#defectView .filter-section .filter-item {
    min-width: 0;
}
#defectView .filter-section .filter-item:not(.search-item) {
    flex: 1 1 108px;
    max-width: 210px;
}
/* 处理进度标签多两个字，单独多给一点基准宽度 */
#defectView .filter-section .filter-item.wide-item {
    flex-basis: 132px;
}
#defectView .filter-section .filter-item.search-item {
    flex: 0 0 auto;
}
#defectView .filter-section .filter-item > input,
#defectView .filter-section .filter-item .dropdown-single {
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
}
#defectView .filter-section .dropdown-toggle {
    width: 100%;
    min-width: 0;
}
#defectView .filter-section .dropdown-input {
    width: 100%;
    min-width: 0;
}

/* ============ 大部件台账 / 异动管理：列表卡片（无标题条） ============ */
.list-card {
    background: #fff;
    border-radius: 10px;
    border: 1px solid rgba(26, 95, 180, 0.06);
    box-shadow: var(--card-shadow);
    overflow: hidden;
}
.list-card-body {
    overflow-x: auto;
}
.list-card table thead th {
    background: #f5f9ff;
    color: #64748b;
    font-size: 12px;
    padding: 9px 10px;
}
.list-card table tbody td {
    padding: 10px;
}
.list-card table tbody tr {
    transition: background 0.12s;
}
.list-card table tbody tr:hover {
    background: #f8fbff;
}
.list-card-pager {
    border-top: 1px solid #f1f5f9;
    padding: 0 14px;
}
