/* 测站安全码设置对话框样式 */

.security-dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.security-dialog {
    background: var(--panel-bg, white);
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* 对话框头部 */
.security-dialog-header {
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.security-dialog-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.security-dialog-header .close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    transition: all 0.3s;
}

.security-dialog-header .close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* 对话框主体 */
.security-dialog-body {
    padding: 24px;
    max-height: calc(90vh - 160px);
    overflow-y: auto;
    color: var(--text-primary, #333);
}

.station-info {
    background: var(--hover-bg, #f8f9fa);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid var(--panel-border, #e0e0e0);
}

.station-info p {
    margin: 8px 0;
    font-size: 14px;
}

.station-info strong {
    color: var(--text-primary, #495057);
}

.security-code-input.is-hidden,
.usage-hint.is-hidden {
    display: none;
}

.privacy-mode-input {
    margin-top: 14px;
    margin-bottom: 16px;
}

.privacy-mode-input label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-primary, #333);
}

.privacy-mode-select {
    width: 100%;
    margin-top: 6px;
    padding: 10px 12px;
    border: 2px solid var(--panel-border, #e0e0e0);
    border-radius: 8px;
    background: var(--input-bg, #fff);
    color: var(--text-primary, #333);
    font-size: 14px;
}

.privacy-mode-select:focus {
    outline: none;
    border-color: #667eea;
}

.privacy-mode-input .hint {
    display: block;
    margin-top: 8px;
    color: var(--text-secondary, #6c757d);
    font-size: 12px;
    line-height: 1.5;
}

/* 开关按钮 */
.security-status {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    font-size: 16px;
    font-weight: 500;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 54px;
    height: 28px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-switch .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 34px;
}

.toggle-switch .slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

.toggle-switch input:checked + .slider {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.toggle-switch input:checked + .slider:before {
    transform: translateX(26px);
}

/* 安全码输入 */
.security-code-input {
    margin-bottom: 20px;
}

.security-code-input label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-primary, #333);
}

.security-code-input .input-group {
    display: flex;
    gap: 8px;
}

.security-code-input input {
    flex: 1;
    padding: 10px 15px;
    border: 2px solid var(--panel-border, #e0e0e0);
    border-radius: 8px;
    font-size: 14px;
    background: var(--input-bg, #fff);
    color: var(--text-primary, #333);
    transition: border-color 0.3s;
}

.security-code-input input:focus {
    outline: none;
    border-color: #667eea;
}

.security-code-input .hint {
    display: block;
    margin-top: 8px;
    color: var(--text-secondary, #6c757d);
    font-size: 12px;
}

/* 使用提示 */
.usage-hint {
    background: rgba(255, 193, 7, 0.15);
    border: 2px solid #ffc107;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.usage-hint h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #856404;
}

.usage-hint code {
    background: var(--input-bg, white);
    padding: 8px 12px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    display: inline-block;
    margin: 5px 0;
}

.usage-hint .copy-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    margin-left: 10px;
    transition: background 0.3s;
}

.usage-hint .copy-btn:hover {
    background: #218838;
}

.usage-hint .example {
    margin: 10px 0 0 0;
    font-size: 13px;
    color: #856404;
    line-height: 1.6;
}

/* 对话框底部 */
.security-dialog-footer {
    padding: 15px 24px;
    background: var(--hover-bg, #f8f9fa);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    border-top: 1px solid var(--panel-border, #e0e0e0);
}

.security-dialog-footer button {
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.security-dialog-footer .btn-cancel {
    background: var(--panel-bg, white);
    color: var(--text-secondary, #6c757d);
    border: 2px solid var(--panel-border, #e0e0e0);
}

.security-dialog-footer .btn-cancel:hover {
    background: var(--hover-bg, #f8f9fa);
    border-color: #6c757d;
}

.security-dialog-footer .btn-save {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.security-dialog-footer .btn-save:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.security-dialog-footer .btn-save:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* 响应式设计 */
@media (max-width: 600px) {
    .security-dialog {
        width: 95%;
        margin: 10px;
    }

    .security-dialog-body {
        padding: 16px;
    }

    .security-dialog-header {
        padding: 15px;
    }

    .usage-hint .copy-btn {
        display: block;
        margin: 10px 0;
        width: 100%;
    }
}

/* 测站列表中的安全码图标 */
.station-security-badge {
    display: inline-block;
    background: #28a745;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    margin-left: 8px;
}

.station-security-badge::before {
    content: "🔐 ";
}

.webloc-station-type {
    color: #4caf50;
}

.webloc-notice {
    background: rgba(33, 150, 243, 0.12);
    border: 1px solid rgba(33, 150, 243, 0.3);
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
}

.webloc-notice-title {
    color: #2196f3;
    margin-top: 0;
    margin-bottom: 10px;
}

.webloc-notice-desc {
    line-height: 1.8;
    margin: 0;
}

.webloc-notice-list {
    margin: 10px 0;
    padding-left: 25px;
    line-height: 2;
}

.webloc-notice-tip {
    margin-top: 10px;
    color: var(--text-secondary, #666);
    font-style: italic;
}

.webloc-usage-hint {
    margin-top: 15px;
}

.webloc-usage-desc {
    margin: 10px 0;
}

.webloc-inline-code {
    background: var(--input-bg, #f5f5f5);
    padding: 2px 6px;
    border-radius: 4px;
}

.webloc-usage-warn {
    margin-top: 10px;
    color: #856404;
    font-size: 0.95em;
}
