* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'SimSun', 'KaiTi', 'Microsoft YaHei', 'PingFang SC', serif;
    background: #FAF5EB;
    color: #3B2A1A;
    min-height: 100vh;
}

.container {
    max-width: 640px;
    margin: 0 auto;
    padding: 16px;
}

.header {
    text-align: center;
    padding: 24px 0 16px;
}

.header h1 {
    font-size: 28px;
    color: #8B0000;
    letter-spacing: 4px;
    font-weight: bold;
}

.subtitle {
    font-size: 13px;
    color: #B8860B;
    margin-top: 4px;
    letter-spacing: 2px;
}

/* Tab 切换 */
.tab-bar {
    display: flex;
    border-bottom: 2px solid #D4A853;
    margin-bottom: 16px;
}

.tab-btn {
    flex: 1;
    padding: 12px;
    font-size: 15px;
    font-weight: bold;
    border: none;
    background: transparent;
    color: #888;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
}

.tab-btn.active {
    color: #8B0000;
    border-bottom-color: #8B0000;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* 卡片 */
.card {
    background: #FFF8F0;
    border: 1px solid #D4A853;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 16px;
}

/* 表单 */
.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    font-size: 13px;
    color: #8B0000;
    font-weight: bold;
    margin-bottom: 6px;
}

.input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #D4A853;
    border-radius: 6px;
    font-size: 15px;
    font-family: inherit;
    background: #FFFAF0;
    color: #3B2A1A;
    outline: none;
    transition: border-color 0.2s;
}

.input:focus {
    border-color: #8B0000;
}

select.input {
    cursor: pointer;
}

/* 模式切换 */
.mode-toggle {
    display: flex;
    gap: 0;
    margin-bottom: 16px;
    border: 1px solid #D4A853;
    border-radius: 6px;
    overflow: hidden;
}

.mode-btn {
    flex: 1;
    padding: 10px;
    font-size: 14px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: bold;
}

.mode-btn.active {
    background: #8B0000;
    color: #F5D080;
}

.mode-btn:not(.active) {
    background: transparent;
    color: #3B2A1A;
}

/* 按钮 */
.btn-primary {
    width: 100%;
    padding: 14px;
    background: #8B0000;
    color: #F5D080;
    border: none;
    border-radius: 8px;
    font-size: 17px;
    font-weight: bold;
    cursor: pointer;
    letter-spacing: 4px;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: #6B0000;
}

.btn-primary:disabled {
    background: #888;
    color: #ccc;
    cursor: not-allowed;
}

/* 状态文字 */
.status-text {
    text-align: center;
    padding: 12px;
    font-size: 14px;
    color: #8B0000;
    margin-top: 8px;
}

/* 进度点 */
.dots {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 8px;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #E0D5C0;
    transition: background 0.3s;
}

.dot.done {
    background: #8B0000;
}

/* 手动排盘行 */
.manual-row {
    display: flex;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid #F0E6D0;
}

.manual-label {
    font-weight: bold;
    color: #8B0000;
    font-size: 13px;
    min-width: 48px;
}

.manual-option {
    flex: 1;
    text-align: center;
    padding: 8px 4px;
    margin: 0 2px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    background: #F0E6D0;
    color: #3B2A1A;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.manual-option.selected {
    background: #8B0000;
    color: #F5D080;
    font-weight: bold;
}

/* Loading */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 20px;
    color: #8B0000;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 3px solid #D4A853;
    border-top-color: #8B0000;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 结果区域 */
#liuyao-result, #bazi-result {
    margin-top: 8px;
}

/* ===== 逐爻起卦新增样式 ===== */

/* 进度点 */
#progDots {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin: 16px 0;
}
#progDots .dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #d4c8b0;
    border: 1px solid #8B0000;
    transition: background 0.3s;
}
#progDots .dot.done {
    background: #8B0000;
}

/* 手动模式爻选项 */
.yao-label {
    width: 50px;
    font-weight: bold;
    color: #5c1010;
    font-size: 14px;
}
.yao-option {
    flex: 1;
    padding: 6px 4px;
    border: 1px solid #c0a060;
    background: #faf5eb;
    color: #3b2a1a;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    text-align: center;
}
.yao-option.selected {
    background: #8B0000;
    color: #f5d080;
    border-color: #8B0000;
    font-weight: bold;
}

/* 模式切换按钮 */
.mode-toggle button.active {
    background: #8B0000;
    color: #f5d080;
    border-color: #8B0000;
}
