/* 基础样式 */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.5;
    color: #333;
    margin: 0;
    padding: 0;
    background-color: #f9fafb;
}

.title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #111827;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.icon {
    vertical-align: middle;
}

/* 卡片组件 */
.calculator-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: 1.5rem;
}

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

/* Radio按钮组样式 */
.radio-group {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
}

.radio-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.875rem;
    color: #4b5563;
}

.radio-label input[type="radio"] {
    margin-right: 0.5rem;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 1rem;
    height: 1rem;
    border: 1px solid #d1d5db;
    border-radius: 50%;
    outline: none;
    cursor: pointer;
}

.radio-label input[type="radio"]:checked {
    border: 4px solid #4f46e5;
    background-color: white;
}

.radio-label input[type="radio"]:focus {
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.radio-label span {
    font-weight: 400;
}
@media (min-width: 640px) {
    .form-grid {
        /*grid-template-columns: repeat(2, 1fr);*/
    }
}

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

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

.input-wrapper {
    position: relative;
}

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

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: #4f46e5;
    outline: 0;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

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

.select-wrapper {
    position: relative;
}

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

/* 按钮样式 */
.button-container {
    display: flex;
    justify-content: center;
    margin-top: 1.5rem;
    width: 100%;
}

.calculate-button {
    background-color: #4f46e5;
    color: white;
    font-weight: 500;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
    width: 100%;
}

.calculate-button:hover {
    background-color: #4338ca;
}

.calculate-button:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.5);
}

/* 结果卡片 */
.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-top: 1.5rem;
}

.result-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
    margin: 0 0 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

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

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

.result-item.blue {
    background-color: rgba(59, 130, 246, 0.1);
}

.result-item.purple {
    background-color: rgba(124, 58, 237, 0.1);
}

.result-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #6b7280;
    margin: 0 0 0.5rem 0;
}

.result-value {
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
    margin: 0;
    word-break: break-all;
}

/* 批量结果表格 */
.batch-result {
    margin-top: 1rem;
    overflow-x: auto;
}

/* 复制按钮样式 */
.copy-button {
    background-color: #f3f4f6;
    color: #4f46e5;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin-left: 0.5rem;
    transition: all 0.2s ease;
}

.copy-button:hover {
    background-color: #e5e7eb;
}

.copy-button:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.3);
}

.batch-copy-btn {
    margin: 0 4px 0 0;
}

.action-cell {
    display: flex;
    gap: 4px;
    justify-content: flex-start;
    align-items: center;
}

/* 解释文字样式 */
.explanation-card {
    background-color: #f9fafb;
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-top: 1.5rem;
    border: 1px solid #e5e7eb;
}

.explanation-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.explanation-content {
    font-size: 0.875rem;
    color: #4b5563;
    line-height: 1.6;
}

.explanation-section {
    margin-bottom: 1rem;
}

.explanation-section h3 {
    font-size: 1rem;
    font-weight: 500;
    color: #111827;
    margin-bottom: 0.5rem;
}

.explanation-section p {
    margin-bottom: 0.5rem;
}

.example-list {
    margin-left: 1.5rem;
    margin-bottom: 0.5rem;
}

.result-table {
    width: 100%;
    border-collapse: collapse;
}

.result-table th,
.result-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.result-table th {
    font-weight: 500;
    color: #374151;
    background-color: #f9fafb;
}

.result-table tr:last-child td {
    border-bottom: none;
}

/* 工具类 */
.hidden {
    display: none;
}

.active {
    color: #4f46e5;
    background-color: #eff6ff;
}

/* 响应式调整 */
@media (max-width: 640px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    #batchInputContainer {
        grid-column: 1 / -1;
    }
}