/* 全局样式 - 90年代复古工具软件风格 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "SimSun", "Microsoft YaHei", "宋体", sans-serif;
    background-color: #e8e8e8;
    color: #000;
    font-size: 12px;
    line-height: 1.5;
}

.main-container {
    width: 100%;
    max-width: 1024px;
    margin: 0 auto;
    background-color: #fff;
    min-height: 100vh;
}

/* ========== 顶部区域：功能设置区 ========== */
.top-section {
    padding: 10px 15px;
    border-bottom: 1px solid #999;
    background-color: #f0f0f0;
}

.main-title {
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    color: #000080;
    margin-bottom: 15px;
    padding: 5px 0;
}

/* 表单行样式 */
.form-row {
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.time-row {
    justify-content: space-between;
}

.params-row {
    justify-content: flex-start;
}

.info-row {
    justify-content: flex-start;
}

.form-group-inline {
    display: flex;
    align-items: center;
    gap: 5px;
}

.right-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.form-label {
    color: #000080;
    font-size: 12px;
    white-space: nowrap;
}

/* 下拉选择框和输入框样式 */
select, input[type="text"], input[type="number"] {
    font-family: "SimSun", "Microsoft YaHei", "宋体", sans-serif;
    font-size: 12px;
    padding: 2px 4px;
    border: 1px solid #999;
    background-color: #fff;
}

select {
    min-width: 60px;
}

input[type="text"] {
    min-width: 100px;
}

input[type="number"] {
    width: 80px;
}

/* 主按钮样式 - 绿色背景 */
.btn-primary {
    font-family: "SimSun", "Microsoft YaHei", "宋体", sans-serif;
    font-size: 13px;
    padding: 5px 15px;
    background-color: #008000;
    color: #fff;
    border: 2px outset #00a000;
    cursor: pointer;
    white-space: nowrap;
}

.btn-primary:hover {
    background-color: #006600;
}

.btn-primary:active {
    border-style: inset;
}

/* 小按钮样式 */
.btn-small {
    font-family: "SimSun", "Microsoft YaHei", "宋体", sans-serif;
    font-size: 12px;
    padding: 3px 10px;
    background-color: #d4d0c8;
    color: #000;
    border: 2px outset #fff;
    cursor: pointer;
    margin-right: 5px;
}

.btn-small:hover {
    background-color: #c0c0c0;
}

.btn-small:active {
    border-style: inset;
}

/* 复选框标签 */
.checkbox-label {
    font-size: 11px;
    color: #333;
    white-space: nowrap;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    margin-right: 3px;
}

/* 真太阳时输入行 */
.true-solar-row {
    padding: 5px 0;
    margin-left: 80px;
}

/* ========== 中间区域：核心展示区 ========== */
.middle-section {
    padding: 10px 15px;
    min-height: 400px;
}

/* 标签切换栏 */
.tab-bar {
    display: flex;
    gap: 0;
    margin-bottom: 10px;
    border-bottom: 2px solid #000080;
}

.tab-item {
    padding: 5px 10px;
    color: #0000ff;
    cursor: pointer;
    font-size: 12px;
    border: 1px solid transparent;
    border-bottom: none;
    background-color: #e8e8e8;
    white-space: nowrap;
}

.tab-item:hover {
    background-color: #d0d0d0;
}

.tab-item.active {
    color: #000080;
    font-weight: bold;
    background-color: #fff;
    border: 1px solid #999;
    border-bottom: 2px solid #fff;
    margin-bottom: -2px;
}

/* 标签内容区 */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* 九宫格容器 */
.jiugong-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2px;
    max-width: 700px;
    margin: 0 auto;
    background-color: #999;
    border: 1px solid #999;
}

/* 单个宫位 */
.gong {
    background-color: #fff;
    border: 1px solid #ccc;
    padding: 8px;
    min-height: 140px;
    position: relative;
}

.gong-header {
    font-size: 12px;
    font-weight: bold;
    color: #000080;
    text-align: center;
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid #ddd;
}

.gong-content {
    font-size: 11px;
}

.gong-row {
    margin-bottom: 3px;
    line-height: 1.4;
}

.gong-label {
    color: #666;
    font-size: 11px;
}

.gong-value {
    color: #000;
    cursor: help;
}

/* 九星颜色 */
.star-tianpeng { color: #0000ff; }
.star-tianren { color: #008000; }
.star-tianchong { color: #ff0000; }
.star-tianfu { color: #800080; }
.star-tianying { color: #ff8000; }
.star-tianrui { color: #666; }
.star-tianzhu { color: #008080; }
.star-tianxin { color: #ff6600; }
.star-tianqin { color: #006666; }

/* 八门颜色 */
.door-xiu { color: #0000ff; }
.door-sheng { color: #008000; }
.door-shang { color: #ff0000; }
.door-du { color: #800080; }
.door-jing { color: #ff8000; }
.door-si { color: #666; }
.door-jing2 { color: #008080; }
.door-kai { color: #ff6600; }

/* 八神颜色 */
.god-zhifu { color: #ff6600; font-weight: bold; }
.god-tengshe { color: #ff0000; }
.god-taiyin { color: #800080; }
.god-liuhe { color: #0000ff; }
.god-baihu { color: #666; }
.god-xuanwu { color: #000; }
.god-jiudi { color: #008000; }
.god-jiutian { color: #ff8000; }

/* 三奇六仪颜色 */
.yi-ding { color: #ff0000; }
.yi-bing { color: #ff8000; }
.yi-yi { color: #008000; }
.yi-wu { color: #ff6600; }
.yi-ji { color: #666; }
.yi-geng { color: #800080; }
.yi-xin { color: #008080; }
.yi-ren { color: #0000ff; }
.yi-gui { color: #000; }

/* 特殊标记 */
.kongwang {
    color: #ff0000;
    font-weight: bold;
}

.maxing {
    color: #ff8000;
    font-weight: bold;
}

/* 占位提示 */
.gong-placeholder {
    grid-column: 1 / -1;
    text-align: center;
    padding: 50px;
    color: #999;
    font-size: 14px;
}

/* 基本信息文本区 */
.basic-info-text {
    background-color: #f8f8f8;
    border: 1px solid #999;
    padding: 10px;
    font-family: "SimSun", "Microsoft YaHei", "宋体", monospace;
    font-size: 12px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 400px;
    overflow-y: auto;
}

#copyBasicBtn {
    margin-top: 10px;
}

/* 分析文本区 */
.analysis-text {
    background-color: #f8f8f8;
    border: 1px solid #999;
    padding: 10px;
    max-height: 400px;
    overflow-y: auto;
}

.analysis-text p {
    margin-bottom: 10px;
    line-height: 1.6;
}

.analysis-text h4 {
    color: #000080;
    font-size: 13px;
    margin: 15px 0 8px 0;
    padding-bottom: 3px;
    border-bottom: 1px solid #ddd;
}

/* ========== 底部区域：说明与版权区 ========== */
.bottom-section {
    padding: 10px 15px;
    border-top: 1px solid #999;
    background-color: #f0f0f0;
}

.usage-instruction {
    margin-bottom: 10px;
}

.instruction-title {
    color: #ff0000;
    font-size: 13px;
    font-weight: bold;
    margin-bottom: 5px;
}

.instruction-text {
    color: #000;
    font-size: 12px;
    line-height: 1.6;
    text-indent: 2em;
}

.copyright {
    margin-bottom: 10px;
}

.copyright p {
    color: #ff0000;
    font-size: 12px;
    line-height: 1.5;
}

.action-buttons {
    display: flex;
    gap: 5px;
    justify-content: flex-end;
    padding-top: 5px;
    border-top: 1px solid #ccc;
}

/* ========== Tooltip提示框 ========== */
.tooltip {
    position: fixed;
    z-index: 1000;
    background-color: #ffffcc;
    border: 1px solid #000;
    padding: 8px 10px;
    font-size: 11px;
    max-width: 250px;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.3);
    pointer-events: none;
}

.tooltip-title {
    font-weight: bold;
    color: #000080;
    margin-bottom: 5px;
    border-bottom: 1px solid #ccc;
    padding-bottom: 3px;
}

.tooltip-content {
    color: #000;
    line-height: 1.4;
}

/* ========== Loading遮罩 ========== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999;
}

.loading-overlay p {
    background-color: #fff;
    padding: 15px 25px;
    border: 1px solid #999;
    font-size: 13px;
}

/* ========== 已保存案例列表 ========== */
.saved-cases-container {
    background-color: #f8f8f8;
    border: 1px solid #999;
    padding: 10px;
    max-height: 400px;
    overflow-y: auto;
}

.case-item {
    background-color: #fff;
    border: 1px solid #ccc;
    padding: 8px;
    margin-bottom: 8px;
    cursor: pointer;
}

.case-item:hover {
    background-color: #e8e8e8;
}

.case-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

.case-title {
    font-weight: bold;
    color: #000080;
}

.case-time {
    color: #666;
    font-size: 11px;
}

.case-preview {
    color: #333;
    font-size: 11px;
}

.case-actions {
    margin-top: 5px;
    display: flex;
    gap: 5px;
}

.no-cases {
    text-align: center;
    color: #999;
    padding: 30px;
}

/* ========== 响应式适配 ========== */
@media (max-width: 1024px) {
    .main-container {
        width: 100%;
    }

    .form-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .right-controls {
        width: 100%;
        justify-content: space-between;
    }

    .tab-bar {
        flex-direction: column;
    }

    .tab-item {
        border: 1px solid #999;
        margin-bottom: 2px;
    }

    .tab-item.active {
        border-bottom: 1px solid #999;
    }

    .jiugong-grid {
        max-width: 100%;
    }

    .gong {
        min-height: 120px;
        padding: 5px;
    }
}

@media (max-width: 768px) {
    .main-title {
        font-size: 16px;
    }

    .top-section,
    .middle-section,
    .bottom-section {
        padding: 8px 10px;
    }

    .form-group-inline {
        flex-wrap: wrap;
    }

    .gong {
        min-height: 100px;
        font-size: 10px;
    }

    .gong-header {
        font-size: 11px;
    }

    .gong-content {
        font-size: 10px;
    }
}
