/* 基础变量 */
:root {
    /* 颜色 */
    --f-primary-color: #6B46C1;
    --f-primary-hover: #805AD5;
    --f-color-1: #2D3748;
    --f-color-2: #4A5568;
    --f-color-white: #FFFFFF;
    --f-bg-1: #F7FAFC;
    --f-border-color: #E2E8F0;

    /* 字体大小 */
    --f-font-size-sm: 0.875rem;
    --f-font-size-base: 1rem;
    --f-font-size-lg: 1.125rem;
    --f-font-size-xl: 1.25rem;

    /* 圆角 */
    --f-radius-md: 0.375rem;
    --f-radius-lg: 0.5rem;

    /* 阴影 */
    --f-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --f-shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* 通用按钮样式 */
.f-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-size: var(--f-font-size-base);
    font-weight: 500;
    line-height: 1.5;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    cursor: pointer;
    user-select: none;
    border: 1px solid transparent;
    border-radius: var(--f-radius-md);
    transition: all 0.2s ease-in-out;
}

.f-button-primary {
    background: linear-gradient(135deg, var(--f-primary-color), var(--f-primary-hover));
    color: var(--f-color-white);
    box-shadow: 0 4px 15px rgba(107, 70, 193, 0.2);
}

/* 表单基础样式 */
#zhouyiForm {
    display: none;
    margin-top: 2rem;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    box-shadow: var(--f-shadow-sm);
}

.f-form-item {
    margin-bottom: 1.5rem;
}

.f-label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--f-color-1);
    font-weight: 500;
}

.f-input,
.f-textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 2px solid var(--f-border-color);
    border-radius: var(--f-radius-md);
    font-size: var(--f-font-size-base);
    transition: all 0.3s ease;
    background: var(--f-bg-1);
}

.f-input:focus,
.f-textarea:focus {
    border-color: var(--f-primary-color);
    background: white;
    box-shadow: 0 0 0 3px rgba(107, 70, 193, 0.1);
    outline: none;
}

.f-textarea {
    min-height: 120px;
    resize: vertical;
}

/* 表单标签样式 */
.numbered-label {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--f-color-1);
    margin-bottom: 12px;
    display: block;
    position: relative;
    padding-left: 10px;
    border-left: 3px solid var(--f-primary-color);
}

.numbered-label:before {
    content: '';
    position: absolute;
    left: -3px;
    top: -3px;
    width: 3px;
    height: calc(100% + 6px);
    background: linear-gradient(to bottom, var(--f-primary-color), var(--f-primary-hover));
    border-radius: 3px;
}

/* 铜钱容器样式 */
.coin-container {
    margin: 30px 0;
    text-align: center;
    padding: 20px;
    background: #fff; /* 修改背景色 */
    border-radius: var(--f-radius-lg);
    box-shadow: var(--f-shadow-sm);
}

/* 铜钱样式 */
.coin {
    display: inline-block;
    width: 60px;
    height: 60px;
    margin: 0 15px;
    background: linear-gradient(135deg, #FFD700, #FFC107);
    border: 2px solid #B7791F;
    border-radius: 50%;
    line-height: 60px;
    text-align: center;
    font-size: 24px;
    color: var(--f-color-1);
    box-shadow: var(--f-shadow-md);
    transition: all 0.3s ease;
}

/* 铜钱动画 */
@keyframes flip {
    0% {
        transform: rotateY(0) scale(1);
    }
    50% {
        transform: rotateY(360deg) scale(1.1);
    }
    100% {
        transform: rotateY(720deg) scale(1);
    }
}

/* 阴阳样式 */
.coin.yin {
    background: linear-gradient(135deg, #E2E8F0, #CBD5E0);
    border-color: #718096;
    color: var(--f-color-2);
}

.coin.yang {
    background: linear-gradient(135deg, #FFD700, #F6AD55);
    border-color: #C05621;
    color: var(--f-color-1);
}

/* 结果显示区域 */
.coin-result {
    margin: 25px 0;
    padding: 20px;
    background: var(--f-bg-1);
    border-radius: var(--f-radius-lg);
    font-size: var(--f-font-size-lg);
    color: var(--f-color-1);
    box-shadow: var(--f-shadow-sm);
    border: 1px solid var(--f-border-color);
}

/* 进度指示器 */
.toss-progress {
    margin: 20px 0;
    font-size: var(--f-font-size-sm);
    color: var(--f-color-2);
}

.toss-progress .current {
    color: var(--f-primary-color);
    font-weight: 600;
}

/* 卦象显示区域 */
#hexagramDisplay {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    margin: 20px auto;
    padding: 20px;
    max-width: 800px;
    gap: 60px;
}

.hexagram-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0 20px;
}

/* 卦象标题 */
.hexagram-title {
    font-size: 18px;
    margin-bottom: 15px;
    font-weight: bold;
}

/* 卦象图形 */
.hexagram {
    display: flex;
    flex-direction: column-reverse;
    gap: 10px;
    margin-bottom: 20px;
    align-items: center;
}

/* 爻线 */
.yao {
    width: 100px;
    height: 20px;
    background-color: #333;
    position: relative;
}

.yao.yin {
    display: flex;
    justify-content: space-between;
    background: none;
}

.yao.yin::before,
.yao.yin::after {
    content: '';
    width: 45%;
    height: 100%;
    background-color: #333;
    display: block;
}

/* 变爻动画效果 */
.yao.changing {
    animation: flash 2s infinite;
}

@keyframes flash {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* 卦象名称和符号 */
.hexagram-symbol {
    font-size: 24px;
    margin: 10px 0;
    font-family: "SimSun", serif;
}

.hexagram-name {
    font-size: 18px;
    margin: 5px 0;
    text-align: center;
    color: #333;
}

/* 移动端适配 */
@media (max-width: 768px) {
    #hexagramDisplay {
        flex-direction: column;
        align-items: center;
        gap: 30px;
    }

    .hexagram-section {
        margin: 0;
    }

    .yao {
        width: 80px;
    }
}

/* 解卦按钮样式 */
.submit-button {
    width: 100%;
    max-width: 400px;
    padding: 1rem 2rem;
    font-size: 1.2rem;
    border-radius: var(--f-radius-lg);
    position: relative;
    overflow: hidden;
}

.submit-button {
    background: linear-gradient(135deg, var(--f-primary-color), var(--f-primary-hover));
    color: var(--f-color-white);
    box-shadow: 0 4px 15px rgba(107, 70, 193, 0.2);
}

.submit-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(107, 70, 193, 0.3);
    background: linear-gradient(135deg, var(--f-primary-hover), var(--f-primary-color));
}

.submit-button:active {
    transform: translateY(1px);
    box-shadow: 0 2px 10px rgba(107, 70, 193, 0.2);
}

.submit-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transition: 0.5s;
}

.submit-button:hover::before {
    left: 100%;
}

.submit-button i {
    margin-right: 10px;
    font-size: 1.1em;
}

.submit-button .price-tag {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.2rem 0.8rem;
    border-radius: var(--f-radius-md);
    margin-left: 10px;
    font-size: 0.9em;
}

.service-note {
    display: block;
    text-align: center;
    color: var(--f-color-2);
    font-size: var(--f-font-size-sm);
    margin-top: 0.5rem;
}

.service-note i {
    margin-right: 5px;
    color: var(--f-primary-color);
}

.action-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 2rem;
}

/* 结果显示样式 */
.divination-result {
    padding: 20px;
    background: #fff;
    border-radius: 8px;
}

.result-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.querent-info {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    color: #666;
}

.querent-info span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.result-section-title {
    color: #4a5568;
    font-size: 1.1em;
    margin: 20px 0 10px;
    padding-bottom: 8px;
    border-bottom: 2px solid #edf2f7;
    display: flex;
    align-items: center;
    gap: 8px;
}

.result-section-title i {
    color: #718096;
}

.result-content {
    line-height: 1.6;
    color: #2d3748;
}

.result-content li {
    margin: 8px 0;
    padding-left: 20px;
    position: relative;
    list-style: none;
}

.result-content li:before {
    content: "•";
    position: absolute;
    left: 0;
    color: #718096;
}

.result-footer {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.result-note {
    color: #718096;
    font-size: 0.9em;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 结果操作按钮样式 */
.result-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e2e8f0;
}

.result-actions button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-md);
}

.result-actions button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.result-actions button:active {
    transform: translateY(0);
}

.result-actions button i {
    margin-right: 0.5rem;
}

.result-actions button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none;
}

/* 投掷按钮样式 */
#tossCoin {
    background: var(--f-primary-color);
    color: var(--f-color-white);
    border: none;
    padding: 1rem 3rem;
    border-radius: var(--f-radius-md);
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--f-shadow-sm);
    margin: 1rem auto;
    min-width: 280px;
    text-align: center;
}

#tossCoin .fa-yin-yang {
    margin-right: 8px;
}

#tossCoin .toss-text {
    font-weight: 500;
}

#tossCoin .toss-count {
    display: none;
}

#tossCoin:hover {
    background: var(--f-primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--f-shadow-md);
}

#tossCoin:active {
    transform: translateY(1px);
}

#tossCoin:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 铜钱容器样式 */
.coin-container {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 20px 0;
}

.coin {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(145deg, #e6e6e6, #ffffff);
    box-shadow: 5px 5px 10px #d9d9d9, -5px -5px 10px #ffffff;
    transition: transform 2s ease-out;
    transform-style: preserve-3d;
    position: relative;
}

.coin.heads::after,
.coin.tails::after {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #4a4a4a;
    backface-visibility: hidden;
}

.coin.heads::after {
    content: '阳';
}

.coin.tails::after {
    content: '阴';
    transform: rotateY(180deg);
}

@keyframes flip {
    0% { transform: rotateY(0); }
    100% { transform: rotateY(360deg); }
}

/* 投掷区域样式 */
.toss-container {
    display: flex;
    flex-direction: column;
    align-items: center;  /* 确保子元素水平居中 */
    width: 100%;  /* 确保容器占满宽度 */
    margin: 1rem 0;
    text-align: center;  /* 确保内部文本居中 */
}

/* 卦象显示样式 */
#hexagramDisplay {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin: 2rem auto;
    max-width: 600px;
    padding: 1rem;
}

.hexagram-original,
.hexagram-changing {
    flex: 1;
    text-align: center;
    padding: 1rem;
    background: var(--f-bg-1);
    border-radius: var(--f-radius-lg);
    box-shadow: var(--f-shadow-sm);
}

.hexagram-title {
    font-size: 1.2rem;
    color: var(--f-color-1);
    margin-bottom: 1rem;
    font-weight: 600;
}

.hexagram-name {
    font-size: 1.1rem;
    color: var(--f-color-2);
    margin: 0.5rem 0;
}

/* 爻线样式 */
.hexagram-lines {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin: 1rem 0;
    padding: 0 2rem;
}

.yao {
    width: 100px;
    height: 20px;
    background-color: #333;
    position: relative;
    margin: 0.25rem 0;
}

.yao.yin {
    display: flex;
    justify-content: space-between;
    background: none;
}

.yao.yin::before,
.yao.yin::after {
    content: '';
    width: 45%;
    height: 100%;
    background-color: #333;
    display: block;
}

.yao.changing {
    animation: changing 2s infinite;
}

@keyframes changing {
    0% { opacity: 1; }
    50% { opacity: 0.3; }
    100% { opacity: 1; }
}

/* 移动端适配 */
@media (max-width: 768px) {
    #hexagramDisplay {
        flex-direction: column;
        align-items: center;
        gap: 30px;
    }

    .hexagram-section {
        margin: 0;
    }

    .yao {
        width: 80px;
    }
}

/* 投掷按钮容器样式 */
.divination-area {
    text-align: center;
    margin: 25px auto;
    padding: 20px;
    width: 100%;
}

/* 投掷按钮样式 */
#tossCoin {
    display: inline-block;
    background: var(--f-primary-color);
    color: var(--f-color-white);
    border: none;
    padding: 1rem 3rem;
    border-radius: var(--f-radius-md);
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--f-shadow-sm);
    margin: 1rem auto;
    min-width: 280px;
}

#tossCoin .fa-yin-yang {
    margin-right: 8px;
}

#tossCoin .toss-text {
    font-weight: 500;
}

/* 隐藏计数显示 */
#tossCoin .toss-count {
    display: none;
}

/* 解卦按钮样式 */
#zhouyiForm .f-btn[type="submit"] {
    background: linear-gradient(135deg, var(--f-primary-color), var(--f-primary-hover));
    color: var(--f-color-white);
    font-size: 1.2rem;
    padding: 1rem 3.5rem;
    border-radius: var(--f-radius-lg);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(107, 70, 193, 0.2);
    display: block;
    width: 100%;
    max-width: 400px;
    margin: 2rem auto;
    position: relative;
    overflow: hidden;
}

#zhouyiForm .f-btn[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(107, 70, 193, 0.3);
    background: linear-gradient(135deg, var(--f-primary-hover), var(--f-primary-color));
}

#zhouyiForm .f-btn[type="submit"]:active {
    transform: translateY(1px);
    box-shadow: 0 2px 10px rgba(107, 70, 193, 0.2);
}

#zhouyiForm .f-btn[type="submit"]::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transition: 0.5s;
}

#zhouyiForm .f-btn[type="submit"]:hover::before {
    left: 100%;
}

/* 性别选择样式 */
.f-radio-group {
    display: flex;
    gap: 20px;
    margin-top: 8px;
}

.f-radio {
    position: relative;
    display: flex;
    align-items: center;
    cursor: pointer;
}

.f-radio input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.f-radio span {
    display: inline-flex;
    align-items: center;
    padding: 8px 24px;
    border: 2px solid var(--f-border-color);
    border-radius: var(--f-radius-md);
    font-size: var(--f-font-size-base);
    color: var(--f-color-2);
    transition: all 0.2s ease;
}

.f-radio span:before {
    content: "";
    font-family: "Font Awesome 6 Free";
    margin-right: 8px;
    font-weight: 900;
}

.f-radio input[value="male"] + span:before {
    content: "\f222";
}

.f-radio input[value="female"] + span:before {
    content: "\f221";
}

.f-radio:hover span {
    border-color: var(--f-primary-color);
    color: var(--f-primary-color);
    background-color: rgba(107, 70, 193, 0.05);
}

.f-radio input:checked + span {
    background-color: var(--f-primary-color);
    border-color: var(--f-primary-color);
    color: white;
}

/* 周易算命描述样式 */
.divination-info {
    background: linear-gradient(145deg, #ffffff, #f8f9ff);
    border: 2px solid var(--f-primary-color);
    border-radius: var(--f-radius-lg);
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(107, 70, 193, 0.1);
    position: relative;
    overflow: hidden;
}

.divination-info:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--f-primary-color), var(--f-primary-hover));
}

.divination-info .fas {
    font-size: 24px;
    color: var(--f-primary-color);
    margin-right: 15px;
    float: left;
}

.divination-info .info-content {
    overflow: hidden;
}

.divination-info h4 {
    color: var(--f-primary-color);
    font-size: 1.25rem;
    margin: 0 0 10px 0;
    font-weight: 600;
}

.divination-info p {
    color: var(--f-color-2);
    margin: 0;
    line-height: 1.6;
    font-size: 1rem;
}
