* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

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

/* 头部样式 */
header {
    text-align: center;
    margin-bottom: 40px;
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

header h1 {
    font-size: 3em;
    color: #8B4513;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.subtitle {
    font-size: 1.2em;
    color: #666;
    font-style: italic;
}

/* 占卜类型选择 */
.category-section {
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.category-section h2 {
    text-align: center;
    margin-bottom: 25px;
    color: #8B4513;
    font-size: 1.8em;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.category-btn {
    padding: 15px 20px;
    border: 2px solid #ddd;
    background: #f8f9fa;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1em;
    font-weight: 500;
}

.category-btn:hover {
    background: #e9ecef;
    border-color: #8B4513;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.category-btn.selected {
    background: #8B4513;
    color: white;
    border-color: #8B4513;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(139, 69, 19, 0.3);
}

.selected-category {
    text-align: center;
    font-size: 1.1em;
    color: #666;
    margin-top: 15px;
}

#selected-category-text {
    font-weight: bold;
    color: #8B4513;
}

/* 占卜按钮 */
.divination-section {
    text-align: center;
    margin-bottom: 40px;
}

.divination-btn {
    padding: 20px 40px;
    font-size: 1.5em;
    background: linear-gradient(45deg, #FFD700, #FFA500);
    color: #8B4513;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.3);
    font-weight: bold;
}

.divination-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(255, 215, 0, 0.4);
}

.divination-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    box-shadow: none;
}

.instruction {
    margin-top: 15px;
    color: #666;
    font-style: italic;
}

/* 钱币动画 */
.coins-section {
    background: rgba(255, 255, 255, 0.95);
    padding: 40px;
    border-radius: 15px;
    margin-bottom: 30px;
    text-align: center;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.coins-section h3 {
    margin-bottom: 30px;
    color: #8B4513;
    font-size: 1.5em;
}

.coins-container {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

/* 基础信息样式 */
.basic-info {
    background: linear-gradient(135deg, #f8f4e6, #f0e68c);
    border: 2px solid #d4af37;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.basic-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.basic-info-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 8px;
    border: 1px solid #d4af37;
}

.basic-info-label {
    font-weight: bold;
    color: #8b4513;
    font-size: 14px;
}

.basic-info-value {
    font-weight: bold;
    font-size: 16px;
    color: #2c3e50;
}

.jixiong-good {
    color: #27ae60 !important;
}

.jixiong-bad {
    color: #e74c3c !important;
}

.jixiong-neutral {
    color: #f39c12 !important;
}

/* 选中结果样式 */
.selected-result {
    background: linear-gradient(135deg, #e8f5e8, #d4edda);
    border: 2px solid #28a745;
}

.selected-result .result-item-title {
    color: #155724;
    font-weight: bold;
}

/* 钱币样式 - 仿古铜钱 */
.coin {
    width: 80px;
    height: 80px;
    perspective: 1000px;
    margin: 0 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    color: #8b4513;
    position: relative;
    box-shadow: 
        inset 0 2px 4px rgba(0, 0, 0, 0.3),
        0 2px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.6s ease-in-out;
}

.coin-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.8s;
    transform-style: preserve-3d;
}

.coin.flipping .coin-inner {
    animation: flip 2s ease-in-out;
}

.coin-front, .coin-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2em;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.coin-front {
    background: radial-gradient(circle at 30% 30%, #d4af37, #b8860b, #8b6914);
    border: 3px solid #654321;
    color: #8B4513;
}

.coin-back {
    background: radial-gradient(circle at 30% 30%, #cd853f, #a0522d, #8b4513);
    border: 3px solid #654321;
    color: white;
    transform: rotateY(180deg);
}

/* 铜钱中间的方孔 */
.coin-front::before, .coin-back::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: #2c3e50;
    border-radius: 2px;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* 铜钱正面文字 */
.coin-front::after {
    content: '正';
    position: absolute;
    font-size: 12px;
    font-weight: bold;
    color: #8b4513;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    z-index: 1;
}

/* 铜钱反面文字 */
.coin-back::after {
    content: '反';
    position: absolute;
    font-size: 12px;
    font-weight: bold;
    color: #654321;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    z-index: 1;
}

.coin.heads .coin-inner {
    transform: rotateY(0deg);
}

.coin.tails .coin-inner {
    transform: rotateY(180deg);
}

@keyframes flip {
    0% { transform: rotateY(0); }
    50% { transform: rotateY(900deg); }
    100% { transform: rotateY(1800deg); }
}

.coins-result {
    font-size: 1.3em;
    color: #8B4513;
    font-weight: bold;
    margin-top: 20px;
}

/* 占卜结果 */
.result-section {
    background: rgba(255, 255, 255, 0.95);
    padding: 40px;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.result-section h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #8B4513;
    font-size: 2em;
}

.result-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    flex-wrap: wrap;
    gap: 15px;
}

.result-code, .result-coins {
    font-size: 1.2em;
    font-weight: bold;
}

.result-code span:first-child,
.result-coins span:first-child {
    color: #666;
}

.result-code span:last-child,
.result-coins span:last-child {
    color: #8B4513;
    margin-left: 10px;
}

.result-details {
    background: #fff;
    padding: 25px;
    border-radius: 10px;
    border-left: 5px solid #8B4513;
    line-height: 1.8;
    font-size: 1.1em;
}

.result-item {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.result-item-title {
    font-weight: bold;
    color: #8B4513;
    margin-bottom: 8px;
    font-size: 1.1em;
}

.result-item-content {
    color: #333;
    line-height: 1.6;
}

.restart-btn {
    display: block;
    margin: 30px auto 0;
    padding: 15px 30px;
    background: linear-gradient(45deg, #28a745, #20c997);
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.3);
}

.restart-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(40, 167, 69, 0.4);
}

/* 底部 */
footer {
    text-align: center;
    padding: 20px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9em;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 2em;
    }
    
    .category-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 10px;
    }
    
    .result-header {
        flex-direction: column;
        text-align: center;
    }
    
    .coins-container {
        gap: 10px;
    }
    
    .coin {
        width: 60px;
        height: 60px;
        margin: 0 5px;
    }
}