/* 模态框公共样式 */
.ai-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: flex-end;
    z-index: 1000;
}

.ai-modal-overlay.show {
    display: flex;
}

.ai-modal-content {
    background: #fff;
    width: 100%;
    height: 80vh;
    border-radius: 16px 16px 0 0;
    transform: translateY(100%);
    transition: transform 0.3s ease-out;
    overflow-y: auto;
}

.ai-modal-overlay.show .ai-modal-content {
    transform: translateY(0);
}

.ai-modal-header {
    padding: 16px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 10;
}

.ai-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
    font-weight: 500;
}

.ai-modal-close {
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 0 8px;
    background: none;
    border: none;
}

.ai-modal-body {
    padding: 16px;
}

/* 表单项公共样式 */
.ai-form-group {
    margin-bottom: 20px;
}

.ai-form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 15px;
    color: #555;
    font-weight: 400;
}

.ai-form-control {
    width: 100%;
    height: 120px;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 15px;
    resize: none;
    box-sizing: border-box;
    transition: border-color 0.2s ease-in-out;
    line-height: 1.5;
}

.ai-form-control:focus {
    outline: none;
    border-color: #07c160;
    box-shadow: 0 0 0 2px rgba(7, 193, 96, 0.1);
}

.ai-form-select {
    width: 100%;
    height: 44px;
    padding: 0 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 15px;
    background-color: #fff;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    transition: border-color 0.2s ease-in-out;
}

.ai-form-select:focus {
    outline: none;
    border-color: #07c160;
    box-shadow: 0 0 0 2px rgba(7, 193, 96, 0.1);
}

/* 内联表单项样式 */
.ai-form-group-inline {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.ai-form-group-inline .ai-form-label {
    margin-bottom: 0;
    margin-right: 10px;
    min-width: 60px;
    white-space: nowrap;
}

.ai-form-group-inline .ai-form-select {
    flex: 1;
}

/* 字数和文体间的间距 */
.ai-form-group-inline + .ai-form-group-inline {
    margin-top: 16px;
}

/* 按钮组样式 */
.ai-form-buttons {
    margin-top: 24px;
}

/* 双按钮布局 */
.ai-form-buttons-group {
    display: flex;
    gap: 12px;
    margin-top: 28px;
}

.ai-form-buttons-group .ai-btn {
    flex: 1;
    border-radius: 8px;
    height: 44px;
    line-height: 44px;
    position: relative;
    overflow: hidden;
}

.ai-btn {
    display: block;
    width: 100%;
    height: 48px;
    line-height: 48px;
    text-align: center;
    border-radius: 24px;
    font-size: 16px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

/* 按钮点击波纹动画 */
.ai-btn::after {
    content: '';
    display: block;
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    background-image: radial-gradient(circle, #fff 10%, transparent 10.01%);
    background-repeat: no-repeat;
    background-position: 50%;
    transform: scale(10, 10);
    opacity: 0;
    transition: transform .3s, opacity .5s;
}

.ai-btn:active::after {
    transform: scale(0, 0);
    opacity: .3;
    transition: 0s;
}

/* 主要按钮和次要按钮样式区分 */
.ai-btn-primary {
    background: #173B74;
    color: #fff;
}

.ai-btn-primary:active {
    background: #06ad55;
}

.ai-btn-secondary {
    background: #EEEEEE;
    color: #000;
    border: 1px solid #173B74;
}

.ai-btn-secondary:active {
    background: #e5f4ea;
}

/* 美化表单整体样式 */
.ai-form {
    padding: 5px;
}

/* 写作文表单特定样式 */
.word-count-row {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    margin: 0 -5px;
}

.word-count-item {
    flex: 0 0 50%;
    padding: 0 5px;
    margin-bottom: 10px;
    box-sizing: border-box;
}

.word-count-item label {
    display: flex;
    height: 42px;
    padding: 0 15px;
    justify-content: center;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 21px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    box-sizing: border-box;
}

.word-count-item input[type="radio"] {
    display: none;
}

.word-count-item input[type="radio"]:checked + label {
    background: #f0f9f4;
    border-color: #07c160;
    color: #07c160;
}

/* 上传相关样式 */
.ai-form-upload {
    margin: 15px 0;
}

.ai-btn-outline {
    background: transparent;
    color: #07c160;
    border: 1px solid #07c160;
}

.ai-btn-outline:active {
    background: rgba(7, 193, 96, 0.1);
}

.ai-photo-preview {
    margin-top: 15px;
    text-align: center;
}

.ai-photo-preview img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 8px;
    border: 1px solid #ddd;
}

.preview-container {
    position: relative;
    display: inline-block;
}

.remove-preview {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
}

.remove-preview:hover {
    background: rgba(0, 0, 0, 0.7);
}

/* 响应式调整 */
@media screen and (max-width: 768px) {
    .ai-modal-content {
        height: auto;
        padding-bottom: 30px;
    }
}

@media screen and (min-width: 769px) {
    .ai-modal-content {
        width: 500px;
        margin: 0 auto;
    }
} 