/* 全局样式 */
body {
    font-family: 'Segoe UI', 'Microsoft YaHei', Arial, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #2d3748;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 移动端优化容器 */
@media (max-width: 768px) {
    .container {
        width: 95%;
        padding: 10px;
    }
}

/* 头部样式 */
header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 2rem 0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    border-radius: 0 0 20px 20px;
    margin-bottom: 30px;
}

header h1 {
    text-align: center;
    margin: 0;
    font-size: 2.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
    letter-spacing: -1px;
}

/* 移动端头部优化 */
@media (max-width: 768px) {
    header {
        padding: 1.5rem 0;
        margin-bottom: 20px;
    }
    
    header h1 {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    header {
        padding: 1rem 0;
        margin-bottom: 15px;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
}

/* 搜索框样式 */
.search-box {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    margin-bottom: 30px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
}

.search-input-wrapper {
    flex: 1;
    min-width: 200px;
    position: relative;
}

.search-box input[type="text"] {
    width: 100%;
    padding: 15px 20px 15px 40px;
    border: 2px solid #e2e8f0;
    border-radius: 25px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.8);
    box-sizing: border-box;
}

.search-box input[type="text"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #a0aec0;
    font-size: 16px;
}

.search-box button {
    padding: 15px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    white-space: nowrap;
}

.search-box button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* 统计信息样式 */
.stats {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    padding: 25px;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    margin-bottom: 30px;
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.stat-item {
    text-align: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 15px;
    margin: 10px;
    min-width: 120px;
    transition: all 0.3s ease;
    flex: 1;
    min-width: 100px;
}

.stat-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.stat-item .number {
    font-size: 32px;
    font-weight: bold;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 5px;
}

.stat-item .label {
    font-size: 14px;
    color: #4a5568;
    font-weight: 500;
}

/* 移动端统计信息优化 */
@media (max-width: 768px) {
    .stats {
        padding: 15px;
    }
    
    .stat-item {
        padding: 15px 10px;
        margin: 5px;
        min-width: 80px;
    }
    
    .stat-item .number {
        font-size: 24px;
    }
    
    .stat-item .label {
        font-size: 12px;
    }
}

/* GitHub链接样式 */
.github-link {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #333;
    font-size: 24px;
    transition: all 0.3s ease;
    text-decoration: none;
}

.github-link:hover {
    color: #667eea;
    transform: translateY(-50%) scale(1.1);
}

/* 头部容器相对定位 */
header .container {
    position: relative;
}

/* 页脚样式 */
.footer {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 20px 0 15px;
    margin-top: 30px;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    gap: 10px;
}

.footer-info {
    flex: 1;
    min-width: 300px;
}

.footer-info .copyright {
    color: #2d3748;
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 5px 0;
}

.footer-info .data-source {
    color: #4a5568;
    font-size: 13px;
    margin: 0;
}

.footer-links {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
}

.footer-links a {
    color: #667eea;
    text-decoration: none;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.footer-links a:hover {
    color: #764ba2;
    text-decoration: underline;
}

.footer-links .separator {
    color: #a0aec0;
}

.github-link-footer .fa-github {
    font-size: 16px;
}

.footer-bottom {
    text-align: center;
    padding-top: 15px;
    border-top: 1px solid rgba(0,0,0,0.1);
}

.footer-bottom p {
    color: #718096;
    font-size: 12px;
    margin: 0;
}

/* 移动端页脚优化 */
@media (max-width: 768px) {
    .footer {
        padding: 20px 0 15px;
        margin-top: 20px;
    }
    
    .footer-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
        margin-bottom: 15px;
    }
    
    .footer-info {
        min-width: 100%;
    }
    
    .footer-info .copyright {
        font-size: 13px;
    }
    
    .footer-info .data-source {
        font-size: 12px;
    }
    
    .footer-links {
        font-size: 12px;
    }
    
    .footer-bottom p {
        font-size: 11px;
    }
    
    /* 移动端GitHub链接优化 */
    .github-link {
        font-size: 20px;
        right: 15px;
    }
}

@media (max-width: 480px) {
    .github-link {
        font-size: 18px;
        right: 10px;
    }
    
    .footer-info .copyright {
        font-size: 12px;
    }
    
    .footer-info .data-source {
        font-size: 11px;
    }
    
    .footer-links {
        font-size: 11px;
        flex-wrap: wrap;
    }
    
    .footer-bottom p {
        font-size: 10px;
    }
}

@media (max-width: 480px) {
    .stats {
        padding: 10px;
    }
    
    .stat-item {
        padding: 10px 5px;
        margin: 3px;
        min-width: 70px;
    }
    
    .stat-item .number {
        font-size: 20px;
    }
    
    .stat-item .label {
        font-size: 11px;
    }
}

/* 语句列表样式 */
.sentence-list {
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
}

.sentence-item {
    padding: 25px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.sentence-item:last-child {
    border-bottom: none;
}

.sentence-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}

.sentence-chinese {
    font-size: 20px;
    margin-bottom: 12px;
    color: #2d3748;
    font-weight: 500;
    line-height: 1.5;
}

.sentence-japanese {
    font-size: 18px;
    margin-bottom: 18px;
    color: #4a5568;
    font-weight: 400;
    line-height: 1.6;
    border-left: 3px solid #667eea;
    padding-left: 15px;
}

.source {
    font-size: 14px;
    color: #718096;
    font-weight: 500;
}

.source a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.source a:hover {
    text-decoration: underline;
    color: #764ba2;
}

/* 移动端语句列表优化 */
@media (max-width: 768px) {
    .sentence-item {
        padding: 20px;
        margin-bottom: 15px;
        border-radius: 15px;
    }
    
    .sentence-chinese {
        font-size: 18px;
        margin-bottom: 10px;
    }
    
    .sentence-japanese {
        font-size: 16px;
        margin-bottom: 15px;
        padding-left: 12px;
    }
    
    .source {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .sentence-item {
        padding: 15px;
        margin-bottom: 10px;
        border-radius: 12px;
    }
    
    .sentence-chinese {
        font-size: 16px;
        margin-bottom: 8px;
    }
    
    .sentence-japanese {
        font-size: 14px;
        margin-bottom: 12px;
        padding-left: 10px;
    }
    
    .source {
        font-size: 12px;
    }
}

/* 分页样式 */
.pagination {
    display: flex;
    justify-content: center;
    margin: 30px 0;
    flex-wrap: wrap;
    gap: 10px;
}

.pagination button {
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #e2e8f0;
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    min-width: 100px;
}

.pagination button:hover:not(.active) {
    background: rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.pagination button.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
}

#page-info {
    align-self: center;
    font-weight: 500;
    color: #4a5568;
    background: rgba(255, 255, 255, 0.8);
    padding: 10px 20px;
    border-radius: 25px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    min-width: 150px;
    text-align: center;
}

.pagination-select {
    padding: 12px 20px;
    border: 1px solid #e2e8f0;
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.9);
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.pagination-select:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.pagination-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 移动端分页优化 */
@media (max-width: 768px) {
    .pagination {
        gap: 5px;
    }
    
    .pagination button {
        padding: 10px 15px;
        min-width: 80px;
        font-size: 14px;
    }
    
    #page-info {
        padding: 8px 15px;
        min-width: 120px;
        font-size: 14px;
    }
    
    .pagination-select {
        padding: 10px 15px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .pagination button {
        padding: 8px 12px;
        min-width: 70px;
        font-size: 13px;
    }
    
    #page-info {
        padding: 6px 12px;
        min-width: 100px;
        font-size: 13px;
    }
    
    .pagination-select {
        padding: 8px 12px;
        font-size: 13px;
    }
}

/* 图标样式 */
.stat-icon {
    font-size: 24px;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 搜索框图标 */
.search-input-wrapper {
    position: relative;
    display: inline-block;
    width: 70%;
}

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #a0aec0;
    font-size: 16px;
}

.search-box input[type="text"] {
    padding-left: 45px;
}

/* 加载动画 */
.loading {
    text-align: center;
    padding: 50px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(102, 126, 234, 0.1);
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

/* 按钮图标间距 */
button i {
    margin-right: 5px;
}

button i.fa-chevron-left {
    margin-right: 8px;
}

button i.fa-chevron-right {
    margin-left: 8px;
    margin-right: 0;
}

/* 语句项动画 */
.sentence-item {
    animation: fadeInUp 0.5s ease-out forwards;
    opacity: 0;
    transform: translateY(20px);
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 无结果提示 */
.no-results {
    text-align: center;
    padding: 60px 20px;
    color: #a0aec0;
}

.no-results i {
    font-size: 48px;
    margin-bottom: 20px;
    display: block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.no-results p {
    font-size: 18px;
    margin: 0;
}

/* 搜索结果高亮 */
.highlight {
    background: linear-gradient(135deg, #ffd166 0%, #ffb347 100%);
    padding: 2px 4px;
    border-radius: 4px;
    font-weight: 600;
    color: #2d3748;
}

/* 响应式设计 */
/* 平板设备 */
@media (max-width: 1024px) {
    .container {
        width: 95%;
        padding: 20px 15px;
    }
    
    header h1 {
        font-size: 2.2rem;
    }
    
    .search-box {
        padding: 25px;
    }
    
    .search-box input[type="text"] {
        width: 65%;
    }
    
    .search-box button {
        padding: 15px 25px;
        margin-left: 10px;
    }
    
    .stats {
        padding: 20px;
    }
    
    .stat-item {
        padding: 15px;
        min-width: 100px;
    }
    
    .stat-item .number {
        font-size: 28px;
    }
    
    .sentence-item {
        padding: 20px;
        margin-bottom: 15px;
    }
    
    .sentence-chinese {
        font-size: 18px;
    }
    
    .sentence-japanese {
        font-size: 16px;
    }
    
    .pagination {
        gap: 8px;
    }
    
    .pagination button {
        padding: 10px 15px;
        font-size: 14px;
    }
    
    #page-info {
        padding: 10px 15px;
        font-size: 14px;
    }
    
    .pagination-select {
        padding: 10px 15px;
        font-size: 14px;
        padding-right: 2.5rem;
    }
}

/* 手机设备 */
@media (max-width: 768px) {
    .container {
        width: 95%;
        padding: 15px 10px;
    }
    
    header {
        padding: 1.5rem 0;
        margin-bottom: 20px;
    }
    
    header h1 {
        font-size: 1.8rem;
        padding: 0 10px;
    }
    
    .search-box {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .search-input-wrapper {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .search-box input[type="text"] {
        width: 100%;
        padding: 12px 15px 12px 40px;
        font-size: 16px; /* 防止iOS缩放 */
        margin-bottom: 10px;
    }
    
    .search-icon {
        left: 12px;
        font-size: 14px;
    }
    
    .search-box button {
        width: 100%;
        padding: 12px;
        margin-left: 0;
        font-size: 16px;
    }
    
    .stats {
        flex-direction: column;
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .stat-item {
        margin: 5px 0;
        min-width: auto;
        width: 100%;
        padding: 15px 10px;
    }
    
    .stat-item .number {
        font-size: 24px;
    }
    
    .stat-item .label {
        font-size: 13px;
    }
    
    .sentence-item {
        padding: 15px;
        margin-bottom: 12px;
        border-radius: 15px;
    }
    
    .sentence-chinese {
        font-size: 16px;
        margin-bottom: 10px;
    }
    
    .sentence-japanese {
        font-size: 14px;
        margin-bottom: 12px;
        padding-left: 12px;
    }
    
    .source {
        font-size: 12px;
    }
    
    .source a {
        font-size: 12px;
    }
    
    .pagination {
        flex-wrap: wrap;
        gap: 6px;
        margin: 20px 0;
        justify-content: center;
        text-align: center;
    }
    
    .pagination button {
        padding: 8px 12px;
        font-size: 13px;
        border-radius: 20px;
    }
    
    #page-info {
        padding: 8px 12px;
        font-size: 13px;
        border-radius: 20px;
        margin: 5px 0;
    }
    
    .pagination-select {
        padding: 8px 12px;
        font-size: 13px;
        border-radius: 20px;
        padding-right: 2rem;
        margin: 5px 0;
    }
    
    /* 分页控件在超小屏幕上堆叠显示 */
    @media (max-width: 480px) {
        .pagination {
            flex-direction: column;
            align-items: center;
        }
        
        .pagination > * {
            margin: 3px 0;
        }
    }
}

/* 超小屏幕设备优化 */
@media (max-width: 480px) {
    .container {
        width: 100%;
        padding: 10px 5px;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
    
    .search-box {
        padding: 12px;
    }
    
    .search-box input[type="text"] {
        padding: 10px 12px 10px 35px;
        font-size: 14px;
    }
    
    .search-icon {
        left: 10px;
        font-size: 12px;
    }
    
    .search-box button {
        padding: 10px;
        font-size: 14px;
    }
    
    .stats {
        padding: 12px;
    }
    
    .stat-item {
        padding: 12px 8px;
    }
    
    .stat-item .number {
        font-size: 20px;
    }
    
    .stat-item .label {
        font-size: 12px;
    }
    
    .sentence-item {
        padding: 12px;
        margin-bottom: 10px;
    }
    
    .sentence-chinese {
        font-size: 15px;
        margin-bottom: 8px;
    }
    
    .sentence-japanese {
        font-size: 13px;
        margin-bottom: 10px;
        padding-left: 10px;
    }
    
    .source {
        font-size: 11px;
    }
    
    .loading {
        padding: 30px 10px;
    }
    
    .loading-spinner {
        width: 30px;
        height: 30px;
    }
    
    .no-results {
        padding: 40px 10px;
    }
    
    .no-results i {
        font-size: 36px;
    }
    
    .no-results p {
        font-size: 16px;
    }
}

/* 横屏模式优化 */
@media (max-height: 500px) and (orientation: landscape) {
    header {
        padding: 1rem 0;
        margin-bottom: 10px;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
    
    .search-box {
        padding: 10px;
        margin-bottom: 10px;
    }
    
    .sentence-item {
        padding: 10px;
        margin-bottom: 8px;
    }
    
    .stats {
        padding: 10px;
        margin-bottom: 10px;
    }
    
    .stat-item {
        padding: 10px 5px;
        margin: 3px 0;
    }
}

/* 移动端专用样式 */
.mobile-device .sentence-item {
    transition: transform 0.1s ease, box-shadow 0.3s ease;
}

.mobile-device .sentence-item:active {
    transform: scale(0.98);
}

/* 触摸设备优化 */
@media (hover: none) {
    .sentence-item:hover {
        transform: none;
        box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    }
    
    .search-box button:hover {
        transform: none;
        box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    }
    
    .pagination button:hover:not(.active) {
        transform: none;
        box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    }
}

/* iOS Safari 优化 */
@supports (-webkit-touch-callout: none) {
    .search-box input[type="text"] {
        -webkit-appearance: none;
        border-radius: 25px;
    }
    
    .pagination-select {
        -webkit-appearance: none;
        border-radius: 25px;
    }
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    body {
        background: #f0f0f0;
        color: #000;
    }
    
    .sentence-item {
        background: #fff;
        border: 2px solid #000;
    }
    
    .sentence-chinese {
        color: #000;
    }
    
    .sentence-japanese {
        color: #333;
        border-left: 3px solid #000;
    }
}

/* 减少动画偏好支持 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .sentence-item {
        animation: none;
    }
    
    .loading-spinner {
        animation: none;
    }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    body {
        background: linear-gradient(135deg, #2d3748 0%, #4a5568 100%);
        color: #e2e8f0;
    }
    
    .search-box,
    .stats,
    .sentence-item,
    .pagination button,
    .pagination-select,
    #page-info {
        background: rgba(45, 55, 72, 0.9);
        color: #e2e8f0;
        border: 1px solid rgba(74, 85, 104, 0.5);
    }
    
    .search-box input[type="text"] {
        background: rgba(26, 32, 44, 0.8);
        border: 2px solid #4a5568;
        color: #e2e8f0;
    }
    
    .stat-item {
        background: rgba(26, 32, 44, 0.6);
    }
    
    .sentence-chinese {
        color: #e2e8f0;
    }
    
    .sentence-japanese {
        color: #cbd5e0;
        border-left: 3px solid #667eea;
    }
    
    .source {
        color: #a0aec0;
    }
    
    .source a {
        color: #90cdf4;
    }
    
    .source a:hover {
        color: #63b3ed;
    }
    
    .search-icon {
        color: #a0aec0;
    }
}