/* 
 * SLITE MONITORING - 基础样式
 * 仅包含布局、动画、功能类，不包含颜色定义
 */

/* --- 基础样式定义 --- */
body { 
    margin: 0;
    font-family: "SF Mono", "Monaco", "Inconsolata", "微软雅黑", "宋体", sans-serif; 
}
.border-custom { border: 1px solid; }
.label-v { 
    font-size: 10px; 
    text-transform: uppercase; 
    font-weight: bold; 
    letter-spacing: 0.1em; 
}

/* 动画定义 */
.status-pulse { animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .5; } }

@keyframes breathe {
    0% { opacity: 0.4; }
    50% { opacity: 1; text-shadow: 0 0 5px currentColor; }
    100% { opacity: 0.4; }
}

.status-dot-green {
    display: inline-block;
    margin-right: 4px;
    animation: breathe 2s infinite ease-in-out;
}

/* 滚动条 */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-thumb { border: none; }

/* --- 展开详情容器 --- */
.detail-container { 
    position: relative; 
    z-index: 10; 
    margin-top: 0; 
    box-shadow: 0 2px 3px rgba(0,0,0,0.05); 
    border-left: 1px solid;
    border-right: 1px solid;
    border-bottom: 1px solid;
}
.grid-row.expanded { border-bottom: 1px solid; }

/* --- 节点信息组件 --- */
.id-badge { 
    font-size: 7px !important; 
    font-family: monospace; 
    padding: 0px 3px; 
    border: 1px solid; 
    margin-left: 4px; 
    display: inline-block; 
}
.meta-tag { 
    font-size: 7px !important; 
    padding: 0 3px; 
    border: 1px solid; 
    margin-right: 3px; 
    font-weight: bold; 
    line-height: 1.2; 
    height: fit-content; 
    display: inline-block; 
}
.node-info-wrapper { 
    display: flex; 
    flex-direction: column; 
    justify-content: center; 
    flex: 1; 
    font-size: 10px !important; 
    line-height: 1.3; 
}
.node-info-wrapper .node-name { 
    font-size: 10px !important; 
    font-weight: 600; 
    display: block; 
}
.node-info-wrapper .node-meta { 
    font-size: 8px !important; 
    margin-top: 2px; 
    display: block; 
}
.status-dot { 
    width: 6px; 
    height: 6px; 
    flex-shrink: 0; 
    margin-right: 8px; 
    position: relative; 
    top: 0px; 
}

/* --- 主列表表格布局 --- */
.grid-header { 
    display: grid; 
    grid-template-columns: 2fr 1fr 1fr 1fr 1.5fr 1.5fr 1.5fr 1fr 1fr 1fr; 
    gap: 0; 
    border: 1px solid; 
    font-size: 9px; 
    font-weight: black; 
    text-transform: uppercase; 
    padding: 4px 0; 
    margin-bottom: 10px; 
}
.grid-header > div { 
    padding: 0 8px; 
    height: 100%; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    border-left: 1px solid; 
}
.grid-header > div:first-child { border-left: none; }

.grid-row { 
    display: grid; 
    grid-template-columns: 2fr 1fr 1fr 1fr 1.5fr 1.5fr 1.5fr 1fr 1fr 1fr; 
    gap: 0; 
    font-size: 11px; 
    border: 1px solid; 
    transition: background-color 0.2s; 
    margin-bottom: 2px; 
}
.grid-cell { 
    padding: 8px; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    justify-content: center; 
    border-left: 1px solid; 
    min-height: 60px; 
    line-height: 1.5; 
}
.grid-cell:first-child { 
    border-left: none; 
    display: flex; 
    flex-direction: row; 
    align-items: center; 
    justify-content: flex-start; 
    padding: 4px 12px; 
    gap: 0; 
    text-align: left; 
}

/* --- 进度条与百分比 --- */
.percent-box { 
    width: 90%; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    justify-content: center; 
    font-family: monospace; 
    font-weight: bold; 
    font-size: 11px; 
    gap: 4px; 
}
.percent-text { line-height: 1; font-weight: bold; }
.percent-progress { 
    width: 100%; 
    height: 4px; 
    overflow: hidden; 
    border-radius: 0 !important; 
    display:block; 
}
.percent-progress > div { 
    height:100%; 
    width:0; 
    border-radius:0 !important; 
}

/* --- 探测列表布局 --- */
.task-list-title { 
    font-size: 10px; 
    text-transform: uppercase; 
    font-weight: bold; 
    letter-spacing: 0.1em; 
    margin-bottom: 10px; 
    margin-top: 10px; 
    width: 100%; 
}
.task-list-container { 
    border: 1px solid; 
    overflow: hidden; 
    width: 100%; 
    margin:0; 
    padding:0; 
}

.task-list-header, .task-item { 
    display: grid; 
    grid-template-columns: 15% 15% 10% 10% 10% 10% 10% 20%; 
    padding: 0; 
    align-items: stretch; 
    width: 100%; 
    margin:0; 
}

.task-list-header { 
    border-bottom: 1px solid; 
    font-size: 9px; 
    font-weight: bold; 
    letter-spacing: 0.05em; 
    height: 36px;
}

/* 单元格全局基础样式 */
.task-list-header > div, .task-item > div {
    display: flex;
    align-items: center;
    justify-content: center;
    border-left: 1px solid;
    padding: 0 8px;
    text-align: center;
}
.task-list-header > div:first-child, .task-item > div:first-child { border-left: none; }

.task-name { 
    font-weight: 600; 
    justify-content: center !important;
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis; 
}

.task-status-cell { justify-content: center !important; }

.task-item { 
    border-bottom: 1px solid; 
    font-size: 10px; 
    cursor: pointer; 
    transition: all 0.2s; 
    min-height: 44px;
}
.task-item:last-child { border-bottom: none; }

.task-item.active { border-left: none; }

.task-status { 
    padding: 3px 6px; 
    border: 1px solid; 
    font-size: 9px; 
    font-weight: bold; 
    border-radius: 2px; 
    display: inline-block;
}

/* --- Docker 布局 --- */
.docker-box { display: flex; flex-direction: column; gap: 10px; }
.docker-summary { 
    display: grid; 
    grid-template-columns: repeat(8, 1fr); 
    gap: 4px; 
    padding: 8px 10px; 
    border: 1px solid; 
}
.docker-summary-item { text-align: center; padding: 2px 0; }
.docker-summary-label { 
    font-size: 7px; 
    margin-bottom: 1px; 
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis; 
}
.docker-summary-value { 
    font-size: 10px; 
    font-weight: bold; 
    font-family: monospace; 
}
.docker-cards-container { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); 
    gap: 8px; 
}
.docker-card { border: 1px solid; padding: 10px; transition: all 0.2s; }
.docker-card-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 8px; 
    padding-bottom: 4px; 
    border-bottom: 1px dashed; 
}
.docker-card-name { 
    font-size: 11px; 
    font-weight: bold; 
    overflow: hidden; 
    text-overflow: ellipsis; 
    flex: 1; 
}
.docker-card-status { 
    font-size: 8px; 
    padding: 1px 4px; 
    border: 1px solid; 
}
.docker-card-metrics { 
    display: flex; 
    flex-direction: column; 
    gap: 4px; 
    font-size: 9px; 
}
.docker-card-metric { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    width: 100%; 
}

/* --- 在线统计与热力图布局 --- */
.uptime-stats-panel { margin-top: 8px; padding-top: 8px; width:100%; }
.heatmap-wrap { width:100%; display: flex; flex-direction: column; gap: 12px; }
.heatmap-calendar { display: grid; grid-template-columns: repeat(10, 1fr); gap: 6px; width:100%; }
.heatmap-item { 
    border: 1px solid; 
    padding:6px 2px; 
    text-align:center; 
    font-size:9px; 
    min-height:50px; 
    display:flex; 
    flex-direction:column; 
    justify-content:center;
}

.uptime-new-metrics { 
    display: grid; 
    grid-template-columns: repeat(3, 1fr); 
    gap: 10px; 
    width:100%; 
    margin-top: 8px; 
}
.uptime-card { border: 1px solid; padding: 10px; }
.uptime-card-value { 
    font-size: 16px; 
    font-weight: bold; 
    font-family: monospace; 
}
.uptime-progress { 
    width:100%; 
    height:6px; 
    border:1px solid; 
}
.uptime-progress-bar { height:100%; }

/* --- 设置与管理按钮 --- */
.setting-box { 
    position: fixed; 
    top:15px; 
    right:15px; 
    z-index:99; 
    border:1px solid; 
    padding:6px 10px; 
    font-size:10px; 
    cursor: pointer; 
}
.admin-btn { 
    position: fixed; 
    top:15px; 
    right:140px; 
    z-index:99; 
    border:1px solid; 
    padding:6px 10px; 
    font-size:10px; 
    cursor: pointer; 
}

/* --- 基础功能类 --- */
[v-cloak] { display: none !important; }
.task-list-outer-border { border: 1px solid !important; }

.heatmap-wrapper {
    position: relative;
    padding-top: 10px;
    padding-bottom: 25px;
}

.heatmap-label-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 7px;
    font-weight: 900;
    white-space: nowrap;
    color: #fff;
    pointer-events: none;
    z-index: 5;
}

.heatmap-label-bottom {
    position: absolute;
    bottom: -18px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 8px;
    font-family: monospace;
    white-space: nowrap;
}

.heatmap-bar:hover { z-index: 10; }
.heatmap-bar { display: flex; align-items: center; justify-content: center; }

.chart-container, .task-list-container {
    border: 1px solid !important;
    box-sizing: border-box;
}

.uptime-day {
    position: relative;
    width: 38px !important;
    height: 38px !important;
    margin: 1px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    line-height: 1.1;
    text-align: center;
    color: #fff;
    white-space: pre-line;
    border-radius: 2px;
    cursor: default;
}
.uptime-day:hover::after { display: none !important; }

/* 动画类 */
.animate-in { animation-duration: 300ms; animation-fill-mode: both; }
.fade-in { animation-name: fadeIn; }
.slide-in-from-top-2 { animation-name: slideInFromTop2; }
.duration-300 { animation-duration: 300ms; }

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* --- 登录页面基础样式 --- */
.bg-pattern {
    background-image: radial-gradient(currentColor 0.5px, transparent 0.5px);
    background-size: 10px 10px;
    opacity: 0.05;
}

.login-container {
    position: relative;
    border: 1px solid;
    padding: 2rem 2.5rem;
    background: inherit;
}

.login-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: currentColor;
}

.login-title {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    margin-bottom: 0.5rem;
    text-align: center;
}

.login-subtitle {
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    text-align: center;
}

.login-input {
    width: 100%;
    border: 1px solid;
    padding: 1rem;
    font-size: 0.875rem;
    font-family: monospace;
    text-align: center;
    outline: none;
    transition: all 0.2s;
}

.login-input:focus {
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
}

.login-button {
    width: 100%;
    border: 1px solid;
    padding: 1rem;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.3em;
    transition: all 0.2s;
}

.login-button:hover:not(:disabled) {
    background-color: currentColor;
    color: #ffffff;
}

.login-button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.login-error {
    background-color: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    padding: 0.75rem;
    font-size: 10px;
    font-weight: bold;
    color: #ef4444;
    text-align: center;
    letter-spacing: -0.025em;
}

.login-footer {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid;
    text-align: center;
}

.login-footer-text {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    margin-bottom: 1rem;
}

.login-footer-link {
    font-size: 10px;
    font-weight: bold;
    border-bottom: 2px solid;
    padding-bottom: 0.125rem;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    transition: all 0.2s;
}

.login-footer-link:hover {
    background-color: currentColor;
    color: #ffffff;
}

.login-page-footer {
    margin-top: 2rem;
    text-align: center;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    line-height: 1.6;
}

.login-page-footer span {
    opacity: 0.5;
}

/* 滚动条美化 */
* {
    scrollbar-width: thin;
}

/* 选择文本 */
::selection {
    color: #ffffff;
}

/* --- 响应式适配 --- */
@media (max-width: 1200px) {
    .task-list-header, .task-item { grid-template-columns: 15% 15% 10% 10% 10% 10% 10% 20%; }
    .heatmap-calendar { grid-template-columns: repeat(6, 1fr); }
}
@media (max-width: 768px) {
    .task-list-header, .task-item { grid-template-columns: 40px 1fr 60px 70px 70px 60px; }
    .task-list-header > div:nth-child(5), .task-item > div:nth-child(5),
    .task-list-header > div:nth-child(6), .task-item > div:nth-child(6),
    .task-list-header > div:nth-child(7), .task-item > div:nth-child(7) { display: none; }
    
    .grid-header, .grid-row { grid-template-columns: 1.5fr repeat(5, 1fr); }
    .grid-header > div:nth-child(n+7), .grid-row > .grid-cell:nth-child(n+7) { display: none; }
    
    .uptime-new-metrics { grid-template-columns: 1fr; }
    .docker-summary { grid-template-columns: repeat(2,1fr); }
    .admin-btn { right: auto; left: 15px; top: 15px; }
}