

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif, '华文仿宋';
    -webkit-tap-highlight-color: transparent;
    -webkit-text-size-adjust: 100%;
}


@media (min-width: 768px) {
    body::after {
        font-size: 20em;
    }
}

/* 基础布局 - 移动优先 */
body {
    background: linear-gradient(135deg, #1a2a6c 0%, #3a7bd5 50%, #00d2ff 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 10px;
    color: #333;
    line-height: 1.5;
    overflow-x: hidden;
}

.container {
    width: 100%;
    max-width: 100%;
    background: rgba(255, 255, 255, 0.98);
    min-height: 100vh;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border-radius: 12px;
}

/* 平板和桌面端适配 */
@media (min-width: 768px) {
    body {
        padding: 20px;
        align-items: center;
    }

    .container {
        max-width: 500px;
        border-radius: 20px;
        box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
        min-height: auto;
        backdrop-filter: blur(10px);
    }
}

/* 头部区域 - 紧凑设计 */
.header {
    background: linear-gradient(90deg, #4b6cb7 0%, #182848 100%);
    color: white;
    padding: 16px 15px 14px;
    text-align: center;
    position: relative;
    border-radius: 12px 12px 0 0;
}

.header h1 {
    font-size: 20px;
    margin-bottom: 6px;
    font-weight: 700;
    letter-spacing: 0.5px;
    line-height: 1.3;
}

.header p {
    font-size: 13px;
    opacity: 0.9;
    max-width: 100%;
    margin: 0 auto;
    padding: 0 10px;
    line-height: 1.4;
}

/* 内容区域 - 紧凑间距 */
.content {
    padding: 16px;
}

@media (max-width: 374px) {
    .content {
        padding: 12px;
    }
}

/* 通用功能区块样式 - 紧凑化 */
.input-section,
.api-key-section,
.ai-control-panel,
.requirement-input-section,
.file-upload-area,
.result-section,
.tab-content,
.ai-analysis-result,
.requirement-analysis-result,
.history-hint,
.quick-suggestions {
    background: #f8f9fb;
    padding: 16px;
    border-radius: 10px;
    border: 1px solid #eaeef2;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* API密钥区域 - 移动端垂直布局 */
.api-key-section {
    background: linear-gradient(135deg, #f0f4f8 0%, #e3eaf7 100%);
    border: 1px solid #d1e3ff;
}

.api-key-row {
    margin-bottom: 10px;
    width: 100%;
}

.api-key-input {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #b8d4fe;
    border-radius: 8px;
    font-size: 15px;
    background: white;
    box-sizing: border-box;
    margin-bottom: 10px;
}

.api-key-button-row {
    display: flex;
    gap: 10px;
    margin-bottom: 8px;
    width: 100%;
    flex-wrap: wrap;
}

.api-key-btn {
    flex: 1;
    min-width: 120px;
    padding: 12px 16px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
}

.api-key-hint {
    font-size: 12px;
    color: #666;
    padding: 10px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    border-left: 3px solid #4b6cb7;
    line-height: 1.4;
}

/* AI控制面板 - 移动端垂直布局 */
.ai-control-row {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

@media (min-width: 425px) {
    .ai-control-row {
        flex-direction: row;
        align-items: center;
    }
}

.model-selector {
    flex: 1;
    min-width: 100%;
}

.model-selector label {
    display: block;
    font-size: 14px;
    color: #4b6cb7;
    margin-bottom: 6px;
    font-weight: 600;
}

.model-select {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #d1e3ff;
    border-radius: 8px;
    font-size: 15px;
    background: white;
    color: #333;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234b6cb7' 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: 14px;
}

.web-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: white;
    border-radius: 8px;
    border: 2px solid #d1e3ff;
    justify-content: center;
    min-height: 54px;
}

.web-toggle input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.web-toggle label {
    font-size: 14px;
    color: #333;
    cursor: pointer;
    font-weight: 500;
}

/* 输入区域 - 紧凑布局 */
.input-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.number-input-full {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.3s;
    -webkit-appearance: none;
    box-sizing: border-box;
}

.number-input-full:focus {
    border-color: #4b6cb7;
}

.ai-analyze-btn-full {
    width: 100%;
    background: linear-gradient(90deg, #27ae60 0%, #1abc9c 100%);
    color: white;
    border: none;
    padding: 14px 18px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s, transform 0.2s;
    white-space: nowrap;
    font-weight: 600;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.ai-analyze-btn-full:hover {
    background: linear-gradient(90deg, #219955 0%, #16a085 100%);
}

.ai-analyze-btn-full:active {
    transform: scale(0.98);
}

.ai-analyze-btn-full i {
    font-size: 16px;
}

/* 极窄屏幕优化 */
@media (max-width: 320px) {
    .ai-analyze-btn-full {
        padding: 12px 14px;
        font-size: 14px;
    }

    .number-input-full {
        padding: 12px 14px;
        font-size: 14px;
    }
}

/* 选项卡 - 紧凑设计 */
.tab-container {
    display: flex;
    margin-bottom: 12px;
    border-bottom: 1px solid #eaeef2;
    background: #f8f9fb;
    border-radius: 8px 8px 0 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 2px;
}

.tab-container::-webkit-scrollbar {
    display: none;
}

.tab {
    flex: 1;
    min-width: 100px;
    padding: 12px 10px;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
    font-size: 13px;
    text-align: center;
    background: #f0f4f8;
    white-space: nowrap;
    font-weight: 500;
}

.tab.active {
    border-bottom: 3px solid #4b6cb7;
    color: #4b6cb7;
    font-weight: bold;
    background: white;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* 结果区域 - 紧凑设计 */
.result-section {
    min-height: 180px;
    background: #f8f9fb;
}

.result-title {
    color: #4b6cb7;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 2px solid #eaeef2;
    font-size: 16px;
    display: flex;
    align-items: center;
    font-weight: 600;
}

.result-title i {
    margin-right: 8px;
    font-size: 18px;
}

.result-content {
    flex: 1;
    font-size: 14px;
    line-height: 1.6;
}

.placeholder {
    color: #999;
    font-style: italic;
    text-align: center;
    padding: 40px 15px;
    font-size: 14px;
}

/* 文件上传区域 - 移动优化 */
.file-upload-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.file-association-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.file-toggle-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    user-select: none;
    flex: 1;
    min-width: 200px;
}

.toggle-slider {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
    background-color: #ccc;
    border-radius: 20px;
    transition: .4s;
    cursor: pointer;
    flex-shrink: 0;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    border-radius: 50%;
    transition: .4s;
}

.file-association-toggle:checked+.toggle-slider {
    background-color: #4b6cb7;
}

.file-association-toggle:checked+.toggle-slider:before {
    transform: translateX(20px);
}

.toggle-text {
    font-weight: 600;
    color: #4b6cb7;
    font-size: 13px;
}

.file-upload-btn-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    width: 100%;
}

.file-upload-label {
    background: linear-gradient(90deg, #3498db 0%, #2980b9 100%);
    color: white;
    border: none;
    padding: 10px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    flex: 1;
    min-width: 140px;
    justify-content: center;
}

.file-upload-label:hover {
    background: linear-gradient(90deg, #2980b9 0%, #21618c 100%);
    transform: translateY(-1px);
}

.selected-file-count {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: #e8f6f3;
    border-radius: 8px;
    border-left: 3px solid #1abc9c;
    font-size: 13px;
    color: #16a085;
    font-weight: 500;
    animation: fadeIn 0.3s ease-in;
    flex-shrink: 0;
}

/* 文件列表 - 移动优化 */
.file-list-container {
    width: 100%;
    background: white;
    border-radius: 8px;
    border: 1px solid #eaeef2;
    overflow: hidden;
    animation: slideDown 0.3s ease-out;
    max-height: 250px;
    display: flex;
    flex-direction: column;
    margin-top: 10px;
}

.file-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: #f8f9fb;
    border-bottom: 1px solid #eaeef2;
    font-size: 13px;
    font-weight: 600;
    color: #4b6cb7;
}

.clear-all-btn {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 4px;
}

.clear-all-btn:hover {
    background: #c0392b;
}

.file-list-content {
    flex: 1;
    overflow-y: auto;
    max-height: 180px;
    padding: 6px;
}

.file-list-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 15px;
    color: #999;
    font-size: 13px;
    gap: 8px;
    text-align: center;
}

.file-list-empty i {
    font-size: 24px;
    opacity: 0.5;
    margin-bottom: 8px;
}

/* 文件列表项 - 紧凑设计 */
.file-list-item {
    display: flex;
    align-items: center;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #eee;
    margin-bottom: 6px;
    background: #fdfdfd;
    cursor: pointer;
    transition: all 0.3s;
    animation: fadeIn 0.3s ease-in;
}

.file-list-item:hover {
    background: #f0f7ff;
    border-color: #cce7ff;
}

.file-list-item.active {
    background: #e8f6f3;
    border-color: #1abc9c;
}

.file-item-icon {
    width: 24px;
    text-align: center;
    color: #3498db;
    font-size: 16px;
    flex-shrink: 0;
}

.file-item-info {
    flex: 1;
    min-width: 0;
    margin: 0 10px;
    overflow: hidden;
}

.file-name {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 3px;
}

.file-size {
    font-size: 11px;
    color: #666;
}

.file-item-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.preview-file-btn,
.remove-file-btn,
.edit-file-btn {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 6px;
    border-radius: 4px;
    font-size: 14px;
    transition: background 0.3s;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-file-btn:hover {
    background: rgba(52, 152, 219, 0.1);
    color: #3498db;
}

.remove-file-btn:hover {
    background: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
}

.edit-file-btn:hover {
    background: rgba(155, 89, 182, 0.1);
    color: #9b59b6;
}

.file-list-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #f8f9fb;
    border-top: 1px solid #eaeef2;
    font-size: 12px;
    color: #666;
}

#totalFileSize,
#totalFileCount {
    font-weight: 600;
    color: #4b6cb7;
}

/* 需求分析区域 - 紧凑设计 */
.requirement-input-section {
    margin-bottom: 16px;
}

.requirement-textarea {
    width: 100%;
    min-height: 100px;
    max-height: 200px;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    margin-top: 8px;
    margin-bottom: 12px;
    transition: border-color 0.3s ease;
    font-family: inherit;
    box-sizing: border-box;
}

.requirement-textarea:focus {
    outline: none;
    border-color: #4b6cb7;
    box-shadow: 0 0 0 3px rgba(75, 108, 183, 0.1);
}

.requirement-rule-display {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
    font-size: 13px;
    line-height: 1.5;
}

.requirement-rule-display h4 {
    margin: 0 0 6px 0;
    color: #856404;
    font-size: 14px;
    font-weight: 600;
}

/* 分析结果 - 紧凑设计 */
.requirement-analysis-result,
.ai-analysis-result {
    background: white;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    margin-top: 16px;
    border-left: 4px solid #4b6cb7;
    animation: fadeIn 0.5s ease;
}

.requirement-header,
.ai-analysis-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    flex-wrap: wrap;
    gap: 8px;
}

.requirement-header h3,
.ai-analysis-header h3 {
    margin: 0;
    font-size: 16px;
    color: #4b6cb7;
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 200px;
}

.requirement-source {
    font-size: 12px;
    color: #666;
    display: flex;
    align-items: center;
    gap: 6px;
}

.requirement-content,
.ai-analysis-content {
    line-height: 1.6;
    font-size: 14px;
    color: #333;
}

.requirement-footer,
.ai-analysis-footer {
    margin-top: 15px;
    padding-top: 12px;
    border-top: 1px solid #eee;
    font-size: 12px;
    color: #888;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

/* 复制按钮组 - 移动优化 */
.requirement-actions,
.ai-analysis-header .copy-analysis-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.copy-analysis-btn,
.full-copy,
.copy-section-btn,
.paragraph-copy-btn {
    background: linear-gradient(90deg, #3498db 0%, #2980b9 100%);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    white-space: nowrap;
}

.requirement-copy-btn,
.full-copy {
    background: linear-gradient(90deg, #9b59b6 0%, #8e44ad 100%);
}

.copy-section-btn {
    background: linear-gradient(90deg, #9b59b6 0%, #8e44ad 100%);
    padding: 6px 10px;
    font-size: 11px;
}

.paragraph-copy-btn {
    padding: 4px 8px;
    font-size: 11px;
    opacity: 0;
    transform: translateX(5px);
}

.analysis-paragraph:hover .paragraph-copy-btn {
    opacity: 1;
    transform: translateX(0);
}

.copy-analysis-btn:hover,
.full-copy:hover,
.copy-section-btn:hover,
.paragraph-copy-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* 分析段落 - 紧凑设计 */
.requirement-section-with-copy {
    position: relative;
    margin-bottom: 16px;
    padding: 14px;
    background: white;
    border-radius: 8px;
    border: 1px solid #eaeef2;
    transition: all 0.3s ease;
}

.requirement-section-with-copy:hover {
    border-color: #4b6cb7;
    box-shadow: 0 2px 8px rgba(75, 108, 183, 0.1);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f0f0f0;
    flex-wrap: wrap;
    gap: 8px;
}

.section-header h4 {
    margin: 0;
    color: #4b6cb7;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.analysis-paragraph {
    position: relative;
    margin-bottom: 12px;
    padding: 12px;
    padding-left: 20px;
    border-left: 3px solid #eaeef2;
    transition: all 0.3s ease;
    background: #fdfdfd;
    border-radius: 0 6px 6px 0;
}

.analysis-paragraph:hover {
    border-left-color: #4b6cb7;
    background-color: #f8f9fa;
}

.paragraph-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    flex-wrap: wrap;
    gap: 8px;
}

.paragraph-number {
    font-size: 12px;
    font-weight: 600;
    color: #4b6cb7;
    min-width: 22px;
    background: #f0f4f8;
    padding: 3px 6px;
    border-radius: 4px;
    text-align: center;
}

.paragraph-content {
    line-height: 1.6;
    color: #333;
    font-size: 14px;
}

/* 快捷需求建议 - 紧凑设计 */
.quick-suggestions {
    margin: 8px 0 12px 0;
    padding: 12px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #4a6baf;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.quick-suggestions-header {
    display: flex;
    align-items: center;
    color: #4a6baf;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid #eaeaea;
}

.quick-suggestions-header i {
    margin-right: 8px;
    font-size: 16px;
}

.quick-suggestions-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-start;
}

.quick-suggestion-btn {
    padding: 8px 12px;
    background-color: #fff;
    border: 1px solid #d0d7e2;
    border-radius: 6px;
    color: #5a6c7d;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    min-width: calc(50% - 8px);
    max-width: 100%;
    text-align: left;
    justify-content: flex-start;
    box-sizing: border-box;
}

.quick-suggestion-btn:hover {
    background-color: #4a6baf;
    color: white;
    border-color: #4a6baf;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(74, 107, 175, 0.2);
}

/* 移动端超小屏幕适配 */
@media (max-width: 374px) {
    .quick-suggestion-btn {
        min-width: 100%;
    }

    .api-key-btn {
        min-width: 100%;
    }

    .file-upload-label {
        min-width: 100%;
    }

    .requirement-header,
    .ai-analysis-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .requirement-actions,
    .ai-analysis-header .copy-analysis-btn {
        width: 100%;
        justify-content: flex-start;
    }
}

/* 平板适配 */
@media (min-width: 768px) {
    .quick-suggestion-btn {
        min-width: calc(33.333% - 8px);
        max-width: calc(33.333% - 8px);
    }

    .api-key-button-row {
        flex-wrap: nowrap;
    }

    .file-upload-btn-group {
        flex-wrap: nowrap;
    }
}

/* 历史记录提示 */
.history-hint {
    background: linear-gradient(135deg, #f0f9ff 0%, #e1f5fe 100%);
    border: 2px solid #3b82f6;
    border-radius: 10px;
    padding: 14px;
    margin: 16px 0;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.1);
    animation: fadeIn 0.5s ease-out;
}

.hint-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(59, 130, 246, 0.2);
    flex-wrap: wrap;
    gap: 8px;
}

.hint-header strong {
    color: #1e40af;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.hint-badge {
    background: #3b82f6;
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.hint-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.hint-section {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 6px;
    transition: all 0.3s ease;
    flex-wrap: wrap;
}

.hint-icon {
    background: #3b82f6;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 14px;
}

.hint-text {
    flex: 1;
    color: #4b5563;
    font-size: 14px;
    min-width: 200px;
}

.hint-footer {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid rgba(59, 130, 246, 0.2);
    color: #059669;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* 状态提示 */
.ai-status {
    display: none;
    padding: 14px;
    margin: 16px 0;
    background: linear-gradient(135deg, #e8f6f3 0%, #d1ede6 100%);
    border-radius: 8px;
    border-left: 4px solid #1abc9c;
    font-size: 14px;
    color: #16a085;
    text-align: center;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.ai-status i {
    font-size: 18px;
}

#requirementStatus {
    background: linear-gradient(135deg, #f0f8ff 0%, #e6f3ff 100%);
    border-color: #b3d9ff;
    color: #1565c0;
}

/* 建议按钮容器 */
.suggestion-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999;
}

.suggestion-button {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.suggestion-button:hover {
    background: linear-gradient(135deg, #2980b9 0%, #1f6392 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

/* 加载动画 */
.loading-spinner {
    text-align: center;
    padding: 30px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #27ae60;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* 全局提示 */
.global-hint {
    position: fixed;
    top: 20px;
    right: 20px;
    max-width: calc(100vw - 40px);
    padding: 12px 16px;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    animation: slideInRight 0.3s ease-out;
    border-left: 4px solid #27ae60;
    word-break: break-word;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* 历史记录徽章 */
.tab .history-count-badge {
    background-color: #e74c3c;
    color: white;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 11px;
    margin-left: 6px;
    font-weight: bold;
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {

    button,
    .api-key-btn,
    .ai-analyze-btn-full,
    .quick-suggestion-btn,
    .tab,
    .file-list-item,
    .copy-analysis-btn {
        min-height: 44px;
        /* 苹果推荐的最小触摸目标尺寸 */
    }

    input,
    textarea,
    select {
        font-size: 16px;
        /* 防止iOS缩放 */
    }
}

/* 打印样式 */
@media print {
    .suggestion-container,
    .global-hint,
    button:not(.print-essential) {
        display: none !important;
    }

    .container {
        box-shadow: none;
        border: 1px solid #ddd;
    }

    body {
        background: white !important;
    }
}
/* 新建文件按钮样式 */
.create-file-btn {
    background: linear-gradient(90deg, #3498db 0%, #2980b9 100%);
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 5px rgba(52, 152, 219, 0.3);
}

.create-file-btn:hover {
    background: linear-gradient(90deg, #2980b9 0%, #1f6392 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.4);
}

.create-file-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(52, 152, 219, 0.3);
}

/* 模态框样式 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-dialog {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 20px;
    background: linear-gradient(135deg, #4b6cb7 0%, #182848 100%);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-close-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 18px;
    padding: 5px;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s;
}

.modal-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    max-height: calc(80vh - 160px);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    color: #2c3e50;
    font-weight: 600;
    font-size: 14px;
}

.modal-input, .modal-textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
    box-sizing: border-box;
}

.modal-input:focus, .modal-textarea:focus {
    outline: none;
    border-color: #4b6cb7;
}

.modal-textarea {
    resize: vertical;
    min-height: 150px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    line-height: 1.5;
}

.form-hint {
    margin-top: 5px;
    color: #7f8c8d;
    font-size: 12px;
    font-style: italic;
}

.modal-footer {
    padding: 15px 20px;
    background: #f8f9fa;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    border-top: 1px solid #eaeaea;
}

.modal-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.preview-btn {
    background: linear-gradient(90deg, #3498db 0%, #2980b9 100%);
    color: white;
}

.cancel-btn {
    background: linear-gradient(90deg, #95a5a6 0%, #7f8c8d 100%);
    color: white;
}

.save-btn {
    background: linear-gradient(90deg, #27ae60 0%, #2ecc71 100%);
    color: white;
}

.modal-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}
/* 文件上传相关样式 */
.file-upload-area {
    width: 100%;
    margin-bottom: 12px;
    background: #f8f9fb;
    border-radius: 8px;
    padding: 12px;
    border: 1px solid #eaeef2;
}

.file-upload-controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.file-association-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
}

.file-toggle-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    user-select: none;
}

.file-association-toggle {
    display: none;
}

.toggle-slider {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
    background-color: #ccc;
    border-radius: 20px;
    transition: .4s;
    cursor: pointer;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    border-radius: 50%;
    transition: .4s;
}

.file-association-toggle:checked + .toggle-slider {
    background-color: #4b6cb7;
}

.file-association-toggle:checked + .toggle-slider:before {
    transform: translateX(20px);
}

.toggle-text {
    font-weight: 600;
    color: #4b6cb7;
}

.file-upload-btn-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.file-upload-label {
    background: linear-gradient(90deg, #3498db 0%, #2980b9 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.file-upload-label:hover {
    background: linear-gradient(90deg, #2980b9 0%, #21618c 100%);
    transform: translateY(-1px);
}

.file-input-hidden {
    display: none;
}

.selected-file-count {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    background: #e8f6f3;
    border-radius: 6px;
    border-left: 3px solid #1abc9c;
    font-size: 12px;
    color: #16a085;
    font-weight: 500;
    animation: fadeIn 0.3s ease-in;
}
/* 分析记录统计 */
.history-stats {
    background: #f8fafc;
    border-radius: 8px;
    padding: 12px;
    margin: 15px 0;
    border-left: 4px solid #10b981;
}

.stats-item {
    display: flex;
    justify-content: space-between;
    margin: 8px 0;
    font-size: 14px;
}

.stats-label {
    color: #6b7280;
}

.stats-value {
    color: #1f2937;
    font-weight: 600;
}

.stats-success {
    color: #059669;
}

.stats-warning {
    color: #f59e0b;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .history-hint {
        padding: 12px;
        margin: 15px 0;
    }
    
    .hint-section {
        padding: 8px;
    }
    
    .hint-text {
        font-size: 13px;
    }
}
.history-count-display {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(0, 123, 255, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 14px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    cursor: pointer;
    transition: all 0.3s ease;
    display: none;
}

.history-count-display:hover {
    background: rgba(0, 123, 255, 1);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.history-count-display i {
    margin-right: 6px;
}
/* 历史记录标签徽章 */
.tab .history-count-badge {
    background-color: #e74c3c;
    color: white;
    border-radius: 12px;
    padding: 2px 6px;
    font-size: 12px;
    margin-left: 6px;
    font-weight: bold;
}

/* 历史记录内容区域 */
.history-content {
    padding: 20px;
    max-height: 500px;
    overflow-y: auto;
}

.history-empty {
    text-align: center;
    padding: 60px 20px;
    color: #95a5a6;
}

.history-empty i {
    font-size: 48px;
    margin-bottom: 20px;
    color: #bdc3c7;
}

.history-empty h3 {
    margin: 15px 0;
    color: #7f8c8d;
}

.history-empty p {
    color: #95a5a6;
    font-size: 14px;
}

/* 历史记录列表 */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.history-item {
    background: white;
    border-radius: 8px;
    padding: 16px;
    border: 1px solid #e0e0e0;
    cursor: pointer;
    transition: all 0.2s ease;
}

.history-item:hover {
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    border-color: #3498db;
}

.history-item-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f1f2f6;
}

.history-index {
    background: #3498db;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
}

.history-date {
    color: #2c3e50;
    font-size: 14px;
}

.history-model {
    background: #9b59b6;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
}

.history-item-body {
    margin-bottom: 12px;
}

.history-patterns,
.history-requirement,
.history-response {
    margin-bottom: 8px;
    line-height: 1.5;
    font-size: 14px;
}

.history-patterns strong,
.history-requirement strong,
.history-response strong {
    color: #2c3e50;
    min-width: 40px;
    display: inline-block;
}

.history-item-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #7f8c8d;
    padding-top: 10px;
    border-top: 1px solid #f1f2f6;
}

.history-time {
    background: #f8f9fa;
    padding: 3px 8px;
    border-radius: 4px;
}

.history-files {
    background: #2ecc71;
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
}
/* 移动端优化样式 */
@media (max-width: 768px) {
    .history-suggestions {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 90%;
        max-width: 400px;
        max-height: 60vh;
        z-index: 10000;
        box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    }
    
    .suggestion-item {
        padding: 15px;
        min-height: 60px; /* 增加触摸区域 */
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
    
    .suggestion-item:active {
        background: #e8f4fc;
        transition: background 0.1s;
    }
    
    .suggestion-text {
        font-size: 16px; /* 移动端加大字体 */
        line-height: 1.4;
    }
    
    .suggestion-pattern {
        font-size: 13px;
        margin-bottom: 5px;
    }
    
    .suggestion-date {
        font-size: 12px;
        margin-top: 3px;
    }
    
    .close-suggestions-btn {
        padding: 8px;
        font-size: 18px;
    }
}

/* 触摸反馈优化 */
.suggestion-item {
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

/* 防止移动端双击缩放 */
.suggestion-item * {
    touch-action: manipulation;
}
/* 历史记录需求建议样式 */
.history-suggestions {
    position: relative;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-top: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 1000;
}

.history-suggestions-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
    border-radius: 8px 8px 0 0;
    font-weight: 600;
    color: #2c3e50;
}

.history-suggestions-header i {
    margin-right: 8px;
    color: #3498db;
}

.close-suggestions-btn {
    background: none;
    border: none;
    color: #7f8c8d;
    cursor: pointer;
    padding: 5px;
    transition: color 0.3s;
}

.close-suggestions-btn:hover {
    color: #e74c3c;
}

.suggestions-list {
    max-height: 200px;
    overflow-y: auto;
    padding: 5px 0;
}

.suggestion-item {
    padding: 10px 15px;
    border-bottom: 1px solid #f1f2f6;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    line-height: 1.4;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover {
    background: #f8f9fa;
    color: #3498db;
}

.suggestion-item.active {
    background: #e8f4fc;
    color: #3498db;
    font-weight: 500;
}

.suggestion-date {
    font-size: 12px;
    color: #95a5a6;
    margin-top: 2px;
    display: block;
}

.suggestion-pattern {
    font-size: 12px;
    color: #9b59b6;
    background: #f5f0fa;
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
    margin-right: 8px;
}

.no-suggestions {
    padding: 15px;
    text-align: center;
    color: #95a5a6;
    font-style: italic;
}
/* 快捷需求建议样式 */
.quick-suggestions {
    margin: 10px 0 15px 0;
    padding: 12px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #4a6baf;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.quick-suggestions-header {
    display: flex;
    align-items: center;
    color: #4a6baf;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid #eaeaea;
}

.quick-suggestions-header i {
    margin-right: 8px;
    font-size: 16px;
}

.quick-suggestions-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-start;
}

.quick-suggestion-btn {
    padding: 8px 12px;
    background-color: #fff;
    border: 1px solid #d0d7e2;
    border-radius: 6px;
    color: #5a6c7d;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    min-width: 120px;
    max-width: 200px;
    text-align: left;
}

.quick-suggestion-btn:hover {
    background-color: #4a6baf;
    color: white;
    border-color: #4a6baf;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(74, 107, 175, 0.2);
}

.quick-suggestion-btn:active {
    transform: translateY(0);
}

.quick-suggestion-btn i {
    font-size: 14px;
}
/* 快捷需求建议样式增强 */
.quick-suggestion-btn.fade-in {
    animation: fadeInUp 0.3s ease-out forwards;
    opacity: 0;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 按钮悬停效果增强 */
.quick-suggestion-btn {
    transition: all 0.3s ease;
}

.quick-suggestion-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74, 107, 175, 0.3);
}

/* 活动状态样式 */
.quick-suggestion-btn:active {
    transform: translateY(0);
}

/* 移动端优化 */
@media (max-width: 768px) {
    .quick-suggestion-btn {
        min-width: 110px;
        max-width: 180px;
        font-size: 12px;
        padding: 8px 10px;
    }
    
    .quick-suggestions-buttons {
        gap: 6px;
    }
}
         .instruction {
            background: #fef6e3;
            padding: 14px;
            border-radius: 8px;
            margin-bottom: 18px;
            border-left: 4px solid #ffd580;
            font-size: 13px;
            line-height: 1.5;
        }
        .instruction i {
            color: #e67e22;
            margin-right: 8px;
        } 
    /* API配置区域样式 */
    .api-config-section {
      background: #f8f9fa;
      border-radius: 8px;
      padding: 15px;
      margin-bottom: 15px;
      border: 1px solid #e9ecef;
    }
    .api-config-title {
      font-size: 14px;
      font-weight: 600;
      color: #2c3e50;
      margin-bottom: 10px;
      display: flex;
      align-items: center;
      gap: 8px;
    }
    .api-config-row {
      display: flex;
      gap: 10px;
      margin-bottom: 10px;
      align-items: center;
      flex-wrap: wrap;
    }
    .api-key-input {
      flex: 1;
      min-width: 200px;
    }
    .api-key-buttons {
      display: flex;
      gap: 8px;
    }
    .api-key-btn {
      padding: 8px 12px;
      background: linear-gradient(135deg, #4b6cb7, #182848);
      color: white;
      border: none;
      border-radius: 6px;
      cursor: pointer;
      font-size: 13px;
      transition: all .2s;
    }
    .api-key-btn:hover {
      opacity: 0.9;
    }
    .api-key-hint {
      font-size: 12px;
      color: #7f8c8d;
      padding: 8px;
      background: #fff;
      border-radius: 6px;
      border-left: 3px solid #3498db;
    }
    @media (max-width: 640px) {
      .row, .api-config-row {
        flex-direction: column;
        align-items: stretch;
      }
      .api-key-buttons {
        width: 100%;
      }
      .api-key-btn {
        flex: 1;
      }
    }
/* 文件类型标签样式 */
.file-type-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    font-size: 12px;
    margin-right: 8px;
    cursor: help;
    transition: all 0.3s ease;
}

.file-type-badge:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

.file-type-badge i {
    font-size: 12px;
}

/* 分析结果增强样式 */
.enhanced-analysis-section {
    margin: 15px 0;
    padding: 15px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.enhanced-analysis-section h4 {
    color: #2d3748;
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.enhanced-analysis-section h4 i {
    color: #667eea;
}

.source-tag {
    display: inline-block;
    padding: 2px 8px;
    background: #e2e8f0;
    color: #4a5568;
    border-radius: 4px;
    font-size: 12px;
    margin-left: 8px;
    font-weight: normal;
}

.warning-section {
    background: linear-gradient(135deg, #fff5f5 0%, #fed7d7 100%);
    border-left: 4px solid #f56565;
}

.success-section {
    background: linear-gradient(135deg, #f0fff4 0%, #c6f6d5 100%);
    border-left: 4px solid #48bb78;
}

.history-reference-section {
    background: linear-gradient(135deg, #faf5ff 0%, #e9d8fd 100%);
    border-left: 4px solid #9f7aea;
}
