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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    overflow: hidden;
}

.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

.header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.header p {
    font-size: 1.1em;
    opacity: 0.9;
}

.content {
    padding: 40px;
}

.input-section {
    margin-bottom: 40px;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

textarea, input {
    width: 100%;
    padding: 15px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

textarea:focus, input:focus {
    outline: none;
    border-color: #667eea;
}

textarea {
    min-height: 120px;
    resize: vertical;
}

.button-group {
    display: flex;
    gap: 15px;
    align-items: center;
}

.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: #f8f9fa;
    color: #333;
    border: 2px solid #e1e5e9;
}

.btn-secondary:hover {
    background: #e9ecef;
}

/* 更灰的按钮样式，仅用于点赞/踩 */
.btn-muted {
    background: #f1f3f5;
    color: #555;
    border: 2px solid #dcdfe4;
}
.btn-muted:hover {
    background: #e2e6ea;
    color: #333;
}
/* selected states for like/dislike */
.btn-liked {
    background: #e6f4ea;
    border-color: #34a853;
    color: #1e7e34;
}
.btn-disliked {
    background: #fde8e8;
    border-color: #ea4335;
    color: #b02a1a;
}

.loading {
    display: none;
    text-align: center;
    padding: 20px;
}

.progress-wrapper {
    margin: 20px 0;
    background: #f8f9fa;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 15px;
}
.progress-bar {
    width: 100%;
    height: 16px;
    background: #e9ecef;
    border-radius: 8px;
    overflow: hidden;
}
.progress-bar-inner {
    height: 100%;
    width: 0%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s ease;
}
.progress-status {
    margin-top: 8px;
    font-size: 0.95em;
    color: #555;
}

.progress-details {
    margin-top: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 5px;
    font-size: 0.9em;
    color: #666;
    border-left: 3px solid #667eea;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.results {
    margin-top: 40px;
}

.result-item {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    border-left: 4px solid #667eea;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.result-title {
    font-size: 1.2em;
    font-weight: 600;
    color: #333;
    flex: 1;
}

.result-similarity {
    background: #667eea;
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 600;
}

.result-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
    font-size: 0.9em;
    color: #666;
}

.result-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.result-abstract {
    color: #555;
    line-height: 1.6;
}

.stats {
    background: #e8f4fd;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    text-align: center;
}

.error {
    background: #ffe6e6;
    border: 1px solid #ffcccc;
    color: #cc0000;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.example {
    background: #f0f8ff;
    border: 1px solid #b3d9ff;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.example h4 {
    color: #0066cc;
    margin-bottom: 10px;
}

.example-text {
    font-style: italic;
    color: #666;
}
/* selectable placeholder style */
textarea.placeholder-text {
    color: #757575;
    font-style: italic;
}

/* Disclaimer styling */
.disclaimer {
    margin-top: 20px;
    background: #fafafa;
    border: none;
    border-radius: 5px;
    padding: 10px 15px;
}

.disclaimer h3 {
    color: #666;
    margin-bottom: 8px;
    font-size: 0.8em;
    border-bottom: none;
    padding-bottom: 0;
}

.disclaimer-content {
    color: #777;
    line-height: 1.4;
    font-size: 0.75em;
}

.disclaimer-content p {
    margin-bottom: 6px;
}

.disclaimer-content p:last-child {
    margin-bottom: 0;
}

/* PDF Export Styles */
.export-pdf-container {
    display: inline-flex;
    align-items: center;
    position: relative;
}

.export-dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-arrow {
    background: #f8f9fa;
    color: #333;
    border: 2px solid #e1e5e9;
    border-left: none;
    border-radius: 0 8px 8px 0;
    padding: 12px 8px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s;
}

.dropdown-arrow:hover {
    background: #e9ecef;
}

.dropdown-content {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 1000;
    min-width: 200px;
    padding: 8px 0;
}

.dropdown-content label {
    display: block;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    transition: background-color 0.2s;
}

.dropdown-content label:hover {
    background-color: #f8f9fa;
}

.dropdown-content input[type="radio"] {
    margin-right: 8px;
}

/* Topic Discovery Styles */
.topic-item {
    background: #f0f8ff;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    border-left: 4px solid #764ba2;
}

.topic-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.topic-title {
    font-size: 1.2em;
    font-weight: 600;
    color: #333;
    flex: 1;
}

.topic-count {
    background: #764ba2;
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 600;
}

.topic-keywords {
    margin-bottom: 15px;
    padding: 10px;
    background: #fff;
    border-radius: 5px;
}

.topic-keywords strong {
    color: #764ba2;
}

.topic-papers {
    margin-top: 10px;
}

.topic-paper-item {
    padding: 10px;
    background: #fff;
    border-radius: 5px;
    margin-bottom: 8px;
    border-left: 3px solid #667eea;
}

.topic-paper-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.topic-paper-meta {
    font-size: 0.9em;
    color: #666;
}
