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

body {
    background: linear-gradient(135deg, #f0f7f3 0%, #e3f0e9 100%);
    color: #333;
    min-height: 100vh;
    padding: 20px;
    line-height: 1.6;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 10px;
}

header {
    text-align: center;
    margin-bottom: 25px;
    padding: 25px 20px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    box-shadow: 0 8px 25px rgba(44, 110, 73, 0.15);
    position: relative;
    overflow: hidden;
    border: 1px solid #d4e8d9;
}

header::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, #2c6e49, #4daa7d, #2c6e49);
    border-radius: 5px 5px 0 0;
}

h1 {
    font-size: 2.2rem;
    margin-bottom: 10px;
    color: #2c6e49;
    font-weight: 700;
    position: relative;
}

h1 i {
    margin-right: 12px;
    background: #eaf4ef;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #2c6e49;
    box-shadow: 0 3px 8px rgba(0,0,0,0.1);
}

.subtitle {
    font-size: 1.05rem;
    color: #4a7a60;
    max-width: 100%;
    margin: 15px auto 0;
    padding: 10px 20px;
    background: #f0f7f3;
    border-radius: 30px;
    display: inline-block;
    border: 1px dashed #a8d0bb;
}

.main-content {
    display: flex;
    flex-direction: column;
    gap: 25px;
    margin-bottom: 20px;
}

.input-section, .result-section, .pan-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 5px 15px rgba(44, 110, 73, 0.08);
    border: 1px solid #d4e8d9;
    position: relative;
}

h2 {
    color: #2c6e49;
    margin-bottom: 18px;
    padding-bottom: 10px;
    border-bottom: 2px solid #eaf4ef;
    font-size: 1.4rem;
    font-weight: 600;
    display: flex;
    align-items: center;
}

h2 i {
    margin-right: 10px;
    background: #eaf4ef;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #2c6e49;
}

.input-group {
    margin-bottom: 18px;
}

.input-row {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.input-row .input-group {
    flex: 1;
    min-width: 200px;
    margin-bottom: 0;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #4a7a60;
    font-size: 0.95rem;
}

select {
    width: 100%;
    padding: 13px 15px;
    border-radius: 10px;
    border: 1px solid #cde4d7;
    background: #f8fcf9;
    color: #2c6e49;
    font-size: 1.05rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232c6e49' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 16px;
}

select:focus {
    border-color: #2c6e49;
    outline: none;
    box-shadow: 0 0 0 3px rgba(44, 110, 73, 0.15);
}

button {
    width: 100%;
    padding: 15px;
    background: linear-gradient(to right, #2c6e49, #3d8b63);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
    box-shadow: 0 4px 10px rgba(44, 110, 73, 0.25);
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(44, 110, 73, 0.35);
}

button:active {
    transform: translateY(0);
}

button i {
    margin-right: 8px;
}

.current-values {
    display: flex;
    gap: 15px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.current-card {
    flex: 1;
    min-width: 120px;
    background: linear-gradient(to bottom, #f0f7f3, #e3f0e9);
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    border: 1px solid #d4e8d9;
    box-shadow: 0 3px 8px rgba(0,0,0,0.05);
}

.current-card h3 {
    color: #4a7a60;
    margin-bottom: 8px;
    font-size: 0.9rem;
    font-weight: 500;
}

.current-card .value {
    font-size: 1.6rem;
    font-weight: bold;
    color: #2c6e49;
    letter-spacing: 1px;
}

.pan-header {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

.pan-header-item {
    flex: 1;
    min-width: calc(50% - 10px);
    text-align: center;
    padding: 15px 10px;
    background: linear-gradient(to bottom, #f0f7f3, #e3f0e9);
    border-radius: 10px;
    border: 1px solid #d4e8d9;
    box-shadow: 0 3px 8px rgba(0,0,0,0.05);
}

.pan-header-item h3 {
    color: #4a7a60;
    font-size: 0.9rem;
    margin-bottom: 8px;
    font-weight: 500;
}

.pan-header-item .value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #2c6e49;
    margin-bottom: 5px;
}

.pan-header-item div {
    font-size: 0.8rem;
    color: #6a8a7a;
}

.pan-table {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    border-collapse: collapse;
    table-layout: fixed;
    background: #fff;
    border: 2px solid #d4e8d9;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.pan-table td {
    width: 25%;
    height: 85px;
    text-align: center;
    vertical-align: middle;
    position: relative;
    border: 1px solid #e1efe7;
    background: #fff;
    transition: all 0.3s ease;
}

.pan-table td:hover {
    background: #f8fcf9;
}

.pan-table .tianpan1 {
    color: #2c6e49;
    font-size: 1.8rem;
    font-weight: bold;
    display: block;
    margin-top: 5px;
    line-height: 1.2;
}

.pan-table .tianpan2 {
    position: absolute;
    left: 6px;
    bottom: 6px;
    font-size: 0.9rem;
    color: #d35400;
    font-weight: bold;
}

.pan-table .tianpan2.circle {
    color: #e74c3c;
}

.pan-table .dipan {
    position: absolute;
    right: 6px;
    bottom: 6px;
    font-size: 0.9rem;
    color: #7a9c8a;
    font-weight: 500;
}

.pan-table td.center {
    background: #eaf4ef;
}

.pan-table .center div {
    color: #2c6e49;
    font-weight: bold;
    font-size: 1.1rem;
}

.pan-table .center .sub {
    color: #7a9c8a;
    margin-top: 8px;
    font-size: 0.9rem;
    font-weight: 500;
}

.result-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-top: 10px;
}

.result-card {
    background: linear-gradient(135deg, #eaf4ef 0%, #d6ece2 100%);
    border-radius: 12px;
    padding: 25px 15px;
    border: 1px solid #cde4d7;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    text-align: center;
}

.result-card h3 {
    color: #4a7a60;
    margin-bottom: 15px;
    font-size: 1.1rem;
    font-weight: 500;
}

.result-value {
    font-size: 3rem;
    font-weight: bold;
    text-align: center;
    color: #2c6e49;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
    letter-spacing: 3px;
}

.result-desc {
    font-size: 1rem;
    color: #4a7a60;
    margin-top: 15px;
    line-height: 1.5;
}

.result-desc strong {
    color: #2c6e49;
    font-weight: 600;
}

.explanation {
    background: #f8fcf9;
    border-radius: 12px;
    padding: 15px;
    margin-top: 15px;
    border-left: 4px solid #4daa7d;
}

.explanation h4 {
    color: #2c6e49;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
}

.explanation h4 i {
    margin-right: 8px;
}

.explanation p {
    color: #5c7e6c;
    font-size: 0.9rem;
    line-height: 1.5;
}

.legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.85rem;
    color: #5c7e6c;
}

.legend-color {
    width: 15px;
    height: 15px;
    border-radius: 3px;
}

.legend-tian1 {
    background: #2c6e49;
}

.legend-tian2 {
    background: #d35400;
}

.legend-circle {
    color: #e74c3c;
    font-weight: bold;
}

.legend-dipan {
    background: #7a9c8a;
}

/* 汗瘥法结果样式 */
.hancuo-result {
    background: #f8fcf9;
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
    border: 1px solid #cde4d7;
}

.hancuo-title {
    display: flex;
    align-items: center;
    color: #2c6e49;
    margin-bottom: 15px;
}

.hancuo-title i {
    margin-right: 10px;
    font-size: 1.2rem;
}

.hancuo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.hancuo-card {
    background: white;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 3px 8px rgba(0,0,0,0.05);
    border: 1px solid #e1efe7;
}

.hancuo-card h4 {
    color: #4a7a60;
    margin-bottom: 10px;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
}

.hancuo-card h4 i {
    margin-right: 5px;
}

.hancuo-value {
    font-size: 1.6rem;
    font-weight: bold;
    color: #d35400;
    text-align: center;
    margin: 10px 0;
}

.hancuo-days {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
}

.hancuo-day {
    background: #eaf4ef;
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: bold;
    color: #2c6e49;
}

.hancuo-sentence {
    font-style: italic;
    color: #5c7e6c;
    margin-top: 15px;
    padding: 10px;
    background: #f0f7f3;
    border-radius: 8px;
    text-align: center;
}

/* 棺墓法样式 */
.guanmu-result {
    background: #f8fcf9;
    border-radius: 12px;
    padding: 25px;
    margin-top: 25px;
    border: 1px solid #cde4d7;
    border-left: 4px solid #4daa7d;
}

.guanmu-title {
    display: flex;
    align-items: center;
    color: #2c6e49;
    margin-bottom: 20px;
}

.guanmu-title i {
    margin-right: 10px;
    font-size: 1.3rem;
}

.guanmu-steps {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 3px 8px rgba(0,0,0,0.05);
    border: 1px solid #e1efe7;
}

.step {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px dashed #d4e8d9;
}

.step:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.step-number {
    background: #2c6e49;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 15px;
    flex-shrink: 0;
}

.step-content {
    flex: 1;
    color: #4a7a60;
}

.step-content strong {
    color: #2c6e49;
    font-weight: 600;
}

.guanmu-final {
    background: linear-gradient(to right, #3d8b63, #2c6e49);
    color: white;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    margin-top: 20px;
}

.guanmu-verse {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 15px;
    letter-spacing: 1px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

.guanmu-interpretation {
    font-size: 0.95rem;
    opacity: 0.9;
}

.example-section {
    background: #f0f7f3;
    border-radius: 12px;
    padding: 15px;
    margin-top: 20px;
    border-left: 4px solid #d35400;
}

.example-section h4 {
    color: #d35400;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

.example-section h4 i {
    margin-right: 8px;
}

.example-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 10px;
}

.example-card {
    background: white;
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    border: 1px solid #d4e8d9;
}

.example-card h5 {
    color: #2c6e49;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.example-card p {
    color: #5c7e6c;
    font-size: 0.85rem;
    line-height: 1.4;
}

/* 主病行流法结果区域样式 - 已修复 */
.zhubing-result {
    background: #f8fcf9;
    border-radius: 12px;
    padding: 25px;
    margin-top: 25px;
    border: 1px solid #cde4d7;
    border-left: 4px solid #4daa7d;
    overflow: hidden; /* 防止内容溢出 */
}

.zhubing-title {
    display: flex;
    align-items: center;
    color: #2c6e49;
    margin-bottom: 20px;
}

.zhubing-title i {
    margin-right: 10px;
    font-size: 1.3rem;
}

.zhubing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.zhubing-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 3px 8px rgba(0,0,0,0.05);
    border: 1px solid #e1efe7;
    overflow: hidden; /* 防止内容溢出 */
    min-width: 0; /* 允许卡片收缩 */
}

.zhubing-card h4 {
    color: #4a7a60;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eaf4ef;
    display: flex;
    align-items: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.zhubing-card h4 i {
    margin-right: 8px;
    flex-shrink: 0; /* 防止图标被压缩 */
}

.zhubing-value {
    font-size: 1.8rem;
    font-weight: bold;
    color: #2c6e49;
    text-align: center;
    margin: 15px 0;
    word-break: break-word; /* 长文本换行 */
}

.zhubing-desc {
    font-size: 1rem;
    color: #5c7e6c;
    line-height: 1.6;
    overflow-wrap: break-word; /* 防止长文本溢出 */
}

.zhubing-desc strong {
    color: #2c6e49;
    font-weight: 600;
}

.xieqi-result {
    background: linear-gradient(to right, #3d8b63, #2c6e49);
    color: white;
    border-radius: 10px;
    padding: 20px;
    margin-top: 20px;
}

.xieqi-title {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 10px;
    text-align: center;
}

.xieqi-content {
    font-size: 1.1rem;
    text-align: center;
    line-height: 1.5;
}

/* 步骤样式 */
.zhubing-steps {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin-top: 20px;
    box-shadow: 0 3px 8px rgba(0,0,0,0.05);
    border: 1px solid #e1efe7;
}

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.input-section, .pan-section, .result-section {
    animation: fadeIn 0.5s ease-out;
}

.result-card, .hancuo-result, .guanmu-result, .zhubing-result {
    animation: fadeIn 0.7s ease-out;
}

footer {
    text-align: center;
    margin-top: 30px;
    padding: 20px 0;
    color: #5c7e6c;
    font-size: 0.85rem;
    border-top: 1px solid #d4e8d9;
}

/* 移动端适配 */
@media (min-width: 600px) {
    .container {
        max-width: 540px;
    }
    
    .pan-header-item {
        min-width: calc(25% - 12px);
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .result-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .zhubing-grid {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 768px) {
    .container {
        max-width: 720px;
    }
    
    .pan-table {
        max-width: 500px;
    }
    
    .zhubing-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 992px) {
    .container {
        max-width: 960px;
    }
    
    .zhubing-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 480px) {
    .zhubing-grid {
        grid-template-columns: 1fr;
    }
    
    .zhubing-card {
        padding: 15px;
    }
    
    .zhubing-value {
        font-size: 1.5rem;
    }
}