:root {
    --main-orange: #ff8c00;
    --main-gray: #f7f8fa;
    --border: #e5e6eb;
    --text: #222;
    --subtext: #888;
    --btn: #ff8c00;
    --btn-hover: #ffb366;
    --radius: 8px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
    background: var(--main-gray);
    color: var(--text);
}

.main-wrap {
    display: flex;
    gap: 24px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 32px 16px;
    min-height: 100vh;
    margin-top: 30px;
}

.sidebar {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    padding: 24px 16px;
    width: 320px;
    min-width: 280px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    height: fit-content;
}

.sidebar .tab-btns {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.sidebar .tab-btns button {
    flex: 1;
    padding: 8px 0;
    border: none;
    border-radius: 4px;
    background: var(--main-orange);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.sidebar .tab-btns button i {
    font-size: 16px;
}

.sidebar .tab-btns button.secondary {
    background: #f2f2f2;
    color: var(--main-orange);
}

.sidebar label {
    font-size: 14px;
    color: var(--text);
    margin-bottom: 4px;
    display: block;
    font-weight: 600;
}

.sidebar input,
.sidebar select,
.sidebar textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 15px;
    margin-bottom: 10px;
    background: #fafbfc;
}

.sidebar textarea {
    min-height: 80px;
    resize: none;
    font-family: inherit;
}

/* 输入框提示文字颜色 */
.sidebar textarea::placeholder,
.sidebar input::placeholder,
.sidebar select::placeholder {
    color: #c0c0c0;
}

.sidebar .main-btn {
    margin-top: 12px;
    background: var(--btn);
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 12px 0;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.sidebar .main-btn:hover {
    background: var(--btn-hover);
}

.content-area {
    flex: 1;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    padding: 28px 24px 24px 24px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-width: 0;
}

.content-area label {
    font-size: 15px;
    color: var(--text);
    margin-bottom: 4px;
    display: block;
    font-weight: 600;
}

.content-area input,
.content-area textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 15px;
    background: #fafbfc;
    resize: none;
    min-height: 60px;
    font-family: inherit;
}

/* 输入框提示文字颜色 */
.content-area textarea::placeholder,
.content-area input::placeholder {
    color: #c0c0c0;
}

.content-area .form-group {
    width: 100%;
    display: flex;
    flex-direction: column;
}

.content-area .form-group textarea {
    min-height: 50px;
}

.content-area .table-wrap {
    margin-top: 18px;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #fafbfc;
    border-radius: 6px;
    overflow: hidden;
    font-size: 15px;
}

th,
td {
    padding: 10px 8px;
    text-align: left;
    border-bottom: 1px solid #ececec;
}

th {
    background: #f2f2f2;
    color: #666;
    font-weight: 600;
}

.trend-up {
    color: #1bc47d;
    font-weight: 600;
}

.trend-down {
    color: #e14c4c;
    font-weight: 600;
}

.score {
    background: #f2f2f2;
    border-radius: 12px;
    padding: 2px 10px;
    font-size: 14px;
    display: inline-block;
    min-width: 32px;
    text-align: center;
}

.table-link {
    color: var(--main-orange);
    font-size: 14px;
    text-decoration: underline;
    cursor: pointer;
    margin-bottom: 8px;
    display: inline-block;
}

.content-area .actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    flex-wrap: wrap;
    justify-content: space-between;
}

.content-area .actions button {
    padding: 10px 22px;
    border: none;
    border-radius: 4px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    background: #f2f2f2;
    color: #222;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.content-area .actions .regenerate-btn {
    background: #f2f2f2;
    color: #222;
}

.content-area .actions .regenerate-btn i {
    font-size: 16px;
}

.content-area .actions .export-btn {
    background: var(--btn);
    color: #fff;
}

.content-area .actions .main-btn {
    background: var(--btn);
    color: #fff;
}

.content-area .actions .main-btn:hover,
.content-area .actions .export-btn:hover {
    background: var(--btn-hover);
}

@media (max-width: 900px) {
    .main-wrap {
        flex-direction: column;
        gap: 0;
        padding: 12px 2vw;
    }

    .sidebar {
        width: 100%;
        min-width: 0;
        margin-bottom: 18px;
    }

    .content-area {
        padding: 18px 8px 16px 8px;
    }

    .content-area .features-list {
        flex-direction: column;
        gap: 12px;
    }

    .content-area .features-list .feature-item {
        max-width: 100%;
    }
}

/* 图片上传区域样式 */
#image-upload-area {
    margin-top: 20px;
    border-top: 1px solid #eee;
    padding-top: 20px;
}

#image-upload-area .title {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 15px;
}

#image-upload-area .upload-container {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.image-uploader {
    width: 160px;
    height: 160px;
    border: 1px dashed #ccc;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    background-color: #f9f9f9;
}

.image-uploader .plus-icon {
    font-size: 24px;
    color: #aaa;
}

.image-uploader .upload-text {
    font-size: 12px;
    color: #999;
    margin-top: 8px;
}

.input-group {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.input-group .input-row {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

.input-group .input-label {
    width: 50px;
}

.input-group .asin-input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    width: 300px;
}

/* 获取ASIN按钮 */
.fetch-btn {
    padding: 6px 15px;
    margin-left: 8px;
    background: var(--btn);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

.fetch-btn:hover {
    background: var(--btn-hover);
}

/* 已上传图片区域 */
.uploaded-images {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 20px;
}

.uploaded-image-container {
    position: relative;
    width: 120px;
    height: 120px;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.uploaded-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.delete-image-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.8);
    border: none;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    z-index: 2;
}

.delete-image-btn:hover {
    background: rgba(255, 255, 255, 1);
    color: #ff3b30;
}

    #layout-dialog {
        position: absolute;
        width: 1000px;
        left: 260px;
        top: 100px;
        z-index: 2000;
        border: solid 2px #ccc;
        border-radius: 8px;
        box-shadow: 0px 0px 2px #999;
        background: #fff;
        padding: 10px 15px;
        display: none;
    }
    .dialog-header {
        padding: 10px;
    }
    .dialog-header h3 {
        font-size: 18px;
        font-weight: bold;
    }
    .dialog-body {
        display: flex;
        flex-wrap: wrap;
    }
    .dialog-footer {
        padding: 10px;
        float: right;
    }
    .layout-img {
        width: 235px;
        height: 130px;
        margin: 5px 3px;
        border: dashed 2px #ccc;
        border-radius: 5px;
        cursor: pointer;
        transition: all 0.2s;
    }
    .layout-img:hover {
        border: solid 2px #1077e78c;
    }
    .layout-img.active {
        border: solid 2px #1f7add;
    }
    .layout-img img {
        max-height: 100%;
    }
    .dialog-footer a {
        border: solid 1px #ccc;
        padding: 8px 20px;
        margin-left: 10px;
        border-radius: 5px;
        cursor: pointer;
        transition: all 0.2s;
    }
    .dialog-footer .btn-confirm {
        background: var(--btn);
        color: #fff;
        border: none;
    }
    .dialog-footer .btn-confirm:hover {
        background: var(--btn-hover);
    }
    .dialog-footer .btn-cancel {
        color: #333;
    }
    .dialog-footer .btn-cancel:hover {
        background: #ccc;
        color: #fff;
    }
