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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #3a5f5f 0%, #508282 50%, #6ba3a3 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

header h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.subtitle {
    font-size: 1.2rem;
    font-weight: 300;
    opacity: 0.9;
}

/* Navigation Bar */
.nav-bar {
    margin-bottom: 30px;
}

.nav-tabs {
    display: flex;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 8px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    max-width: 400px;
    margin: 0 auto;
}

.nav-tab {
    flex: 1;
    padding: 12px 20px;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 1rem;
    font-weight: 500;
}

.nav-tab:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
}

.nav-tab.active {
    background: rgba(255, 255, 255, 0.95);
    color: #508282;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.nav-icon {
    display: none;
}

/* Tab Content */
.tab-content {
    display: none;
    flex: 1;
    margin-bottom: 40px;
}

.tab-content.active {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

/* 端口查重标签页使用特殊布局 */
#port-check-tab.tab-content.active {
    display: block;
}

/* Main Content */
main {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 40px;
}

/* Generator Section */
.generator-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.port-display {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px;
    background: linear-gradient(135deg, #508282 0%, #3a5f5f 100%);
    border-radius: 15px;
    color: white;
    box-shadow: 0 10px 30px rgba(80, 130, 130, 0.3);
}

.port-number {
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    letter-spacing: -2px;
}

.port-label {
    font-size: 1rem;
    font-weight: 500;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Port Check Section */
.port-check-section {
    display: flex;
    gap: 30px;
    height: 100%;
    min-height: 600px;
}

.check-input-area, .check-results {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    flex: 1;
    display: flex;
    flex-direction: column;
}

.check-input-area h3, .check-results h3 {
    color: #2d4040;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 25px;
    text-align: center;
    flex-shrink: 0;
}

.input-methods {
    margin-bottom: 25px;
    flex-grow: 1;
}

.check-results {
    display: flex;
    flex-direction: column;
}

.input-method {
    display: none;
}

.input-method.active {
    display: block;
}

.input-method h4 {
    color: #508282;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 15px;
}

.single-port-input {
    display: flex;
    gap: 10px;
    align-items: center;
}

.single-port-input input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #d1e8e8;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.single-port-input input:focus {
    outline: none;
    border-color: #508282;
    box-shadow: 0 0 0 3px rgba(80, 130, 130, 0.1);
}

.batch-port-input textarea {
    width: 100%;
    height: 120px;
    padding: 15px;
    border: 2px solid #d1e8e8;
    border-radius: 10px;
    font-size: 1rem;
    font-family: 'Inter', monospace;
    resize: vertical;
    transition: all 0.3s ease;
    margin-bottom: 15px;
}

.batch-port-input textarea:focus {
    outline: none;
    border-color: #508282;
    box-shadow: 0 0 0 3px rgba(80, 130, 130, 0.1);
}

.method-switcher {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.method-btn {
    padding: 8px 16px;
    border: 2px solid #d1e8e8;
    background: #f0f8f8;
    color: #508282;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-weight: 500;
}

.method-btn:hover {
    background: #e0f0f0;
    border-color: #508282;
}

.method-btn.active {
    background: #508282;
    color: white;
    border-color: #508282;
}

.results-container {
    max-height: none;
    overflow-y: auto;
    margin-bottom: 20px;
    flex-grow: 1;
}

.results-empty {
    text-align: center;
    color: #888;
    font-style: italic;
    padding: 40px 20px;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    margin-bottom: 8px;
    background: #f8fafa;
    border-radius: 8px;
    border-left: 4px solid #d1e8e8;
    transition: all 0.3s ease;
}

.result-item:hover {
    background: #f0f8f8;
    transform: translateX(5px);
}

.result-item.available {
    border-left-color: #4CAF50;
    background: #f1f8e9;
}

.result-item.occupied {
    border-left-color: #f44336;
    background: #fef7f0;
}

.result-item.reserved {
    border-left-color: #ff9800;
    background: #fff8e1;
}

.result-port {
    font-weight: 600;
    font-size: 1.1rem;
    color: #2d4040;
}

.result-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 500;
}

.result-status.available {
    color: #4CAF50;
}

.result-status.occupied {
    color: #f44336;
}

.result-status.reserved {
    color: #ff9800;
}

.result-main {
    flex: 1;
}

.result-description {
    font-size: 0.8rem;
    color: #666;
    margin-top: 4px;
}

.occupied-software {
    font-size: 0.85rem;
    color: #f44336;
    margin-top: 6px;
    font-weight: 500;
}

.results-summary {
    display: flex;
    justify-content: space-around;
    padding: 15px;
    background: #f0f8f8;
    border-radius: 10px;
    border: 1px solid #d1e8e8;
    flex-shrink: 0;
}

.summary-item {
    text-align: center;
}

.summary-label {
    display: block;
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 4px;
}

.summary-value {
    font-size: 1.2rem;
    font-weight: 600;
    color: #2d4040;
}

.summary-value.available {
    color: #4CAF50;
}

.summary-value.occupied {
    color: #f44336;
}

.summary-value.reserved {
    color: #ff9800;
}

/* Controls */
.controls {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
}

.btn-primary, .btn-secondary {
    flex: 1;
    padding: 15px 25px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-primary {
    background: linear-gradient(135deg, #508282 0%, #3a5f5f 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(80, 130, 130, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(80, 130, 130, 0.6);
    background: linear-gradient(135deg, #6ba3a3 0%, #508282 100%);
}

.btn-secondary {
    background: #f0f8f8;
    color: #508282;
    border: 2px solid #d1e8e8;
}

.btn-secondary:hover {
    background: #e0f0f0;
    transform: translateY(-1px);
    border-color: #508282;
}

.btn-icon {
    display: none;
}

/* Options */
.options {
    border-top: 1px solid #d1e8e8;
    padding-top: 30px;
}

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

.option-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #2d4040;
}

/* 复选框样式 */
.checkbox-label {
    display: flex !important;
    align-items: center;
    cursor: pointer;
    font-weight: 500 !important;
    color: #2d4040 !important;
    margin-bottom: 8px !important;
    position: relative;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    height: 20px;
    width: 20px;
    background-color: #f0f8f8;
    border: 2px solid #d1e8e8;
    border-radius: 4px;
    margin-right: 12px;
    position: relative;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.checkbox-label:hover input ~ .checkmark {
    background-color: #e0f0f0;
    border-color: #508282;
}

.checkbox-label input:checked ~ .checkmark {
    background-color: #508282;
    border-color: #508282;
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: translate(-50%, -60%) rotate(45deg);
}

.checkbox-label input:checked ~ .checkmark:after {
    display: block;
}

.option-description {
    font-size: 0.85rem;
    color: #666;
    margin-top: 5px;
    line-height: 1.4;
}

select, input[type="number"] {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #d1e8e8;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

select:focus, input[type="number"]:focus {
    outline: none;
    border-color: #508282;
    box-shadow: 0 0 0 3px rgba(80, 130, 130, 0.1);
}

.custom-range {
    margin-top: 15px;
    padding: 20px;
    background: #f8fafa;
    border-radius: 10px;
    border: 1px solid #d1e8e8;
}

.range-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.input-group label {
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.info-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.info-card, .history-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.info-card h3, .history-card h3 {
    color: #2d4040;
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 20px;
    text-align: center;
}

.port-info {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

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

.info-label {
    font-weight: 500;
    color: #666;
}

.info-value {
    font-weight: 600;
    color: #2d4040;
}

.status-available {
    color: #4CAF50 !important;
}

.status-occupied {
    color: #f44336 !important;
}

/* History */
.history-list {
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 15px;
}

.history-empty {
    text-align: center;
    color: #888;
    font-style: italic;
    padding: 20px;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    margin-bottom: 8px;
    background: #f8fafa;
    border-radius: 8px;
    border-left: 4px solid #508282;
    transition: all 0.3s ease;
}

.history-item:hover {
    background: #f0f8f8;
    transform: translateX(5px);
}

.history-port {
    font-weight: 600;
    font-size: 1.1rem;
    color: #508282;
}

.history-time {
    font-size: 0.8rem;
    color: #666;
}

.btn-clear {
    width: 100%;
    padding: 10px;
    background: #f8f0f0;
    color: #888;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.btn-clear:hover {
    background: #f0e8e8;
    color: #666;
    border-color: #ccc;
}

footer {
    margin-top: auto;
    padding: 20px 0;
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-content p {
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: rgba(255, 255, 255, 1);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    position: relative;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    right: 20px;
    top: 15px;
    cursor: pointer;
}

.close:hover {
    color: #333;
}

/* Notification */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #508282;
    color: white;
    padding: 15px 25px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
}

.notification.show {
    transform: translateX(0);
    opacity: 1;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    .tab-content.active {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .port-check-section {
        flex-direction: column;
        gap: 20px;
        min-height: auto;
    }

    .check-input-area, .check-results {
        flex: none;
        min-height: 300px;
    }

    header h1 {
        font-size: 2.5rem;
    }

    .port-number {
        font-size: 3rem;
    }

    .generator-section {
        padding: 25px;
    }

    .info-section {
        gap: 15px;
    }

    .info-card, .history-card {
        padding: 20px;
    }

    .port-display {
        padding: 20px;
        margin-bottom: 30px;
    }

    .controls {
        flex-direction: column;
        gap: 12px;
    }

    .btn-primary, .btn-secondary {
        padding: 12px 20px;
        font-size: 0.95rem;
    }

    .options {
        padding-top: 25px;
    }

    .option-group {
        margin-bottom: 15px;
    }

    .custom-range {
        padding: 15px;
    }

    .range-inputs {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .modal-content {
        width: 95%;
        margin: 10% auto;
        padding: 20px;
    }

    .nav-tabs {
        max-width: 100%;
        padding: 6px;
    }

    .nav-tab {
        padding: 10px 15px;
        font-size: 0.9rem;
    }

    .subtitle {
        font-size: 1.1rem;
    }

    .history-list {
        max-height: 150px;
    }

    .history-item {
        padding: 8px 12px;
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .history-port {
        font-size: 1rem;
    }

    .history-time {
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .port-number {
        font-size: 2.5rem;
        letter-spacing: -1px;
    }

    .port-label {
        font-size: 0.9rem;
    }

    .generator-section {
        padding: 20px;
    }

    .info-card, .history-card {
        padding: 15px;
    }

    .info-card h3, .history-card h3 {
        font-size: 1.1rem;
        margin-bottom: 15px;
    }

    .port-display {
        padding: 15px;
        margin-bottom: 25px;
    }

    .controls {
        gap: 10px;
    }

    .btn-primary, .btn-secondary {
        padding: 10px 15px;
        font-size: 0.9rem;
    }

    .nav-tab {
        padding: 8px 12px;
        font-size: 0.8rem;
    }

    .option-group label {
        font-size: 0.9rem;
    }

    .checkbox-label {
        font-size: 0.9rem !important;
    }

    .option-description {
        font-size: 0.8rem;
    }

    select, input[type="number"] {
        padding: 10px 12px;
        font-size: 0.9rem;
    }

    .custom-range {
        padding: 12px;
    }

    .info-item {
        padding: 8px 0;
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .info-label, .info-value {
        font-size: 0.9rem;
    }

    .history-list {
        max-height: 120px;
    }

    .history-item {
        padding: 6px 10px;
    }

    .btn-clear {
        padding: 8px;
        font-size: 0.85rem;
    }

    .footer-content p {
        font-size: 0.8rem;
    }

    .footer-links a {
        font-size: 0.8rem;
    }

    .notification {
        right: 10px;
        top: 10px;
        padding: 12px 20px;
        font-size: 0.9rem;
    }
} 