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

/* 导航栏样式 */
.nav {
    background-color: white;
    border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

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

.nav-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #111827;
    font-weight: 600;
    font-size: 1.125rem;
}

.nav-logo .icon {
    margin-right: 0.5rem;
}

.nav-links {
    display: flex;
    align-items: center;
}

.nav-dropdown {
    position: relative;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    color: #374151;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease, background-color 0.2s ease;
    border-bottom: 3px solid transparent;
}

.nav-link:hover {
    color: #2563eb;
    background-color: #f8fafc;
}

.dropdown-arrow {
    margin-left: 0.5rem;
    transition: transform 0.2s ease;
    width: 16px;
    height: 16px;
}

.nav-dropdown:hover .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    min-width: 200px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
}

.nav-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: block;
    padding: 0.75rem 1rem;
    color: #374151;
    text-decoration: none;
    font-size: 0.875rem;
    transition: background-color 0.2s ease, color 0.2s ease;
    border-bottom: 1px solid #f3f4f6;
}

.dropdown-item:last-child {
    border-bottom: none;
    border-radius: 0 0 0.5rem 0.5rem;
}

.dropdown-item:first-child {
    border-radius: 0.5rem 0.5rem 0 0;
}

.dropdown-item:hover {
    background-color: #f8fafc;
    color: #2563eb;
}

/* 响应式导航 */
@media (max-width: 768px) {
    .nav-container {
        display: none;
    }
    
    .nav-links {
        flex-direction: column;
        width: 100%;
    }
    
    .nav-dropdown {
        width: 100%;
    }
    
    .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: none;
        border-radius: 0;
        background-color: #f8fafc;
        display: none;
    }
    
    .nav-dropdown:hover .dropdown-menu {
        display: block;
    }
}

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;
}



.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;
}

/* 分类标题样式 */
.category-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
    margin: 2rem 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e5e7eb;
}

a {
    text-decoration: none;
}

/* 工具列表样式 */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

@media (min-width: 640px) {
    .tools-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .tools-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.tool-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: 1rem;
    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 {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

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

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

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

.tool-icon.blue {
    background-color: #4F46E5;
}

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

.tool-icon.purple {
    background-color: #7C3AED;
}

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

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

.tool-icon.teal {
    background-color: #0D9488;
}

.tool-icon.indigo {
    background-color: #4338CA;
}

.tool-card .tool-info .tool-title {
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.25rem;
}

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

/* 卡片样式 */
.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 {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

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

.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;
}