/* Base styles */
:root {
    --primary-color: #8B5CF6;
    --background-color: #000000;
    --nav-background: #1A1A1A;
    --text-color: #FFFFFF;
    --input-background: rgba(255, 255, 255, 0.1);
    --border-color: rgba(255, 255, 255, 0.2);
    --button-color: #8B5CF6;
    --chart-blue: #5116b4;
    --chart-purple: #2759ac;
    --chart-pink: #9444a3;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Navigation */
.top-nav {
    background-color: var(--nav-background);
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
    transition: opacity 0.3s ease;
}

.logo:hover {
    opacity: 0.8;
}

.logo-img {
    height: 32px;
    width: auto;
    object-fit: contain;
}

.logo-text {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-color);
}

.explore-more {
    color: var(--text-color);
    text-decoration: none;
    font-size: 1rem;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: background-color 0.3s ease;
}

.explore-more:hover {
    background-color: rgba(139, 92, 246, 0.1);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

/* Input Section */
.input-section {
    margin: 2rem auto;
    width: 25%;
    min-width: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.input-group {
    margin-bottom: 1.5rem;
    width: 100%;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-color);
    font-weight: 500;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
input[type="time"],
select {
    width: 100%;
    padding: 0.75rem;
    background-color: var(--input-background);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-color);
    font-size: 1rem;
    transition: border-color 0.3s ease;
    line-height: normal;
    display: flex;
    align-items: center;
}

select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M2.5 4.5L6 8L9.5 4.5' stroke='white' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

select:focus {
    outline: none;
    border-color: var(--primary-color);
}

select option {
    background-color: var(--background-color);
    color: var(--text-color);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="date"]:focus,
input[type="time"]:focus {
    outline: none;
    border-color: var(--primary-color);
}

input[type="text"]::placeholder,
input[type="email"]::placeholder,
input[type="tel"]::placeholder,
input[type="time"]::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.submit-btn {
    background-color: var(--button-color);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    margin-top: 1rem;
    width: 100%;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.submit-btn:hover {
    background-color: #7C3AED;
    transform: translateY(-2px);
}

.submit-btn:active {
    transform: translateY(0);
}

.btn-text {
    flex: none;
}

.btn-icon {
    width: 28px;
    height: 28px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.submit-btn:hover .btn-icon {
    background-color: rgba(255, 255, 255, 0.3);
    transform: translateX(2px);
}

.btn-icon svg {
    width: 14px;
    height: 14px;
    color: white;
}

/* Date Input Styles */
input[type="date"] {
    width: 100%;
    padding: 0.75rem;
    background-color: var(--input-background);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-color);
    font-size: 1rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    opacity: 0.6;
    cursor: pointer;
}

input[type="date"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

input[type="date"]::-webkit-datetime-edit {
    color: var(--text-color);
}

input[type="date"]::-webkit-datetime-edit-fields-wrapper {
    color: var(--text-color);
}

input[type="date"]::-webkit-datetime-edit-text {
    color: var(--text-color);
    opacity: 0.7;
}

input[type="date"]::-webkit-datetime-edit-month-field,
input[type="date"]::-webkit-datetime-edit-day-field,
input[type="date"]::-webkit-datetime-edit-year-field {
    color: var(--text-color);
}

input[type="date"]::-webkit-inner-spin-button {
    display: none;
}

input[type="date"]::-webkit-clear-button {
    display: none;
}

/* 为空时的占位符颜色 */
input[type="date"]:invalid {
    color: rgba(255, 255, 255, 0.5);
}

/* Time input specific styles */
input[type="time"] {
    color-scheme: dark;
}

input[type="time"]::-webkit-calendar-picker-indicator {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"></circle><polyline points="12,6 12,12 16,14"></polyline></svg>');
    background-size: 16px 16px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

input[type="time"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

input[type="time"]::-webkit-datetime-edit {
    color: white;
}

input[type="time"]::-webkit-datetime-edit-fields-wrapper {
    background: transparent;
}

input[type="time"]::-webkit-datetime-edit-text {
    color: rgba(255, 255, 255, 0.7);
    padding: 0 0.2em;
}

input[type="time"]::-webkit-datetime-edit-hour-field,
input[type="time"]::-webkit-datetime-edit-minute-field {
    background: transparent;
    color: white;
}

input[type="time"]::-webkit-inner-spin-button {
    display: none;
}

input[type="time"]::-webkit-clear-button {
    display: none;
}

/* Energy Chart Section */
.energy-section {
    background: var(--nav-background);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    border: 1px solid var(--border-color);
    width: 100%;
    max-width: 100%;
}

/* Legend styling to match chart colors */
.legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: nowrap;
    width: 100%;
    min-width: min-content;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    flex-shrink: 0;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    flex-shrink: 0;
}

.legend-color.health { background-color: #5116b4; }
.legend-color.career { background-color: #2759ac; }
.legend-color.love { background-color: #9444a3; }

/* Chart Canvas */
canvas {
    width: 100% !important;
    height: 400px !important;
    margin-top: 20px;
}

/* Tablet Responsive Design (768px - 1024px) */
@media (max-width: 1024px) and (min-width: 769px) {
    .nav-content {
        padding: 0 16px;
    }
    
    .container {
        padding: 16px;
        gap: 1.5rem;
    }
    
    .input-section {
        width: 40%;
        min-width: 280px;
    }
    
    .energy-section {
        padding: 20px;
    }
    
    canvas {
        height: 350px !important;
    }
}

/* Mobile Responsive Design (< 768px) */
@media (max-width: 768px) {
    .nav-content {
        padding: 0 16px;
    }
    
    .logo-img {
        height: 28px;
    }
    
    .logo-text {
        font-size: 1.1rem;
    }
    
    .explore-more {
        font-size: 0.9rem;
        padding: 0.4rem 0.8rem;
    }
    
    .container {
        padding: 16px;
        gap: 1.5rem;
    }

    .input-section {
        width: 90%;
        min-width: auto;
        margin: 1rem auto;
    }
    
    .input-group {
        margin-bottom: 1.2rem;
    }
    
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="date"],
    input[type="time"] {
        padding: 0.8rem;
        font-size: 16px; /* 防止 iOS 缩放 */
    }
    
    .submit-btn {
        padding: 0.9rem 2rem;
        font-size: 1rem;
        gap: 10px;
    }
    
    .btn-icon {
        width: 26px;
        height: 26px;
    }
    
    .btn-icon svg {
        width: 12px;
        height: 12px;
    }

    .energy-section {
        padding: 16px;
        width: 100%;
        margin-bottom: 16px;
    }
    
    .legend {
        justify-content: center;
        padding: 0 10px;
        gap: 15px;
    }
    
    .legend-item {
        gap: 4px;
        font-size: 0.9em;
    }
    
    .legend-color {
        width: 12px;
        height: 12px;
    }
    
    canvas {
        height: 300px !important;
    }
}

/* Mobile Navigation Responsive Design (< 600px) */
@media (max-width: 600px) {
    .logo-text {
        font-size: 0.9rem;
    }
}

/* Small Mobile Responsive Design (< 480px) */
@media (max-width: 480px) {
    .nav-content {
        padding: 0 12px;
    }
    
    .logo-img {
        height: 24px;
    }
    
    .logo-text {
        font-size: 0.8rem;
    }
    
    .explore-more {
        font-size: 0.8rem;
        padding: 0.3rem 0.6rem;
    }
    
    .container {
        padding: 12px;
        gap: 1rem;
    }

    .input-section {
        width: 95%;
        margin: 0.5rem auto;
    }
    
    .input-group {
        margin-bottom: 1rem;
    }
    
    .input-group label {
        font-size: 0.9rem;
    }
    
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="date"],
    input[type="time"] {
        padding: 0.7rem;
        font-size: 16px;
    }
    
    .submit-btn {
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
        gap: 8px;
    }
    
    .btn-icon {
        width: 24px;
        height: 24px;
    }
    
    .btn-icon svg {
        width: 10px;
        height: 10px;
    }

    .energy-section {
        padding: 12px;
        margin-bottom: 12px;
    }
    
    .legend {
        gap: 10px;
        justify-content: center;
    }
    
    .legend-item {
        gap: 5px;
        font-size: 0.9rem;
    }
    
    canvas {
        height: 250px !important;
    }
}

/* Landscape orientation optimization for mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .container {
        gap: 1rem;
    }
    
    .input-section {
        margin: 0.5rem auto;
    }
    
    canvas {
        height: 250px !important;
    }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
    .submit-btn {
        min-height: 44px; /* iOS 推荐的最小触摸目标 */
    }
    
    .explore-more {
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="date"],
    input[type="time"] {
        min-height: 44px;
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    canvas {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Footer */
.footer {
    padding: 2rem 0;
    margin-top: 3rem;
    text-align: center;
}

.footer p {
    margin: 0;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    font-weight: 400;
    letter-spacing: 0.5px;
}

/* Footer responsive design */
@media (max-width: 768px) {
    .footer {
        padding: 1.5rem 1rem;
        margin-top: 2rem;
    }
    
    .footer p {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .footer {
        padding: 1rem;
        margin-top: 1.5rem;
    }
    
    .footer p {
        font-size: 0.75rem;
        line-height: 1.4;
    }
}

/* Contact Section */
.contact-section {
    margin: 2rem auto;
    width: 25%;
    min-width: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.contact-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    text-align: left;
    color: var(--text-color);
    width: 100%;
}

.contact-subtitle {
    text-align: center;
    margin-bottom: 2rem;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.contact-fields {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.contact-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.contact-field label {
    font-weight: 500;
    color: var(--text-color);
    font-size: 0.9rem;
}

.contact-field input,
.contact-field textarea {
    padding: 0.75rem;
    background-color: var(--input-background);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-color);
    font-size: 1rem;
    transition: border-color 0.3s ease;
    width: 100%;
}

.contact-field input:focus,
.contact-field textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.contact-field textarea {
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
}

.contact-actions {
    display: flex;
    justify-content: center;
}

.contact-submit {
    background-color: var(--button-color);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.contact-submit:hover {
    background-color: #7C3AED;
    transform: translateY(-2px);
}

.contact-social {
    margin-top: 2rem;
    text-align: center;
}

.contact-icons {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.contact-icons li a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 1.2rem;
    transition: color 0.3s ease;
}

.contact-icons li a:hover {
    color: var(--primary-color);
}

.contact-footnote {
    margin-top: 1rem;
    text-align: center;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
}

.contact-footnote a {
    color: var(--primary-color);
    text-decoration: none;
}

.contact-footnote a:hover {
    text-decoration: underline;
}

/* Contact section responsive design */
@media (max-width: 1024px) and (min-width: 769px) {
    .contact-section {
        width: 30%;
        min-width: 350px;
    }
}

@media (max-width: 768px) {
    .contact-section {
        width: 50%;
        min-width: 280px;
        margin: 1.5rem auto;
    }
    
    .contact-title {
        font-size: 1.3rem;
    }
    
    .contact-field textarea {
        padding: 0.8rem;
        font-size: 16px;
    }
    
    .contact-submit {
        padding: 0.9rem 2rem;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .contact-section {
        width: 95%;
        margin: 0.5rem auto;
    }
    
    .contact-title {
        font-size: 1.2rem;
    }
    
    .contact-field textarea {
        padding: 0.8rem;
        font-size: 16px;
    }
    
    .contact-submit {
        padding: 0.9rem 2rem;
        font-size: 1rem;
    }
} 