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

:root {
   --primary-color: #00a1d6;
   --primary-hover: #0091c1;
   --bg-color: #f8f9fa;
   --border-color: #e0e0e0;
   --text-color: #2c3e50;
   --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
   --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
   --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
   --radius-sm: 4px;
   --radius-md: 8px;
   --radius-lg: 12px;
}

body {
   font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
   line-height: 1.6;
   color: var(--text-color);
   background-color: var(--bg-color);
}

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

h1 {
   text-align: center;
   margin: 20px 0 30px;
   color: var(--text-color);
   font-size: 2.2em;
   font-weight: 600;
   position: relative;
   padding-bottom: 10px;
}

h1::after {
   content: '';
   position: absolute;
   bottom: 0;
   left: 50%;
   transform: translateX(-50%);
   width: 60px;
   height: 3px;
   background-color: var(--primary-color);
   border-radius: 2px;
}

.control-panel {
   display: flex;
   justify-content: flex-end;
   gap: 12px;
   margin-bottom: 20px;
   padding: 10px;
   background: white;
   border-radius: var(--radius-sm);
   box-shadow: var(--shadow-sm);
}

select, button {
   padding: 8px 16px;
   font-size: 14px;
   border: 1px solid var(--border-color);
   border-radius: var(--radius-sm);
   transition: all 0.2s ease;
}

select {
   background-color: white;
   cursor: pointer;
   min-width: 150px;
}

select:hover {
   border-color: var(--primary-color);
}

button {
   background-color: var(--primary-color);
   color: white;
   border: none;
   cursor: pointer;
   font-weight: 500;
   display: flex;
   align-items: center;
   gap: 6px;
}

button:hover {
   background-color: var(--primary-hover);
   transform: translateY(-1px);
   box-shadow: var(--shadow-sm);
}

button:disabled {
   background-color: #cccccc;
   cursor: not-allowed;
   transform: none;
   box-shadow: none;
}

.main-content {
   display: grid;
   grid-template-columns: 1fr 1fr 1fr 1fr;
   gap: 24px;
   min-height: calc(100vh - 200px);
}

.input-panel, .result-panel {
   background: white;
   border-radius: var(--radius-md);
   padding: 15px;
   display: flex;
   flex-direction: column;
   min-height: 800px;
   box-shadow: var(--shadow-md);
   transition: box-shadow 0.3s ease;
}

.input-panel {
   background: white;
   border-radius: var(--radius-md);
   padding: 15px;
   display: flex;
   flex-direction: column;
   height: 100%;
   box-shadow: var(--shadow-md);
   transition: box-shadow 0.3s ease;
}

.input-panel .control-panel {
   margin-bottom: 10px;
   flex-shrink: 0;
}

.input-area {
   flex: 1;
   display: flex;
   flex-direction: column;
   min-height: 0;
}

.input-panel:hover, .result-panel:hover {
   box-shadow: var(--shadow-lg);
}

textarea {
   width: 100%;
   height: 100%;
   min-height: 700px;
   border: 1px solid var(--border-color);
   border-radius: var(--radius-sm);
   resize: none;
   font-size: 14px;
   line-height: 1.6;
   padding: 12px;
   transition: border-color 0.2s ease;
}

textarea:focus {
   outline: none;
   border-color: var(--primary-color);
}

.result-area {
   overflow: auto;
   height: calc(100% - 15px);
   min-height: 700px;
   border: 1px solid var(--border-color);
   border-radius: var(--radius-sm);
   margin-bottom: 15px;
}

.resultContent {
   padding: 12px;
   font-size: 14px;
   line-height: 1.6;
   min-height: 100%;
}

.typo-highlight {
   padding: 2px 4px;
   border-radius: 3px;
   position: relative;
   cursor: help;
   transition: background-color 0.2s ease;
}

.typo-certain {
   background-color: #ffd7d7;
}

.typo-certain:hover {
   background-color: #ffbebe;
}

.typo-possible {
   background-color: #fff3cd;
}

.typo-possible:hover {
   background-color: #ffe69c;
}

.tooltip-header {
   display: flex;
   justify-content: space-between;
   margin-bottom: 8px;
   padding-bottom: 8px;
   border-bottom: 1px solid rgba(255,255,255,0.2);
}

.confidence-score {
   font-size: 12px;
   opacity: 0.9;
}

.error-type {
   font-size: 12px;
   padding: 2px 6px;
   border-radius: 3px;
   background: rgba(255,255,255,0.2);
}

.suggestion {
   margin-bottom: 6px;
   font-weight: 500;
}

.reason {
   margin-bottom: 6px;
   font-size: 13px;
}

.context {
   font-size: 12px;
   opacity: 0.9;
   padding: 6px;
   background: rgba(0,0,0,0.2);
   border-radius: 3px;
   margin-top: 8px;
}

.typo-tooltip {
   display: none;
   position: fixed;
   background: #2c3e50;
   color: white;
   padding: 10px 15px;
   border-radius: var(--radius-sm);
   font-size: 13px;
   min-width: 200px;
   max-width: 400px;
   z-index: 999999;
   word-break: normal;
   white-space: normal;
   line-height: 1.5;
   pointer-events: none;
   box-shadow: var(--shadow-lg);
   animation: tooltip-fade 0.2s ease;
}

@keyframes tooltip-fade {
   from {
      opacity: 0;
      transform: translateY(5px);
   }
   to {
      opacity: 1;
      transform: translateY(0);
   }
}

.loading {
   display: flex;
   align-items: center;
   justify-content: center;
   height: 100%;
   flex-direction: column;
   gap: 15px;
}

.loading::after {
   content: '';
   width: 40px;
   height: 40px;
   border: 3px solid #f3f3f3;
   border-top: 3px solid var(--primary-color);
   border-radius: 50%;
   animation: spin 1s linear infinite;
}

.loading::before {
   content: '检查中...';
   color: var(--text-color);
   font-size: 14px;
}

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

/* 响应式设计 */
@media (max-width: 1600px) {
   .main-content {
      grid-template-columns: 1fr 1fr 1fr;
   }
}

@media (max-width: 1200px) {
   .main-content {
      grid-template-columns: 1fr 1fr;
   }
}

@media (max-width: 768px) {
   .main-content {
      grid-template-columns: 1fr;
   }
   
   .container {
      padding: 10px;
   }
   
   h1 {
      font-size: 1.8em;
   }
}

.footer {
   text-align: center;
   margin-top: 60px;
   padding: 30px 20px;
   color: var(--text-color);
   border-top: 1px solid var(--border-color);
}

.footer-title {
   color: var(--primary-color);
   font-size: 20px;
   font-weight: 500;
   margin-bottom: 20px;
}

.footer-contact {
   margin-bottom: 12px;
   font-size: 15px;
   color: #666;
}

.footer-link {
   margin-bottom: 20px;
}

.footer-link a {
   color: var(--primary-color);
   text-decoration: none;
   transition: color 0.2s ease;
}

.footer-link a:hover {
   color: var(--primary-hover);
   text-decoration: underline;
}

.footer-copyright {
   color: #999;
   font-size: 14px;
   margin-top: 20px;
}