*{box-sizing:border-box}
:root{
  --ink:#07111d;
  --gold:#d9b15e;
  --paper:#f8f1e5;
  --card:#fffaf0;
  --line:#dfd3bd;
  --muted:#6d665b;
  --red:#9b1c1c;
}
body{
  margin:0;
  font-family:"Microsoft JhengHei","Noto Sans TC",Arial,sans-serif;
  background:
    radial-gradient(circle at top,#fff7e9 0,#f3eadb 45%,#eadcc8 100%);
  color:#1d1b18;
}
.topbar{
  background:linear-gradient(135deg,#050b13,#111e2d);
  color:#f6e3b4;
  padding:22px 6vw;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:18px;
  box-shadow:0 4px 18px rgba(0,0,0,.25);
}
.brand{display:flex;align-items:center;gap:16px}
.logo{
  width:58px;height:58px;border:2px solid var(--gold);border-radius:50%;
  display:grid;place-items:center;font-size:34px;color:var(--gold);
}
h1{margin:0;font-size:34px;letter-spacing:4px;font-weight:700}
.brand p{margin:6px 0 0;font-size:16px;letter-spacing:3px}
nav{display:flex;gap:24px;white-space:nowrap}
nav a{color:#f6e3b4;text-decoration:none;font-size:16px}
.container{max-width:1180px;margin:0 auto;padding:34px 24px}
.hero{
  display:grid;
  grid-template-columns:1.05fr .95fr;
  gap:28px;
  align-items:center;
}
.card,.info-card{
  background:rgba(255,250,240,.88);
  border:1px solid var(--line);
  border-radius:14px;
  box-shadow:0 6px 24px rgba(65,45,20,.08);
}
.input-card{padding:26px}
label{display:block;font-size:22px;font-weight:700;margin-bottom:14px}
textarea{
  width:100%;min-height:220px;resize:vertical;border:1px solid #cfc7b8;
  border-radius:9px;padding:18px;font-size:20px;line-height:1.6;background:#fff;
}
textarea:focus{outline:2px solid rgba(217,177,94,.45)}
.count{text-align:right;color:var(--muted);margin:8px 2px 18px}
.primary{
  width:100%;border:0;border-radius:9px;padding:18px 22px;
  background:linear-gradient(135deg,#06111e,#142235);
  color:#f7d98a;font-size:26px;font-weight:700;letter-spacing:8px;
  cursor:pointer;box-shadow:0 8px 20px rgba(0,0,0,.18);
}
.primary:active{transform:translateY(1px)}
.time-row{font-size:20px;color:#51483c;margin-top:20px}
.bagua-wrap{text-align:center}
.bagua{
  width:min(100%,520px);
  border-radius:8px;
  filter:drop-shadow(0 8px 14px rgba(0,0,0,.12));
}
.result-card{margin-top:28px;padding:24px}
h2{margin:0 0 18px;font-size:30px;letter-spacing:3px}
.grid{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  border:1px solid var(--line);
  border-radius:9px;
  overflow:hidden;
  background:#fffdf8;
}
.gua-box{
  min-height:250px;
  padding:18px 10px;
  text-align:center;
  border-right:1px solid var(--line);
}
.gua-box:last-child{border-right:0}
.gua-title{font-size:19px;color:#8a5e1b;font-weight:700}
.gua-name{font-size:30px;font-weight:800;margin:10px 0;color:#15110c}
.moving .gua-name{color:var(--red)}
.gua-sub{font-size:16px;color:#5a5146;line-height:1.6;margin-top:8px}
.lines{height:116px;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:9px}
.yao{height:12px;width:108px;background:#111;border-radius:1px}
.yao.yin{background:linear-gradient(to right,#111 0 42%,transparent 42% 58%,#111 58% 100%)}
.yao.move{background:#a92323}
.yao.yin.move{background:linear-gradient(to right,#a92323 0 42%,transparent 42% 58%,#a92323 58% 100%)}
.prompt-box{
  margin-top:22px;
  background:#fffaf2;
  border:1px solid var(--line);
  border-radius:10px;
  padding:20px;
}
.prompt-head{
  display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:12px
}
.prompt-head h3{margin:0;font-size:22px;color:#80551b}
.prompt-head span{font-size:16px;color:#665b4e;font-weight:400}
.copy{
  border:0;border-radius:8px;padding:12px 20px;background:#07111d;color:#fff;
  font-size:17px;cursor:pointer;white-space:nowrap
}
pre{
  margin:0;white-space:pre-wrap;word-break:break-word;font-family:inherit;
  font-size:18px;line-height:1.65;color:#191512;
}
.info-grid{
  display:grid;grid-template-columns:1fr 1fr;gap:18px;margin-top:28px
}
.info-card{padding:22px;background:rgba(239,252,239,.8)}
.info-card.blue{background:rgba(235,247,255,.78)}
.info-card h3{margin:0 0 12px;font-size:22px}
.info-card p{font-size:17px;line-height:1.8;color:#4d463c}
footer{
  background:#07111d;color:#f6e3b4;text-align:center;padding:18px;font-size:15px;margin-top:24px
}
@media(max-width:900px){
  .topbar{flex-direction:column;align-items:flex-start;padding:18px}
  h1{font-size:26px;letter-spacing:2px}
  .brand p{font-size:14px;letter-spacing:1px}
  nav{gap:16px}
  .container{padding:18px 14px}
  .hero{grid-template-columns:1fr}
  .bagua{width:min(92vw,430px)}
  .grid{grid-template-columns:1fr 1fr}
  .gua-box:nth-child(2){border-right:0}
  .gua-box:nth-child(1),.gua-box:nth-child(2){border-bottom:1px solid var(--line)}
  .prompt-head{flex-direction:column;align-items:stretch}
  .copy{width:100%}
  .info-grid{grid-template-columns:1fr}
}
@media(max-width:520px){
  .brand{gap:10px}
  .logo{width:48px;height:48px;font-size:28px}
  h1{font-size:22px}
  textarea{font-size:17px;min-height:160px;padding:12px}
  .primary{font-size:22px;padding:15px;letter-spacing:4px}
  .time-row{font-size:16px}
  h2{font-size:24px}
  .grid{grid-template-columns:1fr}
  .gua-box{border-right:0;border-bottom:1px solid var(--line);min-height:220px}
  .gua-box:last-child{border-bottom:0}
  .gua-name{font-size:28px}
  pre{font-size:16px}
}


.voice-btn{
    width:100%;
    margin-top:12px;
    padding:14px;
    border:none;
    border-radius:8px;
    cursor:pointer;
    font-size:20px;
    background:#1c6dd0;
    color:#fff;
}

.voice-btn:hover{
    background:#1558a8;
}

.voice-btn.listening{
    background:#b91c1c;
}
