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

html, body {
    font-family: 'Segoe UI', sans-serif;
    font-size: 15px;
    background: #ffffff;
    color: #1a1a1a;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    height: 100%;
}

html.dark-mode, html.dark-mode body {
    background: #1a1a1a;
    color: #e0e0e0;
}

html.green-mode, html.green-mode body {
    background: #3e4637;
    color: #ffffff;
}

.layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 280px;
    padding: 60px 32px;
    border-right: 1px solid #e0e0e0;
    position: fixed;
    height: 100vh;
    overflow-y: hidden;
}

html.dark-mode .sidebar {
    border-right-color: #2a2a2a;
}

html.green-mode .sidebar {
    background: #4a5942;
    border-right-color: rgba(255, 255, 255, 0.3);
}

.sidebar-header {
    margin-bottom: 48px;
}

.logo {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
    text-decoration: none;
    display: block;
    margin-bottom: 8px;
}

html.dark-mode .logo { color: #e0e0e0; }
html.green-mode .logo { color: #ffffff; }

.nav-section {
    margin-bottom: 32px;
}

.nav-section-title {
    font-size: 12px;
    font-weight: 500;
    color: #999;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

html.dark-mode .nav-section-title { color: #666; }
html.green-mode .nav-section-title { color: #ffffff; }

.nav-links {
    list-style: none;
}

.nav-links li {
    margin-bottom: 4px;
}

.nav-links a {
    display: block;
    padding: 6px 12px;
    color: #666;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-size: 14px;
}

.nav-links a:hover {
    background: #f5f5f5;
    color: #1a1a1a;
}

.nav-links a.active {
    background: #f5f5f5;
    color: #1a1a1a;
    font-weight: 500;
}

html.dark-mode .nav-links a { color: #999; }
html.dark-mode .nav-links a:hover { background: #2a2a2a; color: #e0e0e0; }
html.dark-mode .nav-links a.active { background: #2a2a2a; color: #e0e0e0; }

html.green-mode .nav-links a { color: #ffffff; }
html.green-mode .nav-links a:hover { background: rgba(255, 255, 255, 0.05); color: #ffffff; }
html.green-mode .nav-links a.active { background: rgba(255, 255, 255, 0.1); color: #ffffff; }

.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: #ffffff;
    border-bottom: 1px solid #e0e0e0;
    z-index: 1000;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
}

html.dark-mode .mobile-header {
    background: #1a1a1a;
    border-bottom-color: #2a2a2a;
}

html.green-mode .mobile-header {
    background: #4a5942;
    border-bottom-color: rgba(255, 255, 255, 0.2);
}

.hamburger {
    width: 44px;
    height: 44px;
    background: transparent !important;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 0;
    transition: background 0.2s ease;
}

.hamburger:hover {
    background: #f5f5f5 !important;
}

html.dark-mode .hamburger { background: transparent !important; }
html.dark-mode .hamburger:hover { background: #2a2a2a !important; }
html.green-mode .hamburger { background: transparent !important; }
html.green-mode .hamburger:hover { background: rgba(255, 255, 255, 0.05) !important; }

.hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: #1a1a1a;
    transition: all 0.3s ease;
}

html.dark-mode .hamburger span { background: #e0e0e0; }
html.green-mode .hamburger span { background: #ffffff; }

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

.mobile-logo {
    font-family: monospace;
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    text-decoration: none;
}

html.dark-mode .mobile-logo { color: #e0e0e0; }
html.green-mode .mobile-logo { color: #ffffff; }

.mobile-nav {
    display: none;
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    bottom: 0;
    background: #ffffff;
    z-index: 999;
    padding: 24px;
    overflow-y: auto;
}

html.dark-mode .mobile-nav {
    background: #1a1a1a;
}

html.green-mode .mobile-nav {
    background: #3e4637;
}

.mobile-nav.active {
    display: block;
}

.mobile-nav .nav-section {
    margin-bottom: 24px;
}

.mobile-nav .nav-links a {
    padding: 12px 16px;
    font-size: 16px;
}

.mobile-theme-btn {
    width: 46px;
    height: 46px;
    background: transparent !important;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.mobile-theme-btn:hover {
    background: #f5f5f5 !important;
}

.mobile-theme-btn svg {
    width: 34px;
    height: 34px;
    fill: currentColor;
}

html.dark-mode .mobile-theme-btn { color: #ffffff; background: transparent !important; }
html.dark-mode .mobile-theme-btn:hover { background: #2a2a2a !important; }
html.green-mode .mobile-theme-btn { color: #ffffff; background: transparent !important; }
html.green-mode .mobile-theme-btn:hover { background: rgba(255, 255, 255, 0.05) !important; }

.theme-toggle-btn {
    position: fixed;
    top: 24px;
    right: 24px;
    width: 52px;
    height: 52px;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 1001;
    padding: 0;
}

.theme-toggle-btn svg {
    display: block;
    fill: currentColor;
    width: 32px;
    height: 32px;
}

.theme-toggle-btn:hover {
    background: #f5f5f5;
}

html.dark-mode .theme-toggle-btn { color: white; background: transparent; }
html.dark-mode .theme-toggle-btn:hover { background: #2a2a2a; }

html.green-mode .theme-toggle-btn { color: white; background: #3e4637; }
html.green-mode .theme-toggle-btn:hover { background: #4a5942; }

.theme-dropdown {
    position: fixed;
    top: 84px;
    right: 24px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 8px;
    min-width: 140px;
    display: none;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.theme-dropdown.active {
    display: block;
}

html.dark-mode .theme-dropdown { background: #2a2a2a; border-color: #333; }
html.green-mode .theme-dropdown { background: #4a5942; border-color: #3e4637; }

.theme-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    margin: 2px 0;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
}

.theme-option:hover { background: #f5f5f5; }
html.dark-mode .theme-option:hover { background: #333; }
html.green-mode .theme-option:hover { background: rgba(255, 255, 255, 0.05); }

.theme-option.selected { border-color: #666; }

.theme-circle {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1px solid #ccc;
    flex-shrink: 0;
}

.theme-circle.light { background: #ffffff; }
.theme-circle.dark { background: #1a1a1a; }
.theme-circle.green { background: #3e4637; }

.theme-name {
    font-size: 14px;
    color: #666;
}

html.dark-mode .theme-name { color: #999; }
html.green-mode .theme-name { color: #ffffff; }

.main-content {
    margin-left: 280px;
    flex: 1;
    padding: 60px 80px;
    max-width: 900px;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
}

.page-title {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 40px;
    color: #1a1a1a;
}

html.dark-mode .page-title { color: #e0e0e0; }
html.green-mode .page-title { color: #ffffff; }

.info-box {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 20px;
}

html.dark-mode .info-box { background: #2a2a2a; border-color: #444; }
html.green-mode .info-box { background: #4a5942; border-color: rgba(255, 255, 255, 0.1); }

.info-row {
    margin: 20px 0;
}

.info-row:first-child { margin-top: 0; }
.info-row:last-child { margin-bottom: 0; }

.info-label {
    font-size: 12px;
    color: #999;
    text-transform: uppercase;
    margin-bottom: 8px;
    font-weight: 500;
    letter-spacing: 0.5px;
}

html.dark-mode .info-label { color: #666; }
html.green-mode .info-label { color: #ffffff; opacity: 0.7; }

.info-value {
    font-family: 'Segoe UI', monospace;
    font-size: 15px;
    padding: 12px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    word-break: break-all;
    color: #1a1a1a;
    width: 100%;
}

html.dark-mode .info-value { background: #1a1a1a; border-color: #444; color: #e0e0e0; }
html.green-mode .info-value { background: #3e4637; border-color: rgba(255, 255, 255, 0.2); color: #ffffff; }

.info-value:focus {
    outline: none;
    border-color: #666;
}

html.dark-mode .info-value:focus { border-color: #888; }
html.green-mode .info-value:focus { border-color: rgba(255, 255, 255, 0.5); }

.port-button-group {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.port-button {
    padding: 12px 24px;
    background: #f5f5f5;
    color: #1a1a1a;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    font-family: 'Segoe UI', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
}

.port-button:hover {
    background: #e8e8e8;
}

.port-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

html.dark-mode .port-button { background: #2a2a2a; color: #e0e0e0; border-color: #444; }
html.dark-mode .port-button:hover { background: #333; }

html.green-mode .port-button { background: #4a5942; color: #ffffff; border-color: rgba(255, 255, 255, 0.3); }
html.green-mode .port-button:hover { background: #3e4637; }

.rate-limit-info {
    margin-top: 16px;
    font-size: 13px;
    color: #666;
}

html.dark-mode .rate-limit-info { color: #999; }
html.green-mode .rate-limit-info { color: rgba(255, 255, 255, 0.7); }

.result-box {
    display: none;
}

.result-box.show {
    display: block;
}

.result-status {
    padding: 16px;
    border-radius: 6px;
    font-weight: 500;
    text-align: center;
}

.result-status.success {
    background: #d4edda;
    color: #155724;
}

.result-status.error {
    background: #f8d7da;
    color: #721c24;
}

html.dark-mode .result-status.success { background: #1e3a1e; color: #75d675; }
html.dark-mode .result-status.error { background: #3a1e1e; color: #d67575; }

html.green-mode .result-status.success { background: rgba(255, 255, 255, 0.1); color: #90EE90; }
html.green-mode .result-status.error { background: rgba(255, 255, 255, 0.1); color: #FFB6C1; }

.error-message {
    color: #dc3545;
    padding: 16px;
    text-align: center;
}

html.dark-mode .error-message { color: #ff6b6b; }
html.green-mode .error-message { color: #FFB6C1; }

.loading {
    text-align: center;
    padding: 20px;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e0e0e0;
    border-top-color: #1a1a1a;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 12px;
}

html.dark-mode .spinner { border-color: #444; border-top-color: #e0e0e0; }
html.green-mode .spinner { border-color: rgba(255,255,255,0.2); border-top-color: #ffffff; }

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

.disclaimer {
    font-size: 13px;
    color: #666;
}

.disclaimer strong {
    color: #1a1a1a;
}

.disclaimer ul {
    margin: 12px 0;
    padding-left: 20px;
}

.disclaimer li {
    margin-bottom: 8px;
}

html.dark-mode .disclaimer { color: #999; }
html.dark-mode .disclaimer strong { color: #e0e0e0; }

html.green-mode .disclaimer { color: rgba(255, 255, 255, 0.7); }
html.green-mode .disclaimer strong { color: #ffffff; }

html.dark-mode .disclaimer div[style*="border-top"] {
    border-top-color: #444 !important;
}

html.green-mode .disclaimer div[style*="border-top"] {
    border-top-color: rgba(255, 255, 255, 0.2) !important;
}

@media (max-width: 900px) {
    .sidebar { display: none; }
    .main-content { margin-left: 0; padding: 24px; padding-top: 84px; }
    .theme-toggle-btn { display: none; }
    .theme-dropdown { 
        top: 60px;
        right: 12px;
    }
    .mobile-header { display: flex; }
    .port-button-group { flex-direction: column; }
}