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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

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

header {
    margin-bottom: 30px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

h1 {
    color: #2c3e50;
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.header-links {
    display: flex;
    gap: 15px;
    align-items: center;
}

.github-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background-color: #24292e;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    transition: background-color 0.2s;
}

.github-btn:hover {
    background-color: #1b1f23;
}

.terms-link {
    color: #0366d6;
    text-decoration: none;
    padding: 10px 16px;
    border: 1px solid #d1d5da;
    border-radius: 6px;
    transition: background-color 0.2s;
}

.terms-link:hover {
    background-color: #f6f8fa;
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    h1 {
        font-size: 2rem;
        margin-bottom: 0;
    }
}

section {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.search-container {
    display: flex;
    gap: 20px;
    justify-content: space-between;
}

.search-group {
    flex: 1;
}

.info-container {
    display: flex;
    gap: 20px;
}

.info-column {
    flex: 1;
}

.info-column .ip-info,
.info-column .domain-info {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    height: 100%;
}

.info-section {
    background: transparent;
    box-shadow: none;
    padding: 0;
}

h2 {
    color: #34495e;
    font-size: 1.5rem;
    margin-bottom: 15px;
    border-bottom: 2px solid #3498db;
    padding-bottom: 5px;
}

h3 {
    color: #2c3e50;
    font-size: 1.2rem;
    margin: 20px 0 10px 0;
}

.search-form {
    display: flex;
    gap: 10px;
    align-items: center;
}

.search-input {
    flex: 1;
    padding: 10px 15px;
    border: 2px solid #bdc3c7;
    border-radius: 5px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s ease;
    width: 100%;
    min-width: 0;
}

.search-input:focus {
    border-color: #3498db;
}

.search-btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s ease;
    white-space: nowrap;
}

.search-btn:hover {
    background: #2980b9;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.info-item {
    display: flex;
    flex-direction: column;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 5px;
    border-left: 4px solid #3498db;
}

.info-item label {
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 5px;
}

.info-item span {
    color: #7f8c8d;
    word-break: break-all;
    white-space: pre-line;
}


.propagation-form {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 20px;
}

.record-select, .record-type-select {
    padding: 10px 15px;
    border: 2px solid #bdc3c7;
    border-radius: 5px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s ease;
    background: white;
    min-width: 80px;
}

.record-select:focus, .record-type-select:focus {
    border-color: #3498db;
}

.propagation-results {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    padding: 20px;
    min-height: 100px;
}

.propagation-status {
    margin-bottom: 20px;
    padding: 10px;
    background: #e3f2fd;
    border-radius: 5px;
    text-align: center;
    font-weight: bold;
}

.propagation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.propagation-result {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.propagation-result .server-name {
    font-size: 1.1rem;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 5px;
}

.propagation-result .server-ip {
    color: #7f8c8d;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.propagation-result .result-status {
    padding: 5px 10px;
    border-radius: 4px;
    font-weight: bold;
    text-align: center;
    margin-bottom: 10px;
}

.propagation-result .result-status.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.propagation-result .result-status.no-records {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.propagation-result .result-status.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.propagation-result .result-status.waiting {
    background: #e2e3e5;
    color: #383d41;
    border: 1px solid #d6d8db;
}

.propagation-result .result-data {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    background: #f8f9fa;
    padding: 8px;
    border-radius: 4px;
    word-break: break-all;
    min-height: 30px;
}

.propagation-summary {
    margin-bottom: 20px;
    text-align: center;
}

.status-success {
    color: #27ae60;
    font-weight: bold;
    font-size: 1.1rem;
}

.status-partial {
    color: #f39c12;
    font-weight: bold;
    font-size: 1.1rem;
}

.status-error {
    color: #e74c3c;
    font-weight: bold;
    font-size: 1.1rem;
}

.propagation-table {
    overflow-x: auto;
}

.propagation-table table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.propagation-table th,
.propagation-table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
}

.propagation-table th {
    background-color: #f8f9fa;
    font-weight: bold;
    color: #2c3e50;
}

.server-name {
    font-weight: bold;
    color: #3498db;
}

.record-data {
    font-family: 'Courier New', monospace;
    color: #27ae60;
}

.no-record {
    color: #7f8c8d;
    font-style: italic;
}

.controls {
    text-align: center;
}

.refresh-btn {
    background: #27ae60;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s ease;
}

.refresh-btn:hover {
    background: #219a52;
}

.loading {
    color: #f39c12;
    font-style: italic;
}

.error {
    color: #e74c3c;
    font-style: italic;
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .search-container {
        flex-direction: column;
        gap: 15px;
    }
    
    .info-container {
        flex-direction: column;
        gap: 15px;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
}

/* セキュリティ関連のスタイル */
.security-warning {
    background: #d1ecf1;
    border: 2px solid #17a2b8;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.warning-header {
    font-size: 1.1rem;
    font-weight: bold;
    color: #0c5460;
    margin-bottom: 10px;
}

.security-warning p {
    margin-bottom: 8px;
    color: #0c5460;
    line-height: 1.5;
}

.security-warning code {
    background: #fff;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    color: #e83e8c;
    border: 1px solid #dee2e6;
}

/* ポートスキャン機能のスタイル */
.port-scan-form {
    margin-bottom: 20px;
}

.scan-input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.port-options {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

.port-preset, .custom-ports {
    flex: 1;
    min-width: 300px;
}

.port-preset h3, .custom-ports h3 {
    font-size: 1.1rem;
    margin-bottom: 10px;
    color: #2c3e50;
}

.preset-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.preset-btn {
    background: #ecf0f1;
    color: #2c3e50;
    border: 1px solid #bdc3c7;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.preset-btn:hover {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

.security-notice {
    margin-top: 10px;
    padding: 8px 12px;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 4px;
    font-size: 0.85rem;
    color: #856404;
    text-align: center;
}

.port-scan-results {
    margin-top: 20px;
}

.scan-status {
    background: #e3f2fd;
    border: 1px solid #bbdefb;
    border-radius: 5px;
    padding: 15px;
    text-align: center;
    font-weight: bold;
    margin-bottom: 20px;
}

.scan-progress {
    margin-bottom: 20px;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: #ecf0f1;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3498db, #2980b9);
    border-radius: 10px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    text-align: center;
    font-weight: bold;
    color: #2c3e50;
}

.port-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    margin-top: 20px;
}

.port-result {
    background: white;
    border: 2px solid #ecf0f1;
    border-radius: 6px;
    padding: 12px;
    text-align: center;
    transition: all 0.3s ease;
}

.port-result.open {
    border-color: #27ae60;
    background: #d5f4e6;
}

.port-result.closed {
    border-color: #e74c3c;
    background: #fadbd8;
}

.port-number {
    font-size: 1.3rem;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 6px;
}

.port-service {
    font-size: 0.8rem;
    color: #7f8c8d;
    margin-bottom: 6px;
}

.port-status {
    font-weight: bold;
    padding: 3px 6px;
    border-radius: 3px;
    margin-bottom: 6px;
    font-size: 0.85rem;
}

.port-result.open .port-status {
    background: #27ae60;
    color: white;
}

.port-result.closed .port-status {
    background: #e74c3c;
    color: white;
}

.port-response {
    font-size: 0.8rem;
    color: #7f8c8d;
    font-family: 'Courier New', monospace;
}

@media (max-width: 768px) {
    .port-options {
        flex-direction: column;
        gap: 20px;
    }
    
    .port-preset, .custom-ports {
        min-width: auto;
    }
    
    .scan-input-group {
        flex-direction: column;
    }
    
    .preset-buttons {
        justify-content: center;
    }
    
    .port-results-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 8px;
    }
}