.tool-content {
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
    padding: 1.2em;
    border-radius: .6em;
    position: relative;
}

.text-item {
    display: flex;
    flex-direction: column;
    gap: 15px;
    font-family: var(--font-simple);
    margin-bottom: 1.2em;
}

/*单选框*/
.text-item .item-radio {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 0;
}

.text-item .item-radio .text-radio {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 33.3%;
}

.text-item .item-radio .text-radio > label {
    display: block;
    width: 110px;
    padding-right: 10px;
    text-align: right;
}

/*输入框*/
.item-input {
    display: flex;
    align-items: center;
    justify-content: start;
    flex-wrap: wrap;
    gap: 1em;
}

.item-input .input-group {
    display: flex;
    align-items: center;
    justify-content: start;
    width: calc(50% - 0.5em);
    gap: 0 12px;
}

.item-input .input-group label {
    min-width: 80px;
    text-align: right;
}

.item-input .input-group .input-text {
    display: flex;
    flex: 1;
    height: 40px;
    border: solid 1px #ddd;
    background-color: var(--main-bg);
    padding: 0 12px;
    border-radius: 7px;
    font-family: var(--font-simple);
    outline: none;
    font-size: 14px;
}

.item-input .input-group .input-text:focus {
    border-color: #5a4df8;
    background-color: #f8f7fd;
    box-shadow: inset 0 1px 4px rgba(90, 77, 248, 0.2), 0 0 0 2px rgba(90, 77, 248, 0.1);
}

.item-input .input-group .input-date {
    display: flex;
    flex: 1;
    height: 40px;
    border: solid 1px #ddd;
    background-color: var(--main-bg);
    padding: 0 12px;
    border-radius: 7px;
    font-family: var(--font-simple);
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
    font-size: 14px;
}

.item-input .input-group .input-date:focus {
    border-color: #5a4df8;
    background-color: #f8f7fd;
    box-shadow: inset 0 1px 4px rgba(90, 77, 248, 0.2), 0 0 0 2px rgba(90, 77, 248, 0.1);
}

.text-item .input-textarea {
    border: solid 1px #ddd;
    background-color: var(--main-bg);
    min-width: 100%;
    max-width: 100%;
    width: 100%;
    min-height: 120px;
    line-height: 24px;
    padding: 6px 12px;
    border-radius: 7px;
    font-family: var(--font-simple);
    outline: none;
    font-size: 15px;
    resize: none;
    display: block;
}

.text-item .input-textarea:focus {
    border-color: #5a4df8;
    background-color: #f8f7fd;
    box-shadow: inset 0 1px 4px rgba(90, 77, 248, 0.2), 0 0 0 2px rgba(90, 77, 248, 0.1);
}

.tool-content .operate-buttons {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}

.text-result {
    margin-top: 1.2em;
}

.text-result > label {
    margin-bottom: 10px;
    display: block;
    font-family: var(--font-simple);
}

.letter-container {
    border: solid 1px #5a4df8;
    background-color: #f8f7fd;
    border-radius: 10px;
    padding: 35px 50px;
    min-height: 500px;
}

.letter-content {
    line-height: 1.8;
    font-size: 16px;
    white-space: pre-line;
    min-height: 400px;
    font-family: var(--font-simple);
}

/*按钮样式*/
.btn {
    outline: none;
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    padding: 0 12px;
    color: #333;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);
    font-family: var(--font-simple);
}

.btn .ripple {
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    opacity: 0;
    z-index: 1;
    animation: ripple-effect 0.6s ease-out forwards;
}

.btn-purple {
    color: #fff;
    background-color: rgb(93 79 248 / 85%);
    border-width: 0;
    fill: #fff;
}

.btn-orange {
    color: #fff;
    background-color: rgb(255 80 0 / 95%);
    border-color: rgb(255, 80, 0);;
    fill: #fff;
}

.btn-green {
    color: #fff;
    background-color: rgba(34, 197, 94, 0.95);
    border-color: #22c55e;
    fill: #fff;
}

.btn-red {
    color: #fff;
    background-color: rgb(242 55 55 / 95%);
    border-color: rgb(255 31 31);
    fill: #fff;
}

/* 关键动画：扩散 + 淡出 */
@keyframes ripple-effect {
    0% {
        width: 0;
        height: 0;
        opacity: 0.4;
    }
    100% {
        width: 300px;
        height: 300px;
        opacity: 0;
    }
}

.type-selector {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 10px 0;
    font-size: 14px;
}

.type-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-right: 14px;
    border-radius: 12px;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s ease;
    position: relative;
}

.type-item input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

/* 外圈 - 圆形边框 */
.type-item::before {
    content: '';
    position: relative;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    border: 1.5px solid #adb5bd;
    border-radius: 50%;
    background-color: white;
    transition: all 0.2s ease;
    z-index: 1;
}

.type-item.active::before {
    border-color: rgba(90, 77, 248, 0.9);
}

/* 内点 - 默认不显示，active 时出现 */
.type-item::after {
    content: '';
    position: absolute;
    left: 4px;
    width: 10px;
    height: 10px;
    background-color: rgba(90, 77, 248, 0.9);
    border-radius: 50%;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.type-item.active::after {
    opacity: 1;
}

.type-label {
    color: #212529;
    line-height: 1.4;
    position: relative;
    z-index: 1;
}

.type-item.active .type-label {
    color: rgba(90, 77, 248, 0.9);
}

/* ==================== 关键：松手后整体弹出动画 ==================== */
@keyframes popIn {
    0% {
        transform: scale(0);
    }
    60% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

/* 同时给外圈和内点添加动画 */
.type-item.pop-animation::before,
.type-item.pop-animation::after {
    animation: popIn 0.3s cubic-bezier(0.25, 0.1, 0.75, 1) forwards;
}

/* 弹窗遮罩 */
.date-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(25, 27, 31, 0.4);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

/* 日期选择器容器 */
.date-picker {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 350px;
}

/* 日期选择器头部 */
.date-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.month-nav {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 6px;
    transition: background 0.3s;
}

.month-nav:hover {
    background: #f0f0f0;
}

.current-month {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

/* 星期标题 */
.week-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    margin-bottom: 10px;
}

.week-day {
    text-align: center;
    font-weight: 500;
    color: #666;
    font-size: 14px;
    padding: 8px 0;
}

/* 日期网格 */
.date-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
}

.date-cell {
    text-align: center;
    padding: 8px 0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
    background: none;
    font-size: 14px;
    font-weight: 500;
}

.date-cell:hover {
    background: rgba(90, 77, 248, 0.1);
}

.date-cell.selected {
    background: #5a4df8;
    color: white;
    border: none;
}

/* 当前月份日期 - 深色 */
.date-cell.current-month {
    color: #333;
    font-weight: 500;
}

/* 上个月和下个月日期 - 很淡的颜色 */
.disabled {
    color: #ddd !important;
    cursor: default;
}

/* 今天日期特殊样式 */
.date-cell.today {
    background: rgba(90, 77, 248, 0.1);
    color: #5a4df8;
    font-weight: 600;
    border: 1px solid rgba(90, 77, 248, 0.3);
}

.date-cell.today.selected {
    background: #5a4df8;
    color: white;
    border: none;
}

/* 操作按钮 */
.date-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
    gap: 10px;
}

.date-btn {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-confirm {
    background: var(--primary-color);
    color: white;
    font-family: 'Segoe UI', system-ui, sans-serif;
}

.btn-confirm:hover {
    background: #4a3de6;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(90, 77, 248, 0.3);
}

.btn-cancel {
    background: #f5f5f5;
    color: #666;
    font-family: 'Segoe UI', system-ui, sans-serif;
}

.btn-cancel:hover {
    background: #e0e0e0;
}

.btn-today {
    background: rgba(90, 77, 248, 0.1);
    color: #5a4df8;
    border: 1px solid rgba(90, 77, 248, 0.3);
    font-family: 'Segoe UI', system-ui, sans-serif;
}

.btn-today:hover {
    background: rgba(90, 77, 248, 0.2);
    transform: translateY(-1px);
}

@media (max-width: 768px) {
    .tool-content {
        padding: .8em !important;
    }

    .operate-buttons .btn {
        line-height: 32px !important;
        height: 32px !important;
        padding: 0 8px !important;
    }

    .item-input .input-group {
        width: 100%;
    }

    .item-input .input-group label {
        width: fit-content;
        min-width: auto;
        white-space: nowrap;
    }

    .letter-container {
        padding: 15px;
    }

    .letter-content {
        line-height: 1.5;
        font-size: 15px;
    }
}