* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body.no-scroll {
    overflow: hidden !important;
    position: fixed !important;
    width: 100% !important;
    height: 100% !important;
}

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.header {
    text-align: center;
    color: white;
    margin-bottom: 40px;
}

.header h1 {
    font-size: 3em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.header p {
    font-size: 1.2em;
    opacity: 0.9;
}

.search-box {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    margin-bottom: 40px;
    text-align: center;
}

.search-box h2 {
    margin-bottom: 20px;
    color: #667eea;
}

.search-box .input-group {
    display: flex;
    gap: 15px;
    justify-content: center;
    align-items: center;
}

.search-box input {
    padding: 15px 25px;
    font-size: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    width: 300px;
    transition: all 0.3s;
}

.search-box input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-box button {
    padding: 15px 40px;
    font-size: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.search-box button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.results {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.results-scroll-container {
    overflow-y: auto;
    position: relative;
    max-height: 500px;
}

/* 美化滚动条 */
.results-scroll-container::-webkit-scrollbar {
    width: 8px;
}

.results-scroll-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.results-scroll-container::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.results-scroll-container::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.results-scroll-container #results {
    /* 普通列表，不需要transform */
}

.results h2 {
    margin-bottom: 20px;
    color: #667eea;
}

.result-item {
    padding: 20px;
    margin-bottom: 15px;
    background: #f8f9ff;
    border-radius: 10px;
    border-left: 4px solid #667eea;
    transition: all 0.3s;
}

.result-item:hover {
    transform: translateX(5px);
}

.result-item .username {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
}

.result-item .username span {
    color: #667eea;
}

.result-item .type {
    display: inline-block;
    padding: 5px 15px;
    background: #667eea;
    color: white;
    border-radius: 15px;
    font-size: 14px;
    margin-bottom: 10px;
}

.result-item .content {
    color: #666;
    line-height: 1.6;
    margin-bottom: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.result-item .meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 15px;
    color: #999;
    font-size: 14px;
}

.result-item .status {
    color: #28a745;
    font-weight: bold;
}

.result-item .punishment {
    color: #dc3545;
}

.detail-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    overflow: hidden;
    overscroll-behavior: contain;
    touch-action: none;
}

.detail-modal.active {
    overflow: hidden;
}

.detail-modal .modal-wrapper {
    width: 100%;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 20px;
    box-sizing: border-box;
}

.detail-modal .modal-content {
    background: white;
    padding: 25px;
    border-radius: 15px;
    max-width: 600px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    animation: slideIn 0.3s ease;
    margin: 0 auto;
    overscroll-behavior: contain;
}

.detail-modal .modal-content::-webkit-scrollbar {
    width: 8px;
}

.detail-modal .modal-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.detail-modal .modal-content::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.detail-modal .modal-content::-webkit-scrollbar-thumb:hover {
    background: #555;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.detail-modal .close {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 30px;
    cursor: pointer;
    color: #999;
    transition: all 0.3s;
}

.detail-modal .close:hover {
    color: #333;
}

.detail-modal h2 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.5em;
}

.detail-modal .detail-item {
    margin-bottom: 8px;
}

.detail-modal .label {
    font-weight: bold;
    color: #333;
    display: inline-block;
    width: 100px;
    font-size: 14px;
}

.detail-modal .value {
    color: #666;
}

.detail-modal .content-box {
    background: #f8f9ff;
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
}

.detail-modal .detail-section {
    margin: 15px 0;
    background: #f8f9ff;
    border-radius: 10px;
    padding: 15px;
    border: 1px solid #e0e0e0;
}

.detail-modal .section-title {
    font-size: 15px;
    color: #667eea;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 2px solid #667eea;
}

.detail-modal .section-content {
    color: #333;
    line-height: 1.6;
    padding: 8px;
    background: white;
    border-radius: 6px;
}

.no-results {
    text-align: center;
    color: #999;
    padding: 40px;
}

.admin-login {
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    max-width: 400px;
    margin: 50px auto;
}

.admin-login h2 {
    text-align: center;
    color: #667eea;
    margin-bottom: 30px;
}

.admin-login input {
    width: 100%;
    padding: 15px;
    margin-bottom: 20px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
}

.admin-login button {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    cursor: pointer;
}

.admin-dashboard {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.admin-header h2 {
    color: #667eea;
}

.admin-btn {
    padding: 10px 20px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin-left: 10px;
}

.admin-btn.danger {
    background: #dc3545;
}

.admin-btn.success {
    background: #28a745;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.admin-table th,
.admin-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.admin-table th {
    background: #f8f9ff;
    color: #667eea;
    font-weight: bold;
}

.admin-table tr:hover {
    background: #f8f9ff;
}

/* 移动端表格优化 */
.admin-table {
    border-spacing: 0;
}

.admin-table thead th {
    position: sticky;
    top: 0;
    background: #f8f9ff;
    z-index: 10;
}

.admin-table tbody td {
    border-top: 1px solid #e0e0e0;
}

.modal-form {
    background: white;
    padding: 25px 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    max-width: 600px;
    width: 90%;
    max-height: 85vh;
    margin: 20px auto;
    overflow-y: auto;
}

.modal-form::-webkit-scrollbar {
    width: 8px;
}

.modal-form::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.modal-form::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.modal-form::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.modal-form h2 {
    color: #667eea;
    margin-bottom: 30px;
}

.modal-form .form-group {
    margin-bottom: 15px;
}

.modal-form label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: bold;
}

.modal-form input,
.modal-form textarea,
.modal-form select {
    width: 100%;
    padding: 10px 8px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
}

.modal-form textarea {
    min-height: 100px;
    resize: vertical;
}

.modal-form .form-actions {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.hidden {
    display: none !important;
}

.message {
    padding: 15px;
    margin: 15px 0;
    border-radius: 8px;
    text-align: center;
}

.message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .container {
        width: 100%;
    }

    .header h1 {
        font-size: 1.8em;
        margin-bottom: 5px;
    }

    .header p {
        font-size: 0.9em;
    }

    .search-box {
        padding: 20px;
        margin-bottom: 20px;
    }

    .search-box .input-group {
        flex-direction: column;
        width: 100%;
    }

    .search-box input {
        width: 100%;
        font-size: 14px;
    }

    .search-box button {
        width: 100%;
        font-size: 14px;
    }

    .results {
        padding: 20px;
    }

    .results-scroll-container {
        max-height: 400px;
        -webkit-overflow-scrolling: touch;
        overflow-y: scroll;
    }

    .result-item {
        padding: 12px 15px;
        margin-bottom: 10px;
    }

    .result-item .username {
        font-size: 16px;
        margin-bottom: 8px;
    }

    .result-item .type {
        display: inline-block;
        padding: 4px 12px;
        font-size: 12px;
        margin-bottom: 8px;
    }

    .result-item .content {
        font-size: 13px;
        margin-bottom: 8px;
        line-height: 1.4;
    }

    .result-item .meta {
        display: flex;
        flex-wrap: wrap;
        gap: 6px 10px;
        font-size: 11px;
    }

    .result-item .meta span {
        flex: 0 0 auto;
    }

    .result-item button {
        width: 100%;
        padding: 8px 15px;
        font-size: 13px;
        margin-top: 8px;
    }

    .detail-modal .modal-wrapper {
        padding: 10px;
        align-items: flex-start;
    }

    .detail-modal .modal-content {
        padding: 20px;
        width: 95%;
        max-height: 90vh;
        overflow-y: auto;
    }

    .detail-modal h2 {
        font-size: 1.5em;
        margin-bottom: 15px;
    }

    .detail-modal .label {
        width: 100px;
        font-size: 14px;
    }

    .detail-modal .value {
        font-size: 14px;
    }

    .detail-modal .detail-section {
        margin: 20px 0;
        padding: 15px;
    }

    .detail-modal .section-title {
        font-size: 14px;
    }

    .detail-modal .section-content {
        font-size: 13px;
        padding: 8px;
    }

    .admin-login {
        padding: 30px 20px;
        margin: 20px auto;
    }

    .admin-login h2 {
        font-size: 1.5em;
    }

    .admin-login input {
        font-size: 14px;
    }

    .admin-dashboard {
        padding: 15px;
    }

    .admin-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .admin-header h2 {
        font-size: 1.5em;
    }

    .admin-header div {
        display: flex;
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }

    .admin-btn {
        padding: 12px 15px;
        font-size: 14px;
        width: 100%;
        margin: 0;
    }

    .admin-table {
        font-size: 11px;
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .admin-table th,
    .admin-table td {
        padding: 8px 4px;
        white-space: nowrap;
    }

    .modal-form {
        padding: 20px;
        margin: 20px auto;
        max-width: 95%;
        max-height: 80vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .modal-form h2 {
        font-size: 1.5em;
        margin-bottom: 20px;
    }

    .modal-form input,
    .modal-form textarea,
    .modal-form select {
        font-size: 14px;
        padding: 8px 4px;
    }

    .modal-form textarea {
        min-height: 80px;
    }

    .modal-form .form-actions {
        flex-direction: column;
    }

    .modal-form .form-actions .admin-btn {
        width: 100%;
    }

    .detail-modal .close {
        font-size: 24px;
        top: 10px;
        right: 10px;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.5em;
    }

    .result-item .content {
        font-size: 12px;
    }

    .admin-table th,
    .admin-table td {
        padding: 6px 2px;
        font-size: 10px;
    }
}
