/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #8B4513;
    --primary-light: #D2691E;
    --primary-dark: #5D3A1A;
    --gold: #D4AF37;
    --gold-light: #F4D03F;
    --red: #C0392B;
    --red-light: #E74C3C;
    --bg-cream: #FDF6E3;
    --bg-paper: #FAF3E0;
    --text-dark: #2C3E50;
    --text-light: #5D6D7E;
    --border: #D5C4A1;
    --shadow: rgba(139, 69, 19, 0.15);
}

body {
    font-family: 'Noto Serif SC', 'STSong', 'SimSun', serif;
    background: linear-gradient(135deg, #FDF6E3 0%, #F5E6C8 50%, #FDF6E3 100%);
    min-height: 100vh;
    color: var(--text-dark);
    line-height: 1.8;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 头部样式 */
.header {
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-dark) 100%);
    border-radius: 20px;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 40px var(--shadow);
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23D4AF37' fill-opacity='0.1'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
}

.header-content {
    position: relative;
    z-index: 1;
}

.header h1 {
    font-size: 2.8rem;
    color: var(--gold);
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    letter-spacing: 8px;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.1rem;
    color: rgba(255,255,255,0.8);
    letter-spacing: 4px;
}

.deity-name {
    font-size: 0.95rem;
    color: var(--gold);
    letter-spacing: 6px;
    margin-top: 8px;
    font-weight: 600;
}

/* 导航样式 */
.nav {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.nav-item {
    padding: 12px 30px;
    background: white;
    border: 2px solid var(--border);
    border-radius: 30px;
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px var(--shadow);
}

.nav-item:hover,
.nav-item.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 5px 20px var(--shadow);
}

/* 区域标题 */
.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.4rem;
    color: var(--primary-dark);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--gold);
}

.title-icon {
    font-size: 1.6rem;
}

/* 十八变表格 */
.changes-table-section {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 5px 25px var(--shadow);
    border: 1px solid var(--border);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.ying-shu-info {
    font-size: 1rem;
    color: var(--primary-dark);
    font-weight: 600;
    background: var(--bg-cream);
    padding: 8px 15px;
    border-radius: 20px;
    border: 1px solid var(--gold);
}

.changes-table-wrapper {
    overflow-x: auto;
    margin-top: 15px;
    -webkit-overflow-scrolling: touch;
}

.changes-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.changes-table th,
.changes-table td {
    border: 1px solid var(--border);
    padding: 10px 8px;
    text-align: center;
}

.changes-table th {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    font-weight: 600;
}

.changes-table tbody tr:nth-child(even) {
    background: var(--bg-cream);
}

.changes-table tbody tr:hover {
    background: #F5E6C8;
}

.yao-line {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    min-height: 20px;
    justify-content: center;
}

.yang-line {
    width: 40px;
    height: 6px;
    background: var(--primary-dark);
    border-radius: 3px;
}

.yin-line {
    display: flex;
    gap: 4px;
}

.yin-line span {
    width: 18px;
    height: 6px;
    background: var(--primary-dark);
    border-radius: 3px;
}

.moving-yao .yang-line,
.moving-yao .yin-line span {
    background: var(--red);
}

/* 阴线动爻：保持断裂但红色 */
.yin-line.moving-yao {
    background: transparent !important;
}
.yin-line.moving-yao span {
    background: var(--red) !important;
}

.yao-btn {
    padding: 5px 15px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.yao-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 3px 10px var(--shadow);
}

.yao-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.change-calc {
    font-size: 0.75rem;
    color: var(--primary-dark);
    font-family: 'Noto Serif SC', serif;
    text-align: center;
    min-width: 90px;
}

.calc-bian-label {
    font-size: 0.7rem;
    color: var(--gold);
    font-weight: 600;
    background: var(--primary-dark);
    color: #fff !important;
    padding: 2px 8px;
    border-radius: 10px;
    display: inline-block;
    margin-bottom: 4px;
    letter-spacing: 1px;
}

.calc-detail {
    display: block;
    font-size: 0.7rem;
    color: var(--text-light);
    line-height: 1.6;
    word-break: break-all;
}

.calc-detail strong {
    color: var(--primary);
    font-weight: 700;
}

.divination-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
    padding: 20px;
    background: var(--bg-cream);
    border-radius: 10px;
    border: 2px solid var(--border);
}

/* 表格结果行样式 */
.result-row {
    background: linear-gradient(135deg, var(--bg-cream) 0%, #F5E6C8 100%);
    font-weight: 600;
}

.result-row td {
    padding: 15px 10px;
    border-top: 2px solid var(--gold);
}

.gua-name-cell {
    font-size: 1.2rem;
    color: var(--primary-dark);
}

.gua-id {
    color: var(--primary);
    margin-right: 5px;
}

.re-divine-btn {
    margin-left: 15px;
    padding: 5px 15px;
    background: var(--red);
    color: white;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
}

.re-divine-btn:hover {
    background: var(--red-light);
}

.ying-shu-cell {
    font-size: 0.95rem;
    color: var(--text-dark);
    font-family: monospace;
}

.divination-note {
    margin-top: 20px;
    padding: 15px;
    background: linear-gradient(135deg, #FEF9E7 0%, #FDF2E9 100%);
    border-radius: 10px;
    border-left: 4px solid var(--gold);
}

.divination-note p {
    margin: 5px 0;
    font-size: 0.9rem;
    color: var(--text-dark);
}

/* 控制区样式 */
.control-section {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 5px 25px var(--shadow);
    border: 1px solid var(--border);
}

.control-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    border-bottom: 2px solid var(--border);
    padding-bottom: 15px;
}

.tab-btn {
    padding: 10px 25px;
    background: var(--bg-cream);
    border: 2px solid var(--border);
    border-radius: 25px;
    cursor: pointer;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
    transition: all 0.3s ease;
}

.tab-btn:hover {
    background: var(--gold-light);
    border-color: var(--gold);
}

.tab-btn.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    border-color: var(--primary);
}

.tab-content {
    display: none;
}

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

/* 自动起卦 */
.auto-divination {
    text-align: center;
    padding: 30px;
}

.divination-desc {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 25px;
    font-style: italic;
}

.btn-primary {
    padding: 12px 30px;
    background: linear-gradient(135deg, var(--red) 0%, var(--red-light) 100%);
    color: white;
    border: none;
    border-radius: 30px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(192, 57, 43, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(192, 57, 43, 0.4);
}

.btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    padding: 12px 30px;
    background: linear-gradient(135deg, #7f8c8d 0%, #95a5a6 100%);
    color: white;
    border: none;
    border-radius: 30px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(127, 140, 141, 0.3);
}

.btn-large {
    padding: 18px 50px;
    font-size: 1.3rem;
}

.auto-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.btn-icon {
    margin-right: 8px;
    font-size: 1.4rem;
}

/* 手动设卦 */
.manual-divination {
    padding: 20px;
}

.trigram-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 25px;
}

.trigram-group label {
    display: block;
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.trigram-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.trigram-buttons button {
    padding: 15px 10px;
    background: var(--bg-cream);
    border: 2px solid var(--border);
    border-radius: 10px;
    font-family: inherit;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.trigram-buttons button:hover {
    background: var(--gold-light);
    border-color: var(--gold);
}

.trigram-buttons button.selected {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    border-color: var(--primary);
}

/* 选择卦象 */
.select-divination {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 20px;
    align-items: end;
    padding: 20px;
}

.select-group label {
    display: block;
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 10px;
}

.select-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border);
    border-radius: 10px;
    font-family: inherit;
    font-size: 1rem;
    background: white;
    cursor: pointer;
}

.select-group select:focus {
    outline: none;
    border-color: var(--primary);
}

/* 问题输入栏（顶部导航样式） */
.question-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: white;
    border-radius: 15px;
    padding: 15px 25px;
    margin-bottom: 25px;
    box-shadow: 0 5px 25px var(--shadow);
    border: 1px solid var(--border);
    gap: 20px;
}

.question-input-wrapper {
    display: flex;
    align-items: center;
    flex: 1;
    gap: 15px;
}

.question-input-wrapper .question-label {
    font-weight: 600;
    color: var(--primary-dark);
    font-size: 1.1rem;
    white-space: nowrap;
}

.question-input-wrapper .question-input {
    flex: 1;
    padding: 10px 15px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
}

.question-input-wrapper .question-input:focus {
    outline: none;
    border-color: var(--primary);
}

.copy-btn {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white !important;
    padding: 10px 25px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(139, 69, 19, 0.3);
    white-space: nowrap;
}

.copy-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 69, 19, 0.4);
}

.share-btn {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white !important;
    padding: 10px 25px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
    white-space: nowrap;
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

/* 结果区标题和复制按钮 */
.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.result-header .section-title {
    margin-bottom: 0;
}

/* 结果区操作按钮组（分享+复制） */
.result-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* 旧的问题输入样式（保留兼容） */
.question-section {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 5px 25px var(--shadow);
    border: 1px solid var(--border);
    display: flex;
    gap: 15px;
    align-items: center;
}

.question-section .question-label {
    font-weight: 600;
    color: var(--primary-dark);
    font-size: 1.1rem;
    white-space: nowrap;
}

.question-section .question-input {
    flex: 1;
    padding: 12px 20px;
    border: 2px solid var(--border);
    border-radius: 10px;
    font-family: inherit;
    font-size: 1rem;
}

.question-section .question-input:focus {
    outline: none;
    border-color: var(--primary);
}

/* 加载动画 */
.loading-spinner {
    text-align: center;
    padding: 40px;
    color: var(--primary);
    font-size: 1.1rem;
}

.loading-spinner::before {
    content: '☯';
    display: block;
    font-size: 3rem;
    animation: spin 2s linear infinite;
    margin-bottom: 15px;
}

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

/* 错误信息 */
.error-message {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 20px;
    color: #856404;
    line-height: 1.8;
}

.error-message strong {
    color: #721c24;
    font-size: 1.1rem;
}

/* 问题显示（在结果区） */
.question-display {
    background: linear-gradient(135deg, #FFF9E6 0%, #FFF3D0 100%);
    border: 2px solid var(--gold);
    border-radius: 12px;
    padding: 20px 25px;
    margin-bottom: 25px;
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.question-label-display {
    font-weight: 700;
    color: var(--primary-dark);
    font-size: 1.1rem;
    white-space: nowrap;
    padding: 5px 0;
}

.question-content {
    flex: 1;
    font-size: 1.15rem;
    color: var(--text-dark);
    line-height: 1.8;
    padding: 5px 0;
    font-weight: 500;
}

/* 结果显示区 */
.result-section {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 5px 25px var(--shadow);
    border: 1px solid var(--border);
}

.gua-display {
    margin-bottom: 30px;
}

.gua-main {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.gua-card {
    background: linear-gradient(135deg, var(--bg-cream) 0%, var(--bg-paper) 100%);
    border: 2px solid var(--gold);
    border-radius: 15px;
    padding: 25px 35px;
    text-align: center;
    min-width: 180px;
    box-shadow: 0 5px 20px var(--shadow);
}

.gua-type {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 10px;
    letter-spacing: 2px;
}

.gua-name {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 15px;
}

.gua-symbol {
    margin-bottom: 10px;
}

.gua-info {
    font-size: 0.85rem;
    color: var(--text-light);
}

.arrow {
    font-size: 2.5rem;
    color: var(--gold);
}

/* 关系卦 */
.gua-relations {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.relation-card {
    background: var(--bg-cream);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 15px 25px;
    text-align: center;
}

.relation-type {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 8px;
}

.relation-name {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 8px;
}

.relation-symbol {
    transform: scale(0.8);
}

/* 动爻信息 */
.moving-yao-section {
    background: linear-gradient(135deg, #FEF9E7 0%, #FDF2E9 100%);
    border: 1px solid var(--gold);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 25px;
}

.moving-yao-section h3 {
    color: var(--primary-dark);
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.moving-yao-item {
    padding: 12px 15px;
    margin-bottom: 10px;
    background: white;
    border-radius: 8px;
    border-left: 4px solid var(--red);
}

.moving-yao-item.yibian {
    border-left-color: var(--gold);
    background: linear-gradient(135deg, #FEF9E7 0%, #FDF2E9 100%);
}

.moving-yao-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 6px;
}

.moving-yao-text {
    line-height: 1.8;
    color: var(--text-dark);
}

.single-zhi-gua {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white !important;
    padding: 3px 12px;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 1px;
}

.yibian-tag {
    background: var(--gold);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.8rem;
    margin-left: 5px;
}

.yao-value {
    color: var(--primary);
    font-weight: 600;
}

.single-zhi-gua-yao {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-left: 5px;
}

.moving-tag {
    background: var(--red);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.8rem;
    margin-left: 5px;
}

/* 卦辞爻辞 */
.text-section {
    margin-top: 25px;
}

.text-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border);
}

.text-tab {
    padding: 10px 25px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    font-family: inherit;
    font-size: 1rem;
    cursor: pointer;
    color: var(--text-light);
    transition: all 0.3s ease;
}

.text-tab:hover {
    color: var(--primary);
}

.text-tab.active {
    color: var(--primary-dark);
    border-bottom-color: var(--primary);
    font-weight: 600;
}

.text-content {
    display: none;
}

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

.text-block {
    background: var(--bg-cream);
    border-radius: 10px;
    padding: 20px;
    line-height: 2;
    font-size: 1.05rem;
}

.text-block h4 {
    color: var(--primary-dark);
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.yao-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.yao-item {
    background: var(--bg-cream);
    border-radius: 10px;
    padding: 15px 20px;
    border-left: 4px solid var(--primary);
}

.yao-item.moving {
    border-left-color: var(--red);
    background: #FDF2E9;
}

.yao-item.yibian {
    border-left-color: var(--gold);
    background: linear-gradient(135deg, #FEF9E7 0%, #FDF2E9 100%);
}

.yao-item.moving.yibian {
    border-left-width: 6px;
    border-image: linear-gradient(to bottom, var(--red), var(--gold)) 1;
}

.yao-position {
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 5px;
}

.yao-text {
    line-height: 1.8;
}

.yao-xiang {
    margin-top: 8px;
    font-size: 0.95rem;
    color: var(--text-light);
    font-style: italic;
}

/* 页脚 */
.footer {
    text-align: center;
    padding: 30px;
    color: var(--text-light);
    font-size: 0.9rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header h1 {
        font-size: 1.8rem;
        letter-spacing: 4px;
    }

    .trigram-selector {
        grid-template-columns: 1fr;
    }

    .trigram-buttons {
        grid-template-columns: repeat(4, 1fr);
    }

    .select-divination {
        grid-template-columns: 1fr;
    }

    .gua-main {
        flex-direction: column;
    }

    .arrow {
        transform: rotate(90deg);
    }

    .control-tabs {
        flex-wrap: wrap;
    }

    .question-section {
        flex-direction: column;
        align-items: stretch;
    }
}

/* 默认：桌面端隐藏手机合并列（必须在 @media 外面） */
.changes-table th.hide-desktop,
.changes-table td.hide-desktop {
    display: none;
}

/* 手机端：三变列合并为一列 */
@media (max-width: 600px) {
    .changes-table-section {
        padding: 12px;
    }

    .changes-table {
        font-size: 0.8rem;
    }

    .changes-table th,
    .changes-table td {
        padding: 6px 4px;
    }

    /* 隐藏独立的三个变列头 */
    .changes-table th.hide-mobile {
        display: none;
    }

    /* 隐藏独立的三变td */
    .changes-table td.hide-mobile {
        display: none;
    }

    /* 显示合并列 */
    .changes-table th.show-mobile {
        display: table-cell;
    }

    .changes-table td.show-mobile {
        display: table-cell;
    }

    /* 合并列内的样式 */
    .mobile-bian-combined {
        text-align: left;
        padding: 4px 6px !important;
    }

    .mobile-bian-combined .mobile-bian-row {
        display: flex;
        align-items: flex-start;
        gap: 4px;
        padding: 2px 0;
        border-bottom: 1px dotted var(--border);
        font-size: 0.72rem;
        line-height: 1.5;
    }

    .mobile-bian-combined .mobile-bian-row:last-child {
        border-bottom: none;
    }

    .mobile-bian-combined .mobile-bian-label {
        flex-shrink: 0;
        font-size: 0.65rem;
        color: var(--gold);
        font-weight: 600;
        background: var(--primary-dark);
        color: #fff !important;
        padding: 1px 5px;
        border-radius: 8px;
        white-space: nowrap;
        margin-top: 1px;
    }

    .mobile-bian-combined .mobile-bian-value {
        flex: 1;
        color: var(--text-dark);
        word-break: break-all;
    }

    .mobile-bian-combined .mobile-bian-value strong {
        color: var(--primary);
    }

    /* 占按钮缩小 */
    .yao-btn {
        padding: 4px 10px;
        font-size: 0.78rem;
    }

    /* 结果行文字缩小 */
    .ying-shu-cell {
        font-size: 0.8rem !important;
    }

    /* 问题栏竖排 */
    .question-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        padding: 12px;
    }

    .question-input-wrapper .question-input {
        width: 100%;
    }

    /* 控制按钮区缩小 */
    .divination-controls {
        padding: 12px;
        gap: 8px;
    }

    .btn-large {
        padding: 12px 30px;
        font-size: 1.1rem;
    }

    /* 说明文字缩小 */
    .divination-note p {
        font-size: 0.82rem;
    }
}

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

.gua-card,
.relation-card,
.yao-item,
.text-block {
    animation: fadeIn 0.5s ease forwards;
}

/* 卦象符号样式 - 仅用于表格内的 yao-line 显示 */
.gua-lines {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

/* 注意：结果区的卦象图形已改为纯内联样式，不依赖以下CSS类 */
/* 以下 .gua-line 类仅用于表格中的 yao-line 显示 */
.gua-line {
    width: 60px;
    height: 8px;
    background: var(--primary-dark);
    border-radius: 4px;
}

.gua-line.yin {
    display: flex;
    justify-content: space-between;
    background: transparent !important;
}

.gua-line.yin::before,
.gua-line.yin::after {
    content: '';
    width: 26px;
    height: 8px;
    background: var(--primary-dark);
    border-radius: 4px;
}

.gua-line.moving {
    background: var(--red);
    position: relative;
}

.gua-line.moving::after {
    content: '×';
    position: absolute;
    right: -20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--red);
    font-weight: bold;
}

.gua-line.yin.moving {
    background: transparent !important;
}

.gua-line.yin.moving::before,
.gua-line.yin.moving::after {
    background: var(--red);
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--border);
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: spin 1s ease-in-out infinite;
}

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