* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Microsoft Yahei', Arial, sans-serif;
}
body {
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}
header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 0;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}
header h1 {
    font-size: 1.9rem;
    margin-bottom: 10px;
}
header p.notice {
    font-size: 0.9rem;
    opacity: 0.9;
}
.container {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 10px;
}
.fortune-type {
    text-align: center;
    margin-bottom: 30px;
}
.fortune-type h2 {
    color: #4a5568;
    display: block;
    padding: 10px 20px;
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    width: 50%;
    max-width: 480px;
    margin: 0 auto;
    box-sizing: border-box;
}
.card {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    padding: 25px;
    margin-bottom: 30px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}
.card-header {
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 15px;
    margin-bottom: 20px;
}
.card-header h3 {
    font-size: 1.5rem;
    color: #667eea;
    display: flex;
    align-items: center;
    gap: 10px;
}
.card-header h3 i {
    font-size: 1.2rem;
}
.fortune-basics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}
.basic-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
}
.basic-item label {
    font-size: 0.9rem;
    color: #718096;
    margin-bottom: 8px;
}
.basic-item value {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2d3748;
}
.score-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}
.score-item {
    text-align: center;
    padding: 12px 10px;
    background-color: #f5f7ff;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}
.score-item .label {
    font-size: 0.85rem;
    color: #718096;
    margin-bottom: 5px;
}
.score-item .value {
    font-size: 1.2rem;
    font-weight: bold;
    color: #667eea;
}
.ai-card {
    margin-top: 10px;
}
.ai-header h3 {
    font-size: 1.2rem;
    color: #2d3748;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}
.ai-header h3 i {
    color: #667eea;
}
.ai-subtitle {
    font-size: 0.9rem;
    color: #718096;
    margin-bottom: 12px;
}
.ai-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}
.ai-suggestions {
    margin: 8px 0 4px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.ai-suggest-btn {
    padding: 4px 10px;
    border-radius: 8px;
    border: none;
    background-color: #eef2ff;
    font-size: 0.85rem;
    color: #4a5568;
    cursor: pointer;
    align-self: flex-start;
    text-align: left;
}
.ai-input {
    display: flex;
    gap: 8px;
    margin: 20px 0;
}
.ai-input input[type="text"] {
    flex: 1;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    font-size: 0.9rem;
    outline: none;
}
.ai-input input[type="text"]:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 1px rgba(102, 126, 234, 0.3);
}
.ai-input button {
    padding: 8px 14px;
    border-radius: 8px;
    border: none;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    font-size: 0.9rem;
    cursor: pointer;
    white-space: nowrap;
}
.ai-btn {
    padding: 6px 14px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    background: #ffffff;
    cursor: pointer;
    font-size: 0.9rem;
    color: #4a5568;
}
.ai-btn.active {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
}
.ai-output {
    font-size: 0.95rem;
    color: #4a5568;
    line-height: 1.7;
    background-color: #f8fafc;
    border-radius: 12px;
    padding: 10px 12px;
    min-height: 120px;
    max-height: 320px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.ai-msg {
    padding: 8px 12px;
    border-radius: 8px;
    max-width: 80%;
    word-break: break-word;
}
.ai-msg.user {
    background-color: #4c6fff;
    color: #ffffff;
    margin-left: auto;
    border-bottom-right-radius: 4px;
}
.ai-msg.ai {
    background-color: #ffffff;
    color: #1f2933;
    margin-right: auto;
    border-bottom-left-radius: 8px;
}
.ai-msg.ai p {
    margin: 0 0 0.5em;
}
.ai-msg.ai p:last-child {
    margin-bottom: 0;
}
.ai-msg.ai ul, .ai-msg.ai ol {
    margin: 0.5em 0;
    padding-left: 1.2em;
}
.ai-msg.ai li {
    margin-bottom: 0.25em;
}
.ai-msg.ai strong {
    font-weight: 600;
}
.ai-msg.ai h1, .ai-msg.ai h2, .ai-msg.ai h3 {
    font-size: 0.95em;
    margin: 0.6em 0 0.3em;
    font-weight: 600;
}
.ai-msg.loading {
    background-color: transparent;
    box-shadow: none;
    padding: 4px 0;
}
.ai-dots {
    display: inline-flex;
    gap: 4px;
}
.ai-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #a3b6ff;
    animation: ai-bounce 1s infinite ease-in-out;
}
.ai-dot:nth-child(2) {
    animation-delay: 0.15s;
}
.ai-dot:nth-child(3) {
    animation-delay: 0.3s;
}
@keyframes ai-bounce {
    0%, 80%, 100% {
        transform: scale(0.6);
        opacity: 0.4;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}
.fortune-details {
    margin-top: 20px;
}
.detail-item {
    margin-bottom: 15px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
}
.detail-item h4 {
    font-size: 1.1rem;
    color: #2d3748;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.detail-item p {
    font-size: 1rem;
    color: #4a5568;
    line-height: 1.7;
}
footer {
    background-color: #2d3748;
    color: white;
    padding: 30px 0;
    margin-top: 20px;
}
.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    text-align: center;
}
footer p {
    margin-bottom: 10px;
    font-size: 0.9rem;
    opacity: 0.9;
}
footer .copyright {
    font-size: 0.85rem;
    opacity: 0.7;
}
@media (max-width: 768px) {
    footer {
        margin-bottom: 325px;
    }
    body.vip-ad-minimized footer {
        margin-bottom: 0;
    }
    header h1 {
        font-size: 1.8rem;
    }
    .fortune-type {
        margin-bottom: 20px;
    }
    .fortune-type h2 {
        font-size: 1.4rem;
        padding: 8px 12px;
        width: 100%;
        box-sizing: border-box;
        border-radius: 12px;
        box-shadow: 0 2px 6px rgba(0,0,0,0.04);
    }
    .card {
        padding: 20px;
    }
    .card-header h3 {
        font-size: 1.3rem;
    }
    .fortune-basics {
        grid-template-columns: repeat(3, 1fr);
    }

    .score-container {
        grid-template-columns: repeat(3, 1fr);
    }
    .ai-msg {
        max-width: 100%;
    }
    .ai-msg.user,
    .ai-msg.ai {
        margin-left: 0;
        margin-right: 0;
    }
}
@media (max-width: 480px) {
    .fortune-basics {
        grid-template-columns: repeat(3, 1fr);
    }
    .score-container {
        grid-template-columns: repeat(3, 1fr);
    }
}
.selector-bar {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    padding: 20px;
    margin-bottom: 24px;
}
@media (max-width: 768px) {
    .container.selector-bar {
        margin-left: 10px;
        margin-right: 10px;
    }
}
.type-switch {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.type-switch button {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    background: #f0f0f0;
    color: #555;
}
.type-switch button.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}
.zodiac-items {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}
.zodiac-items button {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 10px 8px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    background: #fff;
    color: #333;
}
.zodiac-items button img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}
.zodiac-items button:hover, .zodiac-items button.active {
    border-color: #667eea;
    background: #f0ebff;
    color: #667eea;
}
@media (max-width: 768px) {
    .zodiac-items {
        grid-template-columns: repeat(2, 1fr);
    }
    .type-switch {
        width: 100%;
        justify-content: center;
    }
    .type-switch button {
        flex: 1;
        max-width: 50%;
        text-align: center;
    }
}
.period-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.period-tabs .tab-btn {
    flex: 1;
    min-width: 0;
    text-align: center;
    padding: 12px 18px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    background: #fff;
    color: #555;
}
.period-tabs .tab-btn.active {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}
@media (max-width: 768px) {
    .period-tabs {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    .period-tabs .tab-btn:nth-child(5) {
        grid-column: 1 / -1;
    }
}
#loading-msg {
    text-align: center;
    padding: 60px 20px;
    color: #718096;
    font-size: 1.1rem;
}
#loading-msg.loading {
    color: #667eea;
}
#loading-msg.error {
    color: #e53e3e;
}
#fortune-cards {
    display: none;
}
#fortune-cards.visible {
    display: block;
}

/* VIP 脚本固定悬浮展示 */
@keyframes vip-shake {
    0%, 100% { transform: translateX(0); }
    15% { transform: translateX(-4px); }
    35% { transform: translateX(4px); }
    55% { transform: translateX(-3px); }
    75% { transform: translateX(3px); }
    90% { transform: translateX(-1px); }
}
.vip-script-wrapper {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    max-width: 320px;
    margin: 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    animation: vip-shake 0.8s ease-in-out 2s infinite;
}
.vip-script-wrapper:hover,
.vip-script-wrapper:focus-within {
    animation-play-state: paused;
}
.vip-minimize-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.15);
    color: #555;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    z-index: 10;
    transition: background 0.2s, color 0.2s;
}
.vip-minimize-btn:hover {
    background: rgba(0, 0, 0, 0.25);
    color: #333;
}
@keyframes vip-text-flash {
    0% { color: #fff; }
    15% { color: #ffd700; }
    30% { color: #ff6b6b; }
    45% { color: #4ecdc4; }
    60% { color: #ff9f43; }
    75% { color: #a29bfe; }
    90% { color: #fd79a8; }
    100% { color: #fff; }
}
.vip-expand-btn {
    position: fixed;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    width: 32px;
    height: 120px;
    padding: 0;
    border: none;
    border-radius: 10px 0 0 10px;
    background: rgba(45, 55, 72, 0.95);
    color: #fff;
    animation: vip-text-flash 2.5s ease-in-out infinite;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 600;
    writing-mode: vertical-rl;
    letter-spacing: 3px;
    z-index: 9999;
    box-shadow: -3px 0 16px rgba(0, 0, 0, 0.25);
    transition: background 0.2s, width 0.2s;
}
.vip-expand-btn:hover {
    background: #2d3748;
    width: 40px;
}
.vip-script-wrapper.vip-minimized .vip-minimize-btn,
.vip-script-wrapper.vip-minimized .vip-ad-content {
    display: none !important;
}
.vip-script-wrapper.vip-minimized {
    max-width: 0;
    min-width: 0;
    width: 0;
    padding: 0;
    overflow: hidden;
    box-shadow: none;
    animation: none;
    background: transparent;
}
@media (max-width: 768px) {
    .vip-script-wrapper {
        bottom: 10px;
        left: 0;
        right: 0;
        max-width: none;
    }
    .vip-script-wrapper.vip-minimized {
        left: auto;
    }
    .vip-expand-btn {
        height: 130px;
    }
}