/* css/style.css V27.0 - 金框布局美化版 */

:root { --bg-dark: #050505; --panel-bg: rgba(255, 255, 255, 0.03); --border: rgba(255, 255, 255, 0.1); --gold: #eebb55; --gold-grad: linear-gradient(135deg, #eebb55 0%, #aa7722 100%); --cyan: #88ffea; --text-main: #e0e0e0; --text-sub: #888; --red: #ff4d4d; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

/* 背景 */
body { 
    background-color: #000;
    background-image: radial-gradient(circle at 50% 50%, #1a1a24 0%, #000000 80%);
    color: var(--text-main); font-family: "PingFang SC", "Microsoft YaHei", sans-serif; margin: 0; padding: 20px 10px; min-height: 100vh; display: flex; flex-direction: column; align-items: center; overflow-x: hidden; position: relative; 
}
body::before {
    content: "☯"; position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
    font-size: 80vmin; color: var(--gold); opacity: 0.03; z-index: -1; pointer-events: none;
    animation: breatheTaiji 8s ease-in-out infinite; filter: blur(2px);
}

.app { width: 95%; max-width: 1000px; background: var(--panel-bg); backdrop-filter: blur(20px); border-radius: 16px; border: 1px solid var(--border); box-shadow: 0 20px 50px rgba(0,0,0,0.7); margin: 30px auto; position: relative; z-index: 5; padding-bottom: 20px; }

.header { text-align: center; padding: 25px 0; border-bottom: 1px solid var(--border); position: relative; display: flex; justify-content: center; align-items: center; min-height: 80px; }
.header h1 { margin: 0; font-weight: 300; color: var(--gold); font-size: 24px; letter-spacing: 8px; text-shadow: 0 0 15px rgba(238, 187, 85, 0.3); }

.tool-btn { position: absolute; right: 20px; top: 50%; transform: translateY(-50%); font-size: 12px; color: var(--gold); border: 1px solid rgba(238,187,85,0.3); padding: 4px 12px; border-radius: 20px; cursor: pointer; background: rgba(0,0,0,0.6); transition: all 0.3s; z-index: 10; user-select: none; white-space: nowrap; }
.tool-btn:hover { background: var(--gold); color: #000; }

.tabs { display: flex; padding: 0 20px; border-bottom: 1px solid var(--border); }
.tab { flex: 1; padding: 18px 0; text-align: center; color: var(--text-sub); cursor: pointer; font-size: 15px; transition: 0.3s; position: relative; }
.tab.active { color: var(--gold); font-weight: bold; }
.tab.active::after { content: ''; position: absolute; bottom: -1px; left: 25%; right: 25%; height: 2px; background: var(--gold); box-shadow: 0 0 8px var(--gold); }

.panel-section { display: none; padding: 30px 20px; animation: fadeUp 0.4s ease; }
.panel-section.active { display: block; }
.input-group { margin-bottom: 25px; position: relative; }
label { display: block; color: var(--text-sub); font-size: 12px; margin-bottom: 8px; letter-spacing: 1px; font-weight: bold; }

input, select { width: 100%; background: rgba(0,0,0,0.4); border: 1px solid #444; padding: 15px; color: var(--cyan); font-size: 18px; border-radius: 8px; outline: none; text-align: center; transition: all 0.3s; appearance: none; }
input:focus, select:focus { border-color: var(--gold); box-shadow: 0 0 15px rgba(238, 187, 85, 0.1); }
.error-shake { animation: shake 0.4s; border-color: var(--red) !important; color: var(--red); }
.error-msg { height: 0; overflow: hidden; color: var(--red); font-size: 13px; margin-top: 0; text-align: center; transition: all 0.3s ease; opacity: 0; font-weight: bold; white-space: nowrap; }
.error-msg.show { height: 24px; margin-top: 6px; opacity: 1; }

.manual-row { display: flex; gap: 15px; justify-content: space-between; }
.col { flex: 1; }
.select-label { display: block; text-align: center; font-size: 12px; color: var(--gold); margin-bottom: 5px; font-weight: bold; }
.manual-row select { background: rgba(238, 187, 85, 0.05); border: 1px solid rgba(238, 187, 85, 0.2); color: var(--gold); font-weight: bold; }
.time-display { padding: 15px; border: 1px dashed var(--border); color: var(--cyan); text-align: center; font-family: monospace; font-size: 24px; background: rgba(0,0,0,0.2); border-radius: 8px; letter-spacing: 2px; }

.btn-group { display: flex; gap: 15px; margin-top: 30px; }
.btn { border: none; border-radius: 8px; font-size: 16px; font-weight: bold; cursor: pointer; position: relative; overflow: hidden; padding: 0; transition: transform 0.1s; letter-spacing: 2px; height: 50px; line-height: 50px; box-shadow: 0 5px 15px rgba(0,0,0,0.3); }
.btn-gold { flex: 2; background: var(--gold-grad); color: #111; }
.btn-reset { flex: 1; background: rgba(255,255,255,0.1); color: #999; border: 1px solid #444; }
.btn:active { transform: scale(0.98); }
.btn::after { content: ""; position: absolute; top: 0; left: -100%; width: 100%; height: 100%; background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent); animation: shine 3s infinite; }

.result-container { display: none; margin-top: 40px; padding-top: 30px; border-top: 1px dashed rgba(255,255,255,0.15); }
.subject-title { text-align: center; color: var(--gold); font-size: 18px; margin-bottom: 30px; border-bottom: 1px solid #333; padding-bottom: 10px; }
.gua-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 25px; }
.gua-card { background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.08); border-radius: 12px; padding: 20px 10px; display: flex; align-items: center; justify-content: center; position: relative; backdrop-filter: blur(5px); gap: 10px; height: 160px; }
.gua-num-col { display: flex; flex-direction: column; justify-content: space-between; height: 100%; width: 50px; padding: 10px 0; border-right: 1px solid rgba(255,255,255,0.1); }
.num-box { height: 50%; display: flex; flex-direction: column; justify-content: center; align-items: center; }
.num-label { font-size: 12px; font-weight: bold; margin-bottom: 2px; color: var(--gold); }
.num-val { font-size: 24px; font-weight: bold; line-height: 1; color: var(--gold); }
.gua-draw { display: flex; flex-direction: column-reverse; justify-content: space-between; width: 60px; height: 100%; padding: 10px 0; }
.yao { width: 100%; height: 12px; border-radius: 2px; position: relative; }
.yang { background: var(--gold); box-shadow: 0 0 5px rgba(238,187,85,0.3); }
.yin { display: flex; justify-content: space-between; }
.yin::before, .yin::after { content:''; width: 42%; height: 100%; background: var(--gold); border-radius: 2px; box-shadow: 0 0 5px rgba(238,187,85,0.3); }
.yao.moving .yang, .yao.moving .yin::before, .yao.moving .yin::after { background: var(--red); box-shadow: 0 0 8px var(--red); }
.yao.changed .yang, .yao.changed .yin::before, .yao.changed .yin::after { background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }
.yao-mk { position: absolute; right: -30px; top: -2px; font-size: 10px; color: var(--red); font-weight: bold; white-space: nowrap; transform: scale(0.8); }
.yao-mk-c { position: absolute; right: -25px; top: -2px; font-size: 10px; color: var(--cyan); font-weight: bold; white-space: nowrap; transform: scale(0.8); }
.gua-text { writing-mode: vertical-rl; text-orientation: upright; letter-spacing: 5px; font-size: 20px; font-weight: bold; color: var(--cyan); height: 100%; display: flex; align-items: center; justify-content: center; border-left: 1px solid rgba(255,255,255,0.1); padding-left: 10px; }
.tag-top { position: absolute; top: -10px; left: 50%; transform: translateX(-50%); background: #000; border: 1px solid var(--gold); color: var(--gold); font-size: 12px; padding: 2px 10px; border-radius: 4px; z-index: 2; }
.tag-special { position: absolute; bottom: -10px; left: 50%; transform: translateX(-50%); font-size: 11px; color: #fff; background: rgba(0,0,0,0.9); border: 1px solid #666; padding: 2px 8px; border-radius: 4px; white-space: nowrap; }
.logs { background: #000; padding: 20px; border-radius: 8px; border: 1px solid #222; font-family: monospace; font-size: 12px; color: #6f6; line-height: 1.6; margin-bottom: 25px; }
.action-area { display: flex; gap: 15px; }
.btn-copy { flex: 1; padding: 12px; border-radius: 6px; cursor: pointer; text-align: center; border: 1px solid var(--cyan); color: var(--cyan); font-size: 14px; font-weight: bold; transition: 0.2s; }
.btn-copy.ai { border-color: var(--gold); color: var(--gold); }
.moving-info { text-align: center; color: var(--gold); margin: 35px 0 15px 0; font-size: 15px; }

/* --- 底部 Footer 美化核心 --- */
.footer { margin-top: auto; width: 100%; background: rgba(0,0,0,0.2); border-top: 1px solid rgba(255,255,255,0.05); padding: 50px 20px; text-align: center; }
.footer-block { max-width: 900px; margin: 0 auto; }

/* 头部标题对齐 */
.footer-head-new { margin-bottom: 30px; display: flex; flex-direction: column; align-items: center; }
/* 手动偏移修正视觉中心 (仅电脑端) */
@media (min-width: 769px) { .footer-head-new { transform: translateX(-2px); } }

.align-line { display: flex; width: 100%; justify-content: center; align-items: center; margin-bottom: 5px; }
.sub-line { margin-top: 5px; }
.align-line .t-right { flex: 1; text-align: right; font-size: 22px; font-weight: bold; color: #999; font-family: "Songti SC", serif; letter-spacing: 2px; }
.align-line .center-dot { flex: 0 0 30px; text-align: center; font-weight: bold; color: #999; }
.align-line .t-left { flex: 1; text-align: left; font-size: 22px; font-weight: bold; color: #999; font-family: "Songti SC", serif; letter-spacing: 2px; }
.sub-line .t-right, .sub-line .t-left, .sub-line .center-dot { font-size: 16px; color: var(--gold); letter-spacing: 1px; }

/* 金框容器 (新增加的) */
.footer-container-box {
    border: 1px solid rgba(238, 187, 85, 0.15); /* 金色微弱边框 */
    background: rgba(238, 187, 85, 0.02); /* 极淡的金色背景 */
    border-radius: 12px;
    padding: 30px 0;
    margin: 0 auto;
    max-width: 800px;
    /* 增加阴影提升层次感 */
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
}

/* 电脑端左右布局 */
.footer-grid { display: flex; width: 100%; justify-content: center; gap: 0; color: #666; }
.footer-col { flex: 1; display: flex; width: 50%; justify-content: center; }

/* 左边列 */
.col-left { 
    border-right: 1px solid rgba(238, 187, 85, 0.15); /* 中间那条可见的垂直线 */
}

/* 统一的内容容器，让文字在里面自然左对齐 */
.content-box { text-align: left; min-width: 220px; padding: 0 20px; }

.content-box h4 { 
    color: var(--gold); margin: 0 0 10px 0; 
    font-size: 15px; font-weight: bold; 
    border-left: 3px solid var(--gold); padding-left: 10px; 
}
.content-box ul { list-style: none; padding: 0; margin: 0; font-size: 13px; line-height: 2.2; font-family: "Songti SC", serif; color: #888; }
.footer-foot { margin-top: 40px; font-size: 12px; color: #444; font-style: italic; letter-spacing: 1px; }

/* Modal & Toast */
.modal-overlay { display: none; position: fixed; z-index: 2000; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.8); backdrop-filter: blur(5px); transition: opacity 0.3s ease; opacity: 0; }
.modal-overlay.show { opacity: 1; display: block; }
.modal-box { background-color: #111; margin: 10vh auto; padding: 20px; border: 1px solid var(--gold); border-radius: 12px; width: 400px; color: #eee; text-align: center; transform: scale(0.95); transition: transform 0.3s ease; }
.modal-overlay.show .modal-box { transform: scale(1); }
.data-table { width: 100%; border-collapse: collapse; margin-top: 10px; }
.data-table th, .data-table td { border: 1px solid #333; padding: 10px; font-size: 14px; }
.data-table th { color: var(--gold); }
.highlight-row { background: rgba(238,187,85,0.2); color: var(--gold); font-weight: bold; border: 1px solid transparent; }
.modal-close { margin-top: 15px; padding: 6px 20px; background: transparent; border: 1px solid #666; color: #aaa; border-radius: 20px; cursor: pointer; }
.toast-box { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); background: rgba(0, 0, 0, 0.9); color: var(--gold); border: 1px solid var(--gold); padding: 15px 30px; border-radius: 8px; font-size: 16px; font-weight: bold; z-index: 3000; opacity: 0; visibility: hidden; transition: all 0.3s; box-shadow: 0 5px 20px rgba(0,0,0,0.5); }
.toast-box.show { opacity: 1; visibility: visible; }
.bagua-trail { position: fixed; pointer-events: none; color: var(--gold); font-size: 24px; font-weight: bold; opacity: 0.8; z-index: 9999; text-shadow: 0 0 10px rgba(238, 187, 85, 0.6); animation: floatAndFade 1.2s ease-out forwards; user-select: none; }

/* 手机端适配：撤销边框样式 */
@media (max-width: 768px) {
    .header h1 { font-size: 20px; padding: 0 10px; margin-right: 60px; } 
    .tool-btn { right: 15px; font-size: 11px; padding: 4px 10px; }
    .gua-grid { grid-template-columns: 1fr; gap: 30px; }
    
    /* 手机端：取消金框，恢复自然排列 */
    .footer-container-box { border: none; background: none; box-shadow: none; padding: 0; }
    .footer-grid { flex-direction: column; gap: 30px; text-align: center; }
    .footer-col { display: block; width: auto; text-align: left; margin: 0 auto; }
    .col-left { border-right: none; } /* 去掉中间分割线 */
    .content-box { padding: 0; min-width: auto; }
    .content-box h4 { border-left: none; border-bottom: 1px solid var(--gold); padding-bottom: 5px; padding-left: 0; display: block; text-align: center; }
    
    .align-line .t-right, .align-line .t-left { font-size: 18px; }
    .sub-line .t-right, .sub-line .t-left, .sub-line .center-dot { font-size: 14px; }
    .modal-box { width: 90%; margin: 5vh auto; padding: 15px; max-height: 85vh; overflow-y: auto; } 
}

@keyframes breatheTaiji { 0%, 100% { opacity: 0.03; transform: translate(-50%, -50%) scale(1); filter: blur(2px); } 50% { opacity: 0.08; transform: translate(-50%, -50%) scale(1.05); filter: blur(0px); } }
@keyframes floatAndFade { 0% { transform: translateY(0) rotate(0deg) scale(0.8); opacity: 0.8; } 100% { transform: translateY(-30px) rotate(45deg) scale(1.5); opacity: 0; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } } 
@keyframes shake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-5px)} 75%{transform:translateX(5px)} }