@keyframes shimmer {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes sparkle {

    0%,
    100% {
        opacity: 0.3;
    }

    50% {
        opacity: 1;
    }
}

@keyframes shine {
    0% {
        left: -100%;
    }

    100% {
        left: 100%;
    }
}

/* 自定義滾動條樣式 - 深色系、細版 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #4a4a4a 0%, #2a2a2a 100%);
    border-radius: 4px;
    border: 1px solid rgba(255, 215, 0, 0.2);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #5a5a5a 0%, #3a3a3a 100%);
    border-color: rgba(255, 215, 0, 0.4);
}

/* Firefox 滾動條樣式 */
* {
    scrollbar-width: thin;
    scrollbar-color: #3a3a3a rgba(0, 0, 0, 0.2);
}

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

body {
    background: linear-gradient(135deg, #1a0a0a 0%, #2d1810 50%, #1a0a0a 100%);
    min-height: 100vh;
    color: #f5e6d3;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.star-field {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.star {
    position: absolute;
    width: 2px;
    height: 2px;
    background: #FFD700;
    border-radius: 50%;
    animation: sparkle 2s ease-in-out infinite;
}

.container {
    position: relative;
    z-index: 1;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.golden-header {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 50%, #FF8C00 100%);
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
    color: #2C1810;
    margin-bottom: 2rem;
    box-shadow: 0 8px 32px rgba(255, 215, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.golden-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg, transparent, rgba(255, 255, 255, 0.3), transparent, rgba(255, 215, 0, 0.4), transparent);
    animation: shimmer 3s linear infinite;
}

.golden-header h1,
.golden-header p {
    position: relative;
    z-index: 1;
    margin: 0.5rem 0;
}

.golden-header h1 {
    font-size: 2.5rem;
    font-weight: bold;
}

.golden-header p {
    font-size: 1.2rem;
}

.glass-card {
    background: rgba(42, 25, 15, 0.85);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 215, 0, 0.3);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    margin-bottom: 1.5rem;
}

.input-grid {
    display: grid;
    gap: 1.5rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.input-group label {
    color: #FFD700;
    font-weight: bold;
}

.date-inputs,
.time-inputs {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr;
    gap: 0.5rem;
}

.time-inputs {
    grid-template-columns: 1fr 1fr;
}

input,
select {
    background: rgba(42, 25, 15, 0.6);
    border: 2px solid rgba(255, 215, 0, 0.3);
    color: #f5e6d3;
    padding: 0.75rem;
    border-radius: 10px;
    transition: all 0.3s ease;
    font-size: 1rem;
}

input:focus,
select:focus {
    outline: none;
    border-color: #FFD700;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
}

input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: #c4b5fd;
    margin-top: 0.5rem;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    cursor: pointer;
}

.golden-btn {
    background: linear-gradient(135deg, #FFD700 0%, #FF8C00 100%);
    color: #2C1810;
    border: none;
    border-radius: 25px;
    padding: 1rem 2rem;
    font-weight: bold;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 140, 0, 0.3);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.golden-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
    transition: left 0.5s;
}

.golden-btn:hover::before {
    left: 100%;
}

.golden-btn:hover {
    background: linear-gradient(135deg, #FFBF00 0%, #FF6B00 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 140, 0, 0.5);
}

.synastry-btn {
    background: linear-gradient(135deg, #FF69B4 0%, #FF1493 100%);
}

.synastry-btn:hover {
    background: linear-gradient(135deg, #FF1493 0%, #C71585 100%);
}

.control-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.small-btn {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

.download-buttons {
    display: flex;
    gap: 0.5rem;
}

.download-btn {
    background: rgba(255, 215, 0, 0.2);
    border: 2px solid rgba(255, 215, 0, 0.5);
    color: #FFD700;
    padding: 0.5rem 1rem;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.download-btn:hover {
    background: rgba(255, 215, 0, 0.3);
    border-color: #FFD700;
    transform: translateY(-2px);
}

.small-margin {
    margin-top: 1rem;
}

.info-card {
    text-align: center;
    font-size: 1.1rem;
    color: #FFD700;
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.full-width {
    grid-column: 1 / -1;
}

.glass-card h2 {
    font-size: 1.8rem;
    font-weight: bold;
    margin-bottom: 1rem;
    color: #FFD700;
    text-align: center;
}

.glass-card h3 {
    font-size: 1.3rem;
    font-weight: bold;
    margin-bottom: 1rem;
    color: #FFD700;
}

.glass-card h4 {
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 0.75rem;
    color: #FFA500;
}

.table-scroll {
    max-height: 600px;
    overflow-y: auto;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 0.5rem;
}

th {
    color: #FFD700;
    font-weight: bold;
    padding: 0.75rem;
    text-align: left;
    font-size: 0.9rem;
    position: sticky;
    top: 0;
    background: rgba(42, 25, 15, 0.95);
    z-index: 10;
}

td {
    background: rgba(255, 215, 0, 0.05);
    padding: 0.75rem;
    border-top: 1px solid rgba(255, 215, 0, 0.2);
    border-bottom: 1px solid rgba(255, 215, 0, 0.2);
    font-size: 0.95rem;
}

td:first-child {
    border-left: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 10px 0 0 10px;
    font-weight: bold;
}

td:last-child {
    border-right: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 0 10px 10px 0;
}

tr:hover td {
    background: rgba(255, 215, 0, 0.1);
}

.aspects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 0.75rem;
}

.aspect-item {
    background: rgba(255, 215, 0, 0.05);
    padding: 0.75rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 215, 0, 0.2);
    font-size: 0.9rem;
}

.aspect-item strong {
    color: #FFD700;
}

.themes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.theme-card {
    background: linear-gradient(135deg, #FFD700 0%, #FFBF00 50%, #FF8C00 100%);
    border-radius: 15px;
    padding: 1.5rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid #FFA500;
    position: relative;
    overflow: hidden;
}

.theme-card:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 40px rgba(255, 140, 0, 0.5);
}

.theme-card .icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.theme-card .name {
    font-weight: bold;
    font-size: 1.1rem;
    color: #2C1810;
}

.analysis-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.analysis-content {
    line-height: 1.8;
    font-size: 1.05rem;
}

.analysis-content p {
    margin-bottom: 1rem;
}

.analysis-content h2 {
    color: #FFD700;
    font-size: 1.5rem;
    font-weight: bold;
    margin-top: 2rem;
    margin-bottom: 1rem;
    padding-left: 1rem;
    border-left: 5px solid #FFD700;
    background: linear-gradient(90deg, rgba(255, 215, 0, 0.15), transparent);
    padding: 0.75rem 0 0.75rem 1rem;
    border-radius: 5px;
}

.analysis-content h3 {
    color: #FFA500;
    font-size: 1.3rem;
    font-weight: bold;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    padding-left: 0.75rem;
    border-left: 4px solid #FFA500;
}

.analysis-content h4 {
    color: #FFD700;
    font-size: 1.1rem;
    font-weight: bold;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    padding-left: 0.5rem;
    border-left: 3px solid rgba(255, 215, 0, 0.6);
}

.analysis-content ul,
.analysis-content ol {
    margin-left: 2rem;
    margin-bottom: 1rem;
}

.analysis-content li {
    margin-bottom: 0.5rem;
    line-height: 1.8;
}

.analysis-content strong {
    color: #c4b5fd;
    font-weight: bold;
}

.chat-history {
    max-height: 600px;
    overflow-y: auto;
    margin-bottom: 1rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

.chat-message {
    display: flex;
    margin-bottom: 1rem;
}

.chat-message.user {
    justify-content: flex-end;
}

.chat-message.assistant {
    justify-content: flex-start;
}

.chat-bubble {
    max-width: 80%;
    padding: 1.25rem;
    border-radius: 15px;
    line-height: 1.8;
    font-size: 1rem;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.chat-message.user .chat-bubble {
    background: linear-gradient(135deg, #FFD700, #FF8C00);
    color: #2C1810;
    font-weight: 500;
}

.chat-message.assistant .chat-bubble {
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.3);
    color: #f5e6d3;
}

.chat-bubble p {
    margin-bottom: 0;
}

.chat-bubble p:last-child {
    margin-bottom: 0;
}

.chat-bubble ul,
.chat-bubble ol {
    margin-left: 1.5rem;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

.chat-bubble li {
    margin-bottom: 0.4rem;
}

.chat-input-area {
    display: flex;
    gap: 0.5rem;
}

.chat-input-area input {
    flex: 1;
}

/* 響應式設計 */
@media (max-width: 768px) {
    .container {
        padding: 1rem 0.5rem;
    }

    .golden-header h1 {
        font-size: 1.8rem;
    }

    .golden-header p {
        font-size: 1rem;
    }

    .glass-card {
        padding: 1.5rem 1rem;
    }

    .result-grid {
        grid-template-columns: 1fr;
    }

    .themes-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    }

    .date-inputs {
        grid-template-columns: 1fr;
    }

    .time-inputs {
        grid-template-columns: 1fr 1fr;
    }

    .control-buttons {
        flex-direction: column;
        align-items: stretch;
    }

    .download-buttons {
        justify-content: center;
    }

    .aspects-grid {
        grid-template-columns: 1fr;
    }

    .chat-bubble {
        max-width: 90%;
    }
}