.liuyao-page {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: #f5f0e8;
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
    min-height: 100dvh;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

/* APP WebView：游戏页全局 overflow:hidden 会锁死滚动，此处兜底 */
html.yyscha-app-webview body.liuyao-page,
body.yyscha-app-webview.liuyao-page {
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    overscroll-behavior-y: auto;
}

.liuyao-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 10px;
    padding-top: max(10px, env(safe-area-inset-top, 0px));
    padding-bottom: max(24px, env(safe-area-inset-bottom, 0px));
    padding-left: max(10px, env(safe-area-inset-left, 0px));
    padding-right: max(10px, env(safe-area-inset-right, 0px));
}

.liuyao-header {
    text-align: center;
    padding: 15px 44px;
    background: #fff;
    border-bottom: 1px solid #e0d5c5;
    position: relative;
    border-radius: 8px 8px 0 0;
}

.liuyao-header h1 {
    font-size: 20px;
    color: #8B4513;
    font-weight: 600;
}

.liuyao-back {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 22px;
    color: #666;
    text-decoration: none;
    line-height: 1;
    padding: 4px 8px;
}

.liuyao-form-error {
    background: #fff3f3;
    color: #b71c1c;
    padding: 10px 12px;
    border-radius: 6px;
    margin: 10px 0;
    font-size: 14px;
}

.liuyao-form-section {
    background: #fff;
    margin: 10px 0;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.liuyao-form-row {
    display: flex;
    margin-bottom: 12px;
    align-items: center;
    gap: 8px;
}

.liuyao-form-row label {
    width: 80px;
    font-size: 14px;
    color: #666;
    flex-shrink: 0;
}

.liuyao-form-row input,
.liuyao-form-row select {
    flex: 1;
    min-width: 0;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    background: #fff;
}

.liuyao-form-row input:focus,
.liuyao-form-row select:focus {
    outline: none;
    border-color: #8B4513;
}

.liuyao-datetime-group {
    display: flex;
    gap: 5px;
    flex: 1;
    min-width: 0;
}

.liuyao-datetime-group input,
.liuyao-datetime-group select {
    flex: 1;
    min-width: 0;
}

.liuyao-btn-primary {
    display: block;
    width: 100%;
    padding: 12px;
    background: #8B4513;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    margin-top: 10px;
    touch-action: manipulation;
}

.liuyao-btn-primary:active {
    background: #6B3410;
}

.liuyao-result-section {
    display: none;
}

.liuyao-result-section.is-active {
    display: block;
}

.liuyao-info-bar {
    background: #fff;
    padding: 12px 15px;
    margin: 10px 0;
    border-radius: 8px;
    font-size: 13px;
    color: #666;
}

.liuyao-info-row {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 6px;
    gap: 4px 12px;
}

.liuyao-info-row:last-child {
    margin-bottom: 0;
}

.liuyao-info-label {
    color: #999;
}

.liuyao-section-title {
    background: #666;
    color: #fff;
    text-align: center;
    padding: 8px;
    margin: 10px 0 0;
    font-size: 14px;
    border-radius: 4px 4px 0 0;
}

.liuyao-shensha-list {
    background: #fff;
    padding: 12px 15px;
    border-radius: 0 0 8px 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.liuyao-shensha-item {
    display: inline-flex;
    align-items: center;
    font-size: 13px;
    color: #8B4513;
}

.liuyao-shensha-item .label {
    color: #666;
    margin-right: 4px;
}

.liuyao-ganzhi-bar {
    background: #c44536;
    color: #fff;
    text-align: center;
    padding: 10px;
    margin: 10px 0 0;
    font-size: 14px;
    border-radius: 4px 4px 0 0;
    word-break: break-all;
}

.liuyao-gua-table {
    width: 100%;
    background: #fff;
    border-collapse: collapse;
    border-radius: 0 0 8px 8px;
    overflow: hidden;
    table-layout: fixed;
}

.liuyao-gua-table th {
    background: #f5f0e8;
    padding: 10px 4px;
    font-size: 12px;
    color: #666;
    font-weight: normal;
    border-bottom: 1px solid #e0d5c5;
    word-break: break-word;
}

.liuyao-gua-table td {
    padding: 10px 4px;
    text-align: center;
    font-size: 13px;
    border-bottom: 1px solid #f0ebe3;
    vertical-align: middle;
}

.liuyao-gua-table tr:last-child td {
    border-bottom: none;
}

.liuyao-yao-symbol {
    display: inline-block;
    width: 36px;
    max-width: 40%;
    height: 14px;
    background: #333;
    vertical-align: middle;
}

.liuyao-yao-symbol.yin {
    background: transparent;
    border-top: 6px solid #333;
    border-bottom: 6px solid #333;
    height: 14px;
}

.liuyao-yao-symbol.dong {
    box-shadow: inset 0 0 0 2px #c44536;
}

.liuyao-shi-tag,
.liuyao-ying-tag {
    color: #c44536;
    font-size: 12px;
    margin-left: 2px;
}

.liuyao-gua-tag {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    margin-left: 4px;
    vertical-align: middle;
}

.liuyao-gua-tag.chong {
    background: #ffebee;
    color: #c44536;
}

.liuyao-gua-tag.hun {
    background: #e8f5e9;
    color: #2e7d32;
}

.liuyao-gua-tag.gui {
    background: #e3f2fd;
    color: #1565c0;
}

.liuyao-notes-section {
    background: #fff;
    margin: 10px 0;
    padding: 15px;
    border-radius: 8px;
}

.liuyao-notes-section h2 {
    font-size: 15px;
    color: #666;
    margin-bottom: 10px;
    font-weight: 600;
}

.liuyao-notes-content {
    background: #f9f6f0;
    padding: 12px;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.8;
    color: #555;
    min-height: 80px;
    white-space: pre-wrap;
    word-break: break-word;
}

.liuyao-ai-loading {
    text-align: center;
    padding: 20px;
    color: #999;
}

.liuyao-ai-loading .spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-top-color: #8B4513;
    border-radius: 50%;
    animation: liuyao-spin 1s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

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

.liuyao-disclaimer {
    text-align: center;
    padding: 15px;
    font-size: 12px;
    color: #999;
}

.liuyao-seo-intro {
    background: #fff;
    margin: 16px 0 8px;
    padding: 14px 16px;
    border-radius: 8px;
    font-size: 13px;
    color: #666;
    line-height: 1.7;
}

.liuyao-seo-intro h2 {
    font-size: 15px;
    color: #8B4513;
    margin-bottom: 8px;
}

@media (max-width: 380px) {
    .liuyao-form-row {
        flex-direction: column;
        align-items: stretch;
    }

    .liuyao-form-row label {
        width: auto;
    }
}
