* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    max-width: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100%;
}

.container {
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
    padding: 20px;
    flex: 1;
    box-sizing: border-box;
    min-width: 0;
}

.header {
    background: linear-gradient(135deg, #1890ff 0%, #096dd9 100%);
    color: white;
    text-align: center;
    padding: 30px 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.header h1 {
    font-size: 28px;
    margin-bottom: 10px;
    font-weight: 600;
}

.header p {
    font-size: 14px;
    opacity: 0.9;
}

.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    margin-bottom: 20px;
    overflow: hidden;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.card-header {
    background: #fafafa;
    padding: 16px 24px;
    border-bottom: 1px solid #e8e8e8;
    font-size: 16px;
    font-weight: 600;
    color: #1890ff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-header .icon {
    width: 4px;
    height: 18px;
    background: #1890ff;
    border-radius: 2px;
}

.card-body {
    padding: 24px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    min-width: 0;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
    font-size: 14px;
}

.form-group label .required {
    color: #ff4d4f;
    margin-left: 2px;
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.3s;
    outline: none;
}

.form-control:focus {
    border-color: #1890ff;
    box-shadow: 0 0 0 2px rgba(24,144,255,0.1);
}

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

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23999' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

.btn {
    display: inline-block;
    padding: 10px 28px;
    border: none;
    border-radius: 4px;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    font-weight: 500;
}

.btn-primary {
    background: #1890ff;
    color: white;
}

.btn-primary:hover {
    background: #40a9ff;
    box-shadow: 0 4px 12px rgba(24,144,255,0.35);
}

.btn-success {
    background: #52c41a;
    color: white;
}

.btn-success:hover {
    background: #73d13d;
}

.btn-secondary {
    background: #f0f0f0;
    color: #555;
}

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

.btn-group {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 24px;
}

.tabs {
    display: flex;
    border-bottom: 2px solid #e8e8e8;
    margin-bottom: 24px;
}

.tab-item {
    flex: 1;
    padding: 14px 20px;
    text-align: center;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    color: #666;
    transition: all 0.3s;
    position: relative;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

.tab-item:hover {
    color: #1890ff;
}

.tab-item.active {
    color: #1890ff;
    border-bottom-color: #1890ff;
}

.tab-content {
    display: none;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.tab-content.active {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.query-form {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    flex-wrap: wrap;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.query-form .form-group {
    flex: 1;
    min-width: 0;
    margin-bottom: 0;
}

.result-list {
    margin-top: 20px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.result-item {
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    padding: 16px;
    margin-bottom: 12px;
    background: #fafbfc;
    word-break: break-word;
    overflow-wrap: break-word;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.result-item .result-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    font-size: 15px;
    word-break: break-word;
    overflow-wrap: break-word;
}

.result-item .result-meta {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #888;
    margin-bottom: 8px;
    flex-wrap: wrap;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    word-break: break-word;
}

.result-item .result-meta span {
    word-break: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
    display: inline-block;
}

.result-item .result-meta > span {
    min-width: 0;
}

.result-item .result-content {
    color: #555;
    font-size: 14px;
    line-height: 1.7;
    margin-bottom: 10px;
    word-break: break-all;
    white-space: pre-wrap;
    white-space: -moz-pre-wrap;
    white-space: -pre-wrap;
    white-space: -o-pre-wrap;
    word-wrap: break-word;
}

.result-item .reply-box {
    background: #e6f7ff;
    border-left: 3px solid #1890ff;
    padding: 12px 16px;
    border-radius: 0 4px 4px 0;
    margin-top: 12px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.result-item .reply-box .reply-label {
    font-weight: 600;
    color: #1890ff;
    font-size: 13px;
    margin-bottom: 6px;
}

.result-item .reply-box .reply-text {
    color: #333;
    font-size: 14px;
    line-height: 1.7;
    word-break: break-all;
    overflow-wrap: break-word;
    white-space: pre-wrap;
    white-space: -moz-pre-wrap;
    white-space: -pre-wrap;
    white-space: -o-pre-wrap;
    word-wrap: break-word;
}

.status-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.status-pending { background: #fff7e6; color: #fa8c16; }
.status-processing { background: #e6f7ff; color: #1890ff; }
.status-replied { background: #f6ffed; color: #52c41a; }
.status-closed { background: #f5f5f5; color: #999; }

.footer {
    background: #262626;
    color: #aaa;
    text-align: center;
    padding: 30px 20px;
    margin-top: auto;
    font-size: 13px;
    line-height: 2;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.footer .copyright-line {
    margin: 2px 0;
}

.footer .copyright-line:first-child {
    color: #ddd;
    font-weight: 500;
}

.alert {
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 16px;
    font-size: 14px;
}

.alert-info {
    background: #e6f7ff;
    border: 1px solid #91d5ff;
    color: #0050b3;
}

.alert-success {
    background: #f6ffed;
    border: 1px solid #b7eb8f;
    color: #389e0d;
}

.alert-error {
    background: #fff2f0;
    border: 1px solid #ffccc7;
    color: #cf1322;
}

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.45);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-overlay.show {
    display: flex;
}

.modal-box {
    background: white;
    border-radius: 8px;
    width: 90%;
    max-width: 480px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

.modal-header {
    padding: 16px 24px;
    border-bottom: 1px solid #e8e8e8;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 16px;
}

.modal-close {
    cursor: pointer;
    font-size: 22px;
    color: #999;
    line-height: 1;
    background: none;
    border: none;
    padding: 0 4px;
}

.modal-close:hover {
    color: #333;
}

.modal-body {
    padding: 24px;
}

.loading {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid #e8e8e8;
    border-top-color: #1890ff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

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

@media (max-width: 600px) {
    .container { padding: 12px; width: 100%; max-width: 100%; box-sizing: border-box; }
    .header { padding-left: 12px; padding-right: 12px; }
    .footer { padding-left: 12px; padding-right: 12px; }
    .header h1 { font-size: 22px; }
    .card-body { padding: 16px; }
    .query-form { flex-direction: column; }
    .btn-group { flex-direction: column; }
    .tab-item { font-size: 14px; padding: 12px 10px; }
    .query-form .form-group { min-width: 0; flex-basis: 100%; }
    .form-control { box-sizing: border-box; }
}
