* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    color: #333;
    padding: 20px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
}

header {
    text-align: center;
    padding: 30px 0;
}

header h1 {
    font-size: 28px;
    color: #1a237e;
    margin-bottom: 8px;
}

.subtitle {
    color: #666;
    font-size: 14px;
}

.input-section {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
}

.tabs {
    display: flex;
    gap: 0;
    margin-bottom: 16px;
    border-bottom: 2px solid #eee;
}

.tab {
    padding: 10px 24px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 15px;
    color: #666;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}

.tab:hover {
    color: #1976d2;
}

.tab.active {
    color: #1976d2;
    border-bottom-color: #1976d2;
    font-weight: 600;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.tab-content input[type="text"] {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.tab-content input[type="text"]:focus {
    outline: none;
    border-color: #1976d2;
}

.file-drop {
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: #f9f9f9;
}

.file-drop:hover {
    border-color: #1976d2;
    background: #e3f2fd;
}

.file-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.file-hint {
    font-size: 12px;
    color: #999;
    margin-top: 8px;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #e8f5e9;
    border-radius: 8px;
    color: #2e7d32;
}

.options {
    margin-top: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.option-label {
    font-size: 14px;
    color: #666;
    display: flex;
    align-items: center;
    gap: 8px;
}

.option-label select {
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    background: #fff;
}

.btn-primary {
    display: block;
    width: 100%;
    margin-top: 16px;
    padding: 14px;
    background: #1976d2;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-primary:hover:not(:disabled) {
    background: #1565c0;
}

.btn-primary:disabled {
    background: #b0bec5;
    cursor: not-allowed;
}

.btn-sm {
    padding: 6px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

.btn-sm:hover {
    background: #f5f5f5;
    border-color: #999;
}

.progress-section {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
}

.progress-bar-container {
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #1976d2, #42a5f5);
    border-radius: 4px;
    transition: width 0.5s ease;
    width: 0%;
}

.progress-text {
    text-align: center;
    color: #666;
    font-size: 14px;
}

.result-section {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
}

.result-tabs {
    display: flex;
    border-bottom: 2px solid #eee;
    background: #fafafa;
}

.result-tab {
    padding: 12px 20px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}

.result-tab:hover {
    color: #1976d2;
}

.result-tab.active {
    color: #1976d2;
    border-bottom-color: #1976d2;
    font-weight: 600;
}

.result-content {
    display: none;
    padding: 20px;
}

.result-content.active {
    display: block;
}

.result-toolbar {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    justify-content: flex-end;
}

.result-text {
    background: #f5f5f5;
    border-radius: 8px;
    padding: 16px;
    font-size: 14px;
    line-height: 1.8;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 500px;
    overflow-y: auto;
}

.result-text p {
    margin-bottom: 8px;
}

.result-text h3 {
    margin: 16px 0 8px;
    color: #1a237e;
}

.result-text hr {
    border: none;
    border-top: 1px solid #ddd;
    margin: 12px 0;
}

.keywords-cloud {
    padding: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    align-items: center;
}

.keyword {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 20px;
    background: #e3f2fd;
    color: #1565c0;
    font-size: 14px;
    transition: all 0.2s;
}

.keyword:hover {
    transform: scale(1.1);
    background: #1976d2;
    color: #fff;
}

.keyword.small { font-size: 13px; }
.keyword.medium { font-size: 16px; }
.keyword.large { font-size: 20px; font-weight: 600; }
.keyword.xlarge { font-size: 24px; font-weight: 700; }

.timeline {
    max-height: 500px;
    overflow-y: auto;
}

.timeline-entry {
    display: flex;
    gap: 16px;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.timeline-entry:last-child {
    border-bottom: none;
}

.tl-time {
    flex-shrink: 0;
    font-family: "SF Mono", "Courier New", monospace;
    color: #1976d2;
    font-weight: 600;
    font-size: 13px;
    min-width: 60px;
}

.tl-text {
    font-size: 14px;
    line-height: 1.6;
}

.error-section {
    margin-bottom: 20px;
}

.error-box {
    background: #ffebee;
    color: #c62828;
    padding: 14px 20px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

@media (max-width: 600px) {
    header h1 { font-size: 22px; }
    .input-section { padding: 16px; }
    .tab { padding: 8px 16px; font-size: 13px; }
    .result-tab { padding: 10px 14px; font-size: 13px; }
}
