:root { --chat-font-size: 16px; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif; background-image: url('bg.gif'); color: #333; margin: 0; padding: 0; }
body.result-page { line-height: 1.6; margin: 20px; background-color: #f4f7f6; }
.tarot-visual-card { width: 100%; aspect-ratio: 2 / 3.4; background: #000000; border: 2px solid #d4af37; border-radius: 6px; display: flex; justify-content: center; align-items: center; box-shadow: 2px 2px 5px rgba(0,0,0,0.3); overflow: hidden; }
.tarot-icon-img { font-size: 36px; line-height: 1; transition: transform 0.3s; }
.tarot-icon-flipped { transform: rotate(180deg); }
.tarot-text-info { margin-top: 8px; text-align: center; width: 100%; line-height: 1.3; }
.tarot-card-name { display: block; font-size: 13px; font-weight: bold; color: #333; }
.tarot-card-status { display: block; font-size: 11px; margin-top: 2px; }
.tarot-interactive-area { text-align: center; padding: 10px 0; }
.tarot-spread-container { display: flex; justify-content: center; gap: 10px; flex-wrap: nowrap; }
.tarot-card-wrapper { flex: 1; max-width: 90px; display: flex; flex-direction: column; align-items: center; }
.tarot-flip-container { width: 100%; perspective: 1000px; aspect-ratio: 2 / 3.4; cursor: pointer; }
.tarot-flip-inner { position: relative; width: 100%; height: 100%; transition: transform 0.6s; transform-style: preserve-3d; }
.tarot-flip-container.flipped .tarot-flip-inner { transform: rotateY(180deg); }
.tarot-face { position: absolute; width: 100%; height: 100%; -webkit-backface-visibility: hidden; backface-visibility: hidden; border-radius: 6px; display: flex; align-items: center; justify-content: center; }
.tarot-back { background: linear-gradient(135deg, #2c3e50 0%, #000000 100%); border: 2px solid #fff; color: #ffd700; font-size: 24px; }
.tarot-front { transform: rotateY(180deg); background: #000000; border: 2px solid #d4af37; }
.tarot-interactive-text { opacity: 0; transition: opacity 0.5s ease-in; margin-top: 5px; }
.tarot-flip-container.flipped + .tarot-interactive-text { opacity: 1; }
.tarot-result-spread { display: flex; justify-content: center; gap: 6px; padding: 0 4px; margin-top: 10px; }
.tarot-result-item { flex: 1; max-width: 90px; display: flex; flex-direction: column; align-items: center; animation: popIn 0.5s ease-out; }
.tarot-pos-label { font-size: 12px; color: #666; margin-bottom: 4px; font-weight: bold; }
@media screen and (max-width: 400px) {
.tarot-icon-img { font-size: 28px; }
.tarot-card-name { font-size: 12px; }
.tarot-card-status { font-size: 10px; }
}
@keyframes blink {
  0% { opacity: 0.7; }
  50% { opacity: 1; }
  100% { opacity: 0.2; }
}
/* 動態生成的元素樣式 */
.dynamic-star {
    animation: fadeIn 0.5s;
    display: block; /* 讓流曜垂直排列 */
    font-size: 11px;
    margin-bottom: 1px;
}

.si-hua-marker-vertical.dynamic {
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* 區分大限與流年四化的形狀 */
.si-hua-liunian {
    border-radius: 50%; /* 流年圓形 */
    border: 1px solid #fff;
    box-shadow: 0 0 2px rgba(0,0,0,0.5);
}

.si-hua-daxian {
    border-radius: 0; /* 大限方形 */
    transform: rotate(45deg); /* 或菱形 */
    font-size: 9px;
    width: 14px;
    height: 14px;
    line-height: 14px;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes popIn {
    from { transform: scale(0); }
    to { transform: scale(1); }
}
@media screen and (max-width: 768px) {
    .year-controller {
        display: none !important;
    }
}
#divine-visual-container { padding: 15px; background: #fefefe; border: 3px solid #888888; border-radius: 8px; margin-top: 5px; text-align: center; min-height: 200px; }
#yao-stack { display: flex; flex-direction: column-reverse; align-items: center; margin: 10px auto; min-height: 160px; justify-content: flex-start; }
.yao-row { display: flex; align-items: center; justify-content: center; width: 100%; max-width: 280px; margin: 4px 0; opacity: 1; animation: slideInYao 0.5s forwards; }
@keyframes slideInYao { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.yao-symbol { width: 100px; height: 20px; margin-right: 15px; display: flex; justify-content: space-between; }
.yao-line { height: 100%; background-color: #333; border-radius: 2px; box-shadow: 1px 1px 2px rgba(0,0,0,0.2); }
.yang-bar { width: 100%; }
.yin-bar { width: 42%; }
.moving-line { background-color: #d32f2f; }
.yao-text-label { width: 100px; text-align: left; font-weight: bold; font-size: 12.5px; color: #000; font-family: "Microsoft JhengHei", sans-serif; }
.hex-result-header { font-size: 1.3em; font-weight: bold; color: #005a9c; margin-top: 20px; padding-top: 15px; border-top: 1px dashed #ccc; line-height: 1.8; animation: fadeInResult 1s forwards; }
@keyframes fadeInResult { from { opacity: 0; } to { opacity: 1; } }
.intro-tabs { display: flex; gap: 5px; margin-bottom: 10px; border-bottom: 2px solid #eee; padding-bottom: 5px; }
.intro-tab-btn { background: transparent; border: none; padding: 5px 12px; font-size: 14px; color: #777; cursor: pointer; border-radius: 20px; font-weight: bold; transition: all 0.3s ease; }
.intro-tab-btn:hover { background-color: #f0f0f0; color: #333; }
.intro-tab-btn.active { background-color: #e3f2fd; color: #005a9c; border: 1px solid #b3e5fc; }
.intro-content-item { animation: fadeIn 0.3s ease-in-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
.intro-list { list-style: none; padding-left: 5px; margin: 10px 0; }
.intro-list li { position: relative; padding-left: 20px; margin-bottom: 6px; color: #444; }
.intro-list li::before { content: '✨'; position: absolute; left: 0; top: 0; font-size: 12px; }
.highlight-badge { display: inline-block; background-color: #fff3cd; color: #856404; padding: 1px 6px; border-radius: 4px; font-size: 0.9em; font-weight: bold; margin: 0 2px; border: 1px solid #ffeeba; }
.hex-result-header { font-size: 1.2em; font-weight: bold; color: #005a9c; margin-top: 15px; padding-top: 10px; border-top: 1px dashed #ccc; line-height: 1.6; }
.star-emoji-decoration { font-size: 10px; line-height: 1; margin-top: 1px; text-align: center; }
.star-sha-icon { font-size: 10px; line-height: 1; margin-top: 0px; text-align: center; }
.star-small-icon { font-size: 10px; }
.changsheng-icon { font-size: 10px; }
.solar-time-section { display: none; width: 100%; background: #e8f4fc; padding: 8px; border-radius: 8px; border: 1px dashed #005a9c; margin-top: 5px; grid-column: 1 / -1; flex-wrap: wrap; gap: 5px; align-items: center; }
.solar-time-section.active { display: flex; }
.solar-toggle-label { font-size: 12px; color: #005a9c; cursor: pointer; display: flex; align-items: center; width: auto !important; margin-left: 5px; }
.re-chart-form { max-width: 768px; margin: 20px auto; padding: 10px; background: #fff; border: 1px solid #ddd; border-radius: 12px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05); display: block; }
.grid-section { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; justify-content: center; }
.grid-section label { font-size: 12px; color: #333; margin-right: 0px; }
.grid-section input, .grid-section select { padding: 3px 2px; font-size: 12px; border: 1px solid #ccc; border-radius: 5px; background: #fdfdfd; }
.grid-section input[name="userName"], .grid-section input[name="userNameB"] { width: 60px; }
.grid-section input[type="number"] { width: 48px; }
.grid-section select { width: auto; min-width: 50px; }
#partner-inputs { margin-top: 15px; background-color: #fff0f0; border: 1px solid #ffcccc; border-radius: 8px; padding: 10px; width: 100%; box-sizing: border-box; }
.re-chart-form button[type="submit"] { background: #555; color: white; border: none; padding: 10px 20px; cursor: pointer; font-size: 13px; font-weight: 500; border-radius: 5px; transition: background 0.3s; margin-top: 15px; display: block; width: 100%; }
.re-chart-form button:hover { background: #333; }
.palace-changsheng-group { position: absolute; top: 74px; right: 27px; display: flex; flex-direction: row; align-items: center; gap: 3px; white-space: nowrap; z-index: 10; }
.boshi-name { font-size: 11px; color: #226EA1; }
.changsheng-name { font-size: 12px; color: #666; }
@media screen and (max-width: 768px) {
.palace-changsheng-group { top: 50px; right: 15px; }
}
.palace-changsheng { position: absolute; top: 76px; right: 50px; bottom: auto; left: auto; font-size: 11px; color: #555; font-weight: normal; padding: 0; line-height: 1; z-index: 5; background: transparent; }
.palace-gods-right { position: absolute; top: 63px; right: 0px; display: flex; flex-direction: column; align-items: flex-end; gap: 1px; z-index: 6; pointer-events: none; width: 25px; }
.palace-liunian-right { position: absolute; top: 25.5px; right: 0px; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; z-index: 6; pointer-events: none; width: 25px; }
.palace-gods-right { position: absolute; top: 100px; right: 122px; display: flex; flex-direction: row; align-items: center; gap: 2px; z-index: 5; pointer-events: none; width: auto; }
.god-star-text { font-size: 11px; color: #033314; white-space: nowrap; font-weight: normal; }
@media screen and (max-width: 768px) {
.palace-gods-right { top: 140px; right: 15px; gap: 3px; }
}
.palace-daxian-layer { position: absolute; top: 76px; right: 0px; display: flex; flex-direction: column; align-items: flex-end; gap: 1px; z-index: 7; pointer-events: none; width: auto; }
.daxian-star-flat { font-size: 11px; color: #00008B; line-height: 1.0; white-space: nowrap; margin-right: 1px; background: transparent; }
@media screen and (max-width: 768px) {
.palace-daxian-layer { top: 110px; right: 45px; }
.liunian-star-flat { top: 130px; right: 45px; }
.palace-liunian-right { top: 80px; right: 15px; }
}
.minggong { background: #fffbe6; }
.shengong { background: #f0f9ff; }
.palace-bottom-left { position: absolute; bottom: 2px; left: 1px; display: flex; flex-direction: row; flex-wrap: wrap; gap: 2px; max-width: 85%; pointer-events: none; z-index: 15; }
.liunian-star-flat { font-size: 11px; color: #993100; line-height: 1.0; white-space: nowrap; margin-right: 1px; font-weight: normal; background: transparent; }
.palace-stars { display: flex; flex-direction: row; flex-wrap: wrap; gap: 0px; align-content: flex-start; justify-content: flex-start; margin-top: 1px; width: 100%; min-height: 65px; padding-left: 0px; }
.star-vertical-group { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; width: auto; min-width: 0.5em; margin-bottom: 1px; margin-right: 0.9px; position: relative; }
.star-name { writing-mode: vertical-rl; text-orientation: upright; line-height: 0; letter-spacing: 0px; text-align: center; white-space: nowrap; }
.liunian-star-text { font-size: 11px; font-weight: bold; color: #e67e22; line-height: 1; background-color: #fff3e0; border-radius: 5px; padding: 1px 0; }
.major-star-text { font-size: 13px; font-weight: bold; color: #263494; line-height: 1.1; }
.minor-star { font-size: 12.5px; color: #555; line-height: 1.0; }
.ji-star-tag-text { font-size: 13px; font-weight: bold; color: #B02E1A; line-height: 1.1; }
.sha-star-tag-text { font-size: 13px; font-weight: bold; color: #424242; line-height: 1.1; }
.star-brightness { font-size: 10.2px; color: #333; margin-top: 0.5px; height: auto; line-height: 1; text-align: center; width: 100%; }
.star-sihua-box { display: flex; flex-direction: column; gap: 0px; align-items: center; width: 100%; margin-top: 0px; }
.si-hua-marker-vertical { display: flex; align-items: center; justify-content: center; width: 13px; height: 13px; color: white !important; font-weight: 700; font-size: 10px; line-height: 1; cursor: pointer; }
@media screen and (max-width: 768px) {
.palace-stars { gap: 0px; }
.star-vertical-group { margin-right: 4px; }
.major-star-text { font-size: 15px; }
.star-name { letter-spacing: 1px; }
}
.si-hua-life { border-radius: 50%; }
.si-hua-daxian { border-radius: 1px; }
.si-hua-liunian { border-radius: 0; border: 1px solid #fff; color: #fff !important; background-color: inherit; font-weight: 900; opacity: 1; }
.si-hua-liuyue { border-radius: 50%; border: 1px dashed #e65100; color: #e65100 !important; background: transparent; }
.chart-container { display: grid; grid-template-columns: repeat(4, 1fr); max-width: 800px; margin: 20px auto; border: 1px solid #ccc; border-radius: 12px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05); background: #fff; }
.palace-cell { border: 1px solid #ddd; padding: 5px; min-height: 105px; font-size: 11px; position: relative; line-height: 1.4; cursor: pointer; }
.pos-si { border-top-left-radius: 8px; }
.pos-shen { border-top-right-radius: 8px; }
.pos-yin { border-bottom-left-radius: 8px; }
.pos-hai { border-bottom-right-radius: 8px; }
.palace-name { font-weight: bold; font-size: 13.5px; color: #005a9c; }
.palace-tag { display: inline-block; padding: 0 1px; margin-left: 2px; font-size: 11px; font-weight: bold; border-radius: 3px; line-height: 1.0; white-space: nowrap; }
.palace-tag.tag-shen { background: #007bff; color: white; }
.palace-tag.tag-laiyin { background: #106604; color: white; }
.palace-tag.tag-liunian, .palace-tag.tag-liuyue { background: #780AAB; color: white; }
.palace-tag.tag-liuri { background: #00897b; color: white; }
.palace-tag.tag-liushi { background: #7A1500; color: white; font-size: 9px; opacity: 0.9; }
.palace-tag.tag-liufen { background: #1D2757; color: white; font-size: 9px; opacity: 0.9; }
#toast-notification { visibility: hidden; min-width: 200px; background-color: rgba(0, 0, 0, 0.85); color: #fff; text-align: center; border-radius: 25px; padding: 12px 20px; position: fixed; z-index: 9999; left: 50%; bottom: 80px; transform: translateX(-50%); font-size: 15px; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3); opacity: 0; transition: opacity 0.3s, bottom 0.3s; }
#toast-notification.show { visibility: visible; opacity: 1; bottom: 100px; }
.si-hua-liuyue { border: 1px dashed #e65100; color: #e65100 !important; border-radius: 50%; padding: 0 1px; cursor: pointer; }
.palace-ganzhi { position: absolute; top: 2px; right: 0px; color: #333; font-weight: bold; font-size: 11.5px; }
.palace-limits { font-size: 10px; color: #000; margin-top: 6px; position: absolute; bottom: 2px; right: 2px; left: auto; line-height: 1.2; width: auto; max-width: 60%; white-space: nowrap; display: flex; flex-direction: column; align-items: flex-end; gap: 1px; text-align: right; z-index: 10; pointer-events: none; }
.palace-daxian { font-size: 10px; color: #333; white-space: nowrap; }
.palace-xiaoxian { font-size: 10px; color: #333; white-space: normal; text-align: right; word-break: break-all; }
.pos-si { grid-column: 1 / 2; grid-row: 1 / 2; }
.pos-wu { grid-column: 2 / 3; grid-row: 1 / 2; }
.pos-wei { grid-column: 3 / 4; grid-row: 1 / 2; }
.pos-shen { grid-column: 4 / 5; grid-row: 1 / 2; }
.pos-chen { grid-column: 1 / 2; grid-row: 2 / 3; }
.pos-you { grid-column: 4 / 5; grid-row: 2 / 3; }
.pos-mao { grid-column: 1 / 2; grid-row: 3 / 4; }
.pos-xu { grid-column: 4 / 5; grid-row: 3 / 4; }
.pos-yin { grid-column: 1 / 2; grid-row: 4 / 5; }
.pos-chou { grid-column: 2 / 3; grid-row: 4 / 5; }
.pos-zi { grid-column: 3 / 4; grid-row: 4 / 5; }
.pos-hai { grid-column: 4 / 5; grid-row: 4 / 5; }
.center-info { grid-column: 2 / 4; grid-row: 2 / 4; text-align: center; padding: 5px; background: #f9f9f9; border: 1px solid #ddd; display: flex; flex-direction: column; justify-content: center; align-items: center; }
.center-info h3 { margin: 0 0 1px 0; color: #333; font-size: 15px; }
.center-info p { margin: 0px 0; font-size: 11px; }
.bazi-info { font-size: 11px; font-weight: bold; color: #c0392b; margin: 2px 0 0; white-space: nowrap; }
.bazi-container { display: flex; align-items: center; gap: 3px; margin-top: 0px; background: #fff; padding: 0px 0px; border-radius: 10px; width: fit-content; }
.bazi-column { display: flex; flex-direction: column; align-items: center; min-width: 35px; }
.bazi-god { font-size: 10px; color: #333; margin-bottom: -2px; }
.bazi-text { font-size: 10px; color: #c0392b; }
.bazi-label { font-size: 10px; color: #333; font-weight: bold; margin-right: 5px; }
.palace-highlight { background-color: #f2f2f2 !important; box-shadow: inset 0 0 0 2px #666666; transition: background-color 0.2s ease; z-index: 5; }
.palace-highlight-self { background-color: #e6e6e6 !important; box-shadow: inset 0 0 0 2px #999999; }
.si-hua-marker { display: inline-flex; align-items: center; justify-content: center; width: 14px; height: 14px; color: white !important; font-weight: 700; font-size: 10px; margin-left: 1px; vertical-align: middle; line-height: 1; cursor: pointer; }
.si-hua-life { border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.5); }
.si-hua-daxian { border-radius: 3px; box-shadow: 0 0 2px rgba(0, 0, 0, 0.3); }
.si-hua-lu { background-color: #2e7d32; }
.si-hua-quan { background-color: #c2185b; }
.si-hua-ke { background-color: #1565c0; }
.si-hua-ji { background-color: #d32f2f; }
.si-hua-liunian { border-radius: 0; border: 1px solid #fff; }
.ai-loading-container { display: flex; align-items: center; padding: 15px 0; color: #666; font-weight: 500; font-size: 19px; }
.loading-spinner { width: 20px; height: 20px; border: 5px solid rgba(0, 0, 0, 0.1); border-radius: 50%; border-top-color: #666; animation: spin 1s ease-in-out infinite; margin-right: 12px; }
@keyframes spin { to { transform: rotate(360deg); } }
#ai-start-btn { display: inline-block; min-width: 120px; padding: 10px 25px; font-size: 18px; background: #333; color: white; border: none; border-radius: 30px; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2); cursor: pointer; transition: all 0.2s ease-in-out; margin-top: 10px; }
#ai-start-btn:hover { background: #555; transform: scale(1.05); box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3); }
#change-style-btn { background: #007bff; color: white; border: none; padding: 5px 10px; cursor: pointer; font-size: 15px; border-radius: 5px; margin-left: 10px; transition: background 0.3s; vertical-align: middle; font-weight: 500; display: none; }
#change-style-btn:hover { background: #0056b3; }
#chat-history { margin-top: 25px; display: none; }
.chat-bubble { padding: 20px; border-radius: 8px; margin-bottom: 20px; text-align: left; position: relative; clear: both; }
.chat-bubble.ai { background: #eee; border-left: 5px solid #333; }
.chat-bubble.user { background: #e3f2fd; border-right: 5px solid #1565c0; text-align: right; float: right; max-width: 80%; }
.chat-bubble.user .content { text-align: left; display: inline-block; }
.chat-bubble .ai-content img {
    max-width: 100%;
    height: auto;
    border-radius: 5px;
}
.chat-bubble .ai-content pre {
    background: #f4f4f4;
    padding: 10px;
    border-radius: 5px;
    overflow-x: auto; /* 允許代碼區塊橫向捲動 */
    font-family: monospace;
}
.chat-bubble .ai-content table {
    border-collapse: collapse;
    width: 100%;
    margin: 10px 0;
}
.chat-bubble .ai-content th, 
.chat-bubble .ai-content td {
    border: 1px solid #ddd;
    padding: 6px;
    text-align: left;
}
.chat-bubble .ai-content { font-size: var(--chat-font-size); line-height: 1.8; }
.chat-bubble .ai-content strong { font-size: inherit; color: #000; font-weight: bold; }
.chat-bubble .ai-content h1, .chat-bubble .ai-content h2, .chat-bubble .ai-content h3 { margin-top: 15px; margin-bottom: 8px; color: #005a9c; font-size: 1.1em; }
.chat-bubble .ai-content ul, .chat-bubble .ai-content ol { padding-left: 20px; margin: 5px 0; }
.chat-bubble .ai-content li { margin-bottom: 5px; }
.chat-bubble .ai-content p { margin-bottom: 10px; }
#toast-notification { visibility: hidden; min-width: 200px; background-color: rgba(0, 0, 0, 0.85); color: #fff; text-align: center; border-radius: 25px; padding: 12px 20px; position: fixed; z-index: 9999; left: 50%; bottom: 80px; transform: translateX(-50%); font-size: 15px; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3); opacity: 0; transition: opacity 0.3s, bottom 0.3s; }
#toast-notification.show { visibility: visible; opacity: 1; bottom: 100px; }
#follow-up-area { margin-top: 20px; padding-top: 20px; border-top: 1px dashed #ccc; text-align: center; display: none; clear: both; }
#follow-up-input { padding: 10px; width: 80%; max-width: 450px; margin: 15px; border: 1px solid #ccc; border-radius: 5px; font-size: 1em; box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05); }

.typing-cursor {
    display: inline-block;
    width: 8px;
    height: 1.2em;
    background-color: #333;
    vertical-align: middle;
    margin-left: 2px;
    animation: blink 1s step-end infinite;
}
@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.btn-group { margin-top: 10px; text-align: left; }
.btn-group button { font-size: 0.85em; padding: 6px 12px; margin-right: 5px; cursor: pointer; border: none; border-radius: 5px; }
.share-mobile-btn { background: #00C853; color: white; border: none; border-radius: 5px; padding: 6px 12px; margin-right: 5px; cursor: pointer; font-size: 0.85em; display: none; align-items: center; gap: 4px; }
.share-mobile-btn:hover { background: #009624; }
@media screen and (max-width: 768px) {
.share-mobile-btn { display: inline-flex !important; }
}
.copy-btn { background: #c62828; color: white; }
.pdf-btn { background: #FFCC00; color: white; }
.speak-btn { background: #1565c0; color: white; }
.share-line-btn { background: #06C755; color: white; border: none; border-radius: 5px; padding: 6px 12px; margin-right: 5px; cursor: pointer; font-size: 0.85em; display: none; }
.share-line-btn:hover { background: #05a546; }
.ai-header { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.ai-header strong { color: #bf360c; }
.ai-timer { color: #d32f2f; font-family: monospace; font-weight: bold; }
#connection-svg { display: none; position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 10; pointer-events: none; }
@media screen and (min-width: 769px) {
.chart-container { position: relative; }
#connection-svg { display: block; }
}
.san-he-polygon { fill: rgba(200, 200, 200, 0.15); stroke: #e2e2e2; stroke-width: 1; transition: all 0.3s ease; }
.dui-gong-line { stroke: #ff0000; stroke-width: 2; stroke-dasharray: 3, 3; opacity: 0.8; }
body.entry-page .grid-section, body.entry-page #partner-inputs { display: grid !important; grid-template-columns: 85px 1fr; gap: 12px; align-items: center; }
body.entry-page .grid-section label, body.entry-page #partner-inputs label { text-align: right; margin-right: 0; width: 100%; font-size: 13px; font-weight: bold; }
body.entry-page .grid-section input, body.entry-page .grid-section select, body.entry-page #partner-inputs input, body.entry-page #partner-inputs select { width: 100% !important; box-sizing: border-box; font-size: 14px; padding: 4px; }
body.entry-page #partner-inputs[style*="display: none"] { display: none !important; }
body.entry-page { max-width: 450px; margin: 4px auto; padding: 2px; background-color: #f4f4f4; }
.entry-page h2 { text-align: center; color: #222; }
@media screen and (max-width: 768px) {
body.result-page { background-image: none; background-color: #f5f5f5; margin: 10px; padding: 0; }
.chart-container { display: flex; flex-direction: column; border: none; box-shadow: none; background: transparent; max-width: 100%; gap: 12px; }
.grid-section { display: grid !important; grid-template-columns: 80px 1fr !important; gap: 10px; align-items: center; width: 100%; box-sizing: border-box; }
#partner-inputs { grid-template-columns: 80px 1fr !important; gap: 10px; align-items: center; width: 100%; box-sizing: border-box; }
.grid-section label, #partner-inputs label { text-align: right; font-size: 15px; margin: 0; white-space: nowrap; color: #444; }
.grid-section input, .grid-section select, #partner-inputs input, #partner-inputs select { width: 100% !important; height: 30px; font-size: 12px; margin: 0; box-sizing: border-box; }
.center-info { order: -1; margin-bottom: 10px; border-radius: 12px; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08); background: #fff; width: 100%; box-sizing: border-box; border: 3px solid #005a9c; }
.palace-cell { width: 100%; box-sizing: border-box; background: #fff; border-radius: 12px !important; border: 2px solid #e0e0e0; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05); padding: 15px; position: relative; display: flex; flex-direction: column; justify-content: flex-start; align-items: flex-start; min-height: auto; }
.palace-name { font-size: 18px; color: #005a9c; border: none; margin: 0 0 8px 0; padding: 0; border-bottom: 1px dashed #eee; width: 100%; padding-bottom: 5px; }
.palace-ganzhi { position: absolute !important; top: 12px; right: 12px; margin: 0; font-size: 14px; color: #555; background: #f0f0f0; padding: 3px 10px; border-radius: 12px; z-index: 2; line-height: 1; white-space: nowrap; }
.palace-stars { width: 100%; margin: 5px 0 10px 0; font-size: 15px; line-height: 1.8; display: flex; flex-wrap: wrap; gap: 6px; }
.major-star-text { font-size: 16px; font-weight: bold; }
.minor-star { font-size: 12px; }
.palace-limits { position: static !important; width: 100%; background: #f7f9fc; padding: 8px; border-radius: 8px; margin-top: auto; box-sizing: border-box; display: flex; justify-content: space-between; align-items: center; }
.palace-daxian { font-size: 13px; font-weight: bold; color: #333; }
.palace-xiaoxian { display: none; }
.palace-changsheng { position: absolute !important; top: 50px; right: 15px; margin: 0; background: transparent; color: #777; }
.si-hua-marker { width: 18px; height: 18px; font-size: 12px; line-height: 18px; }
.brightness { color: #666; padding: 0px 0px; font-size: 12px; font-weight: bold; }
.chat-bubble.user { max-width: 95%; }
.chat-bubble.ai { max-width: 100%; padding: 15px; }
.share-line-btn { display: inline-block !important; }
}
.history-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.history-item { display: inline-flex; align-items: center; background: #fff; border: 1px solid #ddd; border-radius: 15px; padding: 2px 2px; font-size: 10px; cursor: pointer; transition: all 0.2s; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05); max-width: 100%; }
.history-item:hover { background: #f0f8ff; border-color: #007bff; transform: translateY(-1px); }
.history-info { display: flex; align-items: center; gap: 5px; }
.h-icon { font-size: 10px; }
.h-name { font-weight: bold; color: #111; max-width: 50px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.h-date { color: #777; font-size: 11.5px; }
.h-delete { margin-left: 2px; color: #555; font-weight: bold; padding: 2px 2px; border-radius: 50%; }
.h-delete:hover { color: #ff4d4d; background: rgba(255, 0, 0, 0.1); }
@media screen and (max-width: 768px) {
.history-grid { gap: 6px; }
.history-item { padding: 2px 2px; }
}
#toggle-palaces-btn { display: none; }
@media screen and (max-width: 768px) {
#toggle-palaces-btn { display: inline-block !important; margin-right: 5px; }
.chart-container.palaces-hidden .palace-cell { display: none !important; }
.chart-container.palaces-hidden .center-info { display: flex !important; order: -1; width: 100%; margin-bottom: 0; }
.chart-container.palaces-hidden { gap: 0; }
}
@media screen and (max-width: 768px) {
.solar-time-section { box-sizing: border-box !important; width: 100% !important; margin-left: 0 !important; grid-column: 1 / -1 !important; flex-wrap: wrap !important; gap: 8px 5px !important; padding: 10px !important; }
.grid-section .solar-time-section select, #partner-inputs .solar-time-section select { width: auto !important; display: inline-block !important; min-width: unset !important; padding: 2px 5px !important; height: 30px !important; }
.solar-time-section select[name*="solar_hour"], .solar-time-section select[name*="solar_min"] { width: 50px !important; }
.grid-section .solar-time-section label, #partner-inputs .solar-time-section label { text-align: left !important; width: auto !important; margin: 0 !important; white-space: nowrap !important; font-size: 12px !important; color: #333 !important; font-weight: normal !important; }
.solar-time-section>label:nth-of-type(2), .solar-time-section>label:nth-of-type(3) { margin-left: 2px !important; }
.solar-time-section select[name*="longitude"] { flex: 1 !important; min-width: 50px !important; }
}
.center-info { position: relative; z-index: 1; overflow: hidden; }
@media screen and (max-width: 768px) {
#mini-map-container { display: none !important; }
}
#mini-map-container { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 6; pointer-events: none; opacity: 0.6; }
.mini-connection-svg-layer { overflow: visible; }
.center-info h3, .center-info p, .center-info .bazi-container, .center-info button { position: relative; z-index: 2; text-shadow: 0 0 2px rgba(255, 255, 255, 0.8); }
.mini-san-he-polygon { fill: rgba(230, 230, 230, 0.5); stroke: #222222; stroke-width: 1.0; stroke-dasharray: 1, 1; vector-effect: non-scaling-stroke; }
.mini-dui-gong-line { stroke: #0964D9; stroke-width: 1.0; stroke-dasharray: 1, 1; }
@media screen and (max-width: 768px) {
#btn-download-chart { display: none !important; }
}