* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --background: #121212;
    --surface: #1e1e1e;
    --primary: #667eea;
    --secondary: #764ba2;
    --accent: #4facfe;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --error: #f5576c;
    --success: #2ecc71;
    --accent-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --success-gradient: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    --dark-bg: #0f0f23;
    --card-bg: rgba(255, 255, 255, 0.1);
    --glass-bg: rgba(255, 255, 255, 0.05);
    --border-color: rgba(255, 255, 255, 0.1);
    --warning: #f39c12;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* 浏览器模式提示横幅 */
.browser-mode-banner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(135deg, var(--warning), #e67e22);
    color: #fff;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.browser-mode-content {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
}

.browser-mode-icon {
    font-size: 1.5rem;
    margin-right: 12px;
}

.browser-mode-text {
    flex: 1;
    font-size: 0.9rem;
}

.browser-mode-link {
    margin-left: 15px;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    transition: background 0.3s;
    white-space: nowrap;
}

.browser-mode-link:hover {
    background: rgba(255, 255, 255, 0.3);
}

.browser-mode-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    margin-left: 15px;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.browser-mode-close:hover {
    opacity: 1;
}

@media (max-width: 768px) {
    .browser-mode-content {
        flex-direction: column;
        padding: 15px;
    }
    
    .browser-mode-icon {
        margin-right: 0;
        margin-bottom: 8px;
    }
    
    .browser-mode-text {
        text-align: center;
        margin-bottom: 10px;
    }
    
    .browser-mode-link {
        margin-left: 0;
        margin-bottom: 10px;
    }
    
    .browser-mode-close {
        position: absolute;
        top: 10px;
        right: 10px;
        margin-left: 0;
    }
}

.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.floating-orbs {
    position: absolute;
    width: 100%;
    height: 100%;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.15;
}

.orb:nth-child(1) {
    top: -10%;
    left: -10%;
    width: 500px;
    height: 500px;
    background: var(--primary);
    animation: float 25s ease-in-out infinite;
}

.orb:nth-child(2) {
    bottom: -15%;
    right: -5%;
    width: 400px;
    height: 400px;
    background: var(--secondary);
    animation: float 20s ease-in-out infinite reverse;
}

.orb:nth-child(3) {
    top: 40%;
    left: 50%;
    width: 300px;
    height: 300px;
    background: var(--accent);
    animation: float 15s ease-in-out infinite;
    animation-delay: 5s;
}

@keyframes float {
    0% {
        transform: translate(0, 0);
    }
    50% {
        transform: translate(100px, 50px);
    }
    100% {
        transform: translate(0, 0);
    }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    position: relative;
    z-index: 1;
}

.header {
    text-align: center;
    margin-bottom: 2rem;
}

.logo {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 1.5rem;
}

.language-toggle {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 1rem 0;
}

.lang-btn {
    background: rgba(255, 255, 255, 0.05);
    border: none;
    border-radius: 20px;
    padding: 0.5rem 1rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.lang-btn.active {
    background: var(--accent-gradient);
    color: var(--text-primary);
    box-shadow: 0 4px 15px rgba(79, 172, 254, 0.4);
}

.lang-btn:hover:not(.active) {
    background: rgba(255, 255, 255, 0.1);
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
    }
}

.section-title {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.section-icon {
    margin-right: 0.5rem;
    font-size: 1.8rem;
}

.input-section, .output-section {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 15px;
    padding: 1.5rem;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.file-upload-area {
    border: 2px dashed rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.file-upload-area:hover {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.02);
}

.file-upload-area.dragover {
    border-color: var(--accent);
    background: rgba(79, 172, 254, 0.05);
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.text-input {
    width: 100%;
    min-height: 150px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 15px;
    color: var(--text-primary);
    font-size: 1rem;
    resize: vertical;
    transition: all 0.3s ease;
}

.text-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.keyword-count-selector {
    margin: 15px 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.keyword-count-selector label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.count-options {
    display: flex;
    gap: 8px;
}

.count-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    padding: 5px 15px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.count-btn.active {
    background: var(--accent-gradient);
    color: var(--text-primary);
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(79, 172, 254, 0.3);
}

.count-btn:hover:not(.active) {
    background: rgba(255, 255, 255, 0.1);
}

.action-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.result-actions {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.action-buttons-group {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.btn-icon {
    font-size: 1.1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn {
    padding: 0.7rem 1.5rem;
    border: none;
    border-radius: 30px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    height: 44px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
}

.btn-success {
    background: var(--success-gradient);
    color: white;
}

.btn-success:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(46, 204, 113, 0.3);
}

.output-section {
    position: relative;
}

.results-area {
    min-height: 300px;
    max-height: 500px;
    overflow-y: auto;
    padding-right: 10px;
}

.results-area::-webkit-scrollbar {
    width: 8px;
}

.results-area::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.results-area::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.results-area::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

.loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(30, 30, 30, 0.9);
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.loading.active {
    opacity: 1;
    pointer-events: all;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.result-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
    border-left: 4px solid #667eea;
    transition: all 0.3s ease;
}

.result-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.result-product {
    font-weight: 600;
    color: #667eea;
    flex: 1;
}

.result-keywords {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.analyze-btn {
    background: var(--accent-gradient);
    color: white;
    border: none;
    border-radius: 15px;
    padding: 5px 10px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.analyze-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(79, 172, 254, 0.3);
}

.result-analysis {
    margin-top: 15px;
    overflow: hidden;
}

.analysis-container {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    padding: 15px;
    margin-top: 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.analysis-container h3 {
    font-size: 1rem;
    margin-bottom: 15px;
    color: #4facfe;
}

.analysis-container h4 {
    font-size: 0.9rem;
    margin: 15px 0 10px;
    color: var(--text-primary);
}

.analysis-stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 15px;
}

.analysis-stat {
    text-align: center;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #4facfe;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.analysis-distribution {
    margin-bottom: 15px;
}

.distribution-bars {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.distribution-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.dist-label {
    width: 60px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.dist-bar {
    flex: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.dist-fill {
    height: 100%;
    background: var(--accent-gradient);
}

.dist-value {
    width: 30px;
    font-size: 0.8rem;
    text-align: right;
    color: var(--text-secondary);
}

.word-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.word-tag {
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 8px;
    border-radius: 15px;
    color: #4facfe;
    display: inline-block;
}

.word-tag small {
    color: var(--text-secondary);
    font-size: 0.7em;
}

.stats-section {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

@media (max-width: 768px) {
    .stats-section {
        grid-template-columns: repeat(2, 1fr);
    }
}

.stat-card {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    padding: 1rem;
    text-align: center;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.footer {
    margin-top: 3rem;
    text-align: center;
}

.footer-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.copy-success {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--success-gradient);
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    box-shadow: 0 5px 15px rgba(46, 204, 113, 0.3);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
}

.copy-success.show {
    opacity: 1;
    transform: translateX(-50%) translateY(-10px);
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    
    .title {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 0.9rem;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .action-buttons-group {
        flex-direction: column;
        width: 100%;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .copy-mode-selector {
        flex-direction: column;
        gap: 10px;
    }
    
    .copy-mode-options {
        width: 100%;
        justify-content: center;
    }
    
    .copy-mode-btn {
        flex: 1;
        min-width: unset;
    }
    
    .stats-section {
        flex-wrap: wrap;
    }
    
    .stat-card {
        width: calc(50% - 10px);
        margin-bottom: 10px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .input-section, .output-section {
        padding: 20px;
    }
    
    .stats-section {
        grid-template-columns: 1fr;
    }
    
    .copy-mode-options {
        flex-direction: column;
        width: 100%;
    }
    
    .copy-mode-btn {
        width: 100%;
    }
    
    .btn {
        font-size: 0.9rem;
        padding: 0.6rem 1rem;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--glass-bg);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-gradient);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-gradient);
}

/* 复制模式切换开关 */
.copy-mode-switch {
    display: none;
}

.copy-mode-switch span {
    display: none;
}

.copy-mode-switch select {
    display: none;
}

/* 复制模式选择器 */
.copy-mode-selector {
    width: 100%;
    margin-bottom: 15px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.copy-mode-label {
    color: var(--text-secondary);
    font-size: 0.95rem;
    white-space: nowrap;
}

.copy-mode-options {
    display: flex;
    gap: 10px;
    flex-wrap: nowrap;
}

.copy-mode-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 30px;
    padding: 0.6rem 1.2rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    min-width: 130px;
    white-space: nowrap;
}

.copy-mode-btn.active {
    background: var(--accent-gradient);
    color: var(--text-primary);
    box-shadow: 0 4px 15px rgba(79, 172, 254, 0.3);
    border-color: transparent;
}

.copy-mode-btn:hover:not(.active) {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
} 