/* 基础样式 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    background-color: #f9fafb;
    color: #111827;
    line-height: 1.5;
}

.container {
    min-height: 100vh;
    padding: 2rem 1rem;
    max-width: 64rem;
    margin: 0 auto;
}

.tool-container {
    padding: 2rem 1rem;
    max-width: 64rem;
    margin: 0 auto;
}
.tool-card {
    border-radius: 0.5rem;
    padding: 1rem 0.5rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
    display: flex;
    flex-direction: row;
    align-items: center;
    text-align: left;
    height: auto;
}

.tool-card:hover {
    background-color: #e3e4e6;
}

.tool-icon {
    width: 2rem;
    height: 2rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    flex-shrink: 0;
}

.tool-icon svg {
    width: 1rem;
    height: 1rem;
    color: white;
}

.tool-card .tool-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex-grow: 1;
}

.tool-icon.blue {
    background-color: #3b82f6;
}

.tool-icon.green {
    background-color: #10b981;
}

.tool-icon.purple {
    background-color: #8b5cf6;
}

.tool-icon.orange {
    background-color: #f59e0b;
}

.tool-icon.red {
    background-color: #ef4444;
}

.tool-icon.teal {
    background-color: #14b8a6;
}

.tool-card .tool-info .tool-title {
    font-size: 1rem;
    color: rgb(26, 26, 26);
    margin-bottom: 0.25rem;
}

.tool-card .tool-info .tool-description {
    font-size: 0.75rem;
    color: #6b7280;
    line-height: 1.4;
}

.tool-content {
    display: flex;
    gap: 16px;
}
.tool-list {
    width: 25%;
}

.header {
    text-align: center;
    margin-bottom: 2rem;
}

.title {
    font-size: 1.875rem;
    font-weight: 700;
    color: #111827;
    display: flex;
    align-items: center;
    justify-content: center;
}

.title .icon {
    margin-right: 0.5rem;
}

.subtitle {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: #6b7280;
}

/* 卡片样式 */
.calculator-card, .result-card {
    background-color: white;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

/* 表单样式 */
.form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.form-group {
    margin-bottom: 0.5rem;
}

.form-label {
    display: flex;
    align-items: center;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.25rem;
}

.form-label .icon {
    margin-right: 0.5rem;
}

.input-wrapper, .select-wrapper {
    position: relative;
}

.form-input, .form-select {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 1rem;
    line-height: 1.5;
    color: #111827;
    background-color: white;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-input:focus, .form-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

.form-input {
    padding-right: 3rem;
}

.input-suffix {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7280;
    font-size: 0.875rem;
    pointer-events: none;
}

.select-wrapper {
    position: relative;
}

.select-icon {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7280;
    pointer-events: none;
}

/* 按钮样式 */
.button-container {
    margin-top: 1.5rem;
}

.calculate-button {
    display: flex;
    width: 100%;
    justify-content: center;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 0.375rem;
    background-color: #2563eb;
    color: white;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.15s ease-in-out, transform 0.1s ease-in-out;
}

.calculate-button:hover {
    background-color: #1d4ed8;
    transform: scale(1.02);
}

.calculate-button:active {
    transform: scale(0.98);
}

/* 结果卡片样式 */
.result-card {
    display: block;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.result-card.hidden {
    display: none;
    opacity: 0;
    transform: translateY(20px);
}

/* 信用卡分期推广样式 */
.credit-card-promo {
    background-color: #fffbeb;
    border: 1px solid #fef3c7;
    border-radius: 0.375rem;
    padding: 1rem;
    margin: 1.5rem 0;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.promo-content {
    display: flex;
    align-items: center;
}

.promo-content .icon {
    flex-shrink: 0;
    color: #f59e0b;
    margin-right: 1rem;
}

.promo-text p {
    margin: 0;
    font-size: 0.875rem;
    color: #78350f;
}

.promo-text p:first-child {
    margin-bottom: 0.25rem;
}

.promo-text a {
    color: #d97706;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s ease;
}

.promo-text a:hover {
    color: #b45309;
    text-decoration: underline;
}

.result-title {
    font-size: 1.125rem;
    font-weight: 500;
    color: #111827;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
}

.result-title .icon {
    margin-right: 0.5rem;
}

.result-summary {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
    .result-summary {
        grid-template-columns: 1fr 1fr 1fr;
    }
}

.result-item {
    padding: 1rem;
    border-radius: 0.5rem;
}

.result-item.blue {
    background-color: #eff6ff;
}

.result-item.purple {
    background-color: #f5f3ff;
}

.result-item.green {
    background-color: #ecfdf5;
}

.result-label {
    font-size: 0.875rem;
}

.result-item.blue .result-label {
    color: #1e40af;
}

.result-item.purple .result-label {
    color: #5b21b6;
}

.result-item.green .result-label {
    color: #065f46;
}

.result-value {
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 0.25rem;
}

.result-item.blue .result-value {
    color: #2563eb;
}

.result-item.purple .result-value {
    color: #7c3aed;
}

.result-item.green .result-value {
    color: #059669;
}

/* 表格样式 */
.table-container {
    overflow-x: auto;
}

.result-table {
    min-width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.result-table th {
    padding: 0.75rem 1.5rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    color: #6b7280;
    background-color: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.result-table td {
    padding: 1rem 1.5rem;
    font-size: 0.875rem;
    color: #6b7280;
    border-bottom: 1px solid #e5e7eb;
    white-space: nowrap;
}

/* 页脚样式 */
.footer {
    text-align: center;
    font-size: 0.875rem;
    color: #6b7280;
    padding: 1rem 0;
    border-top: 1px solid #e5e7eb;
}

.footer-link {
    color: #2563eb;
    text-decoration: none;
}

.footer-link:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

/* AI建议按钮样式 */
.ai-advice-container {
    margin: 1.5rem 0;
    text-align: center;
}

.ai-advice-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.ai-advice-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.ai-advice-button:active {
    transform: translateY(0);
}

/* 弹窗样式 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    max-width: 800px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    transform: scale(0.9) translateY(20px);
    transition: all 0.3s ease;
}

/* PC端弹窗更大宽度 */
@media (min-width: 768px) {
    .modal-content {
        width: 80%;
        max-width: 900px;
    }
}

.modal-overlay.show .modal-content {
    transform: scale(1) translateY(0);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.modal-title {
    font-size: 1.125rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 0.25rem;
    transition: background-color 0.2s ease;
}

.modal-close:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.modal-body {
    padding: 1.5rem;
    max-height: 60vh;
    overflow-y: auto;
}

.ai-advice-content {
    min-height: 200px;
    margin-bottom: 1.5rem;
}

.advice-placeholder {
    text-align: center;
    color: #6b7280;
    padding: 2rem;
    background-color: #f9fafb;
    border-radius: 0.5rem;
    border: 2px dashed #d1d5db;
}

.advice-text {
    line-height: 1.6;
    color: #374151;
    white-space: pre-wrap;
}

.modal-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.generate-advice-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    border-radius: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.generate-advice-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.generate-advice-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.generate-advice-btn.loading {
    opacity: 0.8;
}

.generate-advice-btn.loading .icon {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        max-height: 90vh;
    }
    
    .modal-header {
        padding: 1rem;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    .modal-title {
        font-size: 1rem;
    }
    
    .ai-advice-button,
    .generate-advice-btn {
        padding: 0.625rem 1.25rem;
        font-size: 0.8125rem;
    }
    .tool-content {
        flex-wrap: wrap;
        gap: 0;
    }
    .tool-list {
        width: 100%;
    }
}

/* 加载动画 */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* 按钮加载状态 */
.generate-advice-btn.loading {
    opacity: 0.7;
    cursor: not-allowed;
}

/* AI建议文本样式 */
.advice-text {
    line-height: 1.8;
    color: #374151;
    font-size: 0.95rem;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.advice-text h1,
.advice-text h2,
.advice-text h3,
.advice-text h4,
.advice-text h5,
.advice-text h6 {
    color: #1f2937;
    margin: 1rem 0 0.5rem 0;
    font-weight: 600;
}

.advice-text p {
    margin: 0.75rem 0;
}

.advice-text ul,
.advice-text ol {
    margin: 0.75rem 0;
    padding-left: 1.5rem;
}

.advice-text li {
    margin: 0.25rem 0;
}

.advice-text strong {
    color: #1f2937;
    font-weight: 600;
}

/* 使用限制提示样式 */
.usage-limit-tip {
    font-size: 0.75rem;
    color: #6b7280;
    text-align: center;
    line-height: 1.4;
    display: flex;
    align-items: center;
}

.usage-limit-tip .highlight {
    color: #dc2626;
    font-weight: 500;
}

/* DeepSeek说明样式 */
.deepseek-info {
    font-size: 0.75rem;
    color: #6b7280;
    text-align: center;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e5e7eb;
}

.deepseek-info .brand {
    color: #4f46e5;
    font-weight: 500;
}

.advice-text code {
    background-color: #f3f4f6;
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
}