/* san_ui.css */

/* 通用 San UI 容器 */
.san-widget-container {
    position: relative;
    display: inline-block;
    z-index: 2000;
}

/* 主 UI 条 */
.san-widget-bar {
    position: relative;
    width: 320px;
    height: 56px;
    /* 背景：暗红渐变，模仿铁链/石纹质感 */
    background: linear-gradient(180deg, #2d1b1b 0%, #1a0a0a 100%);
    border: 2px solid #5c3a3a; /* 暗红边框 */
    border-radius: 28px;
    display: flex;
    align-items: center;
    padding: 0 6px;
    box-shadow:
        0 0 10px rgba(0,0,0,0.8),
        inset 0 0 20px rgba(0,0,0,0.8),
        0 0 5px rgba(139, 0, 0, 0.3);
    cursor: pointer;
    transition: transform 0.1s;
}

.san-widget-bar:hover {
    border-color: #8b4a4a;
    box-shadow: 0 0 15px rgba(139, 0, 0, 0.5);
}

.san-widget-bar:active {
    transform: scale(0.98);
}

/* 大眼睛容器 */
.san-eye-box {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #000;
    border: 2px solid #8b0000;
    box-shadow: 0 0 10px #ff0000;
    position: relative;
    overflow: hidden;
    margin-right: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* 眼睛动画（纯CSS绘制） */
.san-eye-pupil {
    width: 14px;
    height: 14px;
    background: #ff3333;
    border-radius: 50%;
    box-shadow: 0 0 5px #fff inset, 0 0 10px #f00;
    animation: eyeScan 5s infinite ease-in-out;
}

/* 眼睛阶段样式：根据 class 变化 */
.san-eye-box.stage-normal .san-eye-pupil { background: #00ff00; box-shadow: 0 0 5px #fff inset, 0 0 10px #0f0; }
.san-eye-box.stage-warning .san-eye-pupil { background: #ffff00; box-shadow: 0 0 5px #fff inset, 0 0 10px #ff0; }
.san-eye-box.stage-danger .san-eye-pupil { background: #ff0000; box-shadow: 0 0 5px #fff inset, 0 0 10px #f00; animation: eyePanic 0.5s infinite; }
.san-eye-box.stage-madness .san-eye-pupil { background: #880000; width: 6px; height: 6px; animation: eyeMad 0.2s infinite; }

@keyframes eyeScan {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(4px, 0); }
    50% { transform: translate(0, 2px); }
    75% { transform: translate(-4px, -1px); }
}

@keyframes eyePanic {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.3); }
}

@keyframes eyeMad {
    0% { transform: translate(1px, 1px); }
    25% { transform: translate(-1px, -1px); }
    50% { transform: translate(-1px, 1px); }
    75% { transform: translate(1px, -1px); }
    100% { transform: translate(1px, 1px); }
}

/* 数值区域 */
.san-info-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin-right: 10px;
}

.san-value-row {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.san-val-current {
    font-size: 20px;
    font-weight: bold;
    color: #eee;
    font-family: 'Courier New', monospace;
    text-shadow: 0 0 5px rgba(255, 0, 0, 0.5);
}

.san-val-max {
    font-size: 12px;
    color: #888;
}

/* 进度条 */
.san-progress-track {
    width: 100%;
    height: 6px;
    background: #111;
    border-radius: 3px;
    margin-top: 4px;
    overflow: hidden;
    border: 1px solid #333;
}

.san-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #8b0000, #ff4444);
    width: 100%;
    transition: width 0.3s ease-out;
    box-shadow: 0 0 5px rgba(255, 0, 0, 0.5);
}

/* 飘字动画 */
.san-float-text {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 24px;
    font-weight: bold;
    pointer-events: none;
    opacity: 0;
    z-index: 2001;
}

.san-float-text.gain {
    color: #00ff00;
    text-shadow: 0 0 5px #000;
    animation: floatUpGain 2s forwards;
}

.san-float-text.loss {
    color: #ff0000;
    text-shadow: 0 0 5px #000;
    animation: floatUpLoss 2s forwards;
}

@keyframes floatUpGain {
    0% { opacity: 0; transform: translate(-50%, 10px); }
    20% { opacity: 1; transform: translate(-50%, -10px); }
    100% { opacity: 0; transform: translate(-50%, -40px); }
}

@keyframes floatUpLoss {
    0% { opacity: 0; transform: translate(-50%, 10px) scale(1); }
    20% { opacity: 1; transform: translate(-50%, -10px) scale(1.2); }
    100% { opacity: 0; transform: translate(-50%, -40px) scale(1); }
}

/* === 详情面板 === */
.san-detail-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 500px;
    background: #0f0a0a url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0IiBoZWlnaHQ9IjQiPgo8cmVjdCB3aWR0aD0iNCIgaGVpZ2h0PSI0IiBmaWxsPSIjMWExYTFhIi8+CjxwYXRoIGQ9Ik0wIDBMNCA0Wk00IDBMMCA0WiIgc3Ryb2tlPSIjMjIyIiBzdHJva2Utd2lkdGg9IjAuNSIgb3BhY2l0eT0iMC4yIi8+Cjwvc3ZnPg=='); /* 噪点纹理 */
    border: 3px solid #5a2a2a;
    border-radius: 8px;
    padding: 20px;
    z-index: 3000;
    color: #ccc;
    box-shadow: 0 0 50px rgba(0,0,0,0.9);
    display: none;
    font-family: serif;
}

.san-detail-modal.active {
    display: block;
    animation: modalPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes modalPop {
    from { transform: translate(-50%, -60%) scale(0.9); opacity: 0; }
    to { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

.san-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #444;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.san-detail-title {
    font-size: 24px;
    color: #e74c3c;
    text-shadow: 0 0 5px rgba(231, 76, 60, 0.3);
}

.san-help-btn {
    background: none;
    border: 1px solid #666;
    color: #888;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
}
.san-help-btn:hover { color: #fff; border-color: #fff; }

.san-cards-row {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.san-stat-card {
    flex: 1;
    background: rgba(40, 20, 20, 0.5);
    border: 1px solid #4a2a2a;
    padding: 15px;
    border-radius: 4px;
    text-align: center;
}

.san-card-label {
    font-size: 14px;
    color: #aaa;
    margin-bottom: 5px;
}

.san-card-value {
    font-size: 20px;
    color: #ffd700;
    font-weight: bold;
}

.san-log-box {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #333;
    height: 150px;
    overflow-y: auto;
    padding: 10px;
    font-size: 13px;
    line-height: 1.6;
}

.san-log-item {
    border-bottom: 1px dashed #222;
    padding: 4px 0;
}
.san-log-time { color: #666; margin-right: 5px; }
.san-log-reason { color: #aaa; }
.san-log-val { float: right; font-weight: bold; }
.san-log-val.pos { color: #0f0; }
.san-log-val.neg { color: #f00; }

.san-close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    color: #666;
    font-size: 24px;
    cursor: pointer;
}
.san-close-btn:hover { color: #fff; }

/* 规则弹窗 (Tooltip) */
.san-rules-tooltip {
    position: absolute;
    top: 60px;
    right: 20px;
    width: 280px;
    background: #222;
    border: 1px solid #666;
    padding: 15px;
    z-index: 3001;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    display: none;
    font-size: 13px;
    line-height: 1.5;
    color: #ccc;
}
.san-rules-tooltip h4 { margin-top: 0; color: #ffd700; }

/* Home page positioning */
.home-san-pos {
    /* 替换原有的位置 */
    margin-bottom: 20px;
}
