@tailwind base;
@tailwind components;
@tailwind utilities;

/* 保留现有的自定义样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
    width: 100%;
}

body {
    font-family: 'PingFang SC', 'Microsoft YaHei', 'SimHei', 'sans-serif', 'Microsoft JhengHei', sans-serif;
    background-color: white;
    color: black;
    min-height: 100vh;
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background-color: white;
    border-radius: 0;
    padding: 30px;
    margin-top: 30px;
    margin-bottom: 30px;
    box-sizing: border-box;
    width: 100%;
}

h1 {
    text-align: center;
    color: #b2955b;
    margin-bottom: 30px;
    font-size: 2.5em;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: black;
    font-size: 1.1em;
}

input, select {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 0;
    font-size: 16px;
    background-color: white;
    color: black;
    border: 2px solid black;
    box-sizing: border-box;
    max-width: 100%;
}

input[type="date"] {
    width: 100%;
    box-sizing: border-box;
    max-width: 100%;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

input:focus, select:focus {
    outline: none;
    border-color: #b2955b;
    border-width: 2px;
}

.analyze-btn {
    width: 100%;
    padding: 15px;
    background-color: black;
    color: white;
    border: 2px solid black;
    border-radius: 0;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 20px;
    transition: all 0.3s ease;
}

.analyze-btn:hover {
    background-color: #b2955b;
    border-color: #b2955b;
}

.analyze-btn:disabled {
    background-color: #ccc;
    border-color: #ccc;
    cursor: not-allowed;
}

.payment-section {
    margin-top: 30px;
    padding: 20px;
    background-color: white;
    border-radius: 0;
    border: 2px solid black;
    display: none;
    text-align: center;
}

.payment-section.show {
    display: block;
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.payment-info {
    background-color: white;
    padding: 20px;
    border-radius: 0;
    margin-bottom: 20px;
    border: 2px solid black;
}

.price {
    font-size: 2em;
    color: #b2955b;
    font-weight: bold;
    margin: 10px 0;
}

.payment-btn {
    background-color: black;
    color: white;
    border: 2px solid black;
    padding: 15px 30px;
    border-radius: 0;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.payment-btn:disabled {
    background-color: #ccc;
    border-color: #ccc;
    cursor: not-allowed;
}

.loading {
    display: none;
    text-align: center;
    padding: 20px;
}

.loading.show {
    display: block;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #b2955b;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.result-section {
    margin-top: 30px;
    padding: 20px;
    background-color: white;
    border-radius: 0;
    border: 2px solid black;
    display: none;
}

.result-section.show {
    display: block;
    animation: fadeIn 0.5s ease-in;
}

.result-title {
    font-size: 1.5em;
    color: #b2955b;
    margin-bottom: 15px;
    border-bottom: 2px solid #b2955b;
    padding-bottom: 10px;
}

.number-analysis {
    background-color: white;
    padding: 15px;
    border-radius: 0;
    margin-bottom: 15px;
    border: 2px solid black;
}

.number-analysis h3 {
    color: #b2955b;
    margin-bottom: 15px;
    font-size: 1.3em;
}

.suggestion {
    background-color: white;
    padding: 15px;
    border-radius: 0;
    border: 2px solid black;
    line-height: 1.6;
}

.suggestion h3 {
    color: #b2955b;
    margin-bottom: 15px;
    font-size: 1.3em;
}

.download-section {
    background-color: white;
    padding: 15px;
    border-radius: 0;
    margin-bottom: 15px;
    border: 2px solid black;
    text-align: center;
}

.download-section h3 {
    color: #b2955b;
    margin-bottom: 15px;
    font-size: 1.3em;
}

.download-btn {
    background-color: black;
    color: white;
    border: 2px solid black;
    padding: 12px 24px;
    border-radius: 0;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.download-btn:hover {
    background-color: #b2955b;
    border-color: #b2955b;
}

.download-btn:disabled {
    background-color: #ccc;
    border-color: #ccc;
    cursor: not-allowed;
}

.bad-attribute {
    color: #b2955b !important;
    font-weight: bold;
}

.good-attribute {
    color: black !important;
    font-weight: bold;
}

.recommendation {
    background-color: #fff3cd;
    border: 2px solid #b2955b;
    border-radius: 0;
    padding: 15px;
    margin-top: 15px;
}

.phone-recommendation {
    background-color: white;
    border: 2px solid #b2955b;
    border-radius: 0;
    padding: 15px;
    margin: 15px 0;
}

.phone-recommendation h4 {
    color: #b2955b;
    margin: 0 0 10px 0;
}

.phone-recommendation p {
    margin: 5px 0;
    color: #b2955b;
}

.phone-list {
    font-family: monospace;
    font-size: 16px;
    color: #b2955b;
    margin: 5px 0;
}

.error-message {
    color: #b2955b;
    font-size: 0.9em;
    margin-top: 5px;
}

.alert {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 0;
    border: 2px solid black;
}

.alert-error {
    color: black;
    background-color: white;
    border-color: #b2955b;
}

.alert-success {
    color: black;
    background-color: white;
    border-color: black;
}

.analysis-item {
    margin: 15px 0;
    padding: 15px;
    background-color: white;
    border-radius: 0;
    border-left: 4px solid #b2955b;
}

.analysis-item h4 {
    color: #b2955b;
    margin-bottom: 10px;
    font-size: 1.1em;
}

.analysis-item p {
    line-height: 1.6;
    margin: 0;
}

.life-gua-info {
    background-color: white;
    padding: 15px;
    border-radius: 0;
    border-left: 4px solid #b2955b;
    margin: 15px 0;
    border: 2px solid black;
}

.life-gua-info h4 {
    color: #b2955b;
    margin-bottom: 10px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    margin: 10px 0;
    padding: 8px 0;
    border-bottom: 2px solid black;
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    font-weight: bold;
    color: black;
}

.info-value {
    color: #b2955b;
    font-weight: 500;
}

input[type="date"] {
    width: 100%;
    padding: 12px;
    border: 2px solid black;
    border-radius: 0;
    font-size: 16px;
    background-color: white;
    color: black;
    cursor: pointer;
}

input[type="date"]:focus {
    outline: none;
    border-color: #b2955b;
}

input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

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

#stripe-payment-form {
    background-color: white;
    padding: 25px;
    border-radius: 0;
    margin: 20px 0;
    border: 2px solid black;
}

.payment-form-title {
    color: #b2955b;
    margin-bottom: 20px;
    font-size: 1.5em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.order-summary {
    background-color: white;
    padding: 20px;
    border-radius: 0;
    margin-bottom: 20px;
    border: 2px solid black;
}

.order-summary h4 {
    margin: 0 0 15px 0;
    color: black;
    font-size: 1.1em;
}

.order-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 2px solid black;
}

.order-total {
    display: flex;
    justify-content: space-between;
    font-weight: bold;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 2px solid #b2955b;
    font-size: 1.1em;
}

.order-total .price {
    color: #b2955b;
    font-size: 1.2em;
}

.card-input-section {
    margin-bottom: 25px;
}

.card-input-label {
    display: block;
    margin-bottom: 10px;
    font-weight: bold;
    color: black;
    font-size: 1em;
}

#card-element {
    padding: 15px;
    border: 2px solid black;
    border-radius: 0;
    background-color: white;
    transition: border-color 0.3s ease;
}

#card-element:focus-within {
    border-color: #b2955b;
}

#card-errors {
    color: #b2955b;
    margin-top: 10px;
    font-size: 14px;
    font-weight: 500;
}

.security-info {
    font-size: 13px;
    color: black;
    line-height: 1.5;
    background-color: white;
    padding: 15px;
    border-radius: 0;
    margin-bottom: 20px;
    border: 2px solid black;
}

.security-info div {
    margin-bottom: 5px;
}

.payment-buttons {
    display: flex;
    gap: 15px;
}

.stripe-pay-btn {
    flex: 1;
    background-color: black;
    color: white;
    border: 2px solid black;
    padding: 16px 30px;
    border-radius: 0;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 50px;
}

.stripe-pay-btn:hover:not(:disabled) {
    background-color: #b2955b;
    border-color: #b2955b;
}

.stripe-pay-btn:disabled {
    background-color: #ccc;
    border-color: #ccc;
    cursor: not-allowed;
}

.cancel-payment-btn {
    background-color: white;
    color: black;
    border: 2px solid black;
    padding: 16px 25px;
    border-radius: 0;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 50px;
}

.cancel-payment-btn:hover {
    background-color: #b2955b;
    color: white;
}

.payment-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.StripeElement {
    box-sizing: border-box;
    height: 40px;
    padding: 10px 12px;
    border: 2px solid black;
    border-radius: 0;
    background-color: white;
}

.StripeElement--focus {
    border-color: #b2955b;
}

.StripeElement--invalid {
    border-color: #b2955b;
}

.StripeElement--webkit-autofill {
    background-color: #fefde5 !important;
}

.security-badges {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
    padding: 15px;
    background-color: white;
    border-radius: 0;
    border: 2px solid black;
}

.security-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: black;
    font-weight: 500;
}

.payment-section .price {
    font-size: 2em;
    color: #b2955b;
    font-weight: bold;
    margin: 15px 0;
}

.payment-section p {
    margin: 10px 0;
    line-height: 1.6;
    color: black;
}

@media (prefers-color-scheme: dark) {
    input[type="date"] {
        background-color: white;
        color: black;
    }
}

@media (max-width: 768px) {
    body {
        padding: 0 !important;
        overflow-x: hidden !important;
        width: 100% !important;
        max-width: 100vw !important;
    }
    
    .container {
        margin: 10px auto !important;
        padding: 15px !important;
        border-radius: 0;
        max-width: calc(100vw - 20px) !important;
        width: calc(100vw - 20px) !important;
        box-sizing: border-box !important;
    }

    h1 {
        font-size: 1.8em;
        margin-bottom: 20px;
    }

    .form-group {
        margin-bottom: 15px;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    label {
        font-size: 1em;
        margin-bottom: 6px;
    }

    input, select {
        padding: 10px !important;
        font-size: 16px !important;
        width: 100% !important;
        box-sizing: border-box !important;
        max-width: 100% !important;
    }
    
    input[type="date"] {
        width: 100% !important;
        box-sizing: border-box !important;
        max-width: 100% !important;
    }

    .analyze-btn {
        padding: 12px;
        font-size: 16px;
        margin-top: 15px;
    }

    .payment-section, .result-section {
        margin-top: 20px;
        padding: 15px;
        border-radius: 0;
    }

    .payment-info {
        padding: 15px;
        margin-bottom: 15px;
    }

    .price {
        font-size: 1.5em;
        margin: 8px 0;
    }

    .payment-btn, .stripe-pay-btn {
        padding: 12px 20px;
        font-size: 16px;
    }

    .number-analysis, .suggestion, .download-section {
        padding: 12px;
        margin-bottom: 12px;
    }

    .result-title {
        font-size: 1.3em;
        margin-bottom: 12px;
        padding-bottom: 8px;
    }

    .number-analysis h3, .suggestion h3, .download-section h3 {
        font-size: 1.1em;
        margin-bottom: 10px;
    }

    .info-row {
        flex-direction: column;
        margin: 8px 0;
        padding: 6px 0;
    }

    .info-row .info-label,
    .info-row .info-value {
        margin-bottom: 4px;
    }

    .analysis-item {
        margin: 10px 0;
        padding: 12px;
    }

    .analysis-item h4 {
        font-size: 1em;
        margin-bottom: 8px;
    }

    .life-gua-info {
        padding: 12px;
        margin: 10px 0;
    }

    .life-gua-info h4 {
        margin-bottom: 8px;
    }

    #stripe-payment-form {
        padding: 15px;
        margin: 15px 0;
        border-radius: 0;
    }

    .payment-form-title {
        font-size: 1.2em;
        margin-bottom: 15px;
    }

    .order-summary {
        padding: 15px;
        margin-bottom: 15px;
    }

    .order-summary h4 {
        font-size: 1em;
        margin-bottom: 10px;
    }

    .card-input-section {
        margin-bottom: 20px;
    }

    .card-input-label {
        font-size: 0.95em;
        margin-bottom: 8px;
    }

    #card-element {
        padding: 12px;
    }

    .security-info {
        font-size: 12px;
        padding: 12px;
        margin-bottom: 15px;
    }

    .payment-buttons {
        flex-direction: column;
        gap: 10px;
    }

    .stripe-pay-btn, .cancel-payment-btn {
        padding: 14px 20px;
        font-size: 15px;
        min-height: 45px;
    }

    .security-badges {
        flex-direction: column;
        gap: 10px;
        margin-top: 15px;
        padding: 12px;
    }

    .security-badge {
        font-size: 12px;
        justify-content: center;
    }

    .recommendation, .phone-recommendation {
        padding: 12px;
        margin: 10px 0;
        border-radius: 0;
    }

    .phone-recommendation h4 {
        font-size: 1em;
        margin-bottom: 8px;
    }

    .phone-list {
        font-size: 14px;
    }

    .download-btn {
        padding: 10px 20px;
        font-size: 14px;
    }

    .alert {
        padding: 12px;
        margin-bottom: 15px;
        border-radius: 0;
    }

    .error-message {
        font-size: 0.85em;
        margin-top: 4px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 0 !important;
        overflow-x: hidden !important;
        width: 100% !important;
        max-width: 100vw !important;
    }
    
    .container {
        margin: 5px auto !important;
        padding: 10px !important;
        max-width: calc(100vw - 10px) !important;
        width: calc(100vw - 10px) !important;
        box-sizing: border-box !important;
    }

    h1 {
        font-size: 1.6em;
        margin-bottom: 15px;
    }

    .form-group {
        width: 100% !important;
        box-sizing: border-box !important;
    }

    input, select {
        padding: 8px !important;
        font-size: 16px !important;
        width: 100% !important;
        box-sizing: border-box !important;
        max-width: 100% !important;
    }
    
    input[type="date"] {
        width: 100% !important;
        box-sizing: border-box !important;
        max-width: 100% !important;
    }

    .payment-buttons {
        gap: 8px;
    }

    .stripe-pay-btn, .cancel-payment-btn {
        padding: 12px 15px;
        font-size: 14px;
        min-height: 40px;
    }

    .price {
        font-size: 1.3em;
    }

    .payment-form-title {
        font-size: 1.1em;
    }

    .security-badges {
        padding: 10px;
    }
}

.email-download-section {
    margin-top: 30px;
    padding: 25px;
    background-color: white;
    border-radius: 0;
    border: 2px solid black;
}

.section-header {
    text-align: center;
    margin-bottom: 20px;
}

.section-header h2 {
    color: #b2955b;
    font-size: 1.5em;
    margin-bottom: 10px;
}

.section-header p {
    color: black;
    font-size: 1em;
    line-height: 1.4;
}

.email-btn {
    width: 100%;
    padding: 12px 20px;
    background-color: black;
    color: white;
    border: 2px solid black;
    border-radius: 0;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.email-btn:hover {
    background-color: #b2955b;
    border-color: #b2955b;
}

.email-btn:active {
    background-color: black;
}

.email-btn:disabled {
    background-color: #ccc;
    border-color: #ccc;
    cursor: not-allowed;
}

.email-result {
    margin-top: 15px;
    padding: 15px;
    border-radius: 0;
    font-weight: bold;
    text-align: center;
    display: none;
    border: 2px solid black;
}

.email-result.success {
    background-color: white;
    color: black;
    display: block;
}

.email-result.error {
    background-color: white;
    color: #b2955b;
    display: block;
}

.email-result.loading {
    background-color: white;
    color: black;
    display: block;
}

.toggle-section {
    text-align: center;
    margin-top: 20px;
    margin-bottom: 20px;
}

.toggle-btn {
    padding: 10px 20px;
    background-color: white;
    color: black;
    border: 2px solid black;
    border-radius: 0;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.toggle-btn:hover {
    background-color: #b2955b;
    color: white;
}

.toggle-btn.active {
    background-color: black;
    color: white;
}

@media (max-width: 768px) {
    .email-download-section {
        margin-top: 20px;
        padding: 20px;
    }
    
    .section-header h2 {
        font-size: 1.3em;
    }
    
    .section-header p {
        font-size: 0.9em;
    }
    
    .email-btn {
        padding: 12px 15px;
        font-size: 14px;
    }
    
    .toggle-btn {
        padding: 8px 16px;
        font-size: 12px;
    }
    
    .footer-ads {
        flex-direction: column !important;
        gap: 15px;
    }
    
    .ad-item {
        margin: 0 !important;
    }
    
    .ad-item img {
        max-height: 100px !important;
    }
}

.footer-ads {
    transition: all 0.3s ease;
    border: 2px solid black;
    padding: 20px;
    margin-top: 30px;
    background-color: white;
}

.footer-ads .ad-item img {
    border: 2px solid black;
}

.footer-ads .ad-item img:hover {
    transform: scale(1.05);
}

.footer-ads .ad-item a {
    transition: all 0.3s ease;
    color: black;
    text-decoration: none;
}

.footer-ads .ad-item a:hover {
    opacity: 0.9;
}

.footer-ads .ad-item a:hover div {
    color: #b2955b !important;
    transform: translateY(-2px);
}

@media (max-width: 600px) {
    .footer-ads {
        flex-direction: column !important;
        gap: 15px;
    }
    
    .ad-item {
        margin: 0 !important;
    }
    
    .ad-item img {
        max-height: 100px !important;
    }
    
    .ad-item div {
        font-size: 12px !important;
    }
}